Skip to content

Commit

Permalink
Merge branch 'release/1.5.3.1129'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenshin committed Nov 30, 2018
2 parents 312876a + 603ee34 commit 71c7ee9
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 50 deletions.
12 changes: 12 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@
"message": "Support custom e.g. https://source.unsplash.com/<b>{xxxx}</b> usage , split about more <a href='https://source.unsplash.com/' target='_blank'>Unsplash Source</a>"
},

"options_custom_unsplash_screen_label": {
"message": "Custom Unsplash resolution"
},

"options_custom_unsplash_screen_placeholder": {
"message": "Default resolution is: 2k( 2560 * 1440 )"
},

"options_custom_unsplash_screen_notice": {
"message": "Custom resolution: widthxheigh e.g 3200x1800 4096x2160"
},

"options_custom_style": {
"message": "Custom global Style"
},
Expand Down
12 changes: 12 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@
"message": "支持自定义源,例如 https://source.unsplash.com/<b>{xxxx}</b> 用, 分割;详细说明请访问 <a href='http://ksria.com/simptab/docs/#/多种背景源?id=自定义Unsplash' target='_blank'>自定义 Unsplash</a>"
},

"options_custom_unsplash_screen_label": {
"message": "更改 Unsplash 源分辨率"
},

"options_custom_unsplash_screen_placeholder": {
"message": "默认分辨率为:2k( 2560 * 1440 )"
},

"options_custom_unsplash_screen_notice": {
"message": "可更改为适合自己的分辨率,格式:widthxheigh 如: 3200x1800 详细说明请访问 <a href='http://ksria.com/simptab/docs/#/多种背景源?id=自定义分辨率' target='_blank'>自定义分辨率</a>"
},

"options_custom_style": {
"message": "自定义样式( 全局 )"
},
Expand Down
12 changes: 12 additions & 0 deletions _locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@
"message": "支持自定義源,例如 https://source.unsplash.com/<b>{xxxx}</b> 用, 分割;詳細說明請訪問 <a href='http://ksria.com/simptab/docs/#/多种背景源?id=自定义Unsplash' target='_blank'>自定義 Unsplash</a>"
},

"options_custom_unsplash_screen_label": {
"message": "更改 Unsplash 源解析度"
},

"options_custom_unsplash_screen_placeholder": {
"message": "默認解析度為:2k( 2560 * 1440 )"
},

"options_custom_unsplash_screen_notice": {
"message": "可更改為適合自己的解析度,格式:widthxheigh 如: 3200x1800 詳細說明請訪問 <a href='http://ksria.com/simptab/docs/#/多種背景源?id=自定義解析度' target='_blank'>自定義解析度</a>"
},

"options_custom_style": {
"message": "自定義樣式( 全局 )"
},
Expand Down
46 changes: 29 additions & 17 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,10 @@ img {
margin-top: 10px;
}

.options .custom-unsplash input {
margin: 10px 0 0 0;
}

