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 2, 2019
2 parents f2c7190 + 1879007 commit c118d4d
Show file tree
Hide file tree
Showing 17 changed files with 343 additions and 19 deletions.
28 changes: 26 additions & 2 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,10 @@
"message": "This is a bunch of test text, select the text and drag to draw the line, and then select the action you need."
},
"test_ldrg": {
"message": "<a href='###'> This is a test link, drag the link and draw lines, and select action you need. </ A>"
"message": "This is a test link, drag the link and draw lines, and select action you need."
},
"test_idrg": {
"message": "This is a test image, drag the image and draw the line, and then select the action you need: <img src='../icon.png' />"
"message": "This is a test image, drag the image and draw the line, and then select the action you need: "
},
"tip_actionname": {
"message": "Customization action name"
Expand Down Expand Up @@ -1484,5 +1484,29 @@
},
"pxmovie":{
"message":"Poxiao Movie recent update"
},
"convertcase":{
"message":"Convert Case"
},
"btn_upper":{
"message":"UPPER CASE"
},
"btn_lower":{
"message":"LOWER CASE"
},
"btn_start":{
"message":"START"
},
"autoreload":{
"message":"Auto Reload"
},
"autoreload_interval":{
"message":"Reload intervals in seconds:"
},
"autoreload_cache":{
"message":"Bypass cache"
},
"autoreload_icon":{
"message":"Show countdown on icon"
}
}
4 changes: 2 additions & 2 deletions _locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,10 @@
"message": "Questo è un testo d'esempio. Selezionare il testo e trascinare per tratteggiare la linea, e selezionare l'azione richiesta."
},
"test_ldrg": {
"message": "<a href='###'> Questo è un link d'esempio, trascinare il link e tratteggiare linee, e selezionare l'azione richiesta.</A>"
"message": "Questo è un link d'esempio, trascinare il link e tratteggiare linee, e selezionare l'azione richiesta."
},
"test_idrg": {
"message": "Questa è un'immagine d'esempio. Trascinare l'immagine e tratteggiare la linea, e selezionare l'azione richiesta: <img src='../icon.png' />"
"message": "Questa è un'immagine d'esempio. Trascinare l'immagine e tratteggiare la linea, e selezionare l'azione richiesta:"
},
"tip_actionname": {
"message": "Nome azione personalizzata"
Expand Down
4 changes: 2 additions & 2 deletions _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,10 @@
"message": "Это тестовый текст, выделите текст и потяните его, чтобы нарисовать линию, а затем выберите нужное действие."
},
"test_ldrg": {
"message": "<a href='###'> Это тестовая ссылка, перетащите ссылку и нарисуйте линию, а затем выберите нужное действие. </ A>"
"message": "Это тестовая ссылка, перетащите ссылку и нарисуйте линию, а затем выберите нужное действие."
},
"test_idrg": {
"message": "Перетащите тестовую картинку нарисовав линию и затем выберите нужное действие. <img src='../icon.png' />"
"message": "Перетащите тестовую картинку нарисовав линию и затем выберите нужное действие."
},
"tip_actionname": {
"message": "Настройки названия действия"
Expand Down
28 changes: 26 additions & 2 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,10 @@
"message": "这是一段测试文本,选中文本并拖曳画线,然后选择你所需要的操作即可。"
},
"test_ldrg": {
"message": "<a href='###'>这是一个测试链接,拖动此链接并画线,然后选择你所需要的操作。</ a>"
"message": "这是一个测试链接,拖动此链接并画线,然后选择你所需要的操作。"
},
"test_idrg": {
"message": "这是测试用图片,拖动改图片并画线,然后选择所需操作: <img src='../icon.png' />"
"message": "这是测试用图片,拖动改图片并画线,然后选择所需操作:"
},
"tip_actionname": {
"message": "使用自定义操作名称"
Expand Down Expand Up @@ -1453,5 +1453,29 @@
},
"pxmovie":{
"message":"破晓电影最近更新"
},
"convertcase":{
"message":"大小写字母转换"
},
"btn_upper":{
"message":"大写"
},
"btn_lower":{
"message":"小写"
},
"btn_start":{
"message":"开始"
},
"autoreload":{
"message":"自动刷新"
},
"autoreload_interval":{
"message":"刷新间隔时间(秒):"
},
"autoreload_cache":{
"message":"忽略本地缓存"
},
"autoreload_icon":{
"message":"在扩展图标上显示刷新倒计时"
}
}
4 changes: 2 additions & 2 deletions _locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,10 @@
"message": "這是一些測試文字,選擇這些文字並拖曳畫出手勢,然後再選擇你需要的動作。"
},
"test_ldrg": {
"message": "<a href='###'> 這是測試連結,拖曳此連結並畫出手勢,然後選擇你需要的動作。 </ A>"
"message": "這是測試連結,拖曳此連結並畫出手勢,然後選擇你需要的動作。"
},
"test_idrg": {
"message": "這是張測試圖片,拖曳此圖片並畫出手勢,然後選擇你需要的動作:<img src='../icon.png' />"
"message": "這是張測試圖片,拖曳此圖片並畫出手勢,然後選擇你需要的動作:"
},
"tip_actionname": {
"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.4.887.1001",
"date":"2019.07.27",
"content":[
"new mini-apps: convert case, auto reload.",
"fix bugs: Can't add super drag for links and images"
]
},
{
"ver":"6.3.770.881",
"date":"2019.06.30",
Expand Down
3 changes: 2 additions & 1 deletion css/apps_basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ smartup.su_apps a{
}


smartup.su_apps input[type=text]{
smartup.su_apps input[type=text],
smartup.su_apps input[type=number]{
border: 1px solid #d0d9ff;
height: 26px;
border-radius: 3px;
Expand Down
48 changes: 48 additions & 0 deletions css/inject/autoreload.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
smartup.su_apps#su_apps_autoreload .su_autoreload_box{
width: 360px;
padding: 8px;
text-align: center;
}
smartup.su_apps#su_apps_autoreload .su_autoreload_box::after{
content: "";
clear: both;
}
smartup.su_apps#su_apps_autoreload input[type=number]{
height: 20px;
width: 80px;
padding: 0;
margin: 4px 0 6px 0;
}
smartup.su_apps#su_apps_autoreload #su_autoreload_divleft{
/*float: left;*/
margin-right: 85px;
padding-right: 8px;
border-right: 1px solid #cccccc54;
margin-bottom: 8px;
}
smartup.su_apps#su_apps_autoreload #su_autoreload_interval{
padding-left: 8px;
}
smartup.su_apps#su_apps_autoreload #su_autoreload_btnbox{
margin: 8px 0;
}
smartup.su_apps#su_apps_autoreload #su_autoreload_countdownbox{
/*border: 1px solid red;*/
height: 64px;
width: 64px;
border-radius: 50%;
/*float: right;*/
line-height: 64px;
position: absolute;
top: 32px;
right: 16px;
background-color: #597afc;
color: #fff;
font-weight: bold;
}
smartup.su_apps#su_apps_autoreload #su_autoreload_desbox{
clear: both;
text-align: left;
font-size: 12px;
color: #777;
}
12 changes: 12 additions & 0 deletions css/inject/convertcase.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
smartup.su_apps#su_apps_convertcase .su_convertcase_box{
text-align: center;
padding: 8px;
}
smartup.su_apps#su_apps_convertcase textarea{
width: 240px;
height: 60px;
}
smartup.su_apps#su_apps_convertcase button{
display: inline-block;
margin: 8px;
}
2 changes: 2 additions & 0 deletions js/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ let actions={
{name:"jslist"},
{name:"savepdf"},
{name:"lottery"},
{name:"convertcase"},
{name:"autoreload"},
{name:"appslist"}
/*{name:"gmail"},
{name:"ary"},
Expand Down
64 changes: 61 additions & 3 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,14 @@ var sub={
},

//mini apps

autoreload:function(){
var _appname="autoreload";
sub.insertTest(_appname);
},
convertcase:function(){
var _appname="convertcase";
sub.insertTest(_appname);
},
pxmovie:function(){
var _appname="pxmovie";
sub.insertTest(_appname);
Expand Down Expand Up @@ -2441,7 +2448,7 @@ var sub={
var _appname="appslist";
sub.initAppconf(_appname);
var _obj={}
_obj.apps=["rss","tablist","random","extmgm","recentbk","recentht","recentclosed","synced","base64","qr","numc","speaker","jslist","lottery"];
_obj.apps=["rss","tablist","random","extmgm","recentbk","recentht","recentclosed","synced","base64","qr","numc","speaker","jslist","lottery","convertcase","autoreload"];
chrome.tabs.saveAsPDF?_obj.apps.push("savepdf"):null;
sub.cons[_appname]=_obj;
sub.insertTest(_appname);
Expand Down Expand Up @@ -3695,6 +3702,51 @@ var sub={
sub.apps[message.app][message.action](message,sendResponse);
},
apps:{
autoreload:{
reload:function(message,sender,sendResponse){
if(message.value.type=="start"){
if(!sub.cons.autoreload){
sub.cons.autoreload={};
sub.cons.autoreload[sender.tab.id]={};
}else if(!sub.cons.autoreload[sender.tab.id]){
sub.cons.autoreload[sender.tab.id]={};
}
this.clear(message,sender,sendResponse);
sub.cons.autoreload[sender.tab.id].timeRemain=message.value.interval;
sub.cons.autoreload[sender.tab.id].iconCountdown=message.value.iconCountdown;
sub.cons.autoreload[sender.tab.id].bypassCache=message.value.bypassCache;

if(sub.cons.autoreload[sender.tab.id].iconCountdown){
chrome.browserAction.setBadgeText({text:sub.cons.autoreload[sender.tab.id].timeRemain.toString(),tabId:sender.tab.id});
sub.cons.autoreload[sender.tab.id].countDown=window.setInterval(function(){
sub.cons.autoreload[sender.tab.id].timeRemain--;
chrome.browserAction.setBadgeText({text:sub.cons.autoreload[sender.tab.id].timeRemain.toString(),tabId:sender.tab.id});
},1000);
}else{
sub.cons.autoreload[sender.tab.id].countDown=window.setInterval(function(){
sub.cons.autoreload[sender.tab.id].timeRemain--;
},1000)
}
sub.cons.autoreload[sender.tab.id].timer=window.setInterval(function(){
chrome.tabs.reload(sender.tab.id,{bypassCache:sub.cons.autoreload[sender.tab.id].bypassCache});
sub.cons.autoreload[sender.tab.id].timeRemain=message.value.interval+1;
},message.value.interval*1000)
}else{
this.clear(message,sender,sendResponse);
}
},
clear:function(message,sender,sendResponse){
if(sub.cons.autoreload&&sub.cons.autoreload[sender.tab.id]){
window.clearInterval(sub.cons.autoreload[sender.tab.id].timer);
window.clearInterval(sub.cons.autoreload[sender.tab.id].countDown);
sub.cons.autoreload[sender.tab.id].timeRemain=0;
}
chrome.browserAction.setBadgeText({text:"",tabId:sender.tab.id});
},
getConf:function(message,sender,sendResponse){
sendResponse({config:config.apps[message.app],value:sub.cons[message.app],tabId:sender.tab.id});
}
},
rss:{
getMessage:function(message,sender,sendResponse){
console.log(message);
Expand Down Expand Up @@ -4179,7 +4231,13 @@ chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab){
}
});
}

})
chrome.tabs.onRemoved.addListener(function(tabId){
if(sub.cons.autoreload&&sub.cons.autoreload[tabId]){
window.clearInterval(sub.cons.autoreload[tabId].timer);
window.clearInterval(sub.cons.autoreload[tabId].countDown);
}
//(sub.cons.autoreload&&sub.cons.autoreload[tabId])?window.clearInterval(sub.cons.autoreload[tabId]):null;
})
chrome.runtime.onMessageExternal.addListener(function(message,sender,sendResponse){
sub.funOnMessage(message,sender,sendResponse);
Expand Down
Loading

0 comments on commit c118d4d

Please sign in to comment.