Skip to content

Commit

Permalink
Merge branch 'release/1.5.4.330'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenshin committed Mar 31, 2019
2 parents cc756b3 + 53f18d9 commit 0e306f5
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 5 deletions.
20 changes: 20 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@
"message": "Custom Script"
},

"zen_mode_setting_script_howto": {
"message": "How to use"
},

"zen_mode_setting_script_manage": {
"message": "Script Loader"
},

"zen_mode_setting_import": {
"message": "Import"
},
Expand Down Expand Up @@ -685,6 +693,18 @@
"message": "Import failed, config file parse."
},

"notify_zen_mode_script_loader_none": {
"message": "This feature will be come soon."
},

"notify_zen_mode_script_loader_success": {
"message": "Script manage loading success."
},

"notify_zen_mode_script_loader_failed": {
"message": "Script manage loading failed."
},

"notify_zen_mode_exit": {
"message": "Exit zen mode success, please refresh new tab."
},
Expand Down
20 changes: 20 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@
"message": "自定义脚本"
},

"zen_mode_setting_script_howto": {
"message": "如何使用"
},

"zen_mode_setting_script_manage": {
"message": "脚本管理器"
},

"zen_mode_setting_import": {
"message": "导入配置"
},
Expand Down Expand Up @@ -685,6 +693,18 @@
"message": "导入失败,配置文件解析失败,请重新确认。"
},

"notify_zen_mode_script_loader_none": {
"message": "此功能将会马上推出。"
},

"notify_zen_mode_script_loader_success": {
"message": "已成功加载脚本管理器。"
},

"notify_zen_mode_script_loader_failed": {
"message": "当前网络发生了一些问题,请稍后再试。"
},

"notify_zen_mode_exit": {
"message": "已退出禅模式,页面刷新后生效。"
},
Expand Down
20 changes: 20 additions & 0 deletions _locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@
"message": "自定義腳本"
},

"zen_mode_setting_script_howto": {
"message": "如何使用"
},

"zen_mode_setting_script_manage": {
"message": "腳本管理器"
},

"zen_mode_setting_import": {
"message": "導入配置"
},
Expand Down Expand Up @@ -685,6 +693,18 @@
"message": "導入失敗,配置文件解析失敗,請重新確認。"
},

"notify_zen_mode_script_loader_none": {
"message": "此功能將會馬上推出。"
},

"notify_zen_mode_script_loader_success": {
"message": "已成功載入腳本管理器。"
},

"notify_zen_mode_script_loader_failed": {
"message": "當前網路發生了一些問題,請稍後再試。"
},

"notify_zen_mode_exit": {
"message": "已退出禪模式,頁面刷新後生效。"
},
Expand Down
32 changes: 31 additions & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,14 @@ img {
align-items: flex-start;
}

.manage .album.subscribe .photograph .photos {
margin-top: 25px;
}

.manage .album.subscribe .photograph:nth-child(1) .photos {
margin-top: 0;
}

.manage .album.subscribe .photograph img {
margin: 17px;
}
Expand Down Expand Up @@ -1860,7 +1868,7 @@ img {
bottom: 10px;

width: 400px;
height: 575px;
height: 605px;

padding: 15px;

Expand All @@ -1887,6 +1895,28 @@ img {
transform-origin: left top 0;
}

.setting-zen-mode .subtitle {
margin-top: 5px;
font-size: 18px;
transform: scale(.75);
transform-origin: left top 0;
}

.setting-zen-mode .subtitle a {
color: inherit;
text-decoration: none;
transition: all .3s ease;
}

.setting-zen-mode .subtitle a:hover,
.setting-zen-mode .subtitle span:hover {
font-weight: bold;
}

.setting-zen-mode .subtitle span {
cursor: pointer;
transition: all .3s ease;
}

.setting-zen-mode .themes .content {
display: flex;
Expand Down
6 changes: 3 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "
// get time
date.Toggle( setting.Mode( "clockstate" ));

controlbar.AutoPlay();
localStorage["simptab-zenmode"] != "true" && controlbar.AutoPlay();

// listen
controlbar.Listen( function( type, result ) {
Expand Down Expand Up @@ -127,7 +127,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "
background.Earth();
});
message.Subscribe( message.TYPE.HISTORY, function( event ) {
options.Storage.db.history && history.Get( event.data );
localStorage["simptab-zenmode"] != "true" && options.Storage.db.history && history.Get( event.data );
});

chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) {
Expand All @@ -139,6 +139,6 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "

noise.Init();

localStorage[ "simptab-background-mode" ] == "time" && options.Storage.db.history && history.Init();
localStorage["simptab-zenmode"] != "true" && localStorage[ "simptab-background-mode" ] == "time" && options.Storage.db.history && history.Init();

});
26 changes: 26 additions & 0 deletions js/zen.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,31 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ]
storage.db.script = event.target.value;
storage.Set();
});
$( ".setting-zen-mode" ).on( "click", ".script .subtitle span", function( event ) {
var manage = JSON.parse( localStorage[ "simptab-zenmode-manage" ] || "{}" ),
runat = function() {
close();
new Function( manage.script )();
};
if ( $.isEmptyObject( manage )) {
$.ajax({
type : "GET",
url : "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/script/manage.json?" + Math.round(+new Date()),
dataType : "json"
}).then( function( result ) {
if ( result && result.version == "" ) {
new Notify().Render( i18n.GetLang( "notify_zen_mode_script_loader_none" ) );
} else if ( result && result.version ) {
manage = result;
localStorage[ "simptab-zenmode-manage" ] = JSON.stringify( manage );
new Notify().Render( i18n.GetLang( "notify_zen_mode_script_loader_success" ) );
runat();
}
}, function( jqXHR, textStatus, errorThrown ) {
new Notify().Render( 2, i18n.GetLang( "notify_zen_mode_script_loader_failed" ) );
});
} else runat();
});
}

/*********************************************
Expand Down Expand Up @@ -345,6 +370,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ]
<div class="script" style="margin-top: 15px;">\
<div class="title">' + i18n.GetLang( "zen_mode_setting_script" ) + '</div>\
' + scriptView() + '\
<div class="subtitle"><a href="http://ksria.com/simptab/docs/#/%E7%A6%85%E6%A8%A1%E5%BC%8F?id=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%84%9A%E6%9C%AC" target="_blank">' + i18n.GetLang( "zen_mode_setting_script_howto" ) + '</a> & <span>' + i18n.GetLang( "zen_mode_setting_script_manage" ) + '</span></div>\
</div>\
<div class="footer">\
<div class="waves-effect button import">' + i18n.GetLang( "zen_mode_setting_import" ) + '</div>\
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name" : "__MSG_extension_name__",
"short_name" : "SimpTab",
"version" : "1.5.4.202",
"version" : "1.5.4.330",
"default_locale" : "zh_CN",
"description" : "__MSG_extension_desc__",
"author" : "Kenshin",
Expand Down

0 comments on commit 0e306f5

Please sign in to comment.