diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b77db30..9e5919f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1145,6 +1145,9 @@ "app_tip_opt":{ "message":"Options" }, + "app_tip_info":{ + "message":"Information" + }, "app_rss_menu":{ "message":"Menu" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index d48ee89..f759081 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -1148,6 +1148,9 @@ "app_tip_opt":{ "message":"设置" }, + "app_tip_info":{ + "message":"信息" + }, "app_rss_menu":{ "message":"菜单" }, diff --git a/change.log b/change.log index 14280a5..36b9ef7 100644 --- a/change.log +++ b/change.log @@ -1,5 +1,13 @@ { "log": [ + { + "ver":"6.5.1348.1026", + "date":"2019.10.16", + "content":[ + "upgrade tbkjx", + "fix bug: action closeapps, added new options for miniapps don't work" + ] + }, { "ver":"6.5.1240.1020", "date":"2019.09.26", diff --git a/css/inject/tbkjx.css b/css/inject/tbkjx.css index 621d645..1f5bffe 100644 --- a/css/inject/tbkjx.css +++ b/css/inject/tbkjx.css @@ -43,6 +43,7 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_boxsearch input{ padding: 0px 4px; width: 120px; margin: 3px 4px; +margin-left: 0; } smartup.su_apps#su_apps_tbkjx .su_tbkjx_boxsearch button{ min-width: 10px; @@ -52,6 +53,7 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_boxsearch button{ display: inline-block; float: right; margin: 4px auto; + padding: 0; /**/ float: initial; margin-left: 4px; @@ -60,12 +62,51 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_headspan{ font-size: 10px; color: #333; } - - +smartup.su_apps#su_apps_tbkjx .su_tbkjx_sort{ + margin-top: 2px; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_sortbtn{ + font-size: 10px; + height: 18px; + line-height: 18px; + min-width: auto; + padding: 0 4px; + margin: 0; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_sortbtncur{ + color: rgb(255, 255, 255); + background: rgb(86, 119, 252); +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_extent{ + /*padding: 4px 0;*/ + padding: 0; + margin-bottom: 4px; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_extenttext{ + width: 35px; + padding: 0 2px; + margin: 0 2px; + height: 18px; + font-size: 10px; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_extentbtn{ + width: 40px; + min-width: auto; + font-size: 12px; + height: 18px; + line-height: 18px; + padding: 0; + margin: 0; + margin-left: 4px; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_extentspan{ + font-size: 10px; +} smartup.su_apps#su_apps_tbkjx .su_tbkjx_img{ height: 360px; width: 360px; display: block; + cursor: pointer; } smartup.su_apps#su_apps_tbkjx .su_tbkjx_name{ width: 360px; @@ -79,6 +120,7 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_name{ smartup.su_apps#su_apps_tbkjx .su_tbkjx_btnbox{ width: 360px; margin: 0; + padding: 0; background-color: red; color: #fff; } @@ -101,10 +143,10 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_buy{ padding-left: 8px; } smartup.su_apps#su_apps_tbkjx .su_tbkjx_listjing{ - padding-top: 72px; + padding-top: 86px; padding-top: 0; -margin-top: 72px; +margin-top: 106px; position: initial; } smartup.su_apps#su_apps_tbkjx .su_tbkjx_listjing ul{ @@ -116,7 +158,7 @@ height: 288px; overflow-y: auto; overflow-x: hidden; height: 328px; -height: 320px; +height: 278px; padding: 2px 0; } smartup.su_apps#su_apps_tbkjx .su_tbkjx_listjing li{ @@ -183,4 +225,40 @@ smartup.su_apps#su_apps_tbkjx .su_tbkjx_listbottom button:disabled:hover{ color: #000; cursor: not-allowed; box-shadow: none; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_des{ + font-size: 10px; + color: #333; +} +smartup.su_apps#su_apps_tbkjx .su_options_help{ + position: absolute; + left: 0; + top: 0; + background-color: #fff; + padding: 8px 16px; + width: -webkit-calc(100% - 16px); + width: -moz-calc(100% - 16px); + width: calc(100% - 16px); + margin: 8px; + margin-top: 32px; + box-sizing: border-box; + opacity: 0; + z-index: -1; + box-shadow: 0px 2px 4px #5677fc; +} +smartup.su_apps#su_apps_tbkjx .su_options_help li{ + font-size: 12px; + display: block; + float: unset; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_qr{ + position: absolute; + left: 16px; + bottom: 76px; +} +smartup.su_apps#su_apps_tbkjx .su_tbkjx_qr img{ + width: 0px; + height: 0px; + opacity: 0; + cursor: pointer; } \ No newline at end of file diff --git a/js/background.js b/js/background.js index 93d2378..8dc80d0 100644 --- a/js/background.js +++ b/js/background.js @@ -856,7 +856,7 @@ var appConfmodel={ synced:{n_closebox:true}, jslist:{n_closebox:true}, homepage:{n_optype:"s_new",n_position:"s_default",n_pin:false,n_closebox:true,n_homepage_icon:true,n_homepage_bg:true,n_homepage_resize:true,type:"topsites",site:[{title:"Google",url:"https://www.google.com"}]}, - tbkjx:{n_num:50} + tbkjx:{n_num:50,n_optype:"s_new",n_position:"s_default",n_pin:false} } var sub={ @@ -1141,6 +1141,16 @@ var sub={ } return theIndex; }, + date:{ + date:new Date(), + get:function(){ + var _newDate=this.date.getFullYear().toString()+((this.date.getMonth()+1)<10?("0"+(this.date.getMonth()+1)):(this.date.getMonth()+1).toString())+(this.date.getDate()<10?("0"+this.date.getDate()):this.date.getDate().toString()); + return Number(_newDate); + }, + getTime:function(){ + return this.date.getTime(); + } + }, showNotif:function(type,title,txt){ var notif={ iconUrl:"icon.png", @@ -1155,6 +1165,12 @@ var sub={ if(!config.apps[appname]){ config.apps[appname]=appConfmodel[appname]; chrome.storage.sync.set(JSON.parse(JSON.stringify(config)),function(){}); + }else{ + for(var i in appConfmodel[appname]){ + if(config.apps[appname][i]===undefined){ + config.apps[appname][i]=appConfmodel[appname][i]; + } + } } }, insertTest:function(appname){ @@ -2041,7 +2057,7 @@ var sub={ chrome.runtime.reload(); }, closeapps:function(){ - let _code='var eles=document.querySelectorAll("smartup.su_apps");for(var i=0;iresponse.json()) .then(json=>{ - chrome.tabs.sendMessage(sender.tab.id,{type:"data",value:json}); + if(!localStorage.getItem("tbkjx_dataversion")||Number(json.version)>=sub.date.get()){ + _url=_url+"?"+sub.date.get().toString(); + localStorage.setItem("tbkjx_dataversion",json.version); + }else{ + _url=_url+"?"+localStorage.getItem("tbkjx_dataversion"); + } + console.log(_url); + fetch(_url) + .then(response=>response.json()) + .then(json=>{ + chrome.tabs.sendMessage(sender.tab.id,{type:"data",value:json}); + }) }) + // ======================= + + // let _date=new Date(); + // _url=_url+"?"+_date.getFullYear()+((_date.getMonth()+1)<10?("0"+(_date.getMonth()+1)):(_date.getMonth()+1))+(_date.getDate()<10?("0"+_date.getDate()):_date.getDate()) + // fetch(_url) + // .then(response=>response.json()) + // .then(json=>{ + // chrome.tabs.sendMessage(sender.tab.id,{type:"data",value:json}); + // }) }, itemOpen:function(message,sender,sendResponse){ - sub.open(message.value); + let _URL=message.value, + _Target=config.apps[message.app].n_optype, + _Index=sub.getIndex(config.apps[message.app].n_position,"new")[0], + _Pin=config.apps[message.app].n_pin; + sub.open(_URL,_Target,_Index,_Pin); } } } diff --git a/js/inject/tbkjx.js b/js/inject/tbkjx.js index 351e068..6fd83dc 100644 --- a/js/inject/tbkjx.js +++ b/js/inject/tbkjx.js @@ -7,10 +7,14 @@ sue.apps.tbkjx={ headTitle:"tbkjx", headCloseBtn:true, menu:[ - {src:"/image/options.png",title:"app_tip_opt",className:"menu_item menu_item_opt"} + {src:"/image/options.png",title:"app_tip_opt",className:"menu_item menu_item_opt"}, + {src:"/image/info.svg",title:"app_tip_info",className:"menu_item menu_item_help"} ], options:[ {type:"range",label:"app_tbkjx_num",name:"n_num",min:10,max:100,step:10}, + {type:"select",label:"n_optype",name:"n_optype",value:["s_new","s_back","s_current","s_incog"]}, + {type:"select",label:"n_position",name:"n_position",value:["s_default","s_left","s_right","s_head","s_last"]}, + {type:"checkbox",label:"n_pin",name:"n_pin",checked:true} ] } sue.apps.init(); @@ -34,17 +38,43 @@ sue.apps.tbkjx={ boxSearch.appendChild(sue.apps.domCreate("input",{setName:["id","placeholder","type"],setValue:["su_tbkjx_searchkey","键入关键字搜索","text"]},null,null,null)); boxSearch.appendChild(sue.apps.domCreate("button",{setName:["id"],setValue:["su_tbkjx_search"]},null,null,null,"搜索")); - let headSpan=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_headspan"]},null,null,null,"1.部分商品由于商家调价,价格有一定变化\n2.只买对的,不买便宜的(*^_^*)") + let headSort=sue.apps.domCreate("div",{setName:["className"],setValue:["su_tbkjx_sort"]}); + let _sortReset=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_sortbtn su_tbkjx_sortreset"]},null,null,null,"默认排序"), + _sortUp=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_sortbtn su_tbkjx_sortup"]},null,"margin:0 5px;",null,"价格由低到高"), + _sortDn=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_sortbtn su_tbkjx_sortdn"]},null,null,null,"价格由高到低"), + _sortCup=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_sortbtn su_tbkjx_sortcup"]},null,null,null,"优惠券额由低到高"), + _sortCdn=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_sortbtn su_tbkjx_sortcdn"]},null,"margin:4px;",null,"优惠券额由高到低"); + headSort.appendChild(_sortReset); + headSort.appendChild(_sortUp); + headSort.appendChild(_sortDn); + headSort.appendChild(_sortCup); + headSort.appendChild(_sortCdn); + + let headExtent=sue.apps.domCreate("div",{setName:["className"],setValue:["su_tbkjx_extent"]}); + let _extentSpan=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_extentspan"]},null,null,null,"价格范围:"), + _extentFrom=sue.apps.domCreate("input",{setName:["className","id","placeholder","type"],setValue:["su_tbkjx_extenttext","su_tbkjx_extentfrom","最低价","text"]},null,null,null), + _extentDash=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_extenttext"]},null,"font-size:10px;",null,"~"), + _extentTo=sue.apps.domCreate("input",{setName:["className","id","placeholder","type"],setValue:["su_tbkjx_extenttext","su_tbkjx_extento","最高价","text"]},null,null,null), + _extentBtn=sue.apps.domCreate("button",{setName:["className","id"],setValue:["su_tbkjx_extentbtn","su_tbkjx_extentbtn"]},null,null,null,"确定"); + headExtent.appendChild(_extentSpan); + headExtent.appendChild(_extentFrom); + headExtent.appendChild(_extentDash); + headExtent.appendChild(_extentTo); + headExtent.appendChild(_extentBtn); + let _bottomPre=sue.apps.domCreate("button",{setName:["id","className","title"],setValue:["su_tbkjx_btnpre","su_tbkjx_page","上一页"]},null,null,null,"<"), _bottomHome=sue.apps.domCreate("button",{setName:["id","className","title"],setValue:["su_tbkjx_btnhome","su_tbkjx_page","第一页"]},null,"width:40px;margin:0 4px;",{setName:["page"],setValue:["0"]},"□"), - _bottomNext=sue.apps.domCreate("button",{setName:["id","className","title"],setValue:["su_tbkjx_btnnext","su_tbkjx_page","下一页"]},null,null,null,">"); + _bottomNext=sue.apps.domCreate("button",{setName:["id","className","title"],setValue:["su_tbkjx_btnnext","su_tbkjx_page","下一页"]},null,null,null,">"), + _bottomDes=sue.apps.domCreate("div",{setName:["className"],setValue:["su_tbkjx_des"]},null,null,null,"只买需要的,不买便宜的(*^_^*)"); listBottom.appendChild(_bottomPre); listBottom.appendChild(_bottomHome); listBottom.appendChild(_bottomNext); + listBottom.appendChild(_bottomDes); listHead.appendChild(boxSearch); - listHead.appendChild(headSpan); + listHead.appendChild(headSort); + listHead.appendChild(headExtent); boxList.appendChild(listHead); boxList.appendChild(listJing); @@ -53,22 +83,37 @@ sue.apps.tbkjx={ theAppBox.appendChild(boxContent); theAppBox.appendChild(boxList); - chrome.runtime.sendMessage({type:"appsAction",app:"tbkjx",action:"getData",value:"jingxuan"}) + let _infoBox=sue.apps.domCreate("div",{setName:["className"],setValue:["su_options_help"]}), + _info=sue.apps.domCreate("ul"); + _info.appendChild(sue.apps.domCreate("li",null,null,null,null,"1、每日更新上万款优惠券商品,购物前可以从这里搜索是否有和心意的。")); + _info.appendChild(sue.apps.domCreate("li",null,null,null,null,"2、由于商家调价等因素,部分商品价格可能有变动。")); + _info.appendChild(sue.apps.domCreate("li",null,null,null,null,"3、点击商品图片显示领券地址的二维码。可以通过手机淘宝扫码在手机上领券购买!")); + _info.appendChild(sue.apps.domCreate("li",null,null,null,null,"4、理性购物,多多比较,购买需要的物品。")); + let _li=sue.apps.domCreate("li",null,null,null,null,"5、此迷你应用也有相应的网页版本:"); + let _a=sue.apps.domCreate("a",{setName:["href","target"],setValue:["https://quan.zimoapps.com","_blank"]},null,null,null,"quan.zimoapps.com"); + _li.appendChild(_a); + _info.appendChild(_li); + _infoBox.appendChild(_info); + dom.appendChild(_infoBox); + chrome.runtime.sendMessage({type:"appsAction",app:"tbkjx",action:"getData",value:"jingxuan"}) dom.style.cssText+="border-color:#2b2b34;"; dom.querySelector(".su_head").style.cssText+="background-color:#2b2b34;"; dom.addEventListener("click",this.handleEvent,false); dom.addEventListener("keypress",this.handleEvent,false); + dom.addEventListener("mouseover",this.handleEvent,false); }, itemInit:function(data){ let _dom=sue.apps.tbkjx.dom.querySelector(".su_main .su_tbkjx_boxcontent"); _dom.textContent=""; - let _img=sue.apps.domCreate("img",{setName:["className","src"],setValue:["su_tbkjx_img",data[1]]}), + // let _img=sue.apps.domCreate("img",{setName:["className","src"],setValue:["su_tbkjx_img",data[1]]}), + let _img=sue.apps.domCreate("div",{setName:["className","title"],setValue:["su_tbkjx_img","点击图片显示领券地址的二维码。\n通过手机淘宝扫码在手机上领券购买!"]},null,"background-image:url("+data[1]+");background-size:contain"), + _name=sue.apps.domCreate("div",{setName:["className","title"],setValue:["su_tbkjx_name",DOMPurify.sanitize(data[0])]},null,null,null,DOMPurify.sanitize(data[0])), _spanPrice=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_spanprice su_tbkjx_open"]},null,null,{setName:["link"],setValue:[DOMPurify.sanitize(data[3])]},"券后价"), _price=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_price su_tbkjx_open"]},null,null,{setName:["link"],setValue:[DOMPurify.sanitize(data[3])]},"¥"+DOMPurify.sanitize(data[2])), - _buy=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_buy su_tbkjx_open"]},null,null,{setName:["link"],setValue:[DOMPurify.sanitize(data[3])]},"前往领券"), + _buy=sue.apps.domCreate("span",{setName:["className"],setValue:["su_tbkjx_buy su_tbkjx_open"]},null,null,{setName:["link"],setValue:[DOMPurify.sanitize(data[3])]},"前往领券(¥"+DOMPurify.sanitize(data[4])+")"), _btnBox=sue.apps.domCreate("button",{setName:["className"],setValue:["su_tbkjx_btnbox su_tbkjx_open"]},null,null,{setName:["link"],setValue:[DOMPurify.sanitize(data[3])]}); @@ -79,9 +124,17 @@ sue.apps.tbkjx={ _dom.appendChild(_img); _dom.appendChild(_name); _dom.appendChild(_btnBox); + + let _domQr=sue.apps.domCreate("div",{setName:["className"],setValue:["su_tbkjx_qr"]},null,"display:none;"); + new QRCode(_domQr,data[3]); + _img.appendChild(_domQr); + window.setTimeout(function(){ + _domQr.style.cssText+="display:block;"; + },500) }, initList:function(data,page){ - sue.apps.tbkjx.cons.curData=data; + // sue.apps.tbkjx.cons.curData=data; + sue.apps.tbkjx.cons.curData=data.slice(0); //// let _listLength=sue.apps.tbkjx.config.n_num; let _page=page; @@ -111,6 +164,7 @@ sue.apps.tbkjx={ sue.apps.tbkjx.itemSwitch(_dom.querySelector("li")); sue.apps.tbkjx.itemInit(data[0]); + sue.apps.tbkjx.setSortBtn(); }, handleEvent:function(e){ switch(e.type){ @@ -133,25 +187,94 @@ sue.apps.tbkjx={ if(e.target.classList.contains("su_tbkjx_page")){ sue.apps.tbkjx.initList(sue.apps.tbkjx.cons.curData,e.target.dataset.page); } - break + if(e.target.classList.contains("su_tbkjx_sortbtn")){ + let sortType="up"; + if(e.target.classList.contains("su_tbkjx_sortup")){ + sortType="up"; + }else if(e.target.classList.contains("su_tbkjx_sortdn")){ + sortType="dn"; + }else if(e.target.classList.contains("su_tbkjx_sortcup")){ + sortType="cup"; + }else if(e.target.classList.contains("su_tbkjx_sortcdn")){ + sortType="cdn"; + }else{ + sortType="reset"; + } + sue.apps.tbkjx.itemSort(sortType); + } + if(e.target.classList.contains("su_tbkjx_extentbtn")){ + sue.apps.tbkjx.itemExtent(); + } + if(e.target.classList.contains("menu_item_help")){ + sue.apps.tbkjx.showHelp(e); + } + if(e.target.classList.contains("su_tbkjx_img")||(e.target.parentNode&&e.target.parentNode.classList.contains("su_tbkjx_qr"))){ + sue.apps.tbkjx.showQR(); + } + break; case"keypress": - if(e.keyCode==13){ - sue.apps.tbkjx.itemSearch(); + if(e.keyCode==13&&e.target.id=="su_tbkjx_searchkey"){ + sue.apps.tbkjx.itemSearch(e.target); + }else if(e.keyCode==13&&e.target.classList.contains("su_tbkjx_extenttext")){ + sue.apps.tbkjx.itemExtent(); } - break + break; + } + }, + showQR:function(){ + var _qrImg=sue.apps.tbkjx.dom.querySelector(".su_tbkjx_qr img"); + console.log(_qrImg) + var _qrState=window.getComputedStyle(_qrImg).width=="0px"?true:false; + console.log(_qrState) + if(_qrState){ + _qrImg.style.cssText+="width:345px;height:345px;opacity:1;"; + }else{ + _qrImg.style.cssText+="width:0px;height:0px;opacity:0;"; } }, itemSearch:function(){ - console.log("itemSearch") - let _key=sue.apps.tbkjx.dom.querySelector("#su_tbkjx_searchkey").value; - console.log(_key); - let newData=[], - data=sue.apps.tbkjx.cons.data; + let _dom=sue.apps.tbkjx.dom; + _dom.querySelector("#su_tbkjx_extentfrom").value=""; + _dom.querySelector("#su_tbkjx_extento").value=""; + + let data=sue.apps.tbkjx.cons.data; + let _keys=_dom.querySelector("#su_tbkjx_searchkey").value.split(" "); + let _newD=[]; + let arrayDiff=function(arr) { + let result = []; + let obj = {}; + if(!arr){return result;} + for(var i=0;i-1){ + if(!_newD[_num]){_newD[_num]=[]} + _newD[_num].push(data[i]); + } + } + let concatArray=_newD[_newD.length-1]; + for(var i=_newD.length-1;i>0;i--){ + concatArray=concatArray.concat(_newD[i-1]); } + + let newData=arrayDiff(concatArray); + + sue.apps.tbkjx.cons.curSort="reset"; + sue.apps.tbkjx.cons.reset=newData; + sue.apps.tbkjx.cons.extentBase=newData; sue.apps.tbkjx.initList(newData,0); }, itemSwitch:function(ele){ @@ -164,6 +287,86 @@ sue.apps.tbkjx={ }, itemOpen:function(link){ chrome.runtime.sendMessage({type:"appsAction",app:"tbkjx",action:"itemOpen",value:link}); + }, + itemSort:function(sortType){ + let compare=function(type){ + if(type=="up"||type=="dn"){ + return function(m,n){ + var a = m[2]; + var b = n[2]; + if(type=="up"){ + return a - b; + }else{ + return b - a; + } + } + }else{ + return function(m,n){ + var a = m[4]; + var b = n[4]; + if(type=="cup"){ + return a - b; + }else{ + return b - a; + } + } + } + } + if(sortType!="reset"){ + sue.apps.tbkjx.cons[sortType]=sue.apps.tbkjx.cons.curData.sort(compare(sortType)); + } + sue.apps.tbkjx.initList(sue.apps.tbkjx.cons[sortType],0); + sue.apps.tbkjx.cons.curSort=sortType; + sue.apps.tbkjx.setSortBtn(); + + // sue.apps.tbkjx.initList(sue.apps.tbkjx.cons.curData.sort(compare(sortType)),0); + }, + setSortBtn:function(){ + console.log("setSortBtn"); + if(!sue.apps.tbkjx.cons.curSort){sue.apps.tbkjx.cons.curSort="reset"} + let _btns=sue.apps.tbkjx.dom.querySelectorAll(".su_tbkjx_sortbtn"); + for(var i=0;i<_btns.length;i++){ + if(_btns[i].classList.contains("su_tbkjx_sortbtncur")){ + _btns[i].classList.remove("su_tbkjx_sortbtncur"); + } + if(_btns[i].classList.contains("su_tbkjx_sort"+sue.apps.tbkjx.cons.curSort)){ + _btns[i].classList.add("su_tbkjx_sortbtncur"); + } + } + }, + itemExtent:function(){ + let _dom=sue.apps.tbkjx.dom; + let _from=Number(_dom.querySelector("#su_tbkjx_extentfrom").value), + _to=Number(_dom.querySelector("#su_tbkjx_extento").value); + console.log(_from) + + let newData=[], + data=sue.apps.tbkjx.cons.extentBase; + for(var i=0;i=_from){ + newData.push(data[i]); + } + } + if(Number(data[i][2])>=_from&&Number(data[i][2])<=_to){ + newData.push(data[i]); + } + } + + sue.apps.tbkjx.cons.curSort="reset"; + sue.apps.tbkjx.cons.reset=newData; + sue.apps.tbkjx.cons.curData=newData; + sue.apps.tbkjx.itemSort(sue.apps.tbkjx.cons.curSort) + // sue.apps.tbkjx.initList(newData,0); + }, + showHelp:function(e){ + var domopt=sue.apps.getAPPboxEle(e).querySelector(".su_options_help"); + var _opt=window.getComputedStyle(domopt).opacity==0?true:false; + if(_opt){ + domopt.style.cssText+="opacity:.9;z-index:10;"; + }else{ + domopt.style.cssText+="opacity:0;z-index:-1;"; + } } } chrome.runtime.sendMessage({type:"apps_getvalue",apptype:"tbkjx"},function(response){ @@ -174,6 +377,8 @@ chrome.runtime.onMessage.addListener(function(message,sender,sendResponse) { switch(message.type){ case"data": sue.apps.tbkjx.cons.data=message.value.data; + sue.apps.tbkjx.cons.reset=sue.apps.tbkjx.cons.data.slice(0); + sue.apps.tbkjx.cons.extentBase=sue.apps.tbkjx.cons.data.slice(0); sue.apps.tbkjx.initList(message.value.data,0); break; } diff --git a/manifest.json b/manifest.json index 8fde04f..2a0da1c 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "minimum_chrome_version": "22", "name": "__MSG_ext_name__", "short_name":"smartUp", - "version": "6.5.1240.1020", + "version": "6.5.1348.1026", "description": "__MSG_ext_des__", "default_locale": "en", "author":"zimo",