This commit is contained in:
尹吉欢
2018-03-13 10:16:16 +08:00
parent 10a547fb6b
commit ed180d40a5
155 changed files with 30041 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
(function(w){
document.addEventListener('plusready',function(){
checkArguments();
},false);
// 判断启动方式
function checkArguments(){
console.log("Shortcut-plus.runtime.launcher: "+plus.runtime.launcher);
if(plus.runtime.launcher=='shortcut'){
try{
var cmd = JSON.parse(plus.runtime.arguments);
console.log("Shortcut-plus.runtime.arguments: "+plus.runtime.arguments)
var type=cmd&&cmd.type;
switch(type){
case 'share':
openWebview('plus/share.html');
break;
case 'about':
openWebview('about.html','zoom-fade-out',true);
break;
default:
break;
}
}catch(e){
console.log("Shortcut-exception: "+e);
}
}
}
// 打开页面
function openWebview(id,a,s){
if(!_openw||_openw.id!=id){
clicked(id,a,s);
}
}
// 处理从后台恢复
document.addEventListener('newintent',function(){
console.log("Shortcut-newintent");
checkArguments();
},false);
})(window);