diff --git a/image/github.svg b/image/github.svg
new file mode 100644
index 0000000..cb01640
--- /dev/null
+++ b/image/github.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/image/issue.svg b/image/issue.svg
new file mode 100644
index 0000000..a618916
--- /dev/null
+++ b/image/issue.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/image/version.svg b/image/version.svg
new file mode 100644
index 0000000..d830ffd
--- /dev/null
+++ b/image/version.svg
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/js/actions.js b/js/actions.js
index 4f1d0cc..4af26ee 100644
--- a/js/actions.js
+++ b/js/actions.js
@@ -39,7 +39,8 @@ let actions={
{name:"closewin",selects:["n_win"]},
{name:"max"},
{name:"min"},
- {name:"full"}
+ {name:"full"},
+ {name:"mergewin",selects:["n_winstate"]}//Maximize the window after merging,Window state
],
[//group txt
{name:"copytxt"},
@@ -207,6 +208,7 @@ let actionOptions={
n_win:["s_current","s_all","s_others"],
n_wintype:["s_normal","s_popup","s_panel","s_detached_panel"],
n_winincog:["s_no","s_yes"],
+ n_winstate:["s_normal","s_minimized","s_maximized","s_fullscreen"],
n_reload_clear:["s_no","s_yes"],
n_close_sel:["s_default","s_left","s_right","s_head","s_last"],
diff --git a/js/background.js b/js/background.js
index caa0d81..f24693b 100644
--- a/js/background.js
+++ b/js/background.js
@@ -950,7 +950,7 @@ var sub={
}
console.log(selObj)
sub.message={type:"action_ctm",selEle:selObj}
- sub.initCurrent(null,theConf);
+ sub.initCurrent(null,sub.theConf);
break;
}
}
@@ -1210,10 +1210,10 @@ var sub={
}
}
sub.theConf=theConf;
- return theConf;
+ return sub.theConf;
},
initCurrent:function(sender,theConf){
- sender?sub.extID=sender.id:null;
+ //sender?sub.extID=sender.id:null;
chrome.windows.getCurrent({populate:true},function(window){
sub.curWin=window;
chrome.tabs.query({active:true,currentWindow:true},function(tabs){
@@ -1627,6 +1627,64 @@ var sub={
}
chrome.windows.update(sub.curWin.id,{state:t},function(window){})
},
+ mergewin:function(){
+ sub.cons.mergewin=sub.cons.mergewin||{lastwins:[]};
+ let i=0,ii=0,tabIds=[],win=[],_win=[],
+ winState=sub.getConfValue("selects","n_winstate").substr(2);
+ chrome.windows.getCurrent(function(window){
+ chrome.windows.getAll({populate:true,windowTypes:["normal"]},function(windows){
+ for(i=0;i
0)?win:sub.cons.mergewin.lastwins;
+ if(tabIds.length>0&&windows.length>1){
+ chrome.tabs.move(tabIds,{windowId:window.id,index:-1},function(){
+ if(winState!="normal"){
+ chrome.windows.update(window.id,{state:winState})
+ }
+ });
+ }else if(sub.cons.mergewin.lastwins.length>0){
+ for(i=0;i1){
+ sub.cons.mergewin.lastwins[_temp].splice(0,1);
+ chrome.tabs.move(sub.cons.mergewin.lastwins[_temp],{windowId:window.id,index:-1},function(){
+ if(_temp==sub.cons.mergewin.lastwins.length-1){
+ chrome.windows.update(winId,{focused:true})
+ }
+ })
+ }
+ })
+ })(i,window.id)
+ }
+ }
+ })
+ })
+ return;
+ chrome.windows.getLastFocused(function(window){
+ chrome.windows.getAll({populate:true,windowTypes:["normal"]},function(windows){
+ let i=0,ii=0,tabIds=[];
+ for(i=0;i0?chrome.tabs.move(tabIds,{windowId:window.id,index:-1}):null;
+ })
+ })
+ },
//txt
copytxt:function(){//chk
if(!sub.message.selEle.txt){return;}
@@ -3637,7 +3695,7 @@ var sub={
//set last as default
if(_index!==0&&config.pop.settings.last){
config.pop.actions[_index]=config.pop.actions[0];
- config.pop.actions[0]=theConf;
+ config.pop.actions[0]=sub.theConf;
sub.saveConf();
}
break;
@@ -3714,6 +3772,29 @@ var sub={
}
}
+chrome.browserAction.onClicked.addListener(function(tab){
+ if(config.icon.settings.type=="back"){
+ //sub.extID=chrome.runtime.id?chrome.runtime.id:null;
+ var theConf=config.icon.actions[0];
+ sub.theConf=theConf;
+ sub.initCurrent(null,sub.theConf);
+ }else{
+ chrome.tabs.query({active:true,currentWindow:true},function(tabs){
+ sub.curTab=tabs[0];
+ chrome.tabs.sendMessage(tabs[0].id,{type:"icon"},function(response){
+ if(response&&response.type=="action_icon"){
+ sub.message=response;
+ sub.extID=chrome.runtime.id?chrome.runtime.id:null;
+ var theConf=config.icon.actions[0];
+ sub.theConf=theConf;
+ sub.initCurrent(null,sub.theConf);
+ console.log(sub.message)
+ }
+ });
+ })
+ }
+})
+
if(!chrome.runtime.getPlatformInfo){}
else{
chrome.runtime.getPlatformInfo(function(info){
@@ -3807,235 +3888,6 @@ chrome.runtime.onMessageExternal.addListener(function(message,sender,sendRespons
chrome.runtime.onMessage.addListener(function(message,sender,sendResponse) {
console.log(message)
sub.funOnMessage(message,sender,sendResponse);
-
- return;
- sub.message=message;
- if(message.type=="opt_getpers"){
- console.log(message)
- sub.checkPermission(message.value.thepers,message.value.theorgs,message.value.theFunction,message.value.msg);
- return;
- }
- if(message.type=="evt_getconf"||message.type=="pop_getconf"||message.type=="opt_getconf"){
- var _conf={
- type:message.type,
- defaultConf:defaultConf,
- config:config,
- devMode:devMode,
- os:sub.cons.os
- }
- sendResponse(_conf);
- return;
- }
- if(message.type=="per_getconf"){
- var _conf=sub.cons.permissions;
- sendResponse(_conf);
- return;
- }
- if(message.type=="apps_action"){
- sub.action.apps_action(message,sendResponse);
- return;
- }
- if(message.type=="apps_saveconf"){
- sub.action.apps_saveconf(message,sendResponse);
- return;
- }
- if(message.type=="apps_test"){
- //console.log(message.apptype)
- console.log("apps_test")
- let _fun=function(){
- if(message.appjs){
- chrome.tabs.executeScript({code:"sue.apps['"+message.apptype+"'].initUI();",runAt:"document_start"});
- return;
- }
- if(message.apptype=="base64"){
- chrome.tabs.executeScript({file:"js/base64.min.js",runAt:"document_start"},function(){})
- }else if(message.apptype=="qr"){
- chrome.tabs.executeScript({file:"js/jquery.min.js",runAt:"document_start"},function(){})
- chrome.tabs.executeScript({file:"js/jquery.qrcode.min.js",runAt:"document_start"},function(){})
- }
-
- chrome.tabs.insertCSS({file:"css/inject/"+message.apptype+".css",runAt:"document_start"},function(){});
- chrome.tabs.executeScript({file:"js/inject/"+message.apptype+".js",runAt:"document_start"},function(){})
- }
- if(!message.value){
- chrome.tabs.insertCSS({file:"css/apps_basic.css",runAt:"document_start"},function(){})
- chrome.tabs.executeScript({file:"js/apps_basic.js",runAt:"document_start"},function(){_fun();})
- }else{
- _fun();
- }
-
-
- return;
- }
- if(message.type=="getappconf"){
- sendResponse(sub.cons[message.apptype]);
- return;
- }
- if(message.type=="apps_getvalue"){
- //sendResponse("")
- sendResponse({type:message.apptype,config:config.apps[message.apptype],value:sub.cons[message.apptype]})
- return
- }
- if(message.type=="action_np"){
- console.log(message)
- sub.action.next();
- return;
- }
- if(message.type=="reloadconf"){
- console.log("reloadconf");
- config=message.value;
- loadConfig();
- return;
- }
- if(message.type=="saveConf"){
- console.log("saveconf")
- config=message.value;
- sub.saveConf();
- return;
- }
- if(message.type=="updateConfStatus"){
- console.log("updateConfStatus")
- return;
- }
- if(message.type=="per_clear"){
- console.log("per_clear")
- sub.cons.permissions={};
- return;
- }
- if(message.type=="getpers"){
- sub.initpers();
- return;
- }
- if(message.type=="scroll"){
- sendResponse({type:sub.cons.scroll.type,effect:sub.cons.scroll.effect});
- return;
- }
- if(message.type=="zoom"){
- sendResponse({value:sub.cons.zoom});
- return;
- }
- if(message.type=="action_pop"){
- var _index=message.index;
- var theConf=config.pop.actions[_index]; //message.popvalue;
- sub.theConf=theConf;
- if(config.pop.settings.type=="front"){
- chrome.tabs.query({active:true,currentWindow:true},function(tabs){
- sub.curTab=tabs[0];
- chrome.tabs.sendMessage(tabs[0].id,{type:"pop"},function(response){
- if(response&&response.type=="action_pop"){
- sub.message=response;
- sub.extID=chrome.runtime.id?chrome.runtime.id:null;
- sub.initCurrent(null,theConf);
- console.log(sub.message)
- }
- });
- })
- }else{
- sub.initCurrent(sender,theConf);
- }
- //set last as default
- if(_index!==0&&config.pop.settings.last){
- config.pop.actions[_index]=config.pop.actions[0];
- config.pop.actions[0]=theConf;
- sub.saveConf();
- }
- return;
- }
- if(message.type=="action_rges"){
- console.log("action_rges");
- var rgesType=message.sendValue.buttons==1?0:1;
- var theConf=config.rges.actions[rgesType];
- sub.theConf=theConf;
- sub.initCurrent(sender,theConf);
- return;
- }
- if(message.type=="action_wges"){
- console.log("action_wges")
- var _id;
- if(message.sendValue.buttons==1){
- if(message.sendValue.wheelDelta<0){_id=0;}else{_id=1}
- }else if(message.sendValue.buttons==2){
- if(message.sendValue.wheelDelta<0){_id=2;}else(_id=3)
- }
- var theConf=config.wges.actions[_id];
- sub.theConf=theConf;
-
- if(sub.theConf.name=="scroll"){//fix action scroll
- //sendResponse({name:sub.theConf.name});
- window.setTimeout(function(){
- sub.initCurrent(sender,theConf);
- },200)
- return
- }
-
- sub.initCurrent(sender,theConf)
- return;
- }
- var drawType=message.drawType;
- var confType=config[drawType[0]][drawType[1]];
- var direct=message.direct;
- var theName="",
- theConf="";
- for(var i=0;idirect.length){
- let _action={
- direct:confType[i].direct,
- tip:(confType[i].mydes&&confType[i].mydes.type&&confType[i].mydes.value)?confType[i].mydes.value:sub.getI18n(confType[i].name)
- }
- _sendConf.allaction.push(_action);
- }
- if(i==confType.length-1&&_sendConf.allaction.length==0){
- _sendConf.allaction=null;
- }
- }
- }
- sendResponse(_sendConf);
- }else if(message.type=="action"){
- theConf.type="action";
- if(theConf.name=="paste"){//for action paste
- if(sub.cons.permissions.contains("clipboardWrite")) {
- var clipOBJ=document.body.appendChild(document.createElement("textarea"));
- clipOBJ.focus();
- document.execCommand('paste', false, null);
- var clipData=clipOBJ.value;
- clipOBJ.remove();
- theConf.paste=clipData;
- theConf.typeAction="paste";
- sendResponse(theConf);
- }else {
- sub.checkPermission(["clipboardWrite"]);
- }
- }else{
- sendResponse(theConf);
- }
- sub.initCurrent(sender,theConf);
- }
});
loadConfig();
//browsersettings
diff --git a/js/options.js b/js/options.js
index 10dd818..95ee3b3 100644
--- a/js/options.js
+++ b/js/options.js
@@ -57,7 +57,7 @@ var suo={
init:function(){
console.log("begin");
suo.cons.menuPin=window.innerWidth>800?true:false;
- suo.set.set_01();
+ suo.set.set_11();
suo.initHandle();
},
initHandle:function(){
@@ -921,7 +921,7 @@ var suo={
for(var j=0;j0&&i1&&i.setcontent");
+ set_11:function(){
+ var domOBJ=document.querySelector(".set-00>.setcontent");
domOBJ.innerHTML="";
for(var i=1;i.setcontent");
+ var domlog=document.querySelector(".set.set-113.confobj>.setcontent");
domlog.innerHTML=""
for(var i=0;i