.options .custom-tp .custom-tp-fields {
max-width: 805px;
height: 150px;
Expand Down Expand Up @@ -1874,22 +1878,6 @@ img {
}

.setting-zen-mode .themes .content input {
width: 100%;
height: 28px;
line-height: 28px;

margin: 5px;
padding-left: 5px;

color: rgb(170, 170, 170);
background-color: #24292e;
caret-color: rgb(170, 170, 170);

outline: none;
border-radius: 4px;
border: none;
font-size: 14px;

opacity: 0;
}

Expand Down Expand Up @@ -2414,9 +2402,30 @@ img {
}

/*
* md-textarea
* md-textarea/input
*/

.md-input {
margin: 5px;
padding-left: 5px;

width: 100%;
height: 28px;
line-height: 28px;

font-size: 14px;

color: #fff;
background-color: rgb(63, 68, 71);
caret-color: #fff;

outline: none;
border-radius: 4px;
border: none;

transition: all .6s ease;
}

.md-textarea {
padding: 5px 0 0 5px;

Expand All @@ -2430,8 +2439,11 @@ img {

border-radius: 4px;
border: none;

transition: all .6s ease;
}

.md-input:focus,
.md-textarea:focus {
outline: none !important;
background-color: rgb(109, 112, 115);
Expand Down
50 changes: 28 additions & 22 deletions js/apis.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
'{"key":"db", "color": "#55711C", "title":"豆瓣搜索", "query": "https://www.douban.com/search?source=suggest&q={query}"}',
'{"key":"fy", "color": "#4285F4", "title":"谷歌翻译", "query": "https://translate.google.cn/#auto/en/{query}"}',
],
unsplash: [ "collection/2463312", "collection/614656", "collection/1111575", "collection/1717137", "collection/445266", "collection/610876", "collection/1457745", "collection/782142", "collection/1136512", "collection/869152", "collection/782123", "collection/595970", "collection/641379", "collection/488182", "collection/142376" ],
unsplash: [ "collection/3593484", "collection/3593482", "collection/2463312", "collection/614656", "collection/1111575", "collection/1717137", "collection/445266", "collection/610876", "collection/1457745", "collection/782142", "collection/1136512", "collection/869152", "collection/782123", "collection/595970", "collection/641379", "collection/488182", "collection/142376" ],
unsplash_screen: "",
subscribe: {
sequence: false,
index: 0
Expand Down Expand Up @@ -76,6 +77,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
<div class="label">' + i18n.GetLang( "options_custom_unsplash_label" ) + '</div>\
<textarea class="md-textarea custom-unsplash"></textarea>\
<div class="notice">' + i18n.GetLang( "options_custom_unsplash_notice" ) + '</div>\
<div class="label" style="margin-top:10px;">' + i18n.GetLang( "options_custom_unsplash_screen_label" ) + '</div>\
<input class="md-input custom-unsplash-screen" type="text" placeholder="' + i18n.GetLang( "options_custom_unsplash_screen_placeholder" ) + '"/>\
<div class="notice" style="margin-top:2px;">' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '</div>\
</div>\
';
return tmpl;
Expand All @@ -87,14 +91,19 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
storage.db.unsplash = event.target.value.split( "," );
storage.Set();
});
$( ".options .custom-unsplash" ).find( "input" ).prop( "checked", storage.db.subscribe.sequence );
$( ".options" ).on( "change", ".custom-unsplash input", function( event ) {
$( ".options .custom-unsplash .custom-unsplash-cbx" ).find( "input" ).prop( "checked", storage.db.subscribe.sequence );
$( ".options .custom-unsplash .custom-unsplash-screen" ).val( storage.db.unsplash_screen );
$( ".options" ).on( "change", ".custom-unsplash .custom-unsplash-cbx input", function( event ) {
var $cb = $(this),
value = $cb.prop( "checked" );
$cb.val( value );
storage.db.subscribe.sequence = value;
storage.Set();
});
$( ".options" ).on( "keyup", ".custom-unsplash .custom-unsplash-screen", function( event ) {
storage.db.unsplash_screen = event.target.value;
storage.Set();
});
}

/*********************************************
Expand Down
12 changes: 6 additions & 6 deletions js/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ define([ "jquery", "waves", "i18n", "zen" ], function( $, Waves, i18n, zen ) {
return value.split(":")[1];
},

Only: function() {
var code = 14;
setting.origins.forEach( function( origin, index ) {
if ( origin.endsWith( "true" ) && index != 13 ) {
code = origin.split(":")[0];
EmptyOrigins: function() {
var empty = true;
setting.origins.forEach( function( origin, idx ) {
if ( origin.endsWith( "true" ) && ( idx != 3 && idx != 5 && idx != 8 && idx != 11 ) ) {
empty = false;
}
});
return code;
return empty;
},

TogglePinState: function( state ) {
Expand Down
2 changes: 1 addition & 1 deletion js/zen.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ]
var target = ".setting-zen-mode .themes input";
if ( type == "add" ) {
if ( $(target).length > 0 ) return;
$( ".setting-zen-mode .themes .content" ).append( '<input type="text" placeholder="' + i18n.GetLang( "zen_mode_setting_theme_placeholder" ) + '"/>' );
$( ".setting-zen-mode .themes .content" ).append( '<input class="md-input" type="text" placeholder="' + i18n.GetLang( "zen_mode_setting_theme_placeholder" ) + '"/>' );
setTimeout( function() {
storage.themes.indexOf( storage.db.theme.replace( "#", "" ) ) == -1 &&
$(target).val( storage.db.theme );
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.3.1127",
"version" : "1.5.3.1129",
"default_locale" : "zh_CN",
"description" : "__MSG_extension_desc__",
"author" : "Kenshin",
Expand Down

0 comments on commit 71c7ee9

Please sign in to comment.