Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zimocode committed Aug 26, 2018
2 parents f17642f + 21713d5 commit 1193a21
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 74 deletions.
7 changes: 7 additions & 0 deletions change.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"log": [
{
"ver":"6.1.1108.837",
"date":"2018.08.18",
"content":[
"fix bug: issues@github: #2,#3,#13,#14,#15"
]
},
{
"ver":"6.1.747.831",
"date":"2018.06.10",
Expand Down
2 changes: 1 addition & 1 deletion html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
<div id="about_info">
<div id="abinfo_ver">Ver </div>
<div id="abinfo_git">smartUp@GitHub: <a href="https://github.com/zimocode/smartup" target="_blank">zimocode/smartup</a></div>
<div id="abinfo_fb"><span data-i18n="ext_issue"></span> <a href="" target="_blank">Issues@github</a> , <a href="mailto:crexme@gmail.com?Subject=about smartup">[email protected]</a></div>
<div id="abinfo_fb"><span data-i18n="ext_issue"></span> <a href="https://github.com/zimocode/smartup/issues" target="_blank">Issues@github</a> , <a href="mailto:zimocode@gmail.com?Subject=about smartup">[email protected]</a></div>
<div id="abinfo_vers">
<span data-i18n="ext_allver"></span>
<a href="https://chrome.google.com/webstore/detail/bgjfekefhjemchdeigphccilhncnjldn" target="_blank">Chrome</a>,
Expand Down
70 changes: 47 additions & 23 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,12 @@ var sub={
if(sub.curTab.index==0){
// theId=false;
// break;
for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
if(sub.curWin.tabs[i].index>sub.curTab.index){
theId.push(sub.curWin.tabs[i].id);
}
}
// for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
// if(sub.curWin.tabs[i].index>sub.curTab.index){
// theId.push(sub.curWin.tabs[i].id);
// }
// }
break;
}
for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
if(sub.curWin.tabs[i].index<sub.curTab.index){
Expand All @@ -1060,13 +1061,15 @@ var sub={
break;
case"s_rights":
if(sub.curTab.index==sub.curWin.tabs.length-1){
// theId=false;
// break;
for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
if(sub.curWin.tabs[i].index<sub.curTab.index){
theId.push(sub.curWin.tabs[i].id);
}
}
// if(fnName&&fnName=="close"){
// break;
// }
// for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
// if(sub.curWin.tabs[i].index<sub.curTab.index){
// theId.push(sub.curWin.tabs[i].id);
// }
// }
break;
}
for(var i=0;i<sub.curWin.tabs.length&&sub.curWin.tabs.length>1;i++){
if(sub.curWin.tabs[i].index>sub.curTab.index){
Expand Down Expand Up @@ -1319,7 +1322,7 @@ var sub={
// });
},
close:function(){
var ids=sub.getId(sub.getConfValue("selects","n_tab")),
var ids=sub.getId(sub.getConfValue("selects","n_tab"),arguments.callee.name),
selid=sub.getId(sub.getConfValue("selects","n_close_sel"))[0],
selvalue=sub.getConfValue("selects","n_close_sel"),
_closeKeep=sub.getConfValue("checks","n_close_keep");
Expand Down Expand Up @@ -1405,7 +1408,8 @@ var sub={
_pin=sub.getConfValue("checks","n_pin"),
_url="";
let _urlA=sub.curTab.url;
let _urlB=_urlA.split("/"),_urlC="";
let _urlB=_urlA.split("/"),
_urlC="";
if(_urlB.length>3){
_urlC=_urlB[_urlB.length-1];
console.log(_urlC)
Expand All @@ -1415,19 +1419,28 @@ var sub={

let setNum=function(txt){
console.log(txt)
let _array=txt.match(/(\d*)([a-z]*)/g);
let i=0,_num="";
console.log(_array);
let _array=txt.match(/(\d*)/g);
let i=0,
_num="",
_numNew,
_index;
for(i=_array.length-1;i>-1;i--){
if(!isNaN(parseInt(_array[i]))){
_num=_array[i];
break;
}
}
txt=_num?txt.replace(_num.toString(),(parseInt(_num)+1).toString()):txt;
//txt=txt.replace(_num.toString(),(parseInt(_num)+1).toString());
_numNew=parseInt(_num)+1;
if(_numNew.toString().length<_num.length){
_numNew="0".repeat(_num.length-_numNew.toString().length)+_numNew;
}
_index=txt.lastIndexOf(_num);
if(_index!=-1){
txt=txt.substr(0,_index)+_numNew.toString()+txt.substr(_index+_num.length)
}
return txt;
}
console.log(setNum(_urlC))
_urlB[_urlB.length-1]=setNum(_urlC);
_url=_urlB.join("/");
_url=_url==_urlA?"":_url;
Expand All @@ -1439,7 +1452,8 @@ var sub={
_pin=sub.getConfValue("checks","n_pin"),
_url="";
let _urlA=sub.curTab.url;
let _urlB=_urlA.split("/"),_urlC="";
let _urlB=_urlA.split("/"),
_urlC="";
if(_urlB.length>3){
_urlC=_urlB[_urlB.length-1];
console.log(_urlC)
Expand All @@ -1449,15 +1463,25 @@ var sub={

let setNum=function(txt){
console.log(txt)
let _array=txt.match(/(\d*)([a-z]*)/g);
let i=0,_num="";
let _array=txt.match(/(\d*)/g);
let i=0,
_num="",
_numNew,
_index;
for(i=_array.length-1;i>-1;i--){
if(!isNaN(parseInt(_array[i]))){
_num=_array[i];
break;
}
}
txt=_num?txt.replace(_num.toString(),(parseInt(_num)-1)<0?"0":(parseInt(_num)-1).toString()):txt;
_numNew=parseInt(_num)-1;
if(_numNew.toString().length<_num.length){
_numNew="0".repeat(_num.length-_numNew.toString().length)+_numNew;
}
_index=txt.lastIndexOf(_num);
if(_index!=-1){
txt=txt.substr(0,_index)+_numNew.toString()+txt.substr(_index+_num.length)
}
return txt;
}
_urlB[_urlB.length-1]=setNum(_urlC);
Expand Down
86 changes: 37 additions & 49 deletions js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,10 @@ var sue={
if(ui_dir){
var _img=document.createElement("img");
_img.src=chrome.extension.getURL("")+"image/"+"direct.png";
_img.style.cssText+=
"float:left;"+
sue.directimg(sue._dirArray[sue._dirArray.length-1])+
"zoom:"+Number(config[sue.drawType[0]].ui.direct.width)/32;
//"background-color:"+config[sue.drawType[0]].ui.direct.color;
ui_dir.appendChild(_img)
_img.style.cssText+="float:left;"
+"height:"+config[sue.drawType[0]].ui.direct.width+"px;"
+"transform:rotate(+"+sue.directimg(sue._dirArray[sue._dirArray.length-1])+");";
ui_dir.appendChild(_img);
}else{
ui_dir=document.createElement("div");
ui_dir.dataset.suui="dir";
Expand All @@ -752,19 +750,18 @@ var sue={
if(!_dom){
var _dom=document.createElement("div");
_dom.dataset.suui="tip";
_dom.style.cssText+=
"display:inline-block;padding:2px 5px 2px 5px;border-radius: 3px;font-family: arial,sans-serif !important;"+
"background-color:"+config[sue.drawType[0]].ui.tip.bgcolor+";"+
"color:"+config[sue.drawType[0]].ui.tip.color+";"+
"font-size:"+config[sue.drawType[0]].ui.tip.width+"px;"+
"opacity:"+config[sue.drawType[0]].ui.tip.opacity/100+";"
_dom.style.cssText+="display:inline-block;padding:2px 5px 2px 5px;border-radius: 3px;font-family: arial,sans-serif !important;"
+"background-color:"+config[sue.drawType[0]].ui.tip.bgcolor+";"
+"color:"+config[sue.drawType[0]].ui.tip.color+";"
+"font-size:"+config[sue.drawType[0]].ui.tip.width+"px;"
+"opacity:"+config[sue.drawType[0]].ui.tip.opacity/100+";"
uidom.appendChild(_dom);
var _br=document.createElement("br");
_br.style.cssText+="/*display:none;*/";
uidom.appendChild(_br);
}
if(confOBJ.tip){
var domdir=sue.domDir();
var domdir=sue.domDir(config[sue.drawType[0]].ui.tip.width);
_dom.innerHTML=(domdir+confOBJ.tip);
_dom.style.cssText+="display:inline-block;";
}else{
Expand All @@ -783,9 +780,9 @@ var sue={
"color:"+config[sue.drawType[0]].ui.note.color+";"+
"font-size:"+config[sue.drawType[0]].ui.note.width+"px;"+
"opacity:"+config[sue.drawType[0]].ui.note.opacity/100+";"
//_dom.innerText=confOBJ.note.value;
uidom.appendChild(_dom);
uidom.appendChild(document.createElement("br"));
var _br=document.createElement("br");
uidom.appendChild(_br);
}
if(confOBJ.note&&confOBJ.note.type&&confOBJ.note.value){
_dom.style.cssText+="display:inline-block;";
Expand All @@ -795,39 +792,20 @@ var sue={
_dom.innerText="";
return;
}
return
if(_dom&&!confOBJ.note.value){
_dom.style.cssText+="display:none;";
_dom.innerText="";
return;
}
if(_dom){
_dom.style.cssText+="display:inline-block;";
_dom.innerText=confOBJ.note.value;
}else{
_dom=document.createElement("div");
_dom.dataset.suui="note";
_dom.style.cssText+="font-family: arial,sans-serif !important;font-style: italic;position:fixed;"+
"color:"+config[sue.drawType[0]].ui.note.color+";"+
"font-size:"+config[sue.drawType[0]].ui.note.width+"px;"+
"opacity:"+config[sue.drawType[0]].ui.note.opacity/100+";"
_dom.innerText=confOBJ.note.value;
uidom.appendChild(_dom);
uidom.appendChild(document.createElement("br"));
}
},
ui_allaction:function(confOBJ,e){
if(!config[sue.drawType[0]].ui.allaction.enable){return;}
var uidom=sue.document.querySelector("div[data-suui=uibox][data-sustyle="+config[sue.drawType[0]].ui.allaction.style+"]");

var _dom=uidom.querySelector("div[data-suui=allaction]");
if(!_dom){
_dom=document.createElement("div");
_dom.dataset.suui="allaction";
_dom.style.cssText+="font-family: arial,sans-serif !important;text-align:left;padding: 5px 20px;border-radius: 2px;"+
"color:"+config[sue.drawType[0]].ui.allaction.color+";"+
"background-color:"+config[sue.drawType[0]].ui.allaction.bgcolor+";"+
"font-size:"+config[sue.drawType[0]].ui.allaction.width+"px;"+
"opacity:"+config[sue.drawType[0]].ui.allaction.opacity/100+";"
_dom.style.cssText+="font-family: arial,sans-serif !important;text-align:left;padding: 5px 20px;border-radius: 2px;"
+"color:"+config[sue.drawType[0]].ui.allaction.color+";"
+"background-color:"+config[sue.drawType[0]].ui.allaction.bgcolor+";"
+"font-size:"+config[sue.drawType[0]].ui.allaction.width+"px;"
+"opacity:"+config[sue.drawType[0]].ui.allaction.opacity/100+";"
uidom.appendChild(_dom);
//uidom.appendChild(document.createElement("br"));
}else{
Expand All @@ -837,7 +815,13 @@ var sue={
for(var i=0;i<confOBJ.allaction.length;i++){
var _img="";
for(var ii=0;ii<confOBJ.allaction[i].direct.length;ii++){
_img+="<img src='"+chrome.extension.getURL("")+"image/"+"direct.png"+"' style='float:left;"+sue.directimg(confOBJ.allaction[i].direct[ii])+";zoom:"+Number(config[sue.drawType[0]].ui.allaction.width)/32+"'>"
_img+="<img src='"+chrome.extension.getURL("")+"image/"+"direct.png"+"' style='"
//+"float:left;"
+"vertical-align: text-top;"
+"height:"+config[sue.drawType[0]].ui.allaction.width+"px;"
+"transform:rotate("+sue.directimg(confOBJ.allaction[i].direct[ii])+")"
+";'"
+"'>";
}
var _acction=document.createElement("div");
_acction.innerHTML=_img+"&nbsp;&nbsp;"+confOBJ.allaction[i].tip;
Expand All @@ -851,23 +835,27 @@ var sue={
},
directimg:function(direct){
var myDeg={L:"0deg",U:"90deg",R:"180deg",D:"270deg"};
return "-webkit-transform:rotate(+"+myDeg[direct]+");";
return myDeg[direct];
//return "-webkit-transform:rotate(+"+myDeg[direct]+");";
},
domDir2:function(img){
var domimg=document.createElement("img");
domimg.src=chrome.extension.getURL("")+"image/"+"direct.png";
domimg.style.cssText+=
"float:left;"+
sue.directimg(img)+
"zoom:"+Number(config[sue.drawType[0]].ui.direct.width)/32;
//";zoom:"+Number(config[sue.drawType[0]].ui.tip.width)/32+"'>"
domimg.style.cssText+="float:left;"
+"height:"+config[sue.drawType[0]].ui.direct.width+"px;"
+"vertical-align: text-top;"
+"transform:rotate(+"+sue.directimg(img)+");";
return domimg;
},
domDir:function(){
domDir:function(value){
if(config[sue.drawType[0]].ui.tip.withdir){
var domdir="";
for(var i=0;i<sue._dirArray.length;i++){
domdir+="<img src='"+chrome.extension.getURL("")+"image/"+"direct.png"+"' style='float:left;display:block;margin-top:5px;"+sue.directimg(sue._dirArray[i])+";zoom:"+Number(config[sue.drawType[0]].ui.tip.width)/32+"'>"
domdir+="<img src='"+chrome.extension.getURL("")+"image/"+"direct.png"+"' style='/*float:left;display:block;margin-top:5px;*/"
+"vertical-align: text-top;"
+"transform:rotate(+"+sue.directimg(sue._dirArray[i])+");"
+"height: "+config[sue.drawType[0]].ui.tip.width+"px;"
+"'>"
}
return domdir;
}else{
Expand Down
7 changes: 7 additions & 0 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,13 @@ var suo={
suo.bgChange(e);
}
if(e.target.classList.contains("change-checkbox")){
switch(e.target.dataset.confele){
case"fnctm"://when set disable contextmenu, remove all.
if(!e.target.checked&&chrome.contextMenus){
chrome.contextMenus.removeAll();
}
break;
}
//fnswitch drg/sdrg
if(e.target.dataset.confele=="fndrg"){
var doms=document.querySelector("input[data-confele=fnsdrg]");
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"minimum_chrome_version": "22",
"name": "__MSG_ext_name__",
"short_name":"smartUp",
"version": "6.1.747.831",
"version": "6.1.1108.837",
"description": "__MSG_ext_des__",
"default_locale": "en",
"author":"zimo",
Expand Down

0 comments on commit 1193a21

Please sign in to comment.