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 Oct 21, 2019
2 parents 64e56dc + e2a68e9 commit 6ffa7c5
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 36 deletions.
3 changes: 3 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,9 @@
"app_tip_opt":{
"message":"Options"
},
"app_tip_info":{
"message":"Information"
},
"app_rss_menu":{
"message":"Menu"
},
Expand Down
3 changes: 3 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,9 @@
"app_tip_opt":{
"message":"设置"
},
"app_tip_info":{
"message":"信息"
},
"app_rss_menu":{
"message":"菜单"
},
Expand Down
8 changes: 8 additions & 0 deletions change.log
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
88 changes: 83 additions & 5 deletions css/inject/tbkjx.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand All @@ -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{
Expand All @@ -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{
Expand Down Expand Up @@ -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;
}
64 changes: 53 additions & 11 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down Expand Up @@ -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",
Expand All @@ -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){
Expand Down Expand Up @@ -2041,7 +2057,7 @@ var sub={
chrome.runtime.reload();
},
closeapps:function(){
let _code='var eles=document.querySelectorAll("smartup.su_apps");for(var i=0;i<eles.length;i++){eles[i].style.cssText+="transition:all .4s ease-in-out;opacity:0;top:0;";window.setTimeout(function(){eles[i]?eles[i].remove():null;},500)}'
let _code='(function(){let eles=document.querySelectorAll("smartup.su_apps");let _fun=function(ele){window.setTimeout(function(){ele.remove();},500)};for(var i=0;i<eles.length;i++){eles[i].style.cssText+="transition:all .4s ease-in-out;opacity:0;top:0;";_fun(eles[i]);};}())'
chrome.tabs.executeScript({code:_code});
},
dldir:function(){
Expand Down Expand Up @@ -3573,7 +3589,8 @@ var sub={
}else if(message.apptype=="qr"){
chrome.tabs.executeScript({file:"js/qrcode.js",runAt:"document_start"},function(){})
}else if(message.apptype=="tbkjx"){
chrome.tabs.executeScript({file:"js/purify.js",runAt:"document_start"},function(){})
chrome.tabs.executeScript({file:"js/purify.js",runAt:"document_start"},function(){});
chrome.tabs.executeScript({file:"js/qrcode.js",runAt:"document_start"},function(){});
}

chrome.tabs.insertCSS({file:"css/inject/"+message.apptype+".css",runAt:"document_start"},function(){});
Expand Down Expand Up @@ -4243,19 +4260,44 @@ var sub={
},
tbkjx:{
getData:function(message,sender,sendResponse){
console.log("tbkjx.getdata");
let _url="tbkjx.json";
// let _url="https://quan.zimoapps.com/push/tbkjx.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)
// =======================
// let _url="tbkjx.json",
// _configURL="https://quan.zimoapps.com/push/config.json"+"?"+sub.date.getTime();
// =======================
let _url="https://quan.zimoapps.com/push/tbkjx.json",
_configURL="https://quan.zimoapps.com/push/config.json"+"?"+sub.date.getTime();
fetch(_configURL)
.then(response=>response.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);
}
}
}
Expand Down
Loading

0 comments on commit 6ffa7c5

Please sign in to comment.