diff --git a/change.log b/change.log index 03be08b..1bdbe57 100644 --- a/change.log +++ b/change.log @@ -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", diff --git a/html/options.html b/html/options.html index 0174459..0f56488 100644 --- a/html/options.html +++ b/html/options.html @@ -478,7 +478,7 @@
Ver
smartUp@GitHub: zimocode/smartup
-
Issues@github , zimocode@gmail.com
+
Issues@github , zimocode@gmail.com
Chrome, diff --git a/js/background.js b/js/background.js index 8dfa59c..7d1ed3d 100644 --- a/js/background.js +++ b/js/background.js @@ -1046,11 +1046,12 @@ var sub={ if(sub.curTab.index==0){ // theId=false; // break; - for(var i=0;i1;i++){ - if(sub.curWin.tabs[i].index>sub.curTab.index){ - theId.push(sub.curWin.tabs[i].id); - } - } + // for(var i=0;i1;i++){ + // if(sub.curWin.tabs[i].index>sub.curTab.index){ + // theId.push(sub.curWin.tabs[i].id); + // } + // } + break; } for(var i=0;i1;i++){ if(sub.curWin.tabs[i].index1;i++){ - if(sub.curWin.tabs[i].index1;i++){ + // if(sub.curWin.tabs[i].index1;i++){ if(sub.curWin.tabs[i].index>sub.curTab.index){ @@ -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"); @@ -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) @@ -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; @@ -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) @@ -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); diff --git a/js/event.js b/js/event.js index 6d24c9e..f6f7a80 100644 --- a/js/event.js +++ b/js/event.js @@ -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"; @@ -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{ @@ -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;"; @@ -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{ @@ -837,7 +815,13 @@ var sue={ for(var i=0;i" + _img+=""; } var _acction=document.createElement("div"); _acction.innerHTML=_img+"  "+confOBJ.allaction[i].tip; @@ -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" + domdir+="" } return domdir; }else{ diff --git a/js/options.js b/js/options.js index f8792ef..d642afd 100644 --- a/js/options.js +++ b/js/options.js @@ -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]"); diff --git a/manifest.json b/manifest.json index 0422433..9aae71e 100644 --- a/manifest.json +++ b/manifest.json @@ -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",