diff --git a/README-zh_CN.md b/README-zh_CN.md new file mode 100644 index 0000000..769db68 --- /dev/null +++ b/README-zh_CN.md @@ -0,0 +1,26 @@ +

+ GitHub Readme Stats +

smartUp手势

+

一个更好的手势类扩展。功能包括:鼠标手势,简易拖曳,超级拖曳,摇杆手势和滚轮手势。

+

+ + Issues + + + forks + + + Stars + + + GitHub pull requests + +
+

+ +

+ English + · + 简体中文 +

+

\ No newline at end of file diff --git a/README.md b/README.md index 7061560..7826e08 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@

- GitHub Readme Stats -

smartup手势

-

一个更好的手势类扩展。功能包括:鼠标手势,简易拖曳,超级拖曳,摇杆手势和滚轮手势。

-

+ GitHub Readme Stats +

smartUp Gestures

+

A better gestures extension. Features include: mouse gestures, simple drag, super drag, rocker gestures and wheel gestures.

Issues @@ -17,27 +16,11 @@ GitHub pull requests
-
- - - - - -

- 查看 Demo - · - 报告 Bug - · - 请求增加功能 -

-

- English + English · - 简体中文 + 简体中文

-

-

喜欢这个项目?请考虑捐赠来帮助它完善! - +

\ No newline at end of file diff --git a/css/options.css b/css/options.css index 77a4b19..420dd0a 100644 --- a/css/options.css +++ b/css/options.css @@ -1802,7 +1802,7 @@ summary:hover{ } #donate_box .donate_listli{ cursor: pointer; - max-width: 64px; + max-width: 128px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -1821,8 +1821,10 @@ summary:hover{ display: none; } #donate_box #donate_content{ - padding: 8px; + /*padding-top: 1px;*/ + border-top: 1px solid #999; background-color: #fff; + width: 360px; } #donate_box .donate_contentlist{ display: none; @@ -1833,7 +1835,8 @@ summary:hover{ } #donate_box .donate_contentlist img{ display: block; - width: 192px; + /*width: 192px;*/ + width: 100%; margin: 0 auto; } #donate_box .donate_contentlist span{ diff --git a/js/options.js b/js/options.js index c3fab1e..92a828e 100644 --- a/js/options.js +++ b/js/options.js @@ -183,7 +183,7 @@ var suo={ break; } if(ele.classList.contains("donate_listli")){ - suo.donateBox.switchDonate(ele); + suo.donateBox.switch(ele); } if(ele.classList.contains("menuplus_save")){ suo.saveConf2(); @@ -2600,139 +2600,120 @@ var suo={ donateBox:{ init:function(){ chrome.runtime.sendMessage({type:"getDonateData"},function(response){ - console.log(response) - if(response.value){ - suo.cons.xhrDonate=response.value; + let localType=navigator.language, + _url="https://apis.zimoapps.com/su"; + localType=localType.replace("-","_"); + fetch(_url,{ + method:"GET", + cache:"no-cache" + }).then(response=>response.json()) + .then(response=>{ + suo.cons.xhrDonate=response; suo.donateBox.show(); - }else{ - let xhr = new XMLHttpRequest(), - localType=navigator.language, - _url="https://push.zimoapps.com/smartup/message.json"; - //localType="zh-CN"; - // _url="../message.json"; - xhr.onreadystatechange=function(){ - if (xhr.readyState == 4){ - let items=JSON.parse(DOMPurify.sanitize(xhr.response)); - console.log(items) - if(items.options.on){ - if((items.all_local&&items.all_local.length>0)||(items[localType]&&items[localType].length>0)){ - suo.cons.xhrDonate=items; - suo.donateBox.show(); - chrome.runtime.sendMessage({type:"setDonateData",value:items}); - } - } + let data={ + donate:[], + ad:[] + } + if(response[0]&&response[0]["on"]&&response[0].donate[0][localType]){ + data.donate.push(response[0].donate[0][localType]); + }else{ + if(response[0].donate[0]["default"]){ + data.donate.push(response[0].donate[0]["default"]); + }else{ + data.donate.length=0; } } - xhr.open('GET',_url+"?"+new Date().getTime(), true); - xhr.send(); - } + if(response[1]&&response[1]["on"]&&response[1].ad[0][localType]){ + data.ad.push(response[1].ad[0][localType]); + }else{ + if(response[1].ad[0]["default"]){ + data.ad.push(response[1].ad[0]["default"]); + }else{ + data.ad.length=0; + } + } + suo.donateBox.dom(data); + }) }) }, - show:function(){ - document.querySelector("#donate_box").style.cssText+="display:block;"; - }, - checkPushMessage:function(){ - let _items=suo.cons.xhrDonate; - let lang=navigator.language; - //lang="zh-CN"; - let i=0,itemArray=[]; - itemLocal=_items[lang], - itemAllLocal=_items.all_local; - if(_items.all_local_i18n&&_items.all_local_i18n[lang]){ - for(i=0;i<_items.all_local_i18n[lang].length;i++){ - for(var ii in _items.all_local_i18n[lang][i]){ - itemAllLocal[i][ii]=_items.all_local_i18n[lang][i][ii] - } - } - } - if(itemLocal){itemArray.push(itemLocal)} - if(itemAllLocal){itemArray.push(itemAllLocal)} - suo.donateBox.setPushDom(itemArray) - }, - setPushDom:function(items){ - console.log(items) + dom:function(items){ let domMain=document.querySelector("#donate_main"), domList=document.querySelector("#donate_list"), domContent=document.querySelector("#donate_content"); domList.textContent=""; domContent.textContent=""; - let i=0,ii=0,id_i=0,id_ii=0; - let initDom=function(itemOBJ){ - let i=0,ii=0; - for(i=0;i0&&i0&&i