From 46cc098d95a2f535516cd69d3b81cafa5e23410a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 4 Dec 2018 15:02:35 +0800 Subject: [PATCH 001/176] Add mobile icon to controlbar UI and logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ assets/css/main.css | 6 +++++- assets/images/mobile.png | Bin 0 -> 305 bytes js/controlbar.js | 16 ++++++++++++++++ js/i18n.js | 1 + js/shortcuts.js | 1 + main.html | 1 + 9 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 assets/images/mobile.png diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 344af2c..554d548 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -73,6 +73,10 @@ "message": "About" }, + "controlbar_mobile": { + "message": "Send to Mobile" + }, + "controlbar_favorite": { "message": "Like" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 02b6498..d69f780 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -73,6 +73,10 @@ "message": "关于" }, + "controlbar_mobile": { + "message": "发送到手机端" + }, + "controlbar_favorite": { "message": "收藏" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index d016767..ba50dfd 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -73,6 +73,10 @@ "message": "關於" }, + "controlbar_mobile": { + "message": "發送到手機端" + }, + "controlbar_favorite": { "message": "收藏" }, diff --git a/assets/css/main.css b/assets/css/main.css index c7e8f82..0ec5f65 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -287,6 +287,10 @@ img { background-image: url("../images/about.png"); } +.mobileicon { + background-image: url("../images/mobile.png"); +} + /* * clock */ @@ -1513,7 +1517,7 @@ img { bottom: 5px; width: 500px; - height: 380px; + height: 400px; padding: 15px; diff --git a/assets/images/mobile.png b/assets/images/mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..ba9a1d4d4849630e0813d9a2ed4b30a6dc3b1b22 GIT binary patch literal 305 zcmV-10nYx3P)v#PP2{YuLeH!S28Dgs;E46YXdhcUTWv{DA{JF49Gy zOPpsnzu=bUw^LNjqNFy;Jbrx1M~;?=Qe{ zR`e75CBc_!ZDAvD?{~bGM0v-|i)E2B#1%R!s)2q0(nLKQtWVXb00000NkvXXu0mjf DZFq^~ literal 0 HcmV?d00001 diff --git a/js/controlbar.js b/js/controlbar.js index 4c5d3c8..9393e89 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -224,6 +224,22 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", about.Render() : new Notify().Render( i18n.GetLang( "notify_double_open" ) ); break; + case "mobile": + var notify = new Notify().Render({ content: "正在发送,请稍等...", state: "loading" }); + $.ajax({ + type : "POST", + url : "http://192.168.31.57:3100", + data : vo.cur.hdurl, + }).then( function( result ) { + if ( result.status == 200 ) { + notify.complete(); + new Notify().Render( "已成功发送到 " + result.name ); + } else new Notify().Render( 2, "发错失败,请稍后再试。" ); + } , function( jqXHR, textStatus, errorThrown ) { + notify.complete(); + new Notify().Render( 2, "发错失败,请稍后再试。" ); + }); + break; } }); }, diff --git a/js/i18n.js b/js/i18n.js index 96decb1..2f3c80c 100644 --- a/js/i18n.js +++ b/js/i18n.js @@ -22,6 +22,7 @@ define([ "jquery" ], function( $ ) { $( ".controlbar" ).find( "a[url=manage]" ).attr("data-balloon", i18n( "controlbar_manage" )); $( ".controlbar" ).find( "a[url=options]" ).attr("data-balloon", i18n( "controlbar_options" )); $( ".controlbar" ).find( "a[url=about]" ).attr("data-balloon", i18n( "controlbar_about" )); + $( ".controlbar" ).find( "a[url=mobile]" ).attr("data-balloon", i18n( "controlbar_mobile" )); $( ".controlbar" ).find( "a[url=favorite]" ).attr("data-balloon", i18n( "controlbar_favorite" )); $( ".controlbar" ).find( "a[url=pin]" ).attr("data-balloon", i18n( "controlbar_pin" )); $( ".controlbar" ).find( "a[url=dislike]" ).attr("data-balloon", i18n( "controlbar_dislike" )); diff --git a/js/shortcuts.js b/js/shortcuts.js index 3ff81e1..11757ae 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -21,6 +21,7 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f { short: "o", long: "options" }, { short: "t", long: "about" }, { short: "s", long: "setting" }, + { short: "b", long: "mobile" }, { short: "a", long: "favorite" }, { short: "n", long: "pin" }, { short: "u", long: "dislike" }, diff --git a/main.html b/main.html index 2553adf..f913c88 100644 --- a/main.html +++ b/main.html @@ -36,6 +36,7 @@ +
  • From a7cc962b48bf89095755c89bc4e3b6419f98a33f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 4 Dec 2018 15:09:34 +0800 Subject: [PATCH 002/176] Add send mobile notify i18.n --- _locales/en/messages.json | 12 ++++++++++++ _locales/zh_CN/messages.json | 12 ++++++++++++ _locales/zh_TW/messages.json | 12 ++++++++++++ js/controlbar.js | 8 ++++---- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 554d548..9e44422 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -573,6 +573,18 @@ "message": "Confirm" }, + "notify_mobile_send": { + "message": "Send to mobile..." + }, + + "notify_mobile_send_success": { + "message": "Send sucessful " + }, + + "notify_mobile_send_failed": { + "message": "Send failed." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index d69f780..394cf7c 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -573,6 +573,18 @@ "message": "不再提示" }, + "notify_mobile_send": { + "message": "正在发送,请稍等..." + }, + + "notify_mobile_send_success": { + "message": "已成功发送到 " + }, + + "notify_mobile_send_failed": { + "message": "发错失败,请稍后再试。" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index ba50dfd..305ad8c 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -573,6 +573,18 @@ "message": "不再提示" }, + "notify_mobile_send": { + "message": "正在發送,請稍等..." + }, + + "notify_mobile_send_success": { + "message": "已成功發送到 " + }, + + "notify_mobile_send_failed": { + "message": "發錯失敗,請稍後再試。" + }, + "version_detail": { "message": "" }, diff --git a/js/controlbar.js b/js/controlbar.js index 9393e89..37dfe99 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -225,7 +225,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", new Notify().Render( i18n.GetLang( "notify_double_open" ) ); break; case "mobile": - var notify = new Notify().Render({ content: "正在发送,请稍等...", state: "loading" }); + var notify = new Notify().Render({ content: i18n.GetLang( "notify_mobile_send" ), state: "loading" }); $.ajax({ type : "POST", url : "http://192.168.31.57:3100", @@ -233,11 +233,11 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", }).then( function( result ) { if ( result.status == 200 ) { notify.complete(); - new Notify().Render( "已成功发送到 " + result.name ); - } else new Notify().Render( 2, "发错失败,请稍后再试。" ); + new Notify().Render( i18n.GetLang( "notify_mobile_send_success" ) + result.name ); + } else new Notify().Render( 2, i18n.GetLang( "notify_mobile_send_failed" ) ); } , function( jqXHR, textStatus, errorThrown ) { notify.complete(); - new Notify().Render( 2, "发错失败,请稍后再试。" ); + new Notify().Render( 2, i18n.GetLang( "notify_mobile_send_failed" ) ); }); break; } From 90cfc7872d1cd6612545b37ac0e999e58cfee13a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 4 Dec 2018 15:30:33 +0800 Subject: [PATCH 003/176] Add custom mobile host logic. --- js/controlbar.js | 2 +- js/options.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 37dfe99..43f828c 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -228,7 +228,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", var notify = new Notify().Render({ content: i18n.GetLang( "notify_mobile_send" ), state: "loading" }); $.ajax({ type : "POST", - url : "http://192.168.31.57:3100", + url : options.Storage.db.mobile_host, data : vo.cur.hdurl, }).then( function( result ) { if ( result.status == 200 ) { diff --git a/js/options.js b/js/options.js index 10ff92d..ae0bdb2 100644 --- a/js/options.js +++ b/js/options.js @@ -36,7 +36,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( subscribe: { sequence: false, index: 0 - } + }, + mobile_host: "", }; function Storage() { @@ -80,6 +81,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_unsplash_screen_label" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '
    \ +
    自定义监听地址
    \ + \ +
    此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机端
    \ \ '; return tmpl; @@ -92,6 +96,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( storage.Set(); }); $( ".options .custom-unsplash .custom-unsplash-cbx" ).find( "input" ).prop( "checked", storage.db.subscribe.sequence ); + $( ".options .custom-unsplash .custom-mobile" ).val( storage.db.mobile_host ); $( ".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), @@ -104,6 +109,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( storage.db.unsplash_screen = event.target.value; storage.Set(); }); + $( ".options" ).on( "keyup", ".custom-unsplash .custom-mobile", function( event ) { + storage.db.mobile_host = event.target.value; + storage.Set(); + }); } /********************************************* From d2dc4d44ed15936c0bc8a74c8fc9cad5946d356c Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 4 Dec 2018 15:40:52 +0800 Subject: [PATCH 004/176] Add custom mobile host i18n. --- _locales/en/messages.json | 12 ++++++++++++ _locales/zh_CN/messages.json | 12 ++++++++++++ _locales/zh_TW/messages.json | 12 ++++++++++++ js/options.js | 6 +++--- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 9e44422..672a7b7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -357,6 +357,18 @@ "message": "Custom resolution: widthxheigh e.g 3200x1800 4096x2160" }, + "options_custom_mobile_lable": { + "message": "Add JSBox host" + }, + + "options_custom_mobile_placeholder": { + "message": "Please enter the correct format, including port number, such as http://192.168.31.233:3100" + }, + + "options_custom_mobile_notice": { + "message": "First JSBox is required to be installed on iOS, for details Send to mobile" + }, + "options_custom_style": { "message": "Custom global Style" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 394cf7c..205397c 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -357,6 +357,18 @@ "message": "可更改为适合自己的分辨率,格式:widthxheigh 如: 3200x1800 详细说明请访问 自定义分辨率" }, + "options_custom_mobile_lable": { + "message": "自定义监听地址" + }, + + "options_custom_mobile_placeholder": { + "message": "请输入正确的格式,包含端口号,如 http://192.168.31.233:3100" + }, + + "options_custom_mobile_notice": { + "message": "此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机端" + }, + "options_custom_style": { "message": "自定义样式( 全局 )" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 305ad8c..2e6bd86 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -357,6 +357,18 @@ "message": "可更改為適合自己的解析度,格式:widthxheigh 如: 3200x1800 詳細說明請訪問 自定義解析度" }, + "options_custom_mobile_lable": { + "message": "自定義監聽地址" + }, + + "options_custom_mobile_placeholder": { + "message": "請輸入正確的格式,包含埠號,如 http://192.168.31.233:3100" + }, + + "options_custom_mobile_notice": { + "message": "此功能需要在 iOS 端安裝 JSBox,詳細說明請訪問 發送到手機端" + }, + "options_custom_style": { "message": "自定義樣式( 全局 )" }, diff --git a/js/options.js b/js/options.js index ae0bdb2..824d6e3 100644 --- a/js/options.js +++ b/js/options.js @@ -81,9 +81,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_unsplash_screen_label" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '
    \ -
    自定义监听地址
    \ - \ -
    此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机端
    \ +
    ' + i18n.GetLang( "options_custom_mobile_lable" ) + '
    \ + \ +
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \ \ '; return tmpl; From b2e66246293946f660a0ef09b46013a6a9584b02 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 4 Dec 2018 15:54:38 +0800 Subject: [PATCH 005/176] Add mobile host regexp logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/controlbar.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 672a7b7..b9744d4 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -597,6 +597,10 @@ "message": "Send failed." }, + "notify_mobile_host_failed": { + "message": "Host IP Address error, please re-input again." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 205397c..8a85925 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -597,6 +597,10 @@ "message": "发错失败,请稍后再试。" }, + "notify_mobile_host_failed": { + "message": "输入的监听地址不清楚,请重新输入。" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 2e6bd86..74850c0 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -597,6 +597,10 @@ "message": "發錯失敗,請稍後再試。" }, + "notify_mobile_host_failed": { + "message": "輸入的監聽地址不清楚,請重新輸入。" + }, + "version_detail": { "message": "" }, diff --git a/js/controlbar.js b/js/controlbar.js index 43f828c..a8bcff7 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -225,6 +225,10 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", new Notify().Render( i18n.GetLang( "notify_double_open" ) ); break; case "mobile": + if ( !/http:\/\/(\d{1,3}.){4}:\d+/ig.test( options.Storage.db.mobile_host ) ) { + new Notify().Render( 2, i18n.GetLang( "notify_mobile_host_failed" ) ); + return; + } var notify = new Notify().Render({ content: i18n.GetLang( "notify_mobile_send" ), state: "loading" }); $.ajax({ type : "POST", From 0c56fa90c34bf25955d6856282b3cbbd0baec2e3 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 10:58:14 +0800 Subject: [PATCH 006/176] Change post url to base64. --- js/controlbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/controlbar.js b/js/controlbar.js index a8bcff7..013c867 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -233,7 +233,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", $.ajax({ type : "POST", url : options.Storage.db.mobile_host, - data : vo.cur.hdurl, + data : files.DataURI(), }).then( function( result ) { if ( result.status == 200 ) { notify.complete(); From b3f025618a73ee3424a0bb1df2472a3a62b1dc57 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 11:05:53 +0800 Subject: [PATCH 007/176] Optimize file.DataURI() and fix refresh favorite logic bug. --- js/background.js | 1 + js/files.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index 1319d40..ea87973 100644 --- a/js/background.js +++ b/js/background.js @@ -113,6 +113,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar progress.Set( "loading" ); files.GetDataURI( url ).then( function( result ) { + localStorage[ "simptab-background-update" ] == "true" && files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) .progress( function( result ) { if ( typeof result != "undefined" && !$.isEmptyObject( result )) { diff --git a/js/files.js b/js/files.js index 61a177d..6953755 100644 --- a/js/files.js +++ b/js/files.js @@ -203,7 +203,7 @@ define([ "jquery", "vo" ], function( $, vo ) { }, DataURI: function( result ) { - return curURI = curURI || result; + return curURI = result || curURI; }, VerifyUploadFile: function( arr ) { From 91bce954c3ed8538cb804c44bdcdf819145c7587 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 13:47:52 +0800 Subject: [PATCH 008/176] Fix favorite and simptab collections not update DataURI() bug. --- js/manage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/manage.js b/js/manage.js index 067eeea..c8276d5 100644 --- a/js/manage.js +++ b/js/manage.js @@ -121,6 +121,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " type == "subscribe" && new Notify().Render( i18n.GetLang( "notify_mange_setting" ) ); // save url to background.jpg files.GetDataURI( url ).then( function( result ) { + files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) From 59087606df693497143af2d4713c6e8502970567 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 18:10:23 +0800 Subject: [PATCH 009/176] Add files.DownloadfromURI(). --- js/files.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/js/files.js b/js/files.js index 6953755..42b6889 100644 --- a/js/files.js +++ b/js/files.js @@ -286,6 +286,43 @@ define([ "jquery", "vo" ], function( $, vo ) { const $a = $( '' ).appendTo( "body" ); $a[0].click(); $a.remove(); - } + }, + + // hack code + DownloadfromURI: function( file_name, uri ) { + + var path = file_name + ".jpg"; + var def = $.Deferred(); + + fs.root.getFile( path, { create : true }, function( fileEntry ) { + fileEntry.createWriter( function( fileWriter ) { + console.log("fileEntry.toURL() = " + fileEntry.toURL()); + fileWriter.onwritestart = function(e) { def.notify( e ); }; + fileWriter.onprogress = function(e) { def.notify( e ); }; + fileWriter.onwriteend = unBindEvent; + fileWriter.onabort = unBindEvent; + fileWriter.onerror = unBindEvent; + fileWriter.write( dataURItoBlob( uri )); + + function unBindEvent(e) { + fileWriter.onwritestart = null; + fileWriter.onprogress = null; + fileWriter.onabort = null; + fileWriter.onerror = null; + fileWriter.onwriteend = null; + e && e.type == "writeend" ? def.resolve( fileEntry.toURL() ) : def.reject( e ); + }; + }, function( error ) { + console.log( "Save background fail, error is", error ); + def.reject( error ); + }); + }, + function( error ) { + console.log( "Get background fail, error is", error ); + def.reject( error ); + }); + + return def.promise(); + }, }; }); From 4b4c1a366c36ec6b9e5e318756e500067ed3cbca Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 18:10:47 +0800 Subject: [PATCH 010/176] Format source. --- js/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/files.js b/js/files.js index 42b6889..e7fe160 100644 --- a/js/files.js +++ b/js/files.js @@ -288,7 +288,7 @@ define([ "jquery", "vo" ], function( $, vo ) { $a.remove(); }, - // hack code + // hack code source from Add() DownloadfromURI: function( file_name, uri ) { var path = file_name + ".jpg"; From 33740bd2f22cf413b3012e8eef9588425e966425 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 18:14:37 +0800 Subject: [PATCH 011/176] Optimize download logic usage files.DownloadfromURI(). --- js/controlbar.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 013c867..078bfad 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -12,6 +12,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", function setDownloadURL() { + /* if ( vo.cur.info.search( "https://unsplash.com" ) == 0 ) { $( ".controlink[url='download']" ).attr({ "href" : vo.cur.hdurl, @@ -28,6 +29,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", "download" : "SimpTab-" + date.Now() + "-" + shortname + ".jpg" }); } + */ } @@ -180,10 +182,12 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", callBack( url, is_favorite ); break; case "download": - // hack code( when 'unsplash.com' or 'nasa.gov' image download, new tab happen crash error. ) - //if ( vo.cur.type != "unsplash.com" && vo.cur.type != "nasa.gov" ) { - //event.currentTarget.href = files.DataURI() || vo.cur.hdurl; - //} + files.DownloadfromURI( "download", files.DataURI() ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + files.Download( result, "simptab-wallpaper-" + date.Now() + ".png" ); + }); break; case "upload": var input = document.createElement("input"), From 5e12ea3d48130f9613f2d468f2d401c112aa75ed Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 5 Dec 2018 18:30:45 +0800 Subject: [PATCH 012/176] Format source. --- js/controlbar.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 078bfad..7b144fd 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -10,29 +10,6 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", $target.parent().find( ".tooltip" ).text( vo.cur.type == "upload" ? "Upload image" : vo.cur.type ); } - function setDownloadURL() { - - /* - if ( vo.cur.info.search( "https://unsplash.com" ) == 0 ) { - $( ".controlink[url='download']" ).attr({ - "href" : vo.cur.hdurl, - "target" : "_blank", - }).removeAttr( "url" ); - } else { - var shortname = vo.cur.shortname; - if ( shortname == "#" ) { - shortname = vo.cur.name; - } - $( ".controlink[url='download']" ).attr({ - "title" : vo.cur.name, - "href" : vo.cur.hdurl, - "download" : "SimpTab-" + date.Now() + "-" + shortname + ".jpg" - }); - } - */ - - } - function setBackground( url ) { if ( localStorage[ "simptab-background-update" ] == "true" ) return; $("body").css({ "background-image": "url(" + url + ")" }); @@ -272,7 +249,6 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", is_default ? vo.cur = vo.Clone( vo.Create( vo.constructor.DEFAULT_BACKGROUND, vo.constructor.DEFAULT_BACKGROUND, "Wallpaper", "#", date.Now(), "Wallpaper", "default", {} )) : setCurBackgroundURI(); setInfoURL(); - setDownloadURL(); setBackground( is_default ? vo.constructor.DEFAULT_BACKGROUND: vo.constructor.CURRENT_BACKGROUND ); setBackgroundPosition(); setUploadState( setting.IsRandom() ); From 354fab68a4058a386c1978ce64f6007b019ac911 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 10:59:28 +0800 Subject: [PATCH 013/176] Format source. --- js/controlbar.js | 2 +- js/files.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 7b144fd..0e34ca7 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -159,7 +159,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", callBack( url, is_favorite ); break; case "download": - files.DownloadfromURI( "download", files.DataURI() ) + files.SaveBgfromURI( "download", files.DataURI() ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function( result ) { diff --git a/js/files.js b/js/files.js index e7fe160..d2db194 100644 --- a/js/files.js +++ b/js/files.js @@ -289,7 +289,7 @@ define([ "jquery", "vo" ], function( $, vo ) { }, // hack code source from Add() - DownloadfromURI: function( file_name, uri ) { + SaveBgfromURI: function( file_name, uri ) { var path = file_name + ".jpg"; var def = $.Deferred(); From 3dd13570831dd328a62154e9481ab10d2b5c1c24 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:13:56 +0800 Subject: [PATCH 014/176] Fix dropdown css bug. --- assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index 0ec5f65..e4c6661 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2341,7 +2341,7 @@ img { padding: 5px; - width: 100px; + min-width: 100px; color: #fff; background-color: #505c63; From 648b7ac31017e0ecd8502682afba1995a9e75e24 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:26:27 +0800 Subject: [PATCH 015/176] Add carousel logic with options. --- js/options.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/js/options.js b/js/options.js index 824d6e3..1f4e4bd 100644 --- a/js/options.js +++ b/js/options.js @@ -38,6 +38,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( index: 0 }, mobile_host: "", + carousel: "-1", }; function Storage() { @@ -70,6 +71,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( *********************************************/ function unsplashView() { + var items = [{name:"不自动播放", value: "-1" },{name:"每隔 5 分钟", value: "5" },{name:"每隔 10 分钟", value: "10" },{name:"每隔 30 分钟", value: "30" },{name:"每隔 1 小时", value: "60" }]; var tmpl = '
    \
    \
    ' + i18n.GetLang( "options_custom_unsplash_cbx" ) + '
    \ @@ -84,7 +86,12 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_mobile_lable" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \ -
    \ +
    \ +
    背景是否自动播放(显示下一张)?
    \ + ' + comps.Dropdown( ".options .content", "size-carousel", items, "-1" ) + '\ +
    \ +
    当自动播放时,不建议关闭标签页,并配合白噪音效果更好。
    \ +
    \ '; return tmpl; } @@ -113,6 +120,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( storage.db.mobile_host = event.target.value; storage.Set(); }); + $( ".options .size-carousel" )[0].addEventListener( "dropdown", function( event ) { + storage.db.carousel = event.data.value; + storage.Set(); + }); } /********************************************* From b71ad27dcc9ea0ef5cc151abd75bf5fc71393e4f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:37:37 +0800 Subject: [PATCH 016/176] Format source. --- js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/options.js b/js/options.js index 1f4e4bd..8e4df9c 100644 --- a/js/options.js +++ b/js/options.js @@ -88,7 +88,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \
    \
    背景是否自动播放(显示下一张)?
    \ - ' + comps.Dropdown( ".options .content", "size-carousel", items, "-1" ) + '\ + ' + comps.Dropdown( ".options .content", "size-carousel", items, storage.db.carousel ) + '\
    \
    当自动播放时,不建议关闭标签页,并配合白噪音效果更好。
    \ \ From 83dc6a5398c3cefbbc84fa2a9d2bc661c7119a1b Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:55:05 +0800 Subject: [PATCH 017/176] Fix dropdown event not off bug. --- js/options.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/options.js b/js/options.js index 8e4df9c..d3c9624 100644 --- a/js/options.js +++ b/js/options.js @@ -88,7 +88,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \
    \
    背景是否自动播放(显示下一张)?
    \ - ' + comps.Dropdown( ".options .content", "size-carousel", items, storage.db.carousel ) + '\ + ' + comps.Dropdown( ".options", "size-carousel", items, storage.db.carousel ) + '\
    \
    当自动播放时,不建议关闭标签页,并配合白噪音效果更好。
    \ \ @@ -123,6 +123,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( $( ".options .size-carousel" )[0].addEventListener( "dropdown", function( event ) { storage.db.carousel = event.data.value; storage.Set(); + new Notify().Render( "已设置成功,刷新后生效。" ); }); } @@ -287,6 +288,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( function close() { $( ".dialog .close" ).click( function( event ) { + $( document ).off( "click", ".options .size-carousel" ); + $( document ).off( "click", ".options .size-carousel .downlist .list-filed" ); $( ".dialog-bg" ).removeClass( "dialog-bg-show" ); setTimeout( function() { $( ".dialog-overlay" ).remove(); From 9b8ee16d7ee0dbd033d493896a3d614b3c276d26 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:56:30 +0800 Subject: [PATCH 018/176] Format source. --- js/options.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/options.js b/js/options.js index d3c9624..b292bfc 100644 --- a/js/options.js +++ b/js/options.js @@ -88,7 +88,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \
    \
    背景是否自动播放(显示下一张)?
    \ - ' + comps.Dropdown( ".options", "size-carousel", items, storage.db.carousel ) + '\ + ' + comps.Dropdown( ".options", "carousel-dpd", items, storage.db.carousel ) + '\
    \
    当自动播放时,不建议关闭标签页,并配合白噪音效果更好。
    \ \ @@ -120,7 +120,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( storage.db.mobile_host = event.target.value; storage.Set(); }); - $( ".options .size-carousel" )[0].addEventListener( "dropdown", function( event ) { + $( ".options .carousel-dpd" )[0].addEventListener( "dropdown", function( event ) { storage.db.carousel = event.data.value; storage.Set(); new Notify().Render( "已设置成功,刷新后生效。" ); @@ -288,8 +288,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( function close() { $( ".dialog .close" ).click( function( event ) { - $( document ).off( "click", ".options .size-carousel" ); - $( document ).off( "click", ".options .size-carousel .downlist .list-filed" ); + $( document ).off( "click", ".options .carousel-dpd" ); + $( document ).off( "click", ".options .carousel-dpd .downlist .list-filed" ); $( ".dialog-bg" ).removeClass( "dialog-bg-show" ); setTimeout( function() { $( ".dialog-overlay" ).remove(); From 2355ceddf0e41fb2270e661f5b504f9acbbe68c5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 11:57:01 +0800 Subject: [PATCH 019/176] Add carousel logic. --- js/controlbar.js | 8 ++++++++ js/main.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/js/controlbar.js b/js/controlbar.js index 0e34ca7..5b562e5 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -260,6 +260,14 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", setDislikeIcon(); setting.TogglePinState( vo.cur.pin != -1 ); }, + + AutoPlay: function() { + options.Storage.db.carousel != -1 && + setInterval(function() { + $(".controlbar").find("a[url=refresh]")[0].click(); + }, 1000 * 60 * parseInt( options.Storage.db.carousel )); + }, + SetBgPosition : setBackgroundPosition, SetFavorteIcon : setFavorteIcon, SetFavorteState : setFavorteState, diff --git a/js/main.js b/js/main.js index 7d107e7..8d7de11 100644 --- a/js/main.js +++ b/js/main.js @@ -71,6 +71,8 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " // get time date.Toggle( setting.Mode( "clockstate" )); + controlbar.AutoPlay(); + // listen controlbar.Listen( function( type, result ) { switch ( type) { From c04e9fecff328a032e9275e31e593e24410a3619 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 12:01:25 +0800 Subject: [PATCH 020/176] Add carousel notiy i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/options.js | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b9744d4..3477341 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -601,6 +601,10 @@ "message": "Host IP Address error, please re-input again." }, + "notify_carousel": { + "message": "Set successful, please refresh." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 8a85925..55e1a7c 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -601,6 +601,10 @@ "message": "输入的监听地址不清楚,请重新输入。" }, + "notify_carousel": { + "message": "已设置成功,刷新后生效。" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 74850c0..6b271b8 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -601,6 +601,10 @@ "message": "輸入的監聽地址不清楚,請重新輸入。" }, + "notify_carousel": { + "message": "已設置成功,刷新後生效。" + }, + "version_detail": { "message": "" }, diff --git a/js/options.js b/js/options.js index b292bfc..289a79a 100644 --- a/js/options.js +++ b/js/options.js @@ -123,7 +123,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( $( ".options .carousel-dpd" )[0].addEventListener( "dropdown", function( event ) { storage.db.carousel = event.data.value; storage.Set(); - new Notify().Render( "已设置成功,刷新后生效。" ); + new Notify().Render( i18n.GetLang( "notify_carousel" ) ); }); } From f0981a1daea497243555279f0da0e6b9ff79119b Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 12:39:15 +0800 Subject: [PATCH 021/176] Fix options css bug. --- assets/css/main.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/css/main.css b/assets/css/main.css index e4c6661..a3d16f0 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1145,6 +1145,8 @@ img { .options .switche { display: flex; flex-direction: row; + align-items: center; + justify-content: space-between; margin: 10px 0; } From ed1b01213541123b8cedad15d1e5afed30fb2624 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 12:40:03 +0800 Subject: [PATCH 022/176] Add carousel i18n. --- _locales/en/messages.json | 28 ++++++++++++++++++++++++++++ _locales/zh_CN/messages.json | 28 ++++++++++++++++++++++++++++ _locales/zh_TW/messages.json | 28 ++++++++++++++++++++++++++++ js/options.js | 6 +++--- 4 files changed, 87 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3477341..1f73614 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -369,6 +369,34 @@ "message": "First JSBox is required to be installed on iOS, for details Send to mobile" }, + "options_carousel_label": { + "message": "Usage play automatically show next background?" + }, + + "options_carousel_value_1": { + "message": "Nothing" + }, + + "options_carousel_value_5": { + "message": "Every five minutes" + }, + + "options_carousel_value_10": { + "message": "Every ten minutes" + }, + + "options_carousel_value_30": { + "message": "Every 30 minutes" + }, + + "options_carousel_value_60": { + "message": "Every 60 minutes" + }, + + "options_carousel_notice": { + "message": "When playing automatically, it is not recommended to close the TAB, and white noise effect is better." + }, + "options_custom_style": { "message": "Custom global Style" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 55e1a7c..1040edd 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -369,6 +369,34 @@ "message": "此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机端" }, + "options_carousel_label": { + "message": "背景是否自动播放(显示下一张)?" + }, + + "options_carousel_value_1": { + "message": "不自动播放" + }, + + "options_carousel_value_5": { + "message": "每隔 5 分钟" + }, + + "options_carousel_value_10": { + "message": "每隔 10 分钟" + }, + + "options_carousel_value_30": { + "message": "每隔 30 分钟" + }, + + "options_carousel_value_60": { + "message": "每隔 60 分钟" + }, + + "options_carousel_notice": { + "message": "当自动播放时,不建议关闭标签页,并配合 白噪音 效果更好。" + }, + "options_custom_style": { "message": "自定义样式( 全局 )" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 6b271b8..22299c1 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -369,6 +369,34 @@ "message": "此功能需要在 iOS 端安裝 JSBox,詳細說明請訪問 發送到手機端" }, + "options_carousel_label": { + "message": "背景是否自動播放(顯示下一張)?" + }, + + "options_carousel_value_1": { + "message": "不自動播放" + }, + + "options_carousel_value_5": { + "message": "每隔 5 分鐘" + }, + + "options_carousel_value_10": { + "message": "每隔 10 分鐘" + }, + + "options_carousel_value_30": { + "message": "每隔 30 分鐘" + }, + + "options_carousel_value_60": { + "message": "每隔 60 分鐘" + }, + + "options_carousel_notice": { + "message": "當自動播放時,不建議關閉標籤頁,並配合 白噪音 效果更好。" + }, + "options_custom_style": { "message": "自定義樣式( 全局 )" }, diff --git a/js/options.js b/js/options.js index 289a79a..3c217a3 100644 --- a/js/options.js +++ b/js/options.js @@ -71,7 +71,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( *********************************************/ function unsplashView() { - var items = [{name:"不自动播放", value: "-1" },{name:"每隔 5 分钟", value: "5" },{name:"每隔 10 分钟", value: "10" },{name:"每隔 30 分钟", value: "30" },{name:"每隔 1 小时", value: "60" }]; + var items = [{name: i18n.GetLang( "options_carousel_value_1" ), value: "-1" },{name: i18n.GetLang( "options_carousel_value_5" ), value: "5" },{name:i18n.GetLang( "options_carousel_value_10" ) , value: "10" },{name: i18n.GetLang( "options_carousel_value_30" ), value: "30" },{name:i18n.GetLang( "options_carousel_value_60" ), value: "60" }]; var tmpl = '
    \
    \
    ' + i18n.GetLang( "options_custom_unsplash_cbx" ) + '
    \ @@ -87,10 +87,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( \
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \
    \ -
    背景是否自动播放(显示下一张)?
    \ +
    ' + i18n.GetLang( "options_carousel_label" ) + '
    \ ' + comps.Dropdown( ".options", "carousel-dpd", items, storage.db.carousel ) + '\
    \ -
    当自动播放时,不建议关闭标签页,并配合白噪音效果更好。
    \ +
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \
    \ '; return tmpl; From a3e17e68ff0121374870fe90acbb94bb930f4c68 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 12:41:55 +0800 Subject: [PATCH 023/176] Fix dropdown css bug. --- assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index a3d16f0..6aa741c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2341,7 +2341,7 @@ img { display: flex; - padding: 5px; + padding: 5px 25px 5px 5px; min-width: 100px; From 1242295881369e5c977212c3ec94beef16fdcc57 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 12:42:33 +0800 Subject: [PATCH 024/176] Fix options css bug. --- assets/css/main.css | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index 6aa741c..9abfecb 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1152,7 +1152,6 @@ img { } .options .label { - width: 100%; color: rgb(213, 214, 215); } From ab7e92e67ec482002d5fd33e99fd7360ec0dd28a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 6 Dec 2018 13:26:45 +0800 Subject: [PATCH 025/176] Optimize options design. --- assets/css/main.css | 16 +++++++++------- js/options.js | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 9abfecb..0ec9e3e 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1138,7 +1138,7 @@ img { } .options .group { - margin: 10px 0 10px 10px; + margin: 10px 0 10px 25px; font-size: 14px; } @@ -1156,7 +1156,10 @@ img { } .options .notice { - font-style: italic; + margin: 5px 0; + + color: #ADADAD; + font-size: 11px; font-weight: 500; } @@ -1164,10 +1167,8 @@ img { .options .notice a { padding-bottom: 1px; - color: inherit; + color: #327ED6; text-decoration: none; - - border-bottom: 1px solid #fff; } .options .custom-unsplash textarea { @@ -2420,7 +2421,7 @@ img { font-size: 14px; - color: #fff; + color: #cccccc; background-color: rgb(63, 68, 71); caret-color: #fff; @@ -2436,7 +2437,7 @@ img { width: 100%; - color: #fff; + color: #cccccc; background-color: rgb(63, 68, 71); font-family: monospace; @@ -2450,6 +2451,7 @@ img { .md-input:focus, .md-textarea:focus { + color: #fff; outline: none !important; background-color: rgb(109, 112, 115); border-color: #fff; diff --git a/js/options.js b/js/options.js index 3c217a3..99d3691 100644 --- a/js/options.js +++ b/js/options.js @@ -82,15 +82,15 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_unsplash_notice" ) + '
    \
    ' + i18n.GetLang( "options_custom_unsplash_screen_label" ) + '
    \ \ -
    ' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '
    \ +
    ' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '
    \
    ' + i18n.GetLang( "options_custom_mobile_lable" ) + '
    \ \ -
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \ +
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \
    \
    ' + i18n.GetLang( "options_carousel_label" ) + '
    \ ' + comps.Dropdown( ".options", "carousel-dpd", items, storage.db.carousel ) + '\
    \ -
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \ +
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \
    \ '; return tmpl; From 344b8e0ba8143c9a84e9b6592ddacfbf6fa3380c Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 7 Dec 2018 13:55:14 +0800 Subject: [PATCH 026/176] Optimize options design. --- assets/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/main.css b/assets/css/main.css index 0ec9e3e..db958fd 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1169,6 +1169,7 @@ img { color: #327ED6; text-decoration: none; + transform: scale(.9) translateX(-43px); } .options .custom-unsplash textarea { From 3415d9f6c4c502eb1ccac0dd27a6d247751021d0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 7 Dec 2018 14:08:25 +0800 Subject: [PATCH 027/176] Optimize options design. --- assets/css/main.css | 13 +++++++++++-- js/options.js | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index db958fd..5083623 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1132,9 +1132,9 @@ img { .options .content .title { margin: 0.83em; padding-left: 10px; - color: rgb(171, 173, 175); + color: rgba(255, 255, 255, 0.9); font-size: 16px; - border-left: .25em solid rgb(171, 173, 175); + border-left: .25em solid rgba(255, 255, 255, 0.9); } .options .group { @@ -1142,6 +1142,15 @@ img { font-size: 14px; } +.options .division { + margin: 15px 0; + + width: 100%; + height: 1px; + + border-bottom: 1px solid rgba(255, 255, 255, 0.07); +} + .options .switche { display: flex; flex-direction: row; diff --git a/js/options.js b/js/options.js index 99d3691..41047be 100644 --- a/js/options.js +++ b/js/options.js @@ -77,20 +77,25 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_custom_unsplash_cbx" ) + '
    \ ' + comps.Switches( "custom-unsplash-cbx" ) + '\ \ +
    \
    ' + i18n.GetLang( "options_custom_unsplash_label" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_unsplash_notice" ) + '
    \ +
    \
    ' + i18n.GetLang( "options_custom_unsplash_screen_label" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_unsplash_screen_notice" ) + '
    \ +
    \
    ' + i18n.GetLang( "options_custom_mobile_lable" ) + '
    \ \
    ' + i18n.GetLang( "options_custom_mobile_notice" ) + '
    \ +
    \
    \
    ' + i18n.GetLang( "options_carousel_label" ) + '
    \ ' + comps.Dropdown( ".options", "carousel-dpd", items, storage.db.carousel ) + '\
    \
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \ +
    \ \ '; return tmpl; From b13967dda7773022598bba5285d26f2ce955b6ed Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 7 Dec 2018 15:51:49 +0800 Subject: [PATCH 028/176] Optimize options design. --- assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index 5083623..cb58a16 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1171,6 +1171,7 @@ img { font-size: 11px; font-weight: 500; + transform: scale(.9) translateX(-43px); } .options .notice a { @@ -1178,7 +1179,6 @@ img { color: #327ED6; text-decoration: none; - transform: scale(.9) translateX(-43px); } .options .custom-unsplash textarea { From 5dd5be2677ea96711831a75caa01d12d3757426d Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 7 Dec 2018 16:25:06 +0800 Subject: [PATCH 029/176] Add explore UI. --- assets/css/main.css | 3 ++- js/manage.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index cb58a16..020d5af 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -830,7 +830,8 @@ img { border-bottom-left-radius: 3px; } -.manage .tab:nth-child(2) { +.manage .tab:nth-child(3) { + border-left: none; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } diff --git a/js/manage.js b/js/manage.js index c8276d5..3c5e83c 100644 --- a/js/manage.js +++ b/js/manage.js @@ -11,10 +11,12 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", "
    \
    ' + i18n.GetLang( "manage_tab_fav" ) + '
    \
    ' + i18n.GetLang( "manage_tab_sub" ) + '
    \ +
    探索
    \
    \
    \
    Loading...
    \ \ +
    Loading...
    \
    ', favTmpl = '\
    \ @@ -234,6 +236,11 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " $( ".manage .albums" ).scroll( function() { checkImg(); }) + $(".albums").on("scroll", function() { + if( $(this).scrollTop() + Math.floor( $(this).innerHeight() ) >= $(this)[0].scrollHeight - 1 ) { + console.log('end reached'); + } + }); } function observerImg( ioes ) { From 48f4bd25e3f3f639797f21f2697c00d0132a6bc4 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 10:26:16 +0800 Subject: [PATCH 030/176] Fix options storage carousel undefined bug. --- js/controlbar.js | 2 +- js/options.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 5b562e5..6b941b3 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -262,7 +262,7 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", }, AutoPlay: function() { - options.Storage.db.carousel != -1 && + options.Storage.db.carousel && options.Storage.db.carousel != -1 && setInterval(function() { $(".controlbar").find("a[url=refresh]")[0].click(); }, 1000 * 60 * parseInt( options.Storage.db.carousel )); diff --git a/js/options.js b/js/options.js index 41047be..e3061db 100644 --- a/js/options.js +++ b/js/options.js @@ -92,7 +92,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    \
    \
    ' + i18n.GetLang( "options_carousel_label" ) + '
    \ - ' + comps.Dropdown( ".options", "carousel-dpd", items, storage.db.carousel ) + '\ + ' + comps.Dropdown( ".options", "carousel-dpd", items, !storage.db.carousel ? "-1" : storage.db.carousel ) + '\
    \
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \
    \ From ec84bd7749c73743ef10e0d10e2b2f804fe13f44 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 15:26:05 +0800 Subject: [PATCH 031/176] Add explore UI and logic. --- js/manage.js | 69 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/js/manage.js b/js/manage.js index 3c5e83c..6bf6d32 100644 --- a/js/manage.js +++ b/js/manage.js @@ -1,5 +1,5 @@ -define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", "message", "unveil" ], function( $, _, Notify, i18n, vo, date, SimpError, files, message, unveil ) { +define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", "message", "unveil" ], function( $, _, Notify, i18n, vo, date, options, files, message, unveil ) { "use strict"; @@ -38,6 +38,20 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", "
    \ \ ', + exploreTmpl = '\ +
    \ + >\ + \ +
    ', imgTmpl = '\
    \ >\ @@ -80,14 +94,23 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " $( "body" ).on( "click", ".manage .toolbox span", function( event ) { var url = $( event.target ).parent().parent().prev().attr( "src" ), new_vo = $( event.target ).attr( "data-vo" ), - name = url.replace( vo.constructor.FAVORITE, "" ).replace( ".jpg", "" ); + type = $( event.target ).attr( "type" ), + name = url && url.replace( vo.constructor.FAVORITE, "" ).replace( ".jpg", "" ); switch( event.target.className ) { case "useicon": new_vo && ( new_vo = JSON.parse( decodeURI( new_vo )) ); + if ( type == "explore" ) { + url = new_vo.url; + name = new_vo.name; + } setBackground( url, name, new_vo ); break; case "downicon": var title = "SimpTab-Favorite-" + url.replace( vo.constructor.FAVORITE, "" ); + if ( type == "explore" ) { + url = $( event.target ).attr( "url" ); + title = "simptab-wallpaper-" + date.Now() + ".png"; + } files.Download( url, title ); break; case "removeicon": @@ -120,7 +143,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " // when new_vo is undefined is favorite call new_vo == undefined && ( new_vo = files.FindFavorite( files.FavoriteVO(), name )); if ( new_vo ) { - type == "subscribe" && new Notify().Render( i18n.GetLang( "notify_mange_setting" ) ); + if ( type == "subscribe" ) { var notify = new Notify().Render({ content: i18n.GetLang( "notify_mange_setting" ), state: "loading" } ); } // save url to background.jpg files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); @@ -136,6 +159,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " // add url to custom event message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url }); // complete notify + notify && notify.complete(); new Notify().Render( i18n.GetLang( "notify_mange_setting_success" ) ); }); }); @@ -206,6 +230,42 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " }); } + function getExploreTmpl() { + var COUNT = 10, + items = [], + CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", + screen = /\d+x\d+/.test( options.Storage.db.unsplash_screen ) ? options.Storage.db.unsplash_screen : "2560x1440", + random = function( min, max ) { + return Math.floor( Math.random() * ( max - min + 1 ) + min ); + }, + collection = options.Storage.db.unsplash[ random( 0, options.Storage.db.unsplash.length - 1 ) ]; + $.ajax({ + type : "GET", + url : "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&per_page=10", + dataType : "json" + }).then( function( result ) { + if ( result && result.length >= COUNT ) { + for( var i = 0; i < COUNT; i++ ) { + var item = result[i]; + items.push({ + thumb: item.urls.thumb, + url: "https://source.unsplash.com/" + item.id + "/" + screen, + name: item.user.name, + contact: item.user.links.html, + link: item.links.html, + down: item.urls.full, + }); + } + var compiled = _.template( '<% jq.each( albums, function( idx, album ) { %>' + exploreTmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), + html = compiled({ 'albums': items }); + $( ".manage .albums .explore .empty" ).remove(); + $( ".manage .albums .explore" ).append( html ); + } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }, function( jqXHR, textStatus, errorThrown ) { + $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }); + } + function albumLoadListenEvent() { var observer = new MutationObserver( function() { albumLoad++; @@ -238,7 +298,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " }) $(".albums").on("scroll", function() { if( $(this).scrollTop() + Math.floor( $(this).innerHeight() ) >= $(this)[0].scrollHeight - 1 ) { - console.log('end reached'); + $( ".tabs .tab-active").attr("idx") == "2" && getExploreTmpl(); } }); } @@ -263,6 +323,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "error", "files", " albumLoadListenEvent(); getFavoriteTmpl(); getSubscribeTmpl(); + getExploreTmpl(); toolbarListenEvent(); scrollListenEvent(); }, 10 ); From f91e276794b0feba9a390164fd0b83f029334934 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 15:29:30 +0800 Subject: [PATCH 032/176] Optimize download name. --- js/manage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/manage.js b/js/manage.js index 6bf6d32..767be1c 100644 --- a/js/manage.js +++ b/js/manage.js @@ -106,12 +106,10 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", setBackground( url, name, new_vo ); break; case "downicon": - var title = "SimpTab-Favorite-" + url.replace( vo.constructor.FAVORITE, "" ); if ( type == "explore" ) { - url = $( event.target ).attr( "url" ); - title = "simptab-wallpaper-" + date.Now() + ".png"; + url = $( event.target ).attr( "url" ); } - files.Download( url, title ); + files.Download( url, "simptab-wallpaper-" + date.Now() + ".png" ); break; case "removeicon": files.Delete( name, function( result ) { From 31f1459cc574457d788d5f50c7bb351e26ebfb16 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 16:42:25 +0800 Subject: [PATCH 033/176] Format source. --- js/manage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/manage.js b/js/manage.js index 767be1c..1480b50 100644 --- a/js/manage.js +++ b/js/manage.js @@ -236,10 +236,11 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", random = function( min, max ) { return Math.floor( Math.random() * ( max - min + 1 ) + min ); }, - collection = options.Storage.db.unsplash[ random( 0, options.Storage.db.unsplash.length - 1 ) ]; + collection = options.Storage.db.unsplash[ random( 0, options.Storage.db.unsplash.length - 1 ) ], + url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&per_page=10"; $.ajax({ type : "GET", - url : "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&per_page=10", + url : url, dataType : "json" }).then( function( result ) { if ( result && result.length >= COUNT ) { From 5eecb8c0354af04846df191ac44a7833546a695c Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 16:49:13 +0800 Subject: [PATCH 034/176] Optimize explore not image logic. --- js/manage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/manage.js b/js/manage.js index 1480b50..a7a1e7f 100644 --- a/js/manage.js +++ b/js/manage.js @@ -229,6 +229,10 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", } function getExploreTmpl() { + if ( !options.Storage.db.unsplash || ( options.Storage.db.unsplash.length == 1 && options.Storage.db.unsplash[0] == "" )) { + $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + return; + } var COUNT = 10, items = [], CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", From 6c8d9ba0cf4516723bcb27f87e548145e3d50c96 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 18:23:14 +0800 Subject: [PATCH 035/176] Format source. --- js/manage.js | 55 +++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/js/manage.js b/js/manage.js index a7a1e7f..a32f7cf 100644 --- a/js/manage.js +++ b/js/manage.js @@ -241,32 +241,35 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", return Math.floor( Math.random() * ( max - min + 1 ) + min ); }, collection = options.Storage.db.unsplash[ random( 0, options.Storage.db.unsplash.length - 1 ) ], - url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&per_page=10"; - $.ajax({ - type : "GET", - url : url, - dataType : "json" - }).then( function( result ) { - if ( result && result.length >= COUNT ) { - for( var i = 0; i < COUNT; i++ ) { - var item = result[i]; - items.push({ - thumb: item.urls.thumb, - url: "https://source.unsplash.com/" + item.id + "/" + screen, - name: item.user.name, - contact: item.user.links.html, - link: item.links.html, - down: item.urls.full, - }); - } - var compiled = _.template( '<% jq.each( albums, function( idx, album ) { %>' + exploreTmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), - html = compiled({ 'albums': items }); - $( ".manage .albums .explore .empty" ).remove(); - $( ".manage .albums .explore" ).append( html ); - } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); - }, function( jqXHR, textStatus, errorThrown ) { - $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); - }); + getPhotos = function( page ) { + var url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&page=" + page; + $.ajax({ + type : "GET", + url : url, + dataType : "json" + }).then( function( result ) { + if ( result && result.length >= COUNT ) { + for( var i = 0; i < COUNT; i++ ) { + var item = result[i]; + items.push({ + thumb: item.urls.thumb, + url: "https://source.unsplash.com/" + item.id + "/" + screen, + name: item.user.name, + contact: item.user.links.html, + link: item.links.html, + down: item.urls.full, + }); + } + var compiled = _.template( '<% jq.each( albums, function( idx, album ) { %>' + exploreTmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), + html = compiled({ 'albums': items }); + $( ".manage .albums .explore .empty" ).remove(); + $( ".manage .albums .explore" ).append( html ); + } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }, function( jqXHR, textStatus, errorThrown ) { + $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }); + }; + getPhotos( 1 ); } function albumLoadListenEvent() { From 9e927ce8aa1f464d04ce72a2bdaaceea2ec3656e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 8 Dec 2018 19:00:36 +0800 Subject: [PATCH 036/176] Optimize get unsplash collections api logic. --- js/manage.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/js/manage.js b/js/manage.js index a32f7cf..03b8f20 100644 --- a/js/manage.js +++ b/js/manage.js @@ -241,13 +241,29 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", return Math.floor( Math.random() * ( max - min + 1 ) + min ); }, collection = options.Storage.db.unsplash[ random( 0, options.Storage.db.unsplash.length - 1 ) ], + getCollection = function() { + $.ajax({ + type : "GET", + url : "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "?client_id=" + CLIENT, + dataType : "json" + }).then( function( result ) { + console.log( result ) + if ( result && result.total_photos > 0 ) { + var page = random( 1, Math.ceil( result.total_photos / COUNT )); + console.log( page ) + getPhotos( page ); + } + }, function( jqXHR, textStatus, errorThrown ) { + $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }); + }, getPhotos = function( page ) { var url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&page=" + page; $.ajax({ type : "GET", url : url, dataType : "json" - }).then( function( result ) { + }).done( function( result ) { if ( result && result.length >= COUNT ) { for( var i = 0; i < COUNT; i++ ) { var item = result[i]; @@ -265,11 +281,12 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .albums .explore .empty" ).remove(); $( ".manage .albums .explore" ).append( html ); } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); - }, function( jqXHR, textStatus, errorThrown ) { - $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + }).fail( function( jqXHR, textStatus, errorThrown ) { + getCollection(); }); }; - getPhotos( 1 ); + //getPhotos( 1 ); + getCollection(); } function albumLoadListenEvent() { From 8a9e1607616605f0c7ec94a080d717f0fdce80e9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 11:00:59 +0800 Subject: [PATCH 037/176] Change get collections max count. --- js/manage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/manage.js b/js/manage.js index 03b8f20..c1bef37 100644 --- a/js/manage.js +++ b/js/manage.js @@ -233,7 +233,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); return; } - var COUNT = 10, + var COUNT = 12, items = [], CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", screen = /\d+x\d+/.test( options.Storage.db.unsplash_screen ) ? options.Storage.db.unsplash_screen : "2560x1440", @@ -258,7 +258,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", }); }, getPhotos = function( page ) { - var url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&page=" + page; + var url = "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "/photos?client_id=" + CLIENT + "&page=" + page + "&per_page=" + COUNT; $.ajax({ type : "GET", url : url, From 99ac3eb8a9209c6909d7001bb830f0ca23a0bce8 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 11:01:54 +0800 Subject: [PATCH 038/176] Format source. --- js/manage.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/js/manage.js b/js/manage.js index c1bef37..8476100 100644 --- a/js/manage.js +++ b/js/manage.js @@ -247,10 +247,8 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", url : "https://api.unsplash.com/" + collection.replace( "collection", "collections" ) + "?client_id=" + CLIENT, dataType : "json" }).then( function( result ) { - console.log( result ) if ( result && result.total_photos > 0 ) { var page = random( 1, Math.ceil( result.total_photos / COUNT )); - console.log( page ) getPhotos( page ); } }, function( jqXHR, textStatus, errorThrown ) { @@ -285,7 +283,6 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", getCollection(); }); }; - //getPhotos( 1 ); getCollection(); } From 56ecc15a66f4342e6def73436fe6f50929a03e24 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 11:07:30 +0800 Subject: [PATCH 039/176] Optimize explore init load logic. --- js/manage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/manage.js b/js/manage.js index 8476100..6810dff 100644 --- a/js/manage.js +++ b/js/manage.js @@ -87,6 +87,8 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album" ).removeClass( "album-active" ); $( $( ".manage .album" )[idx] ).addClass( "album-active" ); + + $( ".tabs .tab-active").attr("idx") == "2" && $( ".albums .explore").find(".photograph").length == 12 && getExploreTmpl(); }); } From 1a2267464648baa41c7ea628569c00934cd7e248 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 11:24:31 +0800 Subject: [PATCH 040/176] Optimize favorite/subscribe/explore info url logic. --- js/controlbar.js | 4 ++-- js/main.js | 2 +- js/manage.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index 6b941b3..f1dfb3b 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -66,14 +66,14 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", }); } - function update( url ) { + function update( url, info ) { // change background $( "body" ).css( "background-image", 'url("' + url + '")' ); // change background mask $( "head" ).find( ".bgmask-filter" ).html( '' ); $( "body" ).find( ".bgmask-bg > img" ).attr( "src", url ); // change conntrolbar download url and info - $($( ".controlbar" ).find( "a" )[4]).attr( "href", url ); + $($( ".controlbar" ).find( "a" )[4]).attr( "href", info == undefined ? "#" : info ); $( ".controlbar" ).find( "a[url=info]" ).prev().text( vo.cur.type ); // change favorite setFavorteIcon(); diff --git a/js/main.js b/js/main.js index 8d7de11..4f93ddf 100644 --- a/js/main.js +++ b/js/main.js @@ -117,7 +117,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " // global event handler message.Subscribe( message.TYPE.UPDATE_CONTROLBAR, function( event ) { - controlbar.Update( event.data.url ); + controlbar.Update( event.data.url, event.data.info ); }); chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) { diff --git a/js/manage.js b/js/manage.js index 6810dff..3d4bbd6 100644 --- a/js/manage.js +++ b/js/manage.js @@ -157,7 +157,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", vo.Set( vo.cur ); console.log( "======= Current background download success.", vo ) // add url to custom event - message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url }); + message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: vo.cur.info }); // complete notify notify && notify.complete(); new Notify().Render( i18n.GetLang( "notify_mange_setting_success" ) ); @@ -272,7 +272,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", url: "https://source.unsplash.com/" + item.id + "/" + screen, name: item.user.name, contact: item.user.links.html, - link: item.links.html, + info: item.links.html, down: item.urls.full, }); } From 108693915b86d5e12905883ccc8ddb3d5fbff5ba Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 12:26:12 +0800 Subject: [PATCH 041/176] Add first load explore notify logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/manage.js | 8 +++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1f73614..bf004d6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -609,6 +609,10 @@ "message": "Welcome to zen mode. Use shortcut c or mouse to move the lower right corner to pop up the options." }, + "notify_explore_tips": { + "message": "Scroll down to load more, background loading depending on your network speed." + }, + "notify_zen_mode_tips_confirm": { "message": "Confirm" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 1040edd..2e63cad 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -609,6 +609,10 @@ "message": "欢迎来到 禅模式,使用快捷键 c 或者鼠标移动右下角弹出选项卡。" }, + "notify_explore_tips": { + "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 22299c1..5898682 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -609,6 +609,10 @@ "message": "歡迎來到 禪模式,使用快捷鍵 c 或者滑鼠移動右下角彈出選項卡。" }, + "notify_explore_tips": { + "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/js/manage.js b/js/manage.js index 3d4bbd6..ee2d2e0 100644 --- a/js/manage.js +++ b/js/manage.js @@ -88,7 +88,13 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album" ).removeClass( "album-active" ); $( $( ".manage .album" )[idx] ).addClass( "album-active" ); - $( ".tabs .tab-active").attr("idx") == "2" && $( ".albums .explore").find(".photograph").length == 12 && getExploreTmpl(); + if ( $( ".tabs .tab-active").attr("idx") == "2" ) { + $( ".albums .explore").find(".photograph").length == 12 && getExploreTmpl(); + localStorage["simptab-explore-notify"] != "false" && + new Notify().Render({ content: i18n.GetLang( "notify_explore_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + localStorage["simptab-explore-notify"] = false; + }}); + } }); } From 1c38bd0f239d0b0be170962a2cb9331a2e364afe Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 12:57:06 +0800 Subject: [PATCH 042/176] Add explore i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/manage.js | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bf004d6..37cf87d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -241,6 +241,10 @@ "message": "Collections" }, + "manage_tab_explore": { + "message": "Explore" + }, + "manage_toolbar_use": { "message": "Set current Background" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 2e63cad..92ac88d 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -241,6 +241,10 @@ "message": "精选集" }, + "manage_tab_explore": { + "message": "探索" + }, + "manage_toolbar_use": { "message": "使用当前背景" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 5898682..6978726 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -241,6 +241,10 @@ "message": "精選集" }, + "manage_tab_explore": { + "message": "探索" + }, + "manage_toolbar_use": { "message": "使用當前背景" }, diff --git a/js/manage.js b/js/manage.js index ee2d2e0..64934e4 100644 --- a/js/manage.js +++ b/js/manage.js @@ -11,7 +11,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files",
    \
    ' + i18n.GetLang( "manage_tab_fav" ) + '
    \
    ' + i18n.GetLang( "manage_tab_sub" ) + '
    \ -
    探索
    \ +
    ' + i18n.GetLang( "manage_tab_explore" ) + '
    \
    \
    \
    Loading...
    \ From 395b9d68f4f3934a399b007b2b42c7c3bfaef8f6 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 9 Dec 2018 14:01:16 +0800 Subject: [PATCH 043/176] Add noise framework. --- assets/css/main.css | 35 +++++++++++++++++++++++++++++++++ js/main.js | 5 ++++- js/message.js | 3 ++- js/noise.js | 48 +++++++++++++++++++++++++++++++++++++++++++++ js/shortcuts.js | 9 ++++++++- 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 js/noise.js diff --git a/assets/css/main.css b/assets/css/main.css index 020d5af..70dc7e8 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2033,6 +2033,41 @@ img { height: 60px; } +/* +* wihite noise mode +*/ +.noise-mode { + position: fixed; + + display: flex; + flex-direction: column; + + right: 10px; + bottom: 10px; + + width: 400px; + height: 200px; + + padding: 15px; + + text-transform: initial; + + color: #fff; + background-color: rgb(47, 52, 55); + + border-radius: 4px; + + opacity: 0; + transform: translateY(100px); + transition: all .6s ease; + + box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.4) 0px 9px 24px; + + overflow-x: hidden; + overflow-y: auto; +} + + /* * media */ diff --git a/js/main.js b/js/main.js index 4f93ddf..b8403a6 100644 --- a/js/main.js +++ b/js/main.js @@ -33,6 +33,7 @@ requirejs.config({ "welcome" : "js/welcome", "zen" : "js/zen", "options" : "js/options", + "noise" : "js/noise", "comps" : "js/components", "message" : "js/message", }, @@ -47,7 +48,7 @@ requirejs.config({ }); // main -requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options ) { +requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options", "noise" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options, noise ) { progress.Init(); @@ -127,4 +128,6 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " localStorage["simptab-zenmode"] == "true" && zen.Render(); + noise.Init(); + }); diff --git a/js/message.js b/js/message.js index c816a67..bb8ad3d 100644 --- a/js/message.js +++ b/js/message.js @@ -16,7 +16,8 @@ define([ "jquery" ], function( $ ) { "UPDATE_CONTROLBAR": "UPDATE_CONTROLBAR", "OPEN_BOOKMARKS" : "OPEN_BOOKMARKS", "OPEN_QUICKBAR" : "OPEN_QUICKBAR", - "OPEN_ZENMODE" : "OPEN_ZENMODE", + "OPEN_ZENMODE" : "OPEN_ZENMODE", + "OPEN_NOISE" : "OPEN_NOISE", }, Subscribe: subscribe, Publish : publish diff --git a/js/noise.js b/js/noise.js new file mode 100644 index 0000000..061f8a7 --- /dev/null +++ b/js/noise.js @@ -0,0 +1,48 @@ + +define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ], function( $, Mousetrap, _, Notify, i18n, comps, message ) { + + "use strict"; + + function sound() { + var cafe = new Audio( "http://st.ksria.cn/noise/cafe001.mp3" ); + var jazz = new Audio( "http://st.ksria.cn/noise/jazz001.mp3" ); + var rain = new Audio( "http://st.ksria.cn/noise/rain001.mp3" ); + cafe.play(); + cafe.loop = true; + jazz.play(); + jazz.loop = true; + jazz.volume = 0.5; + rain.play(); + rain.volume = 0.5; + rain.loop = true; + } + + function render() { + var tmpl = '\ +
    \ + White Noise\ +
    '; + $( "body" ).append( tmpl ); + } + + function open() { + setTimeout( function(){ + $( ".noise-mode" ).css({ "transform": "translateY(0px)", "opacity": 1 }); + sound(); + }, 10 ); + } + + function close() { + // TO-DO + } + + return { + Init: function() { + message.Subscribe( message.TYPE.OPEN_NOISE, function( event ) { + render(); + open(); + }); + } + } + +}); \ No newline at end of file diff --git a/js/shortcuts.js b/js/shortcuts.js index 11757ae..50a35b4 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -44,7 +44,8 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f { short: "b", long: "bookmarks"}, { short: "q", long: "quickbar" }, { short: "z", long: "topsites" }, - { short: "c", long: "zenmode" }, + { short: "c", long: "zenmode" }, + { short: "w", long: "noise" }, ]; Object.defineProperties( Keys.prototype, { @@ -124,6 +125,9 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f case "c": message.Publish( message.TYPE.OPEN_ZENMODE ); break; + case "w": + message.Publish( message.TYPE.OPEN_NOISE ); + break; } }); } @@ -248,6 +252,9 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f case "setting-zen-mode": $( ".setting-zen-mode" ).find( ".footer .close" )[0].click(); break; + case "noise-mode": + //$( ".noise-mode" ).find( ".close" )[0].click(); + break; } }); } From 3bf0df8eecc7a1805a5b78ecd7ac9ed6e4828be0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 14 Dec 2018 14:33:46 +0800 Subject: [PATCH 044/176] Add play/pause UI. --- assets/css/main.css | 46 +++++++++++++++++++++++++++++++++++++++- assets/images/pause.png | Bin 0 -> 1150 bytes assets/images/play.png | Bin 0 -> 1516 bytes js/noise.js | 23 ++++++++++++++++++-- 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 assets/images/pause.png create mode 100644 assets/images/play.png diff --git a/assets/css/main.css b/assets/css/main.css index 70dc7e8..1e61fc4 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2041,12 +2041,14 @@ img { display: flex; flex-direction: column; + justify-content: center; + align-items: center; right: 10px; bottom: 10px; width: 400px; - height: 200px; + height: 150px; padding: 15px; @@ -2067,6 +2069,48 @@ img { overflow-y: auto; } +.noise-mode .action { + display: block; + + width: 70px; + height: 70px; + + background-position: center; + background-repeat: no-repeat; + + opacity: .7; +} + +.noise-mode .action.play { + background-image: url("../images/play.png"); +} + +.noise-mode .action.pause { + background-image: url("../images/pause.png"); +} + +.noise-mode .scene { + position: absolute; + bottom: 0; + + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + color: rgb(213, 214, 215, .7); + font-size: 11px; +} + +.noise-mode .scene .mode { + margin: 5px 10px; + cursor: not-allowed; +} + +.noise-mode .scene .mode.active { + color: rgb(213, 214, 215); + cursor: pointer; +} /* * media diff --git a/assets/images/pause.png b/assets/images/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..588998e9ca5a3ce58bad3d37e8d237528385dd71 GIT binary patch literal 1150 zcmV-^1cCdBP)8pfy{Nh&(5v$KexG^_qyTnfa>C z4(faF&4NVaArZYKq8H%Z{ zV<51kYDm?9HUeh=RSl^M(8l02K{5jh%lJjLQ!m@`(7FvU0SZg`Pa?vxVT%oc`@pgV zumXbRU?aHYcFD|#+6kxuZ8YwrIH-fR3eY`pttlwAt7!pY`~FsImK%}7aRi6yY%2n~ zht@LyQCX1&5Ga2rkyd_xnvhF9-zu+E<4&w-MH)cAyq0xlj*cfH5}TP--byE=a}RR; zvVcScnLwP1tyw2*m2XfKmx-uU(;rqLDI)0fsA1rLx>_e}m9NzEhMAKE zrKN;f&nV`odne7T7GagIw4h|NEW1%02J>_?>x8ZH6@aqtr3K`<+^23by?$?Hl*}X! z57OL=VGE96{lGf<%H?lSbXqEfDFOj`E+BS@~-(ygYU=%3v&r}|d`3Xt5>A&N=Xil~b=n_|$kbEqFe z;9je{!L5#S^*<%z)fO~b+1479s$!0-1&ttKbwibw>s@~7ubcTEZ%H3nRx9@y6nmhE z;7Ee9nWbC~R)hCfqopi0z?)qx5|@yjgMxV5d7lk0^#V>bby};4JD`!<0Te9Ct;R7i z$yvY*W6cI=0t#CKe7p|3H^EBJy)9;zAgwjukis4Q^8!{sEieGV4j4Olyscx}4Qus_ z$<1y-CFQ~kdV|JCMbNO~|Je6&-+gyF_wMt&E;#VGXP>p#@9e$TS$pmEL`f16n**bO z1JkuT;NL2jd;SIZHC|)&njB zW&)dZ`_>CS{|7Jwm?O!fUq}iAN5me$Bfz1BddlDUHDJ7?uZyTI1RN1wqfY{x7U`tK zwrhY>C3%gvC2a#o#O1)vfTwdW$-lrfNpspUswHqlY>=GAx$P)ii)|hNrbzmynGH>W zBf|He0#06wAVs=fAgSrVv;w}--@hU~_CVX&lBPGZqakoaTmanL0|1?vFiDc9_#mkZ z91)Ix-vqpV*G2I<9xdskTH^-+N5sa!r@(IOB59S)E4_J<^j9@UJ>WZli!#9eo&uD; zfMYZ0>qNzEk{l8C%K+er*a!Hm6U}v=xn0tw{yie>_-+`2c)QjNho1XM@{H}1THq%f zxnu&qRnip|T@i5-un6#y8A^FvlDDh_fisV;l@9<;BRv{;4%l`Gi3f~w{|HBfW8_mZ z8ZrntLGJ)80Y+x*tCgxnlFsa((h;#G@KfeBRu?!ydrRr%b3!XiGu`(n50|vMZ-gUa zDljjT@`{>>dal&RX0`A-4)>HfianTZ3Ew@3yTm$=!mhpM$2slC8nO+ZElNoxM zfxQhpB(vheYq(zj5pg!~P)3LPhJn8T_UuLAG}=c1PXk+IuyLhasqD!_&}}O;AEA7KL@-?&n;PiBf^96EO2lJ1N)|QFFUP$ zffoQD+U1ZH1}-Cx?%GR7#EB_kkn^x^NzVly$um2z>|@xLCnE)ieV&1*0CyF9u$|_G z*KkB^loEeuw9`QcZ6+J|AmHr|9&YtWA>fFxC-&wchjVIV+b9EjTj=d!w=Tcq&r(F# zIXUgKW2?8=#r?mXK&&JHmZ$oRF7yq0w5<^?$vM^IST1Qy1$Yv0UryS3S<5;R)K$Rj z5}Z>#lnIjNSAd5Bt1|}aO+QP?Io%Ho)tR%W^OlmX7C^t&e4ux~7#aJw< z&+}IU9|gQrCU8pjJ8~-1In_frQqrpffYS%x#vGpsy7s8Wk<-GG6Ls}WUnIIZ$Zj{~(b?{G=4*EVWa)Z%)^>so2;(fczbxej!Y zv?^P2e)yaog=%Ehd`b2jb)^-sHx`bwk6uThUj~kmh*%$(KZLPw(HHBbcYd>xtte~@xY9TxoOZdos5K?GpDD=>wk;_HoTj)7 zOeEv2FL1x1o<-CQACbsM?NztERZiBwTRjqmZGH zw}5LU`ODFfbOl@m?s6xu?XnVZJ}j6e>6wlws~*Y%Tm`;&^5o-zUAr{yOJD);uq6MT zMX~}{TNDwy08Rn>ayhcsy^lQouXvlKwk|;RzvKDxp`K3&-|;2sn=FJiO8y5=MCsvf SZPES!0000 Date: Fri, 14 Dec 2018 14:42:04 +0800 Subject: [PATCH 045/176] Add close logic. --- assets/css/main.css | 17 +++++++++++++++++ js/noise.js | 9 ++++++++- js/shortcuts.js | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 1e61fc4..0616285 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2069,6 +2069,23 @@ img { overflow-y: auto; } +.noise-mode .close { + position: absolute; + top: 5px; + right: 5px; + + display: block; + + width: 14px; + height: 14px; + + background-position: center; + background-repeat: no-repeat; + background-image: url("../images/remove.png"); + + cursor: pointer; +} + .noise-mode .action { display: block; diff --git a/js/noise.js b/js/noise.js index 25243eb..b2bab8f 100644 --- a/js/noise.js +++ b/js/noise.js @@ -20,6 +20,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] function render() { var tmpl = '\
    \ + \
    \
    \
    \ @@ -52,7 +53,12 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] } function close() { - // TO-DO + $( ".noise-mode .close" ).click( function( event ) { + $( ".noise-mode" ).css({ "transform": "translateY(100px)", "opacity": 0 }); + setTimeout( function(){ + $( ".noise-mode" ).remove(); + }, 500 ); + }); } return { @@ -60,6 +66,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] message.Subscribe( message.TYPE.OPEN_NOISE, function( event ) { render(); open(); + close(); }); } } diff --git a/js/shortcuts.js b/js/shortcuts.js index 50a35b4..c9b0c07 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -253,7 +253,7 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f $( ".setting-zen-mode" ).find( ".footer .close" )[0].click(); break; case "noise-mode": - //$( ".noise-mode" ).find( ".close" )[0].click(); + $( ".noise-mode" ).find( ".close" )[0].click(); break; } }); From 1ebcf0e860c20cd578d9cbb7d0ca6cd10f637032 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 14 Dec 2018 14:44:34 +0800 Subject: [PATCH 046/176] Optimize css. --- assets/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/main.css b/assets/css/main.css index 0616285..9af3f42 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2067,6 +2067,7 @@ img { overflow-x: hidden; overflow-y: auto; + z-index: 200; } .noise-mode .close { From 49dbfd60435da5b4142bec16aad3c4aec6e1da36 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 14 Dec 2018 14:49:34 +0800 Subject: [PATCH 047/176] Optimize double open logic. --- js/noise.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/noise.js b/js/noise.js index b2bab8f..a5eb0c3 100644 --- a/js/noise.js +++ b/js/noise.js @@ -64,9 +64,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] return { Init: function() { message.Subscribe( message.TYPE.OPEN_NOISE, function( event ) { - render(); - open(); - close(); + if ( $( "body" ).find( ".noise-mode" ).length > 0 ) { + $( ".noise-mode .close" )[0].click(); + } else { + render(); + open(); + close(); + } }); } } From 03416ddbebcca05c48a7454ac9eac0b1b0aaa99e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 14 Dec 2018 14:52:44 +0800 Subject: [PATCH 048/176] Add noise shortcuts i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 37cf87d..d9acbe8 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -313,6 +313,10 @@ "message": "Open zen mode setting" }, + "shortcuts_key_noise": { + "message": "Open White noise" + }, + "about_content_more": { "message": "More about..." }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 92ac88d..41a1ed5 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -313,6 +313,10 @@ "message": "打开禅模式的选项页" }, + "shortcuts_key_noise": { + "message": "开启白噪音模式" + }, + "about_content_more": { "message": "查看更多..." }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 6978726..654514d 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -313,6 +313,10 @@ "message": "打開禪模式的選項頁" }, + "shortcuts_key_noise": { + "message": "開啟白噪音模式" + }, + "about_content_more": { "message": "查看更多..." }, From 8db42d35ee77696c04a2bd2f20c9714668374330 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 14 Dec 2018 19:09:56 +0800 Subject: [PATCH 049/176] Add play/pause logic. --- js/noise.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/js/noise.js b/js/noise.js index a5eb0c3..802c4c1 100644 --- a/js/noise.js +++ b/js/noise.js @@ -3,6 +3,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "use strict"; + var noise = { + "cafe001": "http://st.ksria.cn/noise/cafe001.mp3", + "jazz001": "http://st.ksria.cn/noise/jazz001.mp3", + "rain001": "http://st.ksria.cn/noise/rain001.mp3", + }, sounds = {}; + + /* function sound() { var cafe = new Audio( "http://st.ksria.cn/noise/cafe001.mp3" ); var jazz = new Audio( "http://st.ksria.cn/noise/jazz001.mp3" ); @@ -16,6 +23,23 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] rain.volume = 0.5; rain.loop = true; } + */ + + function play() { + var cls = $( ".noise-mode .scene" ).find( ".active" ).attr( "class" ), + key = cls.replace( "mode", "" ).replace( "active", "" ).trim(), + url = noise[ key ]; + sounds[ key ] = new Audio( url ); + sounds[ key ].loop = true; + sounds[ key ].play(); + } + + function pause() { + Object.keys( sounds ).forEach( function( key ) { + sounds[key].pause(); + delete sounds[key]; + }); + } function render() { var tmpl = '\ @@ -24,7 +48,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ]
    \
    \
    \ - 安静的咖啡馆\ + 安静的咖啡馆\ 露天咖啡馆\ 酒吧\ 嘈杂的咖啡馆\ @@ -40,7 +64,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] var $target = $( event.target ); if ( $target.hasClass( "play" )) { $target.removeClass( "play" ).addClass( "pause" ); + play(); } else { + pause(); $target.removeClass( "pause" ).addClass( "play" ); } }); From fcb62a4f88e89aa8a3b9ad1ef175b1ca8f229e1a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 11:13:12 +0800 Subject: [PATCH 050/176] Optimize close logic. --- js/noise.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/noise.js b/js/noise.js index 802c4c1..7c3d8df 100644 --- a/js/noise.js +++ b/js/noise.js @@ -81,9 +81,6 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] function close() { $( ".noise-mode .close" ).click( function( event ) { $( ".noise-mode" ).css({ "transform": "translateY(100px)", "opacity": 0 }); - setTimeout( function(){ - $( ".noise-mode" ).remove(); - }, 500 ); }); } @@ -91,7 +88,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] Init: function() { message.Subscribe( message.TYPE.OPEN_NOISE, function( event ) { if ( $( "body" ).find( ".noise-mode" ).length > 0 ) { - $( ".noise-mode .close" )[0].click(); + open(); } else { render(); open(); From e8dd4cae14ed32eb6f9aee6dc97f7d1a795062cc Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 14:35:16 +0800 Subject: [PATCH 051/176] Add new components: Slider. --- assets/css/main.css | 52 +++++++++++++++++++++++++++++++++++++++++++++ js/components.js | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/assets/css/main.css b/assets/css/main.css index 9af3f42..1fe3ba1 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2107,6 +2107,12 @@ img { background-image: url("../images/pause.png"); } +.noise-mode .volume { + margin-top: 5px; + width: 317px; + text-align: center; +} + .noise-mode .scene { position: absolute; bottom: 0; @@ -2565,3 +2571,49 @@ img { border-color: #fff; box-shadow: 0px 0 2px #fff; } + +/* +* md-textarea/slide +*/ + +.md-slider-root { + position: relative; +} + +.md-slider { + -webkit-appearance: none; + width: 100%; + height: 5px; + border-radius: 5px; + background: #c2c0c2; + outline: none; + opacity: 1; + -webkit-transition: .2s; + transition: opacity .2s; +} + +.md-slider:hover { + opacity: 1; +} + +.md-slider::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 20px; + height: 20px; + border-radius: 50%; + background: #00796B; + cursor: pointer; +} + +.md-slider-bar { + position: absolute; + left: 2px; + bottom: 3px; + + height: 5px; + + border-radius: 5px; + background-color: #00796B; + pointer-events: none; +} \ No newline at end of file diff --git a/js/components.js b/js/components.js index 3ecf708..5b9bb6e 100644 --- a/js/components.js +++ b/js/components.js @@ -39,6 +39,44 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "vo", "date" ], func ' + html + '\
    \
    '; + }, + + Slider: function( min, max, value, cls ) { + var target = ".md-slider-root ." + cls, + tmpl = '', + compiled = _.template( tmpl ); + html = compiled({ min: min, max: max, value: value, cls: cls }), + lineWidth= function ( $target, value ) { + var maxWidth = $target.width(), + perc = ( max - value ) / ( max - min ), + width = maxWidth - ( maxWidth * perc ); + value == max && ( width = maxWidth - 20 ); + $target.next().width( width ); + }, + isDrag = false; + + setTimeout( function () { + lineWidth( $( target ), value ); + }, 100 ); + + $( document ).on( "mousedown", target, function( event ) { isDrag = true }); + $( document ).on( "mouseup", target, function( event ) { isDrag = false }); + $( document ).on( "mousemove", target, function( event ) { + isDrag && lineWidth( $( target ), $( target ).val() ); + }); + $( document ).on( "change", target, function( event ) { + lineWidth( $( event.target ), event.target.value ); + + var evt = new Event( "slider" ); + evt.data = event.target.value; + $( target )[0].dispatchEvent( evt ); + event.stopPropagation(); + }); + + return '
    \ + ' + html + '\ +
    \ +
    '; } } }); \ No newline at end of file From a18b22e51d52ca4dd87ec7ade85a3b21d798c87a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 14:49:57 +0800 Subject: [PATCH 052/176] Optimize Slider logic. --- js/components.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/components.js b/js/components.js index 5b9bb6e..e2ccec4 100644 --- a/js/components.js +++ b/js/components.js @@ -53,6 +53,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "vo", "date" ], func value == max && ( width = maxWidth - 20 ); $target.next().width( width ); }, + onChanged= function( $target, value, event ) { + lineWidth( $target, value ); + var evt = new Event( "slider" ); + evt.data = value; + $( target )[0].dispatchEvent( evt ); + event.stopPropagation(); + }, isDrag = false; setTimeout( function () { @@ -62,15 +69,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "vo", "date" ], func $( document ).on( "mousedown", target, function( event ) { isDrag = true }); $( document ).on( "mouseup", target, function( event ) { isDrag = false }); $( document ).on( "mousemove", target, function( event ) { - isDrag && lineWidth( $( target ), $( target ).val() ); + isDrag && onChanged( $( target ), $( target ).val(), event ); }); $( document ).on( "change", target, function( event ) { - lineWidth( $( event.target ), event.target.value ); - - var evt = new Event( "slider" ); - evt.data = event.target.value; - $( target )[0].dispatchEvent( evt ); - event.stopPropagation(); + onChanged( $( event.target ), event.target.value, event ); }); return '
    \ From d58cdb1f19083f8d94c14fd3df7a35a363bc1d20 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 14:51:25 +0800 Subject: [PATCH 053/176] Optimize noise volumes logic. --- assets/css/main.css | 5 ++++- js/noise.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 1fe3ba1..4bae750 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2107,10 +2107,13 @@ img { background-image: url("../images/pause.png"); } -.noise-mode .volume { +.noise-mode .volumes { margin-top: 5px; width: 317px; text-align: center; + + opacity: 0; + transition: all .5s ease; } .noise-mode .scene { diff --git a/js/noise.js b/js/noise.js index 7c3d8df..5f2bc40 100644 --- a/js/noise.js +++ b/js/noise.js @@ -46,7 +46,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ]
    \ \
    \ -
    \ +
    \ + ' + comps.Slider( 0, 100, 50, "volume" ) + '\ +
    \
    \ 安静的咖啡馆\ 露天咖啡馆\ @@ -63,13 +65,16 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $( ".noise-mode .action" ).on( "click", function( event ) { var $target = $( event.target ); if ( $target.hasClass( "play" )) { - $target.removeClass( "play" ).addClass( "pause" ); + $target.removeClass( "play" ).addClass( "pause" ).next().css( "opacity", 1 ); play(); } else { pause(); - $target.removeClass( "pause" ).addClass( "play" ); + $target.removeClass( "pause" ).addClass( "play" ).next().css( "opacity", 0 ); } }); + $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { + sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); + }); } function open() { From 110b60bebce263cd1ea0fe938764f3c2ce52d8f9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 15:01:53 +0800 Subject: [PATCH 054/176] Optimize volume logic. --- js/noise.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/noise.js b/js/noise.js index 5f2bc40..c3f8847 100644 --- a/js/noise.js +++ b/js/noise.js @@ -25,12 +25,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] } */ - function play() { + function play( volume ) { var cls = $( ".noise-mode .scene" ).find( ".active" ).attr( "class" ), key = cls.replace( "mode", "" ).replace( "active", "" ).trim(), url = noise[ key ]; - sounds[ key ] = new Audio( url ); - sounds[ key ].loop = true; + sounds[ key ] = new Audio( url ); + sounds[ key ].loop = true; + sounds[ key ].volume = volume / 100; sounds[ key ].play(); } @@ -66,7 +67,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] var $target = $( event.target ); if ( $target.hasClass( "play" )) { $target.removeClass( "play" ).addClass( "pause" ).next().css( "opacity", 1 ); - play(); + play( $target.next().find( "input" ).val() ); } else { pause(); $target.removeClass( "pause" ).addClass( "play" ).next().css( "opacity", 0 ); From 0b8656d65749eeb0c15726054c27cfc70f6a539a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 17:03:19 +0800 Subject: [PATCH 055/176] Fix Slider logic bug. --- js/components.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components.js b/js/components.js index e2ccec4..a613102 100644 --- a/js/components.js +++ b/js/components.js @@ -57,7 +57,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "vo", "date" ], func lineWidth( $target, value ); var evt = new Event( "slider" ); evt.data = value; - $( target )[0].dispatchEvent( evt ); + $target[0].dispatchEvent( evt ); event.stopPropagation(); }, isDrag = false; @@ -69,7 +69,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "vo", "date" ], func $( document ).on( "mousedown", target, function( event ) { isDrag = true }); $( document ).on( "mouseup", target, function( event ) { isDrag = false }); $( document ).on( "mousemove", target, function( event ) { - isDrag && onChanged( $( target ), $( target ).val(), event ); + isDrag && onChanged( $( event.target ), $( event.target ).val(), event ); }); $( document ).on( "change", target, function( event ) { onChanged( $( event.target ), event.target.value, event ); From 0f8e73ddf2ac0e2b5064e5f363e67f490bc68062 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 17:05:37 +0800 Subject: [PATCH 056/176] Add sfx UI/Layout. --- assets/css/main.css | 93 +++++++++++++++++++++++++++++- assets/images/jazz.png | Bin 0 -> 2401 bytes assets/images/noise-sfx-close.png | Bin 0 -> 293 bytes assets/images/rain.png | Bin 0 -> 1148 bytes assets/images/wind.png | Bin 0 -> 1344 bytes js/noise.js | 41 ++++++++++++- 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 assets/images/jazz.png create mode 100644 assets/images/noise-sfx-close.png create mode 100644 assets/images/rain.png create mode 100644 assets/images/wind.png diff --git a/assets/css/main.css b/assets/css/main.css index 4bae750..c28ed36 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2065,8 +2065,7 @@ img { box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.4) 0px 9px 24px; - overflow-x: hidden; - overflow-y: auto; + overflow: hidden; z-index: 200; } @@ -2134,11 +2133,101 @@ img { cursor: not-allowed; } +.noise-mode .scene .mode:last-child { + color: #fff; + font-weight: 500; + cursor: pointer; +} + .noise-mode .scene .mode.active { color: rgb(213, 214, 215); cursor: pointer; } +.noise-mode .sfx { + position: absolute; + + left: 0; + right: 0; + top: 0; + + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; + + height: 0; + + background-color: rgb(47, 52, 55); + + opacity: 0; + transition: all .6s ease; +} + +.noise-mode .sfx .exit { + position: absolute; + top: 5px; + right: 5px; + + display: block; + + width: 14px; + height: 14px; + + background-position: center; + background-repeat: no-repeat; + background-image: url("../images/noise-sfx-close.png"); + + cursor: pointer; +} + +.noise-mode .sfx .effect { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + height: 100%; + + opacity: .7; + transition: all .6s ease; +} + +.noise-mode .sfx .effect:hover { + background-color: rgb(63, 68, 71); +} + +.noise-mode .sfx .effect .avatar { + display: block; + + width: 60px; + height: 60px; + + background-position: center; + background-repeat: no-repeat; +} + +.noise-mode .sfx .effect.jazz .avatar { + background-image: url("../images/jazz.png"); +} + +.noise-mode .sfx .effect.rain .avatar { + background-image: url("../images/rain.png"); +} + +.noise-mode .sfx .effect.wind .avatar { + background-image: url("../images/wind.png"); +} + +.noise-mode .sfx .effect .label { + margin: 10px; + font-size: 14px; +} + +.noise-mode .sfx .effect .volum { + width: 50%; +} + /* * media */ diff --git a/assets/images/jazz.png b/assets/images/jazz.png new file mode 100644 index 0000000000000000000000000000000000000000..b1bc0167d81561db1e1ff296d0eccd2acc87e3a2 GIT binary patch literal 2401 zcmV-n37+1KwPRR?VQ zmcTuLdjlH*_X6$<{2RC)_yzFm^4~W|`p;@^!m0qay(zE{um|vH;MM~{{2llLa4~R! zq#qCbZg8^|18n~fG5Jjr^mo0z&nA9B>ihJs*Z*W1Gas4;7H*4<=C#oyy`xF z3A_t9UD9tC8DJs6w)XHp`zGbE+|!8Q|M+u6|%0~<^kAy3VRfRiPCXYedq8rt3hcscMaAWvJHWf7k( z>71cs4F+ucFyI{>9iImrFX{V32OrYT_5*;|bX=c!^TQ=|&26?LU7XVeQ=XbQl6_`9 zT0_7#+mx%6IfTU27SQ`j`dDATy*q6C5y0oBkcS-GCrSG0vKiRB0xu}{@psuJNpJ0& zP|rQz1o$+N<6hf8fX7I>ysM8+z_vpJzh3BI-A|r|{U!Z*^h2SMhn9DFtCoTHlJxNf zLEj!Y3&@jL+YP`rlJf6X>jV5HAYQq)Pe|IcI&vW(Ia1l#X?BXFIHHBk_JvbGUnc31 zGXu80fAPrmx7Ps=m-N@h&h8NITY`cvFuCiQ=)z|Ew!oKxZCg4!KvGV@GHcyo+j(|E z-0xF;5z_GBCaJf5U?Cx00YW06Q}fJ7ii24ZD?v&&AmpWKd80RLd;6yWej)J2zLm3` zAR$gBkAFc?>s*{eBc#Nbs)nhILY`(=L|u9Yt?MO4>-6Q z^lC{7O2#$;xbW9+x6E`aN#p--JI_xPji$vJJyufNLaaJ?+gk$P>YIBFIQQ-i)kjxI zO8B;9wxdV=1h_@jE==mgE@ZZI?;lj2l6dZrn(HLpv=S>~`-+w*>sU#rjry+v=Piv) z)3g^$8ZUzFc<*@erbURm|1=q*B3(eEsE{74ZBd%_%zmlZv?Un zP1`}zHH{t4{j6i*mq^MxyUc8F283*E(=*{~i?f?sxU-#jIzmI!elKZ^X$-jV=E$Z^ z`%516rgUmM`cfpxnvPg1R97J+mI!cAVJbfJ-ICQM8)vXihcl%e5KBtxpB+R(*Vvq`S<8c8ycb;@5LNNYWCv z<_@w`%&oj8~t$}Y;-~Ot+(@R&!b}|uZQwQ~1&MOhw4$%mfrX4kk#hZYS1L8@W z_F74=m=o|Jz`Lt&&yX}R8QT#Bj;PulEGZm(X0x5^a6w)}w&WSA#Dj-?M<9vf6!JyjfDs zm`j@pY4#O`tIK-X^d&+;9)S*$$OQZj+e~+Tef+9!9&@(Xx}x5KTXm& zAekq4Xw$N;loXG8-@(HkDxekpKDHGw#{NH|Ru=E{z zAkdZs+gegvaJ}#%^mSl6S;WXiwS04)q;a~|c7*?Lw)D4!q-bwT)+X_^tKYL z`rURMRFsys)a))z-E4})lQiu_+O-XE8v)7ji_W{&w5lT6d=!XuQ`^~+k|QzaL*VqvqL_cibAH2Yww*qNZ49qH1`CAFn^m-_Dm z+?5bNzZ8^=6XNrrx1DrNU3V3Z{K;e-B~1i0wpTA99sss?20lB*W9E&_QETPDLl?ky zoMcprFtJe;&=2bGZKvenGe8JZZ8-tSd~}vE_11V4&?zsNR@9PvwYQ`sr&rAe6tyIQ z*IS`C2yg+Nw{b}|m}04pJ7E>dmNqYCOHc0@d#q^mt@vQT1@w@@v^bg6a;!vQ+RK1c z7<3h;g&SnC2iZ)33+SPxhvDRzNCfa9rH7G(63?zbrH7*>EXAdfV7rc4bHzu+rC$NU zmYNoIBEo)1{?Ovm)OsGeR*FlTGhGMe!%4U&i;yR4E}QvC*Q3}D?@e|hI&?G1HrIrv ze3S%UPE-WG1O;>3!hjpcJOO(0un7R3&_`+p%sAvDQBaCT*PlNDXq$Mcp9=Ndea=7f z_!Myddi_Tp({`-XU#7GviL=o^p{zMwkzI3K|G)o?XTWh?XH8b@4zDu=GY=7KJNXX62e7fQ7|e=+*zwO<-&g3Nq6e-1i8FHp$2i4SM7$SgnK_IzEMP7o?n?j1<;>i{VMV#cDvIz5 zleNDX5!Y?v0UThv4&GxFWB5QPB8s!GYA|Q!IOcJJ!8-SfH9SVdbE`NrJ2=8Q_Hc<8 zOrcnv#&Sdyqz3aY_Uq;c%wVD}8L9oHh$wH+5O*`bVW`^wo4J0?W()IrMBIE2)vqDR r%voGi=9P$e>P}<-687Jm_jLIa(hfrqpq9 literal 0 HcmV?d00001 diff --git a/assets/images/rain.png b/assets/images/rain.png new file mode 100644 index 0000000000000000000000000000000000000000..2fe9a8c4c51e674cbd454bac777e94a46f25a2da GIT binary patch literal 1148 zcmV-?1cUpDP)^5Qe|sDL7+LF^VHXG{Ff8f@C2oK}4KEV{~WS1dWJm!G$2GXcFSatc*iIK_iMT zTqr6Ajd6~O3vq};oCg$5^p|>`mVW)ZUw7Z((B1bPc<|tMovQEDxpk}R9MQ0$hVe27 zT(`$<9|{}?`~!S0>D#(>w$ERyhi&f%TmmcyP6Cbv_UQop5qK4N33wTJP10X=EkZ58 zwwC}m09OGA4r%-kz&*fPNxuy#+xO>{0^2?jxI1~Zukt=W_zt)OxW7t|R|af*DeyFK za9Pq0`Hz4rB)wn7yp;gkz7lu@*t-g&y3Fw>aIK`r%g$dK*!I=H!@wS8jp-vFQGJD^ zO=a|y0#4ib1z^uIMhqeQH?UOFmLX)O{d6E;+h+n707nBy0Dl1SZrupXFRHwt+)m&* z;27XD;4R<{;1x-+AhV91z_#Oic@uCma8$pEM&S9+z-C~hr009t(-qkEGGIgU=m@Y3 zZNhe7m85vxdT(jl5qNG(e*%3wTY6$YWuBK_gd7S}WTJ z0a257mTd*+9a*s`Mve^N6~IFyYi6~ET^7I*s3KrBVQdQEH-XceKpSaj0Dl7<-VorO z0UR00UJU`>9l&3u3aAOpI|6tca7Ghor#hmxH%9xUA;9Yc_~KMYHi3Cr07r)P1#sAe z6Gt|=pp{EUXCw0INgn^@(y3aC_GD5w#J_UFkm^We2Gwb0NpzS#HiXQX0 zw|81d(aXM0QXCRYjTvC6vHoC)lq>Q+f# zcFsHN*0p_pYzg2}AQ}bTMl`=a1Qu6lbmvq75rOA~S#-4e((5E`?e)8X-c{RCT%6T* z@(|zd9l)o+Hc7vyUUt;hhg1yyF%X@{t+r!PF9PI4r zkGbNW$1}i_z_am+6xG>Ju2$d~k;jhP0db2b^7eQKqm%f39iA)|wEC^uI6cqm;Zaza zIp7>#NKFSxiUaJdBfE!fN5FbJQJywYR}Z_n&h`Vq_37CLNh@=@IID+kM=|nF+pV9- z!%vkIR}`|0+`vzyLZlsTv!p0avW#rNwoeASc`_1^#gabAL7Wr#-gE`38`m01aXqT` zkrOy_zuuQd+ojU+G}62nTa+t zUi!eBy2tw-?t6F>8-f0m-ozX_1gEPWw!Iy2GH?uV5U?8f2zXJ__uUxmt^nKK8n_0y z0obt)n1L67>m+?uC3xk)ws!|!2978J@;h*$q{St4N2F3IaGJvJr|DbPzzx8$lHM-+ zLMwVz1K*vda&FV>zyrWC;Lo(C?+5nHl)eKdNcy`Km@>MR0o&dg_z~DDGh~6JTWbxo zy%P`~jX+k&6_Oq)1JR03mB6!r+~CEMPHSYG?W2K}S^H8+C$s`nMz>1fhkz?HBW6f? zb2y`He*^5Dbk<55UuQPV04@e%fF`6_^dazkM0!aP0~$(|z+u2SSjr6Moj&END`~f^CDfZZgVtY>@rt}s`X_cf&whshW)q(vlWodtvx5JX|ah+qf z1KZv;j0eun>{<`(0qg~QnmvzzG)>aGwF7E9SRw`-m$l846uCe-VB0Yz&jcbDu0moO z9tmty^YPh|9<+UP@@CPzP*UXMb;Wi>?Ju&%6_Tcw0=9iB@JbbwO};q@W&3I1qD+6H zq%Vhi-*&X`pLEtp+NCV;?34m_i#d*pb0s}nbZ9#UJO(}_*6t3?_F3C+rQ>J3V@X92 z9Qa7XHJsADNE8mMh&Yafv2T7HQ9Kd{NdYw|wl4*WNPCy0Yn$0plf0~!6aj5eMm=bi z0Ehu!C+X`Fx)HGAP*TVuNoVyGa5Knk`bQcX)srGMjiyT^MI7iI4>to&)s!=U`_fic zyb_g@2y&62GzPYP0kE*>egn>v^lCl5 zdcZ#b8%4Gr0gk92TiW%*1-N>^M*+8IN&HymjiX~6IAUvyZ7rNNtc>|>sTn}4?S0@@ zN37TM+w!pO1Auuz{B}wr-Hdc{nWP9r9hG*0qskb?v?}Bs;Cx9@qwbir3;a27aL23} z`k`Oril$5+UDk$nfg`bh28g;-RT3rG$+aosNIPo_c%+@ydoPt}_Dcu;1vNJomrHuQ z6a94^*mm3^P63{(EwB|pw&w!(W`N5jP478i+X1>F8U7hCsrJwxZML^eHwr~gzd=$* z>S|r}u<6x3sbpMj>fn)m_6x&w=_hgTjNXm=sBWCX^a9W>HSU)7QIQH`R|Bpyw zq9`9XgAt|2WjZq@Jvm~^?8VUljzZgOEgV1NmSIXy@58od0*{q|{v@tXCB@Y5h;-e< zh1IrWP2LF{+JGc#)w7!2I<`6rqXwLT9}b+G3jS+=SksYc47o6C6|SECr~`KbqLpv- zfm<1^UexV-xEH安静的咖啡馆\ 露天咖啡馆\ 酒吧\ - 嘈杂的咖啡馆\ + 更多场景\ +
    \ +
    \ + \ +
    \ +
    \ +
    JAZZ
    \ +
    \ + ' + comps.Slider( 0, 100, 50, "jazz" ) + '\ +
    \ +
    \ +
    \ +
    \ +
    RAIN
    \ +
    \ + ' + comps.Slider( 0, 100, 50, "rain" ) + '\ +
    \ +
    \ +
    \ +
    \ +
    WIND
    \ +
    \ + ' + comps.Slider( 0, 100, 50, "wind" ) + '\ +
    \ +
    \
    \
    '; $( "body" ).append( tmpl ); @@ -76,6 +100,21 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); }); + $( ".noise-mode .scene" ).find( ".mode:last" ).on( "click", function( event ) { + $( ".noise-mode .sfx" ).css( "opacity", "1" ).css( "height", "100%" ); + }); + $( ".noise-mode .sfx .exit" ).on( "click", function( event ) { + $( ".noise-mode .sfx" ).css( "opacity", "0" ).css( "height", "0" ); + }); + $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { + // TO-DO + }); + $( ".md-slider-root .rain" )[0].addEventListener( "slider", function( event ) { + // TO-DO + }); + $( ".md-slider-root .wind" )[0].addEventListener( "slider", function( event ) { + // TO-DO + }); } function open() { From bd8c84ef222892b22fbf18ddccf255b9b418e4da Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 15 Dec 2018 17:08:59 +0800 Subject: [PATCH 057/176] Format source. --- js/noise.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/noise.js b/js/noise.js index eb90102..c91269a 100644 --- a/js/noise.js +++ b/js/noise.js @@ -57,7 +57,6 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] 更多场景\
    \
    \ - \
    \
    \
    JAZZ
    \ @@ -79,6 +78,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] ' + comps.Slider( 0, 100, 50, "wind" ) + '\
    \
    \ + \
    \
    '; $( "body" ).append( tmpl ); From 941491b72cceeffcbadfde4a523a091781f07708 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 14:24:25 +0800 Subject: [PATCH 058/176] Optimize sfx UI. --- assets/css/main.css | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index c28ed36..241827a 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2164,6 +2164,11 @@ img { transition: all .6s ease; } +.noise-mode .sfx .md-slider-bar, +.noise-mode .sfx .md-slider::-webkit-slider-thumb { + background-color: #fff; +} + .noise-mode .sfx .exit { position: absolute; top: 5px; @@ -2187,13 +2192,15 @@ img { justify-content: center; align-items: center; + width: 100%; height: 100%; - opacity: .7; + opacity: .5; transition: all .6s ease; } .noise-mode .sfx .effect:hover { + opacity: 1; background-color: rgb(63, 68, 71); } @@ -2225,7 +2232,11 @@ img { } .noise-mode .sfx .effect .volum { + position: absolute; + bottom: 20px; width: 50%; + + opacity: 0; } /* From 48e331045ca60c2a4b9cc840379fcd9e92e97f1a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 14:30:01 +0800 Subject: [PATCH 059/176] Optimize open/close sfx logic. --- js/noise.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/noise.js b/js/noise.js index c91269a..b591c68 100644 --- a/js/noise.js +++ b/js/noise.js @@ -101,10 +101,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); }); $( ".noise-mode .scene" ).find( ".mode:last" ).on( "click", function( event ) { - $( ".noise-mode .sfx" ).css( "opacity", "1" ).css( "height", "100%" ); + $( ".noise-mode .sfx" ).css({ "opacity": "1", "height": "100%", "pointer-events": "initial" }); }); $( ".noise-mode .sfx .exit" ).on( "click", function( event ) { - $( ".noise-mode .sfx" ).css( "opacity", "0" ).css( "height", "0" ); + $( ".noise-mode .sfx" ).css({ "opacity": "0", "height": "0", "pointer-events": "none" }); }); $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { // TO-DO From c77e3c378ed50014af3a94d07faa0cbadd2a8fea Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 14:55:56 +0800 Subject: [PATCH 060/176] Add sfx logic. --- assets/css/main.css | 10 ++++--- js/noise.js | 63 +++++++++++++++++++++------------------------ 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 241827a..387b9b5 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2197,6 +2197,7 @@ img { opacity: .5; transition: all .6s ease; + cursor: initial; } .noise-mode .sfx .effect:hover { @@ -2212,17 +2213,19 @@ img { background-position: center; background-repeat: no-repeat; + + cursor: pointer; } -.noise-mode .sfx .effect.jazz .avatar { +.noise-mode .sfx .effect[type="jazz"] .avatar { background-image: url("../images/jazz.png"); } -.noise-mode .sfx .effect.rain .avatar { +.noise-mode .sfx .effect[type="rain"] .avatar { background-image: url("../images/rain.png"); } -.noise-mode .sfx .effect.wind .avatar { +.noise-mode .sfx .effect[type="wind"] .avatar { background-image: url("../images/wind.png"); } @@ -2237,6 +2240,7 @@ img { width: 50%; opacity: 0; + transition: all .6s ease; } /* diff --git a/js/noise.js b/js/noise.js index b591c68..dc3ff5b 100644 --- a/js/noise.js +++ b/js/noise.js @@ -9,37 +9,17 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "rain001": "http://st.ksria.cn/noise/rain001.mp3", }, sounds = {}; - /* - function sound() { - var cafe = new Audio( "http://st.ksria.cn/noise/cafe001.mp3" ); - var jazz = new Audio( "http://st.ksria.cn/noise/jazz001.mp3" ); - var rain = new Audio( "http://st.ksria.cn/noise/rain001.mp3" ); - cafe.play(); - cafe.loop = true; - jazz.play(); - jazz.loop = true; - jazz.volume = 0.5; - rain.play(); - rain.volume = 0.5; - rain.loop = true; - } - */ - - function play( volume ) { - var cls = $( ".noise-mode .scene" ).find( ".active" ).attr( "class" ), - key = cls.replace( "mode", "" ).replace( "active", "" ).trim(), - url = noise[ key ]; + function play( key, volume ) { + var url = noise[ key ]; sounds[ key ] = new Audio( url ); sounds[ key ].loop = true; sounds[ key ].volume = volume / 100; sounds[ key ].play(); } - function pause() { - Object.keys( sounds ).forEach( function( key ) { - sounds[key].pause(); - delete sounds[key]; - }); + function pause( key ) { + sounds[ key ] && sounds[key].pause(); + delete sounds[key]; } function render() { @@ -57,21 +37,21 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] 更多场景\
    \
    \ -
    \ +
    \
    \
    JAZZ
    \
    \ ' + comps.Slider( 0, 100, 50, "jazz" ) + '\
    \
    \ -
    \ +
    \
    \
    RAIN
    \
    \ ' + comps.Slider( 0, 100, 50, "rain" ) + '\
    \
    \ -
    \ +
    \
    \
    WIND
    \
    \ @@ -88,12 +68,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] function model() { $( ".noise-mode .action" ).on( "click", function( event ) { - var $target = $( event.target ); + var $target = $( event.target ), + cls = $( ".noise-mode .scene" ).find( ".active" ).attr( "class" ), + key = cls.replace( "mode", "" ).replace( "active", "" ).trim(); if ( $target.hasClass( "play" )) { $target.removeClass( "play" ).addClass( "pause" ).next().css( "opacity", 1 ); - play( $target.next().find( "input" ).val() ); + play( key, $target.next().find( "input" ).val() ); } else { - pause(); + pause( key ); $target.removeClass( "pause" ).addClass( "play" ).next().css( "opacity", 0 ); } }); @@ -106,14 +88,27 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $( ".noise-mode .sfx .exit" ).on( "click", function( event ) { $( ".noise-mode .sfx" ).css({ "opacity": "0", "height": "0", "pointer-events": "none" }); }); + $( ".noise-mode .sfx .effect .avatar" ).on( "click", function( event ) { + var $parent = $( event.target ).parent(), + key = $parent.attr( "type" ) + "001", + $volume = $parent.find( ".volum" ), + volume = $parent.find( ".md-slider-root input" ).val(); + if ( sounds[key] ) { + pause( key ); + $volume.css( "opacity", 0 ); + } else { + play( key, volume ); + $volume.css( "opacity", 1 ); + } + }); $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { - // TO-DO + sounds[ "jazz001" ] && ( sounds[ "jazz001" ].volume = event.data / 100 ); }); $( ".md-slider-root .rain" )[0].addEventListener( "slider", function( event ) { - // TO-DO + sounds[ "rain001" ] && ( sounds[ "rain001" ].volume = event.data / 100 ); }); $( ".md-slider-root .wind" )[0].addEventListener( "slider", function( event ) { - // TO-DO + sounds[ "wind001" ] && ( sounds[ "wind001" ].volume = event.data / 100 ); }); } From 64a56e99f2e844a4c329acdce6cd57f86766f865 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 15:01:27 +0800 Subject: [PATCH 061/176] Optimize sfx selected logic. --- js/noise.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/js/noise.js b/js/noise.js index dc3ff5b..6c2b772 100644 --- a/js/noise.js +++ b/js/noise.js @@ -4,10 +4,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "use strict"; var noise = { - "cafe001": "http://st.ksria.cn/noise/cafe001.mp3", - "jazz001": "http://st.ksria.cn/noise/jazz001.mp3", - "rain001": "http://st.ksria.cn/noise/rain001.mp3", - }, sounds = {}; + "cafe001": "http://st.ksria.cn/noise/cafe001.mp3", + "jazz001": "http://st.ksria.cn/noise/jazz001.mp3", + "rain001": "http://st.ksria.cn/noise/rain001.mp3", + }, colors = { + "jazz001": "#7CA6ED", + "rain001": "#D2A24A", + }, + sounds = {}; function play( key, volume ) { var url = noise[ key ]; @@ -96,9 +100,11 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] if ( sounds[key] ) { pause( key ); $volume.css( "opacity", 0 ); + $parent.css({ "background-color": "initial", "opacity": 0 }); } else { play( key, volume ); $volume.css( "opacity", 1 ); + $parent.css({ "background-color": colors[key], "opacity": 1 }); } }); $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { From 6906d3b08e859cf42f0a565695752b1b4890a8df Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 15:03:12 +0800 Subject: [PATCH 062/176] Format source. --- js/noise.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/noise.js b/js/noise.js index 6c2b772..735d8c1 100644 --- a/js/noise.js +++ b/js/noise.js @@ -83,9 +83,6 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $target.removeClass( "pause" ).addClass( "play" ).next().css( "opacity", 0 ); } }); - $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { - sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); - }); $( ".noise-mode .scene" ).find( ".mode:last" ).on( "click", function( event ) { $( ".noise-mode .sfx" ).css({ "opacity": "1", "height": "100%", "pointer-events": "initial" }); }); @@ -107,6 +104,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $parent.css({ "background-color": colors[key], "opacity": 1 }); } }); + $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { + sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); + }); $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { sounds[ "jazz001" ] && ( sounds[ "jazz001" ].volume = event.data / 100 ); }); From 4bcdb81aa80c69f38761e301c4de49213afa1da1 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 15:05:45 +0800 Subject: [PATCH 063/176] Format source. --- js/noise.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/noise.js b/js/noise.js index 735d8c1..a2cd4a9 100644 --- a/js/noise.js +++ b/js/noise.js @@ -97,7 +97,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] if ( sounds[key] ) { pause( key ); $volume.css( "opacity", 0 ); - $parent.css({ "background-color": "initial", "opacity": 0 }); + $parent.css({ "background-color": "initial", "opacity": 0.5 }); } else { play( key, volume ); $volume.css( "opacity", 1 ); From be779b68690c4d7f7652b9bad363361cef041749 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 15:16:45 +0800 Subject: [PATCH 064/176] Add sfx background color. --- js/noise.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/noise.js b/js/noise.js index a2cd4a9..b873820 100644 --- a/js/noise.js +++ b/js/noise.js @@ -4,12 +4,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "use strict"; var noise = { - "cafe001": "http://st.ksria.cn/noise/cafe001.mp3", - "jazz001": "http://st.ksria.cn/noise/jazz001.mp3", - "rain001": "http://st.ksria.cn/noise/rain001.mp3", + "cafe001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/cafe001.mp3", + "jazz001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/jazz001.mp3", + "rain001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/rain001.mp3", + "wind001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/wind001.mp3", }, colors = { - "jazz001": "#7CA6ED", - "rain001": "#D2A24A", + "jazz001": "#3D5AFE", + "rain001": "#ff932b", + "wind001": "#f3294d", }, sounds = {}; From 8d81d2ba29f6ba746cdb19906d556c0dcfee41ab Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 15:53:01 +0800 Subject: [PATCH 065/176] Format source. --- assets/css/main.css | 6 +++--- js/noise.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 387b9b5..0ca8529 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2217,15 +2217,15 @@ img { cursor: pointer; } -.noise-mode .sfx .effect[type="jazz"] .avatar { +.noise-mode .sfx .effect[type="jazz001"] .avatar { background-image: url("../images/jazz.png"); } -.noise-mode .sfx .effect[type="rain"] .avatar { +.noise-mode .sfx .effect[type="rain001"] .avatar { background-image: url("../images/rain.png"); } -.noise-mode .sfx .effect[type="wind"] .avatar { +.noise-mode .sfx .effect[type="wind001"] .avatar { background-image: url("../images/wind.png"); } diff --git a/js/noise.js b/js/noise.js index b873820..05de61b 100644 --- a/js/noise.js +++ b/js/noise.js @@ -43,25 +43,25 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] 更多场景\
    \
    \ -
    \ +
    \
    \
    JAZZ
    \
    \ - ' + comps.Slider( 0, 100, 50, "jazz" ) + '\ + ' + comps.Slider( 0, 100, 50, "jazz001" ) + '\
    \
    \ -
    \ +
    \
    \
    RAIN
    \
    \ - ' + comps.Slider( 0, 100, 50, "rain" ) + '\ + ' + comps.Slider( 0, 100, 50, "rain001" ) + '\
    \
    \ -
    \ +
    \
    \
    WIND
    \
    \ - ' + comps.Slider( 0, 100, 50, "wind" ) + '\ + ' + comps.Slider( 0, 100, 50, "wind001" ) + '\
    \
    \ \ @@ -93,7 +93,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] }); $( ".noise-mode .sfx .effect .avatar" ).on( "click", function( event ) { var $parent = $( event.target ).parent(), - key = $parent.attr( "type" ) + "001", + key = $parent.attr( "type" ), $volume = $parent.find( ".volum" ), volume = $parent.find( ".md-slider-root input" ).val(); if ( sounds[key] ) { @@ -109,13 +109,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); }); - $( ".md-slider-root .jazz" )[0].addEventListener( "slider", function( event ) { + $( ".md-slider-root .jazz001" )[0].addEventListener( "slider", function( event ) { sounds[ "jazz001" ] && ( sounds[ "jazz001" ].volume = event.data / 100 ); }); - $( ".md-slider-root .rain" )[0].addEventListener( "slider", function( event ) { + $( ".md-slider-root .rain001" )[0].addEventListener( "slider", function( event ) { sounds[ "rain001" ] && ( sounds[ "rain001" ].volume = event.data / 100 ); }); - $( ".md-slider-root .wind" )[0].addEventListener( "slider", function( event ) { + $( ".md-slider-root .wind001" )[0].addEventListener( "slider", function( event ) { sounds[ "wind001" ] && ( sounds[ "wind001" ].volume = event.data / 100 ); }); } From 5008cd8f3c5980557611650fe88e3e66a9cacd15 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:06:07 +0800 Subject: [PATCH 066/176] Rework main layout. --- assets/images/cafe.png | Bin 0 -> 1121 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/images/cafe.png diff --git a/assets/images/cafe.png b/assets/images/cafe.png new file mode 100644 index 0000000000000000000000000000000000000000..ff414219347e743a960a5fb0da222e82cc9bfe4d GIT binary patch literal 1121 zcmV-n1fKheP)kfL{St<|u7J=3C$hNk6CB>IobXPT_Y_m9;#7lceiXZPo#=1s+aS*7E%A zl1@#vSqHotcqCO>%k%#Mo&X%_cL%jy2Yfp4{GduEJkQ`a0yjzetDi4*z{dh__Y>~e z|8D_jN%DeLJL-TB0lw@QP}QBM0Q-4d>5un;6_S3f^Susu58(HX178Z<1KbL1Ectr3 zq)U>3Jvk!223&k}bvS+hD?TE^1=5R6uT) zbU`ZcX5jpehSw|eB1!*$b`jwezq9by-|%8de^>o)ittsy%^d~)SkkhxZxL}Q@I~p_ zN=dJ!0G|fD&{5#6lFqIA77>2{yBE*hU_6!rycqbgqrg{7x}^v3Pr%;A^L3IQ92mG* z3_f#L(n07GCB0fn={|a#@}zC4NNIn^-vc{$D9V>hy1kOlmjQQ_o^6zLTQYC~{UVUucaG@= zIaQaI8-$2B18`lvYhm+~qSETwISq1%w;s56OaQ5BUy|hQ($&=gfTMU$Nr?-Q<&xg3 zQ#=T;SHJH7Hx!c|uB09ZRsk26_FVhr>T8vxXPTVs3tYU-2Y~Y?P1|7K+tC_H+xq!9 zDDdHc_v9`uUNdZO02^i+iID&oQFiaSp`XGQ{`bP=&d7E0L%oWNp;Nj5UIO^Uf3Fsx zswVCS{8_n2|4P!Ixjqb((lg2cQ)y#jd7=SL&*%7E8P+B714v(yX)TtFWTJn9;DNGIKut(7#^W2K>i z3+SDI3xOMe0~5i$68nVo3Q1!>QW^4fOCy>NiHeEU2;6vmnm@Wo0}_g(+JO% nNagxDjd1Rpn=5h)F2er;#6&MlBpYaR00000NkvXXu0mjf`8^V6 literal 0 HcmV?d00001 From da9ce14913e937bdd0d9810bebaaaa4dc54bc6b1 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:06:34 +0800 Subject: [PATCH 067/176] Rework main layout. --- assets/css/main.css | 68 +++++---------------------------------------- js/noise.js | 43 ++++++++-------------------- 2 files changed, 18 insertions(+), 93 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 0ca8529..94e5a8c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2047,7 +2047,7 @@ img { right: 10px; bottom: 10px; - width: 400px; + width: 500px; height: 150px; padding: 15px; @@ -2086,64 +2086,6 @@ img { cursor: pointer; } -.noise-mode .action { - display: block; - - width: 70px; - height: 70px; - - background-position: center; - background-repeat: no-repeat; - - opacity: .7; -} - -.noise-mode .action.play { - background-image: url("../images/play.png"); -} - -.noise-mode .action.pause { - background-image: url("../images/pause.png"); -} - -.noise-mode .volumes { - margin-top: 5px; - width: 317px; - text-align: center; - - opacity: 0; - transition: all .5s ease; -} - -.noise-mode .scene { - position: absolute; - bottom: 0; - - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - - color: rgb(213, 214, 215, .7); - font-size: 11px; -} - -.noise-mode .scene .mode { - margin: 5px 10px; - cursor: not-allowed; -} - -.noise-mode .scene .mode:last-child { - color: #fff; - font-weight: 500; - cursor: pointer; -} - -.noise-mode .scene .mode.active { - color: rgb(213, 214, 215); - cursor: pointer; -} - .noise-mode .sfx { position: absolute; @@ -2156,11 +2098,11 @@ img { justify-content: space-around; align-items: center; - height: 0; + height: 100%; background-color: rgb(47, 52, 55); - opacity: 0; + /*opacity: 0;*/ transition: all .6s ease; } @@ -2217,6 +2159,10 @@ img { cursor: pointer; } +.noise-mode .sfx .effect[type="cafe001"] .avatar { + background-image: url("../images/cafe.png"); +} + .noise-mode .sfx .effect[type="jazz001"] .avatar { background-image: url("../images/jazz.png"); } diff --git a/js/noise.js b/js/noise.js index 05de61b..06b4e18 100644 --- a/js/noise.js +++ b/js/noise.js @@ -9,6 +9,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "rain001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/rain001.mp3", "wind001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/wind001.mp3", }, colors = { + "cafe001": "#753F40", "jazz001": "#3D5AFE", "rain001": "#ff932b", "wind001": "#f3294d", @@ -31,18 +32,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] function render() { var tmpl = '\
    \ - \ -
    \ -
    \ - ' + comps.Slider( 0, 100, 50, "volume" ) + '\ -
    \ -
    \ - 安静的咖啡馆\ - 露天咖啡馆\ - 酒吧\ - 更多场景\ -
    \
    \ +
    \ +
    \ +
    CAFE
    \ +
    \ + ' + comps.Slider( 0, 100, 50, "cafe001" ) + '\ +
    \ +
    \
    \
    \
    JAZZ
    \ @@ -64,8 +61,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] ' + comps.Slider( 0, 100, 50, "wind001" ) + '\
    \
    \ - \
    \ + \
    '; $( "body" ).append( tmpl ); @@ -73,25 +70,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] } function model() { - $( ".noise-mode .action" ).on( "click", function( event ) { - var $target = $( event.target ), - cls = $( ".noise-mode .scene" ).find( ".active" ).attr( "class" ), - key = cls.replace( "mode", "" ).replace( "active", "" ).trim(); - if ( $target.hasClass( "play" )) { - $target.removeClass( "play" ).addClass( "pause" ).next().css( "opacity", 1 ); - play( key, $target.next().find( "input" ).val() ); - } else { - pause( key ); - $target.removeClass( "pause" ).addClass( "play" ).next().css( "opacity", 0 ); - } - }); - $( ".noise-mode .scene" ).find( ".mode:last" ).on( "click", function( event ) { - $( ".noise-mode .sfx" ).css({ "opacity": "1", "height": "100%", "pointer-events": "initial" }); - }); - $( ".noise-mode .sfx .exit" ).on( "click", function( event ) { - $( ".noise-mode .sfx" ).css({ "opacity": "0", "height": "0", "pointer-events": "none" }); - }); - $( ".noise-mode .sfx .effect .avatar" ).on( "click", function( event ) { + $( ".noise-mode .sfx .effect .avatar" ).on( "click", function( event ) { var $parent = $( event.target ).parent(), key = $parent.attr( "type" ), $volume = $parent.find( ".volum" ), @@ -106,7 +85,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $parent.css({ "background-color": colors[key], "opacity": 1 }); } }); - $( ".noise-mode .md-slider-root .volume" )[0].addEventListener( "slider", function( event ) { + $( ".md-slider-root .cafe001" )[0].addEventListener( "slider", function( event ) { sounds[ "cafe001" ] && ( sounds[ "cafe001" ].volume = event.data / 100 ); }); $( ".md-slider-root .jazz001" )[0].addEventListener( "slider", function( event ) { From 1c7ff765f2262de79d7f9d9d9641fe0117c944cc Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:23:19 +0800 Subject: [PATCH 068/176] Optimize icons. --- assets/images/cafe.png | Bin 1121 -> 372 bytes assets/images/jazz.png | Bin 2401 -> 1071 bytes assets/images/pause.png | Bin 1150 -> 0 bytes assets/images/play.png | Bin 1516 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 assets/images/pause.png delete mode 100644 assets/images/play.png diff --git a/assets/images/cafe.png b/assets/images/cafe.png index ff414219347e743a960a5fb0da222e82cc9bfe4d..152bab1bba0b70fe99b41af64c6d69e464596545 100644 GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2Hb0X`wFK>9x|L5-@+E}$LqB|(0{ z3=IeV{`!2qCEY?%>h1l7vx;*f?Ea@#JeZ z;Bg3azBHlHXzDrVclD>ebhKtJ6A)ghwd()BlhU^jtX+OaKXbCUbxY^TY^HBYtiSgk zym_HavTflU!^byyqi-kvVG`qvh}-vP`$N&>V}?5v->Dvw<<)NC<(V5?1Sm;FK~!i%?U`%HWm6c(e}DHfj51~1DWxe1 zNi#Ka{e+r)Ff(e3XvXb}`QTD+rBRd*6uH)@34>e;ad3i=@wU15*ne5lexsz)88v$0YX~uv*fyIr^J`UjbI;C~ZOJ zTi^&uKd0L22^~e|8D_jN%DeLJL-TB0lw@Q zP}QBM0Q-4d>5un;6_S3f^Susu58(HX178Z<1KbL1Ectr3q)U>3Jvk!223&k}bvS+h zD?TE^1=5RDVEjmUKZX@Mhrrj)vDO^CC(A ze|8b!6u-0Z*Wd7BNq<-UZ;J3$z|9>6{#eqovTqS_DDXw;*-A;Tr2wA>ywFkLt&+~I z`W6v?0J|5@-C#VH0=yXbv7^9OOS+{8@K3<7emzEoZh&TgqUA=2z z^OK^|>e)FBa)`GcxOYqdscK)6ItfYn7yDnw;zlT)fQ(fb%9z+hE_@(HcqH`uR90@Zo^>cQ) zy#jd7=SL&*%7E8P+B714v(yX)TtFWTJb&sMc1S1Pm93RD)?=lifeYxJfD3^efCCf3 zy%PI`^a@F1KT;YAaA`5y1vneH5;(pA+=ad?CI9Y{v?K8)WltX|aJCmM3QmEWUUo$I zw$6tES9XOet1nl+Ll91&iP%O?z3Mu!yIA<4H4StAwrXC-;1P|w3m|P?2^;Up$jdV#aDZ*WHJlB^gaPFI%D{|8a&y`5!`ZeOGc=N=7Z{JWvRy}yBqR+ zTaAr+SIYA$!y2_TZ`9T`@R3>43?XM z&y(K$+W%_(!by{@RyIGG{{IM1<3E>~>!SYa-TQt(@R#$%J;^1zC1oc)zjciJ>vBI0 z{@wGEZo9kp?pv=s>5^-c{feM%&(1|SHJQBAztqkr)bf5)$!4*D16y{le;XdFz?y9pPzGw{pruhuCFi zI@>N#pUk6W=alNoG-JXPea88P3-jd}t$DAVJ=FeXMF!)8)in=iFZ?IPSRfwnxb{ZG zCXwUcPU~LC^gG}1q2p+GQR#Eh+5{dEk&Me}yVV2=bC>tq9I_NnTzKfiG-j5X5Q!+q z*=##XKKBJb`_5*t-bO&xU*ecokAAV!|EwizZI}87%S8Dv&;C8hc45&*_C6uCv%Iwq zo@w4)220wzayxFAEtnxaX;T#QwcdZCPl~fsr1vlV9I#mLxZ4|N^E-k!nM|g+YrcQB z`N~DZOl{kyNik{Vwr$-mC3r$`LUX&EM8p z<@D!O^G>~`j0sWa%%vW%^XxU#uPj#9JSOq};<`JHS5sEG)qhhtF2;Lf_YtRwA}`HX zwJ(`Aw^hw=df41sS1)v2Um0v(|9VTSN7hxLdqq1YnC~#Vx8RLb-ON?FR}%bOFCCfQ z=QT(5Cqw0;kPsV>?YR^9_bNP}ylcwI=N+H&-dS!-i`sRo^eNv@)#LH)$J5!uGV9L) Pa}$H7tDnm{r-UW|-DF3W literal 2401 zcmV-n37+1KwPRR?VQ zmcTuLdjlH*_X6$<{2RC)_yzFm^4~W|`p;@^!m0qay(zE{um|vH;MM~{{2llLa4~R! zq#qCbZg8^|18n~fG5Jjr^mo0z&nA9B>ihJs*Z*W1Gas4;7H*4<=C#oyy`xF z3A_t9UD9tC8DJs6w)XHp`zGbE+|!8Q|M+u6|%0~<^kAy3VRfRiPCXYedq8rt3hcscMaAWvJHWf7k( z>71cs4F+ucFyI{>9iImrFX{V32OrYT_5*;|bX=c!^TQ=|&26?LU7XVeQ=XbQl6_`9 zT0_7#+mx%6IfTU27SQ`j`dDATy*q6C5y0oBkcS-GCrSG0vKiRB0xu}{@psuJNpJ0& zP|rQz1o$+N<6hf8fX7I>ysM8+z_vpJzh3BI-A|r|{U!Z*^h2SMhn9DFtCoTHlJxNf zLEj!Y3&@jL+YP`rlJf6X>jV5HAYQq)Pe|IcI&vW(Ia1l#X?BXFIHHBk_JvbGUnc31 zGXu80fAPrmx7Ps=m-N@h&h8NITY`cvFuCiQ=)z|Ew!oKxZCg4!KvGV@GHcyo+j(|E z-0xF;5z_GBCaJf5U?Cx00YW06Q}fJ7ii24ZD?v&&AmpWKd80RLd;6yWej)J2zLm3` zAR$gBkAFc?>s*{eBc#Nbs)nhILY`(=L|u9Yt?MO4>-6Q z^lC{7O2#$;xbW9+x6E`aN#p--JI_xPji$vJJyufNLaaJ?+gk$P>YIBFIQQ-i)kjxI zO8B;9wxdV=1h_@jE==mgE@ZZI?;lj2l6dZrn(HLpv=S>~`-+w*>sU#rjry+v=Piv) z)3g^$8ZUzFc<*@erbURm|1=q*B3(eEsE{74ZBd%_%zmlZv?Un zP1`}zHH{t4{j6i*mq^MxyUc8F283*E(=*{~i?f?sxU-#jIzmI!elKZ^X$-jV=E$Z^ z`%516rgUmM`cfpxnvPg1R97J+mI!cAVJbfJ-ICQM8)vXihcl%e5KBtxpB+R(*Vvq`S<8c8ycb;@5LNNYWCv z<_@w`%&oj8~t$}Y;-~Ot+(@R&!b}|uZQwQ~1&MOhw4$%mfrX4kk#hZYS1L8@W z_F74=m=o|Jz`Lt&&yX}R8QT#Bj;PulEGZm(X0x5^a6w)}w&WSA#Dj-?M<9vf6!JyjfDs zm`j@pY4#O`tIK-X^d&+;9)S*$$OQZj+e~+Tef+9!9&@(Xx}x5KTXm& zAekq4Xw$N;loXG8-@(HkDxekpKDHGw#{NH|Ru=E{z zAkdZs+gegvaJ}#%^mSl6S;WXiwS04)q;a~|c7*?Lw)D4!q-bwT)+X_^tKYL z`rURMRFsys)a))z-E4})lQiu_+O-XE8v)7ji_W{&w5lT6d=!XuQ`^~+k|QzaL*VqvqL_cibAH2Yww*qNZ49qH1`CAFn^m-_Dm z+?5bNzZ8^=6XNrrx1DrNU3V3Z{K;e-B~1i0wpTA99sss?20lB*W9E&_QETPDLl?ky zoMcprFtJe;&=2bGZKvenGe8JZZ8-tSd~}vE_11V4&?zsNR@9PvwYQ`sr&rAe6tyIQ z*IS`C2yg+Nw{b}|m}04pJ7E>dmNqYCOHc0@d#q^mt@vQT1@w@@v^bg6a;!vQ+RK1c z7<3h;g&SnC2iZ)33+SPxhvDRzNCfa9rH7G(63?zbrH7*>EXAdfV7rc4bHzu+rC$NU zmYNoIBEo)1{?Ovm)OsGeR*FlTGhGMe!%4U&i;yR4E}QvC*Q3}D?@e|hI&?G1HrIrv ze3S%UPE-WG1O;>3!hjpcJOO(0un7R3&_`+p%sAvDQBaCT*PlNDXq$Mcp9=Ndea=7f z_!Myddi_Tp({`-XU#7GviL=o^p{zMwkzI3K|G)o?XTWh?XH8b@4zDu=GY8pfy{Nh&(5v$KexG^_qyTnfa>C z4(faF&4NVaArZYKq8H%Z{ zV<51kYDm?9HUeh=RSl^M(8l02K{5jh%lJjLQ!m@`(7FvU0SZg`Pa?vxVT%oc`@pgV zumXbRU?aHYcFD|#+6kxuZ8YwrIH-fR3eY`pttlwAt7!pY`~FsImK%}7aRi6yY%2n~ zht@LyQCX1&5Ga2rkyd_xnvhF9-zu+E<4&w-MH)cAyq0xlj*cfH5}TP--byE=a}RR; zvVcScnLwP1tyw2*m2XfKmx-uU(;rqLDI)0fsA1rLx>_e}m9NzEhMAKE zrKN;f&nV`odne7T7GagIw4h|NEW1%02J>_?>x8ZH6@aqtr3K`<+^23by?$?Hl*}X! z57OL=VGE96{lGf<%H?lSbXqEfDFOj`E+BS@~-(ygYU=%3v&r}|d`3Xt5>A&N=Xil~b=n_|$kbEqFe z;9je{!L5#S^*<%z)fO~b+1479s$!0-1&ttKbwibw>s@~7ubcTEZ%H3nRx9@y6nmhE z;7Ee9nWbC~R)hCfqopi0z?)qx5|@yjgMxV5d7lk0^#V>bby};4JD`!<0Te9Ct;R7i z$yvY*W6cI=0t#CKe7p|3H^EBJy)9;zAgwjukis4Q^8!{sEieGV4j4Olyscx}4Qus_ z$<1y-CFQ~kdV|JCMbNO~|Je6&-+gyF_wMt&E;#VGXP>p#@9e$TS$pmEL`f16n**bO z1JkuT;NL2jd;SIZHC|)&njB zW&)dZ`_>CS{|7Jwm?O!fUq}iAN5me$Bfz1BddlDUHDJ7?uZyTI1RN1wqfY{x7U`tK zwrhY>C3%gvC2a#o#O1)vfTwdW$-lrfNpspUswHqlY>=GAx$P)ii)|hNrbzmynGH>W zBf|He0#06wAVs=fAgSrVv;w}--@hU~_CVX&lBPGZqakoaTmanL0|1?vFiDc9_#mkZ z91)Ix-vqpV*G2I<9xdskTH^-+N5sa!r@(IOB59S)E4_J<^j9@UJ>WZli!#9eo&uD; zfMYZ0>qNzEk{l8C%K+er*a!Hm6U}v=xn0tw{yie>_-+`2c)QjNho1XM@{H}1THq%f zxnu&qRnip|T@i5-un6#y8A^FvlDDh_fisV;l@9<;BRv{;4%l`Gi3f~w{|HBfW8_mZ z8ZrntLGJ)80Y+x*tCgxnlFsa((h;#G@KfeBRu?!ydrRr%b3!XiGu`(n50|vMZ-gUa zDljjT@`{>>dal&RX0`A-4)>HfianTZ3Ew@3yTm$=!mhpM$2slC8nO+ZElNoxM zfxQhpB(vheYq(zj5pg!~P)3LPhJn8T_UuLAG}=c1PXk+IuyLhasqD!_&}}O;AEA7KL@-?&n;PiBf^96EO2lJ1N)|QFFUP$ zffoQD+U1ZH1}-Cx?%GR7#EB_kkn^x^NzVly$um2z>|@xLCnE)ieV&1*0CyF9u$|_G z*KkB^loEeuw9`QcZ6+J|AmHr|9&YtWA>fFxC-&wchjVIV+b9EjTj=d!w=Tcq&r(F# zIXUgKW2?8=#r?mXK&&JHmZ$oRF7yq0w5<^?$vM^IST1Qy1$Yv0UryS3S<5;R)K$Rj z5}Z>#lnIjNSAd5Bt1|}aO+QP?Io%Ho)tR%W^OlmX7C^t&e4ux~7#aJw< z&+}IU9|gQrCU8pjJ8~-1In_frQqrpffYS%x#vGpsy7s8Wk<-GG6Ls}WUnIIZ$Zj{~(b?{G=4*EVWa)Z%)^>so2;(fczbxej!Y zv?^P2e)yaog=%Ehd`b2jb)^-sHx`bwk6uThUj~kmh*%$(KZLPw(HHBbcYd>xtte~@xY9TxoOZdos5K?GpDD=>wk;_HoTj)7 zOeEv2FL1x1o<-CQACbsM?NztERZiBwTRjqmZGH zw}5LU`ODFfbOl@m?s6xu?XnVZJ}j6e>6wlws~*Y%Tm`;&^5o-zUAr{yOJD);uq6MT zMX~}{TNDwy08Rn>ayhcsy^lQouXvlKwk|;RzvKDxp`K3&-|;2sn=FJiO8y5=MCsvf SZPES!0000 Date: Sun, 16 Dec 2018 16:24:30 +0800 Subject: [PATCH 069/176] Format source. --- assets/css/main.css | 8 ++++---- assets/images/{cafe.png => cafe001.png} | Bin assets/images/{jazz.png => jazz001.png} | Bin assets/images/{rain.png => rain001.png} | Bin assets/images/{wind.png => wind001.png} | Bin 5 files changed, 4 insertions(+), 4 deletions(-) rename assets/images/{cafe.png => cafe001.png} (100%) rename assets/images/{jazz.png => jazz001.png} (100%) rename assets/images/{rain.png => rain001.png} (100%) rename assets/images/{wind.png => wind001.png} (100%) diff --git a/assets/css/main.css b/assets/css/main.css index 94e5a8c..e185e16 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2160,19 +2160,19 @@ img { } .noise-mode .sfx .effect[type="cafe001"] .avatar { - background-image: url("../images/cafe.png"); + background-image: url("../images/cafe001.png"); } .noise-mode .sfx .effect[type="jazz001"] .avatar { - background-image: url("../images/jazz.png"); + background-image: url("../images/jazz001.png"); } .noise-mode .sfx .effect[type="rain001"] .avatar { - background-image: url("../images/rain.png"); + background-image: url("../images/rain001.png"); } .noise-mode .sfx .effect[type="wind001"] .avatar { - background-image: url("../images/wind.png"); + background-image: url("../images/wind001.png"); } .noise-mode .sfx .effect .label { diff --git a/assets/images/cafe.png b/assets/images/cafe001.png similarity index 100% rename from assets/images/cafe.png rename to assets/images/cafe001.png diff --git a/assets/images/jazz.png b/assets/images/jazz001.png similarity index 100% rename from assets/images/jazz.png rename to assets/images/jazz001.png diff --git a/assets/images/rain.png b/assets/images/rain001.png similarity index 100% rename from assets/images/rain.png rename to assets/images/rain001.png diff --git a/assets/images/wind.png b/assets/images/wind001.png similarity index 100% rename from assets/images/wind.png rename to assets/images/wind001.png From 0641493cd9f5153a673c998c78c9a8f546bdd4c0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:29:33 +0800 Subject: [PATCH 070/176] Add i18n. --- _locales/en/messages.json | 16 ++++++++++++++++ _locales/zh_CN/messages.json | 16 ++++++++++++++++ _locales/zh_TW/messages.json | 16 ++++++++++++++++ js/noise.js | 8 ++++---- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d9acbe8..58312b2 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -493,6 +493,22 @@ "message": "Close" }, + "noise_mode_cafe001": { + "message": "CAFE" + }, + + "noise_mode_jazz001": { + "message": "JAZZ" + }, + + "noise_mode_rain001": { + "message": "RAIN" + }, + + "noise_mode_wind001": { + "message": "WIND" + }, + "version_title": { "message": "SimpTab is updated" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 41a1ed5..be18eae 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -493,6 +493,22 @@ "message": "关闭" }, + "noise_mode_cafe001": { + "message": "咖啡馆" + }, + + "noise_mode_jazz001": { + "message": "爵士乐" + }, + + "noise_mode_rain001": { + "message": "下雨天" + }, + + "noise_mode_wind001": { + "message": "风声" + }, + "version_title": { "message": "简 Tab 版本提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 654514d..eba1154 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -493,6 +493,22 @@ "message": "關閉" }, + "noise_mode_cafe001": { + "message": "咖啡館" + }, + + "noise_mode_jazz001": { + "message": "爵士樂" + }, + + "noise_mode_rain001": { + "message": "下雨天" + }, + + "noise_mode_wind001": { + "message": "風聲" + }, + "version_title": { "message": "簡 Tab 版本提示" }, diff --git a/js/noise.js b/js/noise.js index 06b4e18..23f6185 100644 --- a/js/noise.js +++ b/js/noise.js @@ -35,28 +35,28 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ]
    \
    \
    \ -
    CAFE
    \ +
    ' + i18n.GetLang( "noise_mode_cafe001" ) + '
    \
    \ ' + comps.Slider( 0, 100, 50, "cafe001" ) + '\
    \
    \
    \
    \ -
    JAZZ
    \ +
    ' + i18n.GetLang( "noise_mode_jazz001" ) + '
    \
    \ ' + comps.Slider( 0, 100, 50, "jazz001" ) + '\
    \
    \
    \
    \ -
    RAIN
    \ +
    ' + i18n.GetLang( "noise_mode_rain001" ) + '
    \
    \ ' + comps.Slider( 0, 100, 50, "rain001" ) + '\
    \
    \
    \
    \ -
    WIND
    \ +
    ' + i18n.GetLang( "noise_mode_wind001" ) + '
    \
    \ ' + comps.Slider( 0, 100, 50, "wind001" ) + '\
    \ From 5e2a2428e249474c9b96b6775469bf384ae5a590 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:36:39 +0800 Subject: [PATCH 071/176] Optimize UI logic. --- js/noise.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/noise.js b/js/noise.js index 23f6185..3363728 100644 --- a/js/noise.js +++ b/js/noise.js @@ -78,11 +78,11 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] if ( sounds[key] ) { pause( key ); $volume.css( "opacity", 0 ); - $parent.css({ "background-color": "initial", "opacity": 0.5 }); + $parent.removeAttr( "style" ).css({ "opacity": 0.5 }); } else { play( key, volume ); $volume.css( "opacity", 1 ); - $parent.css({ "background-color": colors[key], "opacity": 1 }); + $parent.removeAttr( "style" ).css({ "background-color": colors[key], "opacity": 1 }); } }); $( ".md-slider-root .cafe001" )[0].addEventListener( "slider", function( event ) { From 051d321925199336dcdb42b2fb996e79463b9d0b Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 16:52:32 +0800 Subject: [PATCH 072/176] Change wind to thunder. --- _locales/en/messages.json | 4 ++-- _locales/zh_CN/messages.json | 4 ++-- _locales/zh_TW/messages.json | 4 ++-- assets/css/main.css | 4 ++-- assets/images/thun001.png | Bin 0 -> 1593 bytes js/noise.js | 14 +++++++------- 6 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 assets/images/thun001.png diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 58312b2..63c7bc6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -505,8 +505,8 @@ "message": "RAIN" }, - "noise_mode_wind001": { - "message": "WIND" + "noise_mode_thun001": { + "message": "THUNDER" }, "version_title": { diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index be18eae..6b5bb40 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -505,8 +505,8 @@ "message": "下雨天" }, - "noise_mode_wind001": { - "message": "风声" + "noise_mode_thun001": { + "message": "雷声" }, "version_title": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index eba1154..a985d29 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -505,8 +505,8 @@ "message": "下雨天" }, - "noise_mode_wind001": { - "message": "風聲" + "noise_mode_thun001": { + "message": "雷聲" }, "version_title": { diff --git a/assets/css/main.css b/assets/css/main.css index e185e16..86a8eb6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2171,8 +2171,8 @@ img { background-image: url("../images/rain001.png"); } -.noise-mode .sfx .effect[type="wind001"] .avatar { - background-image: url("../images/wind001.png"); +.noise-mode .sfx .effect[type="thun001"] .avatar { + background-image: url("../images/thun001.png"); } .noise-mode .sfx .effect .label { diff --git a/assets/images/thun001.png b/assets/images/thun001.png new file mode 100644 index 0000000000000000000000000000000000000000..e017302adb1043acf3d59f074323086688033caa GIT binary patch literal 1593 zcmV-92FCe`P)6LIqbDmNJryRHhc2&e{h8k9iLj@_<3K0j?a_SOX z=LtuyK@Ledl=D=HibEP|M)}AiYajOAXWzZQz4ltiqn;PeKj*yD^L_7nr|*c*8R>I| zml?pH^&6kL;h7sA@dRuy59|(n8(1G$wfb2acm;SF_$%-y;BHAzjA&vk_Qpcm_J+Xe zz&=30mC`-HJm7jsE)}ZFH#T6~>jGy02f|oc|IfhpB;8*ZOo?1=z_ynFjt9;HmMt+> z$a6k$f}{@$`A1@_1=x1J%Nu}ij%2Nz`B7jmNiUU)lyQy>*!FV3LSVBp6ScXL+;))k zbZrfN1V;jFdnw>HV8~du8A`V5KIE*3gmqyp^N}YsfAlQVRG4;GA)djVb>(AXz*4 z;|suhz^hf~_D~gl_Y5m%Ljl_k&x^pCV>&z);%@>!1Ae(U;3a@}1#X=RZyU6clD2=p zuB`;{uYqG4bY`kl{TDbw(ly-%O8`F(WH9(NQj*Bjal2?yXLV4a2mC)ADw<^x{`wn+;KYz?GsZG&!+v`1gSwln6P2dvhHW#BkT zzv|U(JEdle3Va&}uwz1dk&w21G>{}U^xGceFjkiIFWdK38U> zE&U2a2C`fz+h49)$8nXF$loDpXWKgiw-*R3l(e1g*}x?Q{KHrl1n{ZV5^flC6MvsC z>A(^4#ZM*u(DtRkkqtPoFo5rz!VSg+lIGY>9iCL0`T*Kf(#^J?ZKxl(H-P^Mtlq%s zO)9OxkARD+WVjyiq@-7Dp9cJ7h|LeH`8$jK35U=wtOq{9MuPvFKTGna z9tQlT0mV^~h57Q5KD7NdutE*Jb0l40`vG9f8uHyDf6UA+DYrZUIKZ>0+ht7U5x-B; zwzf9_vRbV}n*h%M?~YkAp8~d(lqZ{yse3%kIw!C4<8CaNzP9X#Xu~g%SGg z#hJ*idRIwV-A+*N0$@ep_rSMmINA|8RMJ(2%|$;mH%i*ub{^SN!s^h)dApXB2w8;s zZZ>QmP%X6UB(n7-JvHR}y9vm|)bC#-PL}lZnmvAcin)@KEc?=8S2@)Se{MRJHXc@O$-Cow&hG9QI+3+MbiIS0@ehUsk_u9D%# zAW6R)=FC+5y$!$_`?|}*wUYLm3NR%$+5nvCC{t1>A)HWNq}wTRtSz240B8Qq930w1 z(kJzgFn!Og4ZxkH;BO`MX6m*su2^pyfYa?n@5YkSXiO_=1Mu3wo057n^|S!qIN)i4 rYJd|nfT#NnjqBgc4Uc<*(_Q`}z=s745Wlwe00000NkvXXu0mjf89N41 literal 0 HcmV?d00001 diff --git a/js/noise.js b/js/noise.js index 3363728..6f0d310 100644 --- a/js/noise.js +++ b/js/noise.js @@ -7,12 +7,12 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "cafe001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/cafe001.mp3", "jazz001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/jazz001.mp3", "rain001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/rain001.mp3", - "wind001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/wind001.mp3", + "thun001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/thun001.mp3", }, colors = { "cafe001": "#753F40", "jazz001": "#3D5AFE", "rain001": "#ff932b", - "wind001": "#f3294d", + "thun001": "#f3294d", }, sounds = {}; @@ -54,11 +54,11 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] ' + comps.Slider( 0, 100, 50, "rain001" ) + '\
    \
    \ -
    \ +
    \
    \ -
    ' + i18n.GetLang( "noise_mode_wind001" ) + '
    \ +
    ' + i18n.GetLang( "noise_mode_thun001" ) + '
    \
    \ - ' + comps.Slider( 0, 100, 50, "wind001" ) + '\ + ' + comps.Slider( 0, 100, 50, "thun001" ) + '\
    \
    \
    \ @@ -94,8 +94,8 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] $( ".md-slider-root .rain001" )[0].addEventListener( "slider", function( event ) { sounds[ "rain001" ] && ( sounds[ "rain001" ].volume = event.data / 100 ); }); - $( ".md-slider-root .wind001" )[0].addEventListener( "slider", function( event ) { - sounds[ "wind001" ] && ( sounds[ "wind001" ].volume = event.data / 100 ); + $( ".md-slider-root .thun001" )[0].addEventListener( "slider", function( event ) { + sounds[ "thun001" ] && ( sounds[ "thun001" ].volume = event.data / 100 ); }); } From cfac919b2bf72063496d05a2b852c4d36a01c4a1 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 16 Dec 2018 17:03:42 +0800 Subject: [PATCH 073/176] Remove 'simptab-background-state' limiting conditions. --- js/background.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/background.js b/js/background.js index ea87973..01a7f22 100644 --- a/js/background.js +++ b/js/background.js @@ -446,12 +446,12 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar UpdateBg: function( type ) { if ( type == "none" ) writePinBackground(); if ( type == "time" ) { - if ( localStorage[ "simptab-background-state" ] == "loading" || localStorage[ "simptab-background-state" ] == "pending" ) new Notify().Render( i18n.GetLang( "notify_refresh" ) ) - else { - localStorage[ "simptab-background-update" ] = "true"; - bgeffect( "add" ); - this.Get( true ); - } + //if ( localStorage[ "simptab-background-state" ] == "loading" || localStorage[ "simptab-background-state" ] == "pending" ) new Notify().Render( i18n.GetLang( "notify_refresh" ) ) + //else { + localStorage[ "simptab-background-update" ] = "true"; + bgeffect( "add" ); + this.Get( true ); + //} } } }; From 4b229354384704ca82b9cda092cc13bd432a5893 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 14:52:00 +0800 Subject: [PATCH 074/176] Fix noise close bug. --- js/noise.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/noise.js b/js/noise.js index 6f0d310..aa54ad6 100644 --- a/js/noise.js +++ b/js/noise.js @@ -101,13 +101,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] function open() { setTimeout( function(){ - $( ".noise-mode" ).css({ "transform": "translateY(0px)", "opacity": 1 }); + $( ".noise-mode" ).css({ "transform": "translateY(0px)", "opacity": 1, "pointer-events": "inherit" }); }, 10 ); } function close() { $( ".noise-mode .close" ).click( function( event ) { - $( ".noise-mode" ).css({ "transform": "translateY(100px)", "opacity": 0 }); + $( ".noise-mode" ).css({ "transform": "translateY(100px)", "opacity": 0, "pointer-events": "none" }); }); } From d60c1852e526fec853b4ee57488f77684a827bb5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 16:20:15 +0800 Subject: [PATCH 075/176] Add earth to controlbar and i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/i18n.js | 1 + js/setting.js | 2 +- main.html | 4 ++++ 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 63c7bc6..e621fb4 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -109,6 +109,10 @@ "message": "Not Change background" }, + "setting_background_earth": { + "message": "Earth every moment" + }, + "setting_background_position_center": { "message": "Align to the center" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 6b5bb40..8cb8693 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -109,6 +109,10 @@ "message": "只显示当前背景" }, + "setting_background_earth": { + "message": "地球每刻" + }, + "setting_background_position_center": { "message": "背景居中对齐" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index a985d29..1321f80 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -109,6 +109,10 @@ "message": "只顯示當前背景" }, + "setting_background_earth": { + "message": "地球每刻" + }, + "setting_background_position_center": { "message": "背景居中對齊" }, diff --git a/js/i18n.js b/js/i18n.js index 2f3c80c..c79df61 100644 --- a/js/i18n.js +++ b/js/i18n.js @@ -33,6 +33,7 @@ define([ "jquery" ], function( $ ) { $($( ".changestate" ).find("label")[0]).text( i18n( "setting_background_every_day" )); $($( ".changestate" ).find("label" )[1]).text( i18n( "setting_background_every_time" )); $($( ".changestate" ).find("label" )[2]).text( i18n( "setting_background_forever" )); + $($( ".changestate" ).find("label" )[3]).text( i18n( "setting_background_earth" )); $($( ".positionstate" ).find("label:first")).text( i18n( "setting_background_position_center" )); $($( ".positionstate" ).find("label" )[1]).text( i18n( "setting_background_position_corner" )); diff --git a/js/setting.js b/js/setting.js index ea466bf..7a7cc95 100644 --- a/js/setting.js +++ b/js/setting.js @@ -69,7 +69,7 @@ define([ "jquery", "waves", "i18n", "zen" ], function( $, Waves, i18n, zen ) { "changestate" : { value : getLS( "simptab-background-mode" ), type : "simptab-background-mode", - vals : [ "day", "time", "none" ], + vals : [ "day", "time", "none", "earth" ], default: 1 }, "positionstate" : { diff --git a/main.html b/main.html index f913c88..f51a634 100644 --- a/main.html +++ b/main.html @@ -58,6 +58,10 @@
    +
    + + +
    From e3d14e0772525b2b9c89c8116584a65b68e7b721 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 18:32:51 +0800 Subject: [PATCH 076/176] Add apis.Earth() logic. --- js/apis.js | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/js/apis.js b/js/apis.js index da11251..53af987 100644 --- a/js/apis.js +++ b/js/apis.js @@ -713,6 +713,45 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] } return { - Init: init + Init: init, + + Earth: function ( callback ) { + var size = 550, + urls = [ + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_0_0.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_0_1.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_1_0.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_1_1.png", + ], + poisition = [{ x:0, y: 0 },{ x:0, y: size },{ x:size, y: 0 },{ x:size, y: size }], + imgLoad = function( i, poisition, url, context ) { + var dtd = $.Deferred(), + img = new Image(); + img.src = url; + img.onload = function() { + context.drawImage( img, poisition.x, poisition.y, size, size ); + dtd.resolve( i ); + }; + return dtd; + }, + imgOnLoad = function ( result ) { + if ( result < urls.length - 1 ) { + i++; + imgLoad( i, poisition[i], urls[i], context ).done( imgOnLoad ); + } else complete(); + }, + complete = function() { + callback( canvas.toDataURL( "image/png" )); + }, + canvas, context, i = 0; + + canvas = document.createElement( "canvas" ); + canvas.width = size * 2; + canvas.height = size * 2; + context = canvas.getContext( "2d" ); + context.rect( 0 , 0 , canvas.width , canvas.height ); + + imgLoad( i, poisition[i], urls[i], context ).done( imgOnLoad ); + } }; }); From ebca44a48ca7d97f23db2e9ec955516c90d5032e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 18:33:55 +0800 Subject: [PATCH 077/176] Add change earth logic. --- assets/css/main.css | 6 ++++++ js/background.js | 26 ++++++++++++++++++++++++++ js/main.js | 1 + 3 files changed, 33 insertions(+) diff --git a/assets/css/main.css b/assets/css/main.css index 86a8eb6..60fd562 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -675,6 +675,12 @@ img { background-position: center center; } +.bgearth { + background-size: contain; + background-repeat: no-repeat; + background-color: black; +} + .bgmask::before { content: ''; position: absolute; diff --git a/js/background.js b/js/background.js index 01a7f22..3eb2e1f 100644 --- a/js/background.js +++ b/js/background.js @@ -29,6 +29,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar def.resolve(3); } else if ( setting.Mode( "changestate" ) == "none" ) { def.resolve(4); + } else if ( setting.Mode( "changestate" ) == "earth" ) { + def.resolve(4); } else if ( setting.Mode( "changestate" ) == "day" && !date.IsNewDay( date.Today() ) ) { def.resolve(4); } else if ( date.IsNewDay( date.Today() ) || ( !is_random && date.Today() != vo.cur.enddate ) ) { @@ -453,6 +455,30 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar this.Get( true ); //} } + }, + + Earth: function () { + apis.Earth( function ( base64 ) { + $( "body" ).css( "background-image", "url(" + base64 + ")" ) + .addClass( "bgearth" ); + files.DataURI( base64 ); + files + .Add( vo.constructor.BACKGROUND, files.DataURI() ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + vo.new.type = "earth"; + vo.new.hdurl = "http://himawari8.nict.go.jp/"; + vo.new.url = "http://himawari8.nict.go.jp/"; + vo.new.info = "http://himawari8.nict.go.jp/"; + vo.new.name = "himawari8.nict.go.jp"; + vo.new.favorite = -1; + vo.new.version = vo.cur.version; + vo.Set( vo.new ); + console.log( "======= Current background success.", vo ) + }); + }); } }; }); diff --git a/js/main.js b/js/main.js index b8403a6..0fff77f 100644 --- a/js/main.js +++ b/js/main.js @@ -91,6 +91,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "positionstate": controlbar.SetBgPosition( true ); break; case "changestate" : result == "none" && background.UpdateBg( result ); + result == "earth"&& background.Earth(); break; } }); From 27fa2293b94140f5b799ff5f89f240756035dd3e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 18:34:33 +0800 Subject: [PATCH 078/176] Add earth mode background image position logic. --- js/controlbar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/controlbar.js b/js/controlbar.js index f1dfb3b..7da2746 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -21,14 +21,16 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", if ( value == "mask" ) { var url = vo.cur.type == "default" ? vo.cur.hdurl : "filesystem:" + chrome.extension.getURL( "/" ) + "temporary/background.jpg", maxHeight = 800, - height = $( "body" ).height(); + height = $( "body" ).height(), + earth = vo.cur.type == "earth" ? "background-size: contain;background-repeat: no-repeat;background-color: black;" : ""; $( "body" ).addClass( "bgmask" ).prepend( '
    ' ); - $( "head" ).append( '' ); + $( "head" ).append( '' ); height <= maxHeight && $( ".bgmask-bg" ).find( "img" ).height( height - 300 ); } else { $( "body" ).removeClass( "bgmask" ).find( ".bgmask-bg" ).remove(); $( ".bgmask-filter" ).remove(); vo.cur.type == "default" || !value || value == "center" ? $( "body" ).addClass( "bgcenter" ) : $( "body" ).removeClass( "bgcenter" ); + vo.cur.type == "earth" && $( "body" ).addClass( "bgearth" ); } } From a514ff7fcccaa6b7866d1adb860a7030a3cc75a5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Mon, 17 Dec 2018 18:45:18 +0800 Subject: [PATCH 079/176] Add earth mode can't usage refresh logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/background.js | 13 +++++++------ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index e621fb4..ed47571 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -665,6 +665,10 @@ "message": "Set successful, please refresh." }, + "notify_eartch_mode": { + "message": "when Earth every moment mode, can't usage this feature." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 8cb8693..4d41547 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -665,6 +665,10 @@ "message": "已设置成功,刷新后生效。" }, + "notify_eartch_mode": { + "message": "「地球每刻」模式下无法使用此功能!" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 1321f80..beb8f5b 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -665,6 +665,10 @@ "message": "已設置成功,刷新後生效。" }, + "notify_eartch_mode": { + "message": "「地球每刻」模式下無法使用此功能!" + }, + "version_detail": { "message": "" }, diff --git a/js/background.js b/js/background.js index 3eb2e1f..8eb0bf3 100644 --- a/js/background.js +++ b/js/background.js @@ -448,12 +448,13 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar UpdateBg: function( type ) { if ( type == "none" ) writePinBackground(); if ( type == "time" ) { - //if ( localStorage[ "simptab-background-state" ] == "loading" || localStorage[ "simptab-background-state" ] == "pending" ) new Notify().Render( i18n.GetLang( "notify_refresh" ) ) - //else { - localStorage[ "simptab-background-update" ] = "true"; - bgeffect( "add" ); - this.Get( true ); - //} + if ( localStorage[ "simptab-background-mode" ] == "earth" ) { + new Notify().Render( 2, i18n.GetLang( "notify_eartch_mode" ) ); + } else { + localStorage[ "simptab-background-update" ] = "true"; + bgeffect( "add" ); + this.Get( true ); + } } }, From 448bec0758d636fc050a0d91199db7b582ef5043 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 09:56:54 +0800 Subject: [PATCH 080/176] Format source. --- js/apis.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/apis.js b/js/apis.js index 53af987..1080ee7 100644 --- a/js/apis.js +++ b/js/apis.js @@ -718,10 +718,10 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] Earth: function ( callback ) { var size = 550, urls = [ - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_0_0.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_0_1.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_1_0.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/17/095000_1_1.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_0_0.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_0_1.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_1_0.png", + "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_1_1.png", ], poisition = [{ x:0, y: 0 },{ x:0, y: size },{ x:size, y: 0 },{ x:size, y: size }], imgLoad = function( i, poisition, url, context ) { From 6563da51158b659be9061fd38f9cb3f5a2c53a85 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 10:06:16 +0800 Subject: [PATCH 081/176] Add changed earth mode notify i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/background.js | 2 ++ 4 files changed, 14 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ed47571..126762c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -669,6 +669,10 @@ "message": "when Earth every moment mode, can't usage this feature." }, + "notify_eartch_loading": { + "message": "Earth background loading..." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 4d41547..94dcb43 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -669,6 +669,10 @@ "message": "「地球每刻」模式下无法使用此功能!" }, + "notify_eartch_loading": { + "message": "获取中,请稍等..." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index beb8f5b..5fd2bf4 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -669,6 +669,10 @@ "message": "「地球每刻」模式下無法使用此功能!" }, + "notify_eartch_loading": { + "message": "獲取中,請稍等..." + }, + "version_detail": { "message": "" }, diff --git a/js/background.js b/js/background.js index 8eb0bf3..5e16682 100644 --- a/js/background.js +++ b/js/background.js @@ -459,7 +459,9 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }, Earth: function () { + var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); apis.Earth( function ( base64 ) { + notify.complete(); $( "body" ).css( "background-image", "url(" + base64 + ")" ) .addClass( "bgearth" ); files.DataURI( base64 ); From 9e3057cbbd2508ea3fe27cfc85d091493dd105f7 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 10:26:02 +0800 Subject: [PATCH 082/176] Add first usage earth mode notify logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/background.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 126762c..207a41c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -641,6 +641,10 @@ "message": "Scroll down to load more, background loading depending on your network speed." }, + "notify_earth_tips": { + "message": "Welcome to Earth every moment, earth background come from 向日葵-8號 ." + }, + "notify_zen_mode_tips_confirm": { "message": "Confirm" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 94dcb43..e7dce91 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -641,6 +641,10 @@ "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" }, + "notify_earth_tips": { + "message": "欢迎使用地球每刻,感谢 向日葵-8號 提供,详细请看 地球每刻 。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 5fd2bf4..a9607d2 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -641,6 +641,10 @@ "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" }, + "notify_earth_tips": { + "message": "歡迎使用地球每刻,感謝 向日葵-8號 提供,詳細請看 地球每刻 。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/js/background.js b/js/background.js index 5e16682..74dd3bc 100644 --- a/js/background.js +++ b/js/background.js @@ -459,6 +459,10 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }, Earth: function () { + localStorage["simptab-earth-notify"] != "false" && + new Notify().Render({ content: i18n.GetLang( "notify_earth_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + localStorage["simptab-earth-notify"] = false; + }}); var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); apis.Earth( function ( base64 ) { notify.complete(); From 4adeca61ca5f874048cb8e0e8afd32b78e4cc2aa Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 10:33:12 +0800 Subject: [PATCH 083/176] Fix earth mode vo data structure error bug. --- js/background.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/background.js b/js/background.js index 74dd3bc..03549e2 100644 --- a/js/background.js +++ b/js/background.js @@ -481,6 +481,9 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar vo.new.info = "http://himawari8.nict.go.jp/"; vo.new.name = "himawari8.nict.go.jp"; vo.new.favorite = -1; + vo.new.pin = -1; + vo.new.dislike = -1; + vo.new.enddate = date.Now(); vo.new.version = vo.cur.version; vo.Set( vo.new ); console.log( "======= Current background success.", vo ) From 1488f143586fc963c4c601592a934cac34c516d1 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 14:04:08 +0800 Subject: [PATCH 084/176] Optimize earth image url. --- js/apis.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/apis.js b/js/apis.js index 1080ee7..8650a1b 100644 --- a/js/apis.js +++ b/js/apis.js @@ -718,10 +718,10 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] Earth: function ( callback ) { var size = 550, urls = [ - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_0_0.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_0_1.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_1_0.png", - "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/2d/550/2018/12/18/012000_1_1.png", + "https://simptab.herokuapp.com/earth/0_0.png", + "https://simptab.herokuapp.com/earth/0_1.png", + "https://simptab.herokuapp.com/earth/1_0.png", + "https://simptab.herokuapp.com/earth/1_1.png", ], poisition = [{ x:0, y: 0 },{ x:0, y: size },{ x:size, y: 0 },{ x:size, y: size }], imgLoad = function( i, poisition, url, context ) { From 9cc5008339d5c3d1e4b4b2cfdc2ce7ea5291fdff Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 16:01:16 +0800 Subject: [PATCH 085/176] Format source. --- js/background.js | 51 +++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/js/background.js b/js/background.js index 03549e2..72f3b5b 100644 --- a/js/background.js +++ b/js/background.js @@ -464,31 +464,34 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar localStorage["simptab-earth-notify"] = false; }}); var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); - apis.Earth( function ( base64 ) { - notify.complete(); - $( "body" ).css( "background-image", "url(" + base64 + ")" ) - .addClass( "bgearth" ); - files.DataURI( base64 ); - files - .Add( vo.constructor.BACKGROUND, files.DataURI() ) - .progress( function( result ) { console.log( "Write process:", result ); }) - .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { - console.log( "Write completed: ", result ); - vo.new.type = "earth"; - vo.new.hdurl = "http://himawari8.nict.go.jp/"; - vo.new.url = "http://himawari8.nict.go.jp/"; - vo.new.info = "http://himawari8.nict.go.jp/"; - vo.new.name = "himawari8.nict.go.jp"; - vo.new.favorite = -1; - vo.new.pin = -1; - vo.new.dislike = -1; - vo.new.enddate = date.Now(); - vo.new.version = vo.cur.version; - vo.Set( vo.new ); - console.log( "======= Current background success.", vo ) + var getEarth = function () { + apis.Earth( function ( base64 ) { + notify.complete(); + $( "body" ).css( "background-image", "url(" + base64 + ")" ) + .addClass( "bgearth" ); + files.DataURI( base64 ); + files + .Add( vo.constructor.BACKGROUND, files.DataURI() ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + vo.new.type = "earth"; + vo.new.hdurl = "http://himawari8.nict.go.jp/"; + vo.new.url = "http://himawari8.nict.go.jp/"; + vo.new.info = "http://himawari8.nict.go.jp/"; + vo.new.name = "himawari8.nict.go.jp"; + vo.new.favorite = -1; + vo.new.pin = -1; + vo.new.dislike = -1; + vo.new.enddate = date.Now(); + vo.new.version = vo.cur.version; + vo.Set( vo.new ); + console.log( "======= Current background success.", vo ) + }); }); - }); + }; + getEarth(); } }; }); From 06a67ea65080b81f49de16d68293b918cb67c75f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 16:13:38 +0800 Subject: [PATCH 086/176] Optimize call earth api count. --- js/background.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/background.js b/js/background.js index 72f3b5b..3dff9b9 100644 --- a/js/background.js +++ b/js/background.js @@ -459,6 +459,10 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }, Earth: function () { + if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 9000 ) { + new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); + return; + } localStorage["simptab-earth-notify"] != "false" && new Notify().Render({ content: i18n.GetLang( "notify_earth_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ localStorage["simptab-earth-notify"] = false; From 7b635a85bd93667debfa3acb8784172ad5f17a30 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 16:33:01 +0800 Subject: [PATCH 087/176] Add auto call earth api logic. --- js/background.js | 3 +++ js/main.js | 3 +++ js/message.js | 1 + 3 files changed, 7 insertions(+) diff --git a/js/background.js b/js/background.js index 3dff9b9..d1241d7 100644 --- a/js/background.js +++ b/js/background.js @@ -30,6 +30,9 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } else if ( setting.Mode( "changestate" ) == "none" ) { def.resolve(4); } else if ( setting.Mode( "changestate" ) == "earth" ) { + if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate > 9000 ) { + message.Publish( message.TYPE.UPDATE_EARTH ); + } def.resolve(4); } else if ( setting.Mode( "changestate" ) == "day" && !date.IsNewDay( date.Today() ) ) { def.resolve(4); diff --git a/js/main.js b/js/main.js index 0fff77f..af3c46a 100644 --- a/js/main.js +++ b/js/main.js @@ -121,6 +121,9 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " message.Subscribe( message.TYPE.UPDATE_CONTROLBAR, function( event ) { controlbar.Update( event.data.url, event.data.info ); }); + message.Subscribe( message.TYPE.UPDATE_EARTH, function() { + background.Earth(); + }); chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) { result && bookmarks.Render( options.Storage.db.search ); diff --git a/js/message.js b/js/message.js index bb8ad3d..6b0e40e 100644 --- a/js/message.js +++ b/js/message.js @@ -18,6 +18,7 @@ define([ "jquery" ], function( $ ) { "OPEN_QUICKBAR" : "OPEN_QUICKBAR", "OPEN_ZENMODE" : "OPEN_ZENMODE", "OPEN_NOISE" : "OPEN_NOISE", + "UPDATE_EARTH" : "UPDATE_EARTH", }, Subscribe: subscribe, Publish : publish From bf44b4dde3d88042e1c0ecbf571300ba24df8964 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 16:55:01 +0800 Subject: [PATCH 088/176] Format source. --- js/background.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index d1241d7..b6f456c 100644 --- a/js/background.js +++ b/js/background.js @@ -462,14 +462,14 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }, Earth: function () { - if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 9000 ) { - new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); - return; - } localStorage["simptab-earth-notify"] != "false" && new Notify().Render({ content: i18n.GetLang( "notify_earth_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ localStorage["simptab-earth-notify"] = false; }}); + if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 9000 ) { + new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); + return; + } var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); var getEarth = function () { apis.Earth( function ( base64 ) { From 74f61510137e48546838bd4432c46b52d6c37da5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:23:59 +0800 Subject: [PATCH 089/176] Optimize call earth logic. --- js/background.js | 10 ++++------ js/main.js | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/background.js b/js/background.js index b6f456c..c176daf 100644 --- a/js/background.js +++ b/js/background.js @@ -30,9 +30,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } else if ( setting.Mode( "changestate" ) == "none" ) { def.resolve(4); } else if ( setting.Mode( "changestate" ) == "earth" ) { - if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate > 9000 ) { - message.Publish( message.TYPE.UPDATE_EARTH ); - } + message.Publish( message.TYPE.UPDATE_EARTH ); def.resolve(4); } else if ( setting.Mode( "changestate" ) == "day" && !date.IsNewDay( date.Today() ) ) { def.resolve(4); @@ -461,13 +459,13 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } }, - Earth: function () { + Earth: function( is_notify ) { localStorage["simptab-earth-notify"] != "false" && new Notify().Render({ content: i18n.GetLang( "notify_earth_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ localStorage["simptab-earth-notify"] = false; }}); - if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 9000 ) { - new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); + if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 10000 ) { + is_notify && new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); return; } var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); diff --git a/js/main.js b/js/main.js index af3c46a..02b849f 100644 --- a/js/main.js +++ b/js/main.js @@ -91,7 +91,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "positionstate": controlbar.SetBgPosition( true ); break; case "changestate" : result == "none" && background.UpdateBg( result ); - result == "earth"&& background.Earth(); + result == "earth"&& background.Earth( true ); break; } }); From f409ae3d92f59fce5ed02f297ace61e5ec7eb584 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:25:02 +0800 Subject: [PATCH 090/176] Format source. --- js/background.js | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/js/background.js b/js/background.js index c176daf..a6aee42 100644 --- a/js/background.js +++ b/js/background.js @@ -468,33 +468,33 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar is_notify && new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); return; } - var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }); - var getEarth = function () { - apis.Earth( function ( base64 ) { - notify.complete(); - $( "body" ).css( "background-image", "url(" + base64 + ")" ) - .addClass( "bgearth" ); - files.DataURI( base64 ); - files - .Add( vo.constructor.BACKGROUND, files.DataURI() ) - .progress( function( result ) { console.log( "Write process:", result ); }) - .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { - console.log( "Write completed: ", result ); - vo.new.type = "earth"; - vo.new.hdurl = "http://himawari8.nict.go.jp/"; - vo.new.url = "http://himawari8.nict.go.jp/"; - vo.new.info = "http://himawari8.nict.go.jp/"; - vo.new.name = "himawari8.nict.go.jp"; - vo.new.favorite = -1; - vo.new.pin = -1; - vo.new.dislike = -1; - vo.new.enddate = date.Now(); - vo.new.version = vo.cur.version; - vo.Set( vo.new ); - console.log( "======= Current background success.", vo ) + var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }), + getEarth = function () { + apis.Earth( function ( base64 ) { + notify.complete(); + $( "body" ).css( "background-image", "url(" + base64 + ")" ) + .addClass( "bgearth" ); + files.DataURI( base64 ); + files + .Add( vo.constructor.BACKGROUND, files.DataURI() ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + vo.new.type = "earth"; + vo.new.hdurl = "http://himawari8.nict.go.jp/"; + vo.new.url = "http://himawari8.nict.go.jp/"; + vo.new.info = "http://himawari8.nict.go.jp/"; + vo.new.name = "himawari8.nict.go.jp"; + vo.new.favorite = -1; + vo.new.pin = -1; + vo.new.dislike = -1; + vo.new.enddate = date.Now(); + vo.new.version = vo.cur.version; + vo.Set( vo.new ); + console.log( "======= Current background success.", vo ) + }); }); - }); }; getEarth(); } From fa917b4f4a7ca65f19b801b1e3f165bcab3bf37a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:30:13 +0800 Subject: [PATCH 091/176] Add earth mode notify i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 6 +++++- _locales/zh_TW/messages.json | 6 +++++- js/background.js | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 207a41c..8b5013f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -677,6 +677,10 @@ "message": "Earth background loading..." }, + "notify_eartch_update_failed": { + "message": "Update background image only once every hour, don't call it many times." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index e7dce91..83ff256 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -674,7 +674,11 @@ }, "notify_eartch_loading": { - "message": "获取中,请稍等..." + "message": "地球影像获取中,请稍等..." + }, + + "notify_eartch_update_failed": { + "message": "此功能每隔一小时才会刷新一次,请勿多次调用。" }, "version_detail": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index a9607d2..308b168 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -674,7 +674,11 @@ }, "notify_eartch_loading": { - "message": "獲取中,請稍等..." + "message": "地球影像獲取中,請稍等..." + }, + + "notify_eartch_update_failed": { + "message": "此功能每隔一小時才會刷新一次,請勿多次調用。" }, "version_detail": { diff --git a/js/background.js b/js/background.js index a6aee42..40cf652 100644 --- a/js/background.js +++ b/js/background.js @@ -465,7 +465,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar localStorage["simptab-earth-notify"] = false; }}); if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 10000 ) { - is_notify && new Notify().Render( "此功能每隔一小时才会刷新一次,请勿多次调用。" ); + is_notify && new Notify().Render( i18n.GetLang( "notify_eartch_update_failed" ) ); return; } var notify = new Notify().Render({ content: i18n.GetLang( "notify_eartch_loading" ), state: "loading" }), From 9521705f6925d17e45626d687d92adfaf9a69d00 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:35:05 +0800 Subject: [PATCH 092/176] Optimize earth mode vo logic. --- js/apis.js | 10 ++++++++++ js/background.js | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/apis.js b/js/apis.js index 8650a1b..7537073 100644 --- a/js/apis.js +++ b/js/apis.js @@ -741,6 +741,16 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] } else complete(); }, complete = function() { + vo.new.type = "earth"; + vo.new.hdurl = "http://himawari8.nict.go.jp/"; + vo.new.url = "http://himawari8.nict.go.jp/"; + vo.new.info = "http://himawari8.nict.go.jp/"; + vo.new.name = "himawari8.nict.go.jp"; + vo.new.favorite = -1; + vo.new.pin = -1; + vo.new.dislike = -1; + vo.new.enddate = date.Now(); + vo.new.version = vo.cur.version; callback( canvas.toDataURL( "image/png" )); }, canvas, context, i = 0; diff --git a/js/background.js b/js/background.js index 40cf652..1859c60 100644 --- a/js/background.js +++ b/js/background.js @@ -481,16 +481,6 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function( result ) { console.log( "Write completed: ", result ); - vo.new.type = "earth"; - vo.new.hdurl = "http://himawari8.nict.go.jp/"; - vo.new.url = "http://himawari8.nict.go.jp/"; - vo.new.info = "http://himawari8.nict.go.jp/"; - vo.new.name = "himawari8.nict.go.jp"; - vo.new.favorite = -1; - vo.new.pin = -1; - vo.new.dislike = -1; - vo.new.enddate = date.Now(); - vo.new.version = vo.cur.version; vo.Set( vo.new ); console.log( "======= Current background success.", vo ) }); From c23ae155151275c01c473a1c5825f2e42beaba28 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:47:11 +0800 Subject: [PATCH 093/176] Optimize change mode logic. --- js/background.js | 2 ++ js/main.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index 1859c60..35bc67e 100644 --- a/js/background.js +++ b/js/background.js @@ -456,6 +456,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar bgeffect( "add" ); this.Get( true ); } + $( "body" ).removeClass( "bgearth" ); } }, @@ -482,6 +483,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar .done( function( result ) { console.log( "Write completed: ", result ); vo.Set( vo.new ); + localStorage[ "simptab-background-position" ] == "mask" && new Notify().Render( "刷新后生效!" ); console.log( "======= Current background success.", vo ) }); }); diff --git a/js/main.js b/js/main.js index 02b849f..2ab5681 100644 --- a/js/main.js +++ b/js/main.js @@ -48,7 +48,7 @@ requirejs.config({ }); // main -requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options", "noise" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options, noise ) { +requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options", "noise", "vo" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options, noise, vo ) { progress.Init(); @@ -92,6 +92,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "changestate" : result == "none" && background.UpdateBg( result ); result == "earth"&& background.Earth( true ); + result == "time" && vo.cur.type == "earth" && background.UpdateBg( result ); break; } }); From 87d633bc2548718f2ecb75f95b17e37435defd96 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:51:19 +0800 Subject: [PATCH 094/176] Format source. --- js/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index 35bc67e..3bc1b2d 100644 --- a/js/background.js +++ b/js/background.js @@ -483,7 +483,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar .done( function( result ) { console.log( "Write completed: ", result ); vo.Set( vo.new ); - localStorage[ "simptab-background-position" ] == "mask" && new Notify().Render( "刷新后生效!" ); + localStorage[ "simptab-background-position" ] == "mask" && new Notify().Render( i18n.GetLang( "notify_carousel" ) ); console.log( "======= Current background success.", vo ) }); }); From 16b4fbaec3f87ed0d6d4698dba6d89d21844d7f5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 18 Dec 2018 18:52:39 +0800 Subject: [PATCH 095/176] Optimize earth mode can't usage bg manage logic. --- js/manage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/manage.js b/js/manage.js index 64934e4..744e163 100644 --- a/js/manage.js +++ b/js/manage.js @@ -144,6 +144,10 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", } function setBackground( url, name, new_vo ) { + if ( localStorage[ "simptab-background-mode" ] == "earth" ) { + new Notify().Render( 2, i18n.GetLang( "notify_eartch_mode" ) ); + return; + } // set vo.cur, include: favorite, subscribe var type = new_vo == undefined ? "favorite" : "subscribe"; // when new_vo is undefined is favorite call From 07756f0a4e3b42ea438a397391aaf18e69ffdf53 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 13:33:13 +0800 Subject: [PATCH 096/176] Fix earth mode can be usage refresh bug. --- js/background.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/background.js b/js/background.js index 3bc1b2d..2dfa8e0 100644 --- a/js/background.js +++ b/js/background.js @@ -447,6 +447,10 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar Waves.attach( '.icon', ['waves-circle'] ); }, UpdateBg: function( type ) { + if ( vo.cur.type == "earth" ) { + new Notify().Render( i18n.GetLang( "notify_eartch_mode" ) ); + return; + } if ( type == "none" ) writePinBackground(); if ( type == "time" ) { if ( localStorage[ "simptab-background-mode" ] == "earth" ) { From 4067c7828a5b445b0843fe3a810ece8db532792f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 13:35:01 +0800 Subject: [PATCH 097/176] Fix clock position bug. --- assets/css/main.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 60fd562..a1718ea 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2202,10 +2202,6 @@ img { .controlbar { zoom: .9; } - - .clock { - right: 60px; - } } /* @@ -2215,10 +2211,6 @@ img { .controlbar { zoom: .8; } - - .clock { - right: 50px; - } } @media screen and (min-height:820px) { From e523d135e8314ba1891e7888be3eecf160602167 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 13:44:05 +0800 Subject: [PATCH 098/176] Fix earth mode changed logic bug. --- js/background.js | 4 ++-- js/main.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index 2dfa8e0..ffcd1cb 100644 --- a/js/background.js +++ b/js/background.js @@ -446,8 +446,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar vo.cur.type != "upload" && vo.cur.favorite == -1 && controlbar.SetDislikeState( is_pinned ); Waves.attach( '.icon', ['waves-circle'] ); }, - UpdateBg: function( type ) { - if ( vo.cur.type == "earth" ) { + UpdateBg: function( type, is_refresh ) { + if ( is_refresh && vo.cur.type == "earth" ) { new Notify().Render( i18n.GetLang( "notify_eartch_mode" ) ); return; } diff --git a/js/main.js b/js/main.js index 2ab5681..bd332c4 100644 --- a/js/main.js +++ b/js/main.js @@ -81,7 +81,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "favorite": background.Favorite( result ); break; case "dislike" : background.Dislike( result ); break; case "pin" : background.Pin( result ); break; - case "refresh" : background.UpdateBg( result ); break; + case "refresh" : background.UpdateBg( result, true ); break; } }); setting.Listen( function( type, result ) { @@ -92,7 +92,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "changestate" : result == "none" && background.UpdateBg( result ); result == "earth"&& background.Earth( true ); - result == "time" && vo.cur.type == "earth" && background.UpdateBg( result ); + result == "time" && background.UpdateBg( result ); break; } }); From a06c4cf4fcda3443874bada6ab5575a5c24867c0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 14:46:31 +0800 Subject: [PATCH 099/176] Format source. --- js/background.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/background.js b/js/background.js index ffcd1cb..71e7548 100644 --- a/js/background.js +++ b/js/background.js @@ -405,6 +405,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar adapter.bind( null, i, filelist[i].name.replace( /\.(jpg|jpge|png|gif|bmp)$/ig, "" ) )(); } }, + Dislike: function( type ) { try { var dislikelist = JSON.parse( localStorage["simptab-dislike"] || "[]" ), @@ -428,6 +429,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar console.error( "background.Dislike(), Parse 'simptab-dislike' error.", error ); } }, + Pin: function( is_pinned ) { console.log("Current background is pinned? ", is_pinned) if ( is_pinned ) { @@ -446,6 +448,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar vo.cur.type != "upload" && vo.cur.favorite == -1 && controlbar.SetDislikeState( is_pinned ); Waves.attach( '.icon', ['waves-circle'] ); }, + UpdateBg: function( type, is_refresh ) { if ( is_refresh && vo.cur.type == "earth" ) { new Notify().Render( i18n.GetLang( "notify_eartch_mode" ) ); From 07008d2d5984469df7f0cd47b05bf021a1e5140c Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 14:47:48 +0800 Subject: [PATCH 100/176] Format source. --- js/background.js | 2 +- js/main.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index 71e7548..9479c8e 100644 --- a/js/background.js +++ b/js/background.js @@ -449,7 +449,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar Waves.attach( '.icon', ['waves-circle'] ); }, - UpdateBg: function( type, is_refresh ) { + Update: function( type, is_refresh ) { if ( is_refresh && vo.cur.type == "earth" ) { new Notify().Render( i18n.GetLang( "notify_eartch_mode" ) ); return; diff --git a/js/main.js b/js/main.js index bd332c4..b0c82c8 100644 --- a/js/main.js +++ b/js/main.js @@ -81,7 +81,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "favorite": background.Favorite( result ); break; case "dislike" : background.Dislike( result ); break; case "pin" : background.Pin( result ); break; - case "refresh" : background.UpdateBg( result, true ); break; + case "refresh" : background.Update( result, true ); break; } }); setting.Listen( function( type, result ) { @@ -90,9 +90,9 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " case "clockstate" : date.Toggle( result ); break; case "positionstate": controlbar.SetBgPosition( true ); break; case "changestate" : - result == "none" && background.UpdateBg( result ); + result == "none" && background.Update( result ); result == "earth"&& background.Earth( true ); - result == "time" && background.UpdateBg( result ); + result == "time" && background.Update( result ); break; } }); From 6eda50682708463c45ed57bed7cd3225baf3d2ec Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 14:48:34 +0800 Subject: [PATCH 101/176] Format source. --- js/background.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 9479c8e..69a8d43 100644 --- a/js/background.js +++ b/js/background.js @@ -480,8 +480,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar getEarth = function () { apis.Earth( function ( base64 ) { notify.complete(); - $( "body" ).css( "background-image", "url(" + base64 + ")" ) - .addClass( "bgearth" ); + $( "body" ).css( "background-image", "url(" + base64 + ")" ).addClass( "bgearth" ); files.DataURI( base64 ); files .Add( vo.constructor.BACKGROUND, files.DataURI() ) From 0b9d590345bcb15cbd7c2960fe34517ad52275cc Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 19 Dec 2018 16:26:20 +0800 Subject: [PATCH 102/176] Add history logic. --- js/background.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/background.js b/js/background.js index 69a8d43..ad521ca 100644 --- a/js/background.js +++ b/js/background.js @@ -116,6 +116,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar progress.Set( "loading" ); files.GetDataURI( url ).then( function( result ) { + sessionStorage.setItem( "base64", result ); localStorage[ "simptab-background-update" ] == "true" && files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) .progress( function( result ) { @@ -176,6 +177,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar isPinTimeout() ? vo.Set( vo.new ) : writePinBackground(); localStorage[ "simptab-background-update" ] == "true" && updateBackground(); console.log( "======= New Background Obj is ", vo ); + localStorage[ "simptab-background-mode" ] == "time" && history(); } } @@ -258,6 +260,21 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } } + function history() { + var MAX = 5, + history = JSON.parse( localStorage[ "simptab-history" ] || '{"pointer":-1, "items":[]}' ); + history.pointer++; + history.items[history.pointer % MAX ] = vo.new; + localStorage[ "simptab-history" ] = JSON.stringify( history ); + files + .SaveBgfromURI( "history" + history.pointer % MAX, sessionStorage.getItem( "base64" ) ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "History background saved complete." ) + }); + } + return { Get: function( is_random ) { From 0fd2905a0f02dd86e39d045dbc4191c3e7e89c9a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 20 Dec 2018 11:05:34 +0800 Subject: [PATCH 103/176] Add arrow left and right shortcuts logic. --- js/background.js | 4 ++++ js/main.js | 3 +++ js/message.js | 1 + js/shortcuts.js | 12 +++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index ad521ca..a326fb7 100644 --- a/js/background.js +++ b/js/background.js @@ -512,6 +512,10 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }); }; getEarth(); + }, + + History: function ( type ) { + console.log( "adsfadsf", type ) } }; }); diff --git a/js/main.js b/js/main.js index b0c82c8..a7f5b1a 100644 --- a/js/main.js +++ b/js/main.js @@ -125,6 +125,9 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " message.Subscribe( message.TYPE.UPDATE_EARTH, function() { background.Earth(); }); + message.Subscribe( message.TYPE.HISTORY, function( event ) { + background.History( event.data ); + }); chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) { result && bookmarks.Render( options.Storage.db.search ); diff --git a/js/message.js b/js/message.js index 6b0e40e..fcaad66 100644 --- a/js/message.js +++ b/js/message.js @@ -19,6 +19,7 @@ define([ "jquery" ], function( $ ) { "OPEN_ZENMODE" : "OPEN_ZENMODE", "OPEN_NOISE" : "OPEN_NOISE", "UPDATE_EARTH" : "UPDATE_EARTH", + "HISTORY" : "HISTORY", }, Subscribe: subscribe, Publish : publish diff --git a/js/shortcuts.js b/js/shortcuts.js index c9b0c07..90cf83d 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -46,6 +46,8 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f { short: "z", long: "topsites" }, { short: "c", long: "zenmode" }, { short: "w", long: "noise" }, + { short: "left", long: "previous" }, + { short: "right", long: "next" }, ]; Object.defineProperties( Keys.prototype, { @@ -126,7 +128,13 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f message.Publish( message.TYPE.OPEN_ZENMODE ); break; case "w": - message.Publish( message.TYPE.OPEN_NOISE ); + message.Publish( message.TYPE.OPEN_NOISE ); + break; + case "left": + message.Publish( message.TYPE.HISTORY, combo ); + break; + case "right": + message.Publish( message.TYPE.HISTORY, combo ); break; } }); @@ -192,6 +200,8 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f function createKeymapTmpl( title, map, prefix ) { var html = ""; $.each( map, function( idx, shortcut ) { + shortcut.short == "left" && ( shortcut.short = "←" ); + shortcut.short == "right" && ( shortcut.short = "→" ); var key = shortcut.short, desc = i18n.GetLang( prefix + shortcut.long ), tmpl = '
    ' + key + '
    ' + desc + '
    '; From 0f4258c553117e9d0d5941c0b64eed1de466b2a0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 20 Dec 2018 14:51:25 +0800 Subject: [PATCH 104/176] Add change history logic. --- js/background.js | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index a326fb7..0c6f7f5 100644 --- a/js/background.js +++ b/js/background.js @@ -515,7 +515,40 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar }, History: function ( type ) { - console.log( "adsfadsf", type ) + var MAX = 5, + idx = !sessionStorage.getItem( "pointer" ) ? MAX : sessionStorage.getItem( "pointer" ), + history = JSON.parse( localStorage[ "simptab-history" ] ), + saveImg = function( url, info ) { + files.GetDataURI( url ).then( function( result ) { + files.DataURI( result ); + files.Add( vo.constructor.BACKGROUND, result ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); + console.log( "======= Current background download success.", vo ) + }); + }); + }; + type == "left" ? idx-- : idx++; + if ( idx < 0 ) { + idx = 0; + new Notify().Render( "当前已经是最后一张了。" ); + sessionStorage.setItem( "pointer", idx ); + return; + } + if ( idx > 4 ) { + idx = 4; + new Notify().Render( "当前已经是最新一张了。" ); + sessionStorage.setItem( "pointer", idx ); + return; + } + console.log( "sadfasdf", idx ) + var item = history.items[ idx ], + url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history' + idx + '.jpg'; + saveImg( url, item.info ); + sessionStorage.setItem( "pointer", idx ); } }; }); From e23c9d8af3b84dd374da968d44e9b88c1d202e45 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 14:30:55 +0800 Subject: [PATCH 105/176] Add DeleteAny() method. --- js/files.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/files.js b/js/files.js index d2db194..0339b91 100644 --- a/js/files.js +++ b/js/files.js @@ -165,6 +165,14 @@ define([ "jquery", "vo" ], function( $, vo ) { }, errorBack ); }, + DeleteAny: function ( url, callback, errorBack ) { + fs.root.getFile( url , { create: false }, function( fileEntry ) { + fileEntry.remove( function() { + callback( url ); + }, errorBack ); + }, errorBack ); + }, + List: function( callback ) { fs.root.getDirectory( FOLDER_NAME, {}, function( dirEntry ) { var dirReader = dirEntry.createReader(); From 83ac0d752e5cd9f843fe42b51bb0882a1251865d Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 14:31:35 +0800 Subject: [PATCH 106/176] Optimize left/right history logic. --- js/background.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/js/background.js b/js/background.js index 0c6f7f5..73235ed 100644 --- a/js/background.js +++ b/js/background.js @@ -262,12 +262,19 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar function history() { var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] || '{"pointer":-1, "items":[]}' ); - history.pointer++; - history.items[history.pointer % MAX ] = vo.new; + history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), + idx = vo.new.enddate; + if ( history.length == MAX ) { + var del = history[0].enddate; + history = history.slice( 1 ); + files.DeleteAny( "history-" + del + ".jpg", function( url ) { + console.log( "History old background removed complete.", url ) + }); + } + history.push( vo.new ); localStorage[ "simptab-history" ] = JSON.stringify( history ); files - .SaveBgfromURI( "history" + history.pointer % MAX, sessionStorage.getItem( "base64" ) ) + .SaveBgfromURI( "history-" + vo.new.enddate, sessionStorage.getItem( "base64" ) ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function( result ) { @@ -516,8 +523,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar History: function ( type ) { var MAX = 5, - idx = !sessionStorage.getItem( "pointer" ) ? MAX : sessionStorage.getItem( "pointer" ), history = JSON.parse( localStorage[ "simptab-history" ] ), + idx = !sessionStorage.getItem( "pointer" ) ? MAX : sessionStorage.getItem( "pointer" ), saveImg = function( url, info ) { files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); @@ -544,9 +551,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar sessionStorage.setItem( "pointer", idx ); return; } - console.log( "sadfasdf", idx ) - var item = history.items[ idx ], - url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history' + idx + '.jpg'; + var item = history[ idx ], + url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; saveImg( url, item.info ); sessionStorage.setItem( "pointer", idx ); } From 23a032060c4f90adbdcd4a712157cd026c99f55d Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 14:57:40 +0800 Subject: [PATCH 107/176] Add history file and move history logic to this file. --- js/background.js | 11 +++++--- js/history.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ js/main.js | 5 ++-- 3 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 js/history.js diff --git a/js/background.js b/js/background.js index 73235ed..5e5e294 100644 --- a/js/background.js +++ b/js/background.js @@ -1,5 +1,5 @@ -define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar", "error", "notify", "progress", "waves", "message" ], function( $, date, i18n, setting, apis, vo, files, controlbar, SimpError, Notify, progress, Waves, message ) { +define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar", "error", "notify", "progress", "waves", "message", "history" ], function( $, date, i18n, setting, apis, vo, files, controlbar, SimpError, Notify, progress, Waves, message, history ) { "use strict"; @@ -116,7 +116,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar progress.Set( "loading" ); files.GetDataURI( url ).then( function( result ) { - sessionStorage.setItem( "base64", result ); + //sessionStorage.setItem( "base64", result ); + history.DataURI( result ); localStorage[ "simptab-background-update" ] == "true" && files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) .progress( function( result ) { @@ -177,7 +178,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar isPinTimeout() ? vo.Set( vo.new ) : writePinBackground(); localStorage[ "simptab-background-update" ] == "true" && updateBackground(); console.log( "======= New Background Obj is ", vo ); - localStorage[ "simptab-background-mode" ] == "time" && history(); + localStorage[ "simptab-background-mode" ] == "time" && history.Add(); } } @@ -260,6 +261,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } } + /* function history() { var MAX = 5, history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), @@ -281,6 +283,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar console.log( "History background saved complete." ) }); } + */ return { Get: function( is_random ) { @@ -521,6 +524,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar getEarth(); }, + /* History: function ( type ) { var MAX = 5, history = JSON.parse( localStorage[ "simptab-history" ] ), @@ -556,5 +560,6 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar saveImg( url, item.info ); sessionStorage.setItem( "pointer", idx ); } + */ }; }); diff --git a/js/history.js b/js/history.js new file mode 100644 index 0000000..4b46ae9 --- /dev/null +++ b/js/history.js @@ -0,0 +1,66 @@ +define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], function( $, _, Notify, i18n, files, vo, message ) { + + var current, base64; + + return { + DataURI: function( value ) { + base64 = value; + }, + + Add: function () { + var MAX = 5, + history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), + idx = vo.new.enddate; + if ( history.length == MAX ) { + var del = history[0].enddate; + history = history.slice( 1 ); + files.DeleteAny( "history-" + del + ".jpg", function( url ) { + console.log( "History old background removed complete.", url ) + }); + } + history.push( vo.new ); + localStorage[ "simptab-history" ] = JSON.stringify( history ); + files + .SaveBgfromURI( "history-" + vo.new.enddate, base64 ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "History background saved complete." ) + }); + }, + + Get: function( type ) { + var MAX = 5, + history = JSON.parse( localStorage[ "simptab-history" ] ), + idx = current == undefined ? MAX : current, + saveImg = function( url, info ) { + files.GetDataURI( url ).then( function( result ) { + files.DataURI( result ); + files.Add( vo.constructor.BACKGROUND, result ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); + console.log( "======= Current background download success.", vo ) + }); + }); + }; + type == "left" ? idx-- : idx++; + if ( idx < 0 ) { + current = 0; + new Notify().Render( "当前已经是最后一张了。" ); + return; + } + if ( idx > 4 ) { + current = 4; + new Notify().Render( "当前已经是最新一张了。" ); + return; + } + var item = history[ idx ], + url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; + saveImg( url, item.info ); + current = idx; + } + } +}); \ No newline at end of file diff --git a/js/main.js b/js/main.js index a7f5b1a..8dbb231 100644 --- a/js/main.js +++ b/js/main.js @@ -34,6 +34,7 @@ requirejs.config({ "zen" : "js/zen", "options" : "js/options", "noise" : "js/noise", + "history" : "js/history", "comps" : "js/components", "message" : "js/message", }, @@ -48,7 +49,7 @@ requirejs.config({ }); // main -requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options", "noise", "vo" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options, noise, vo ) { +requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", "setting", "i18n", "shortcuts", "files", "topsites", "version", "progress", "waves", "message", "bookmarks", "welcome", "zen", "options", "noise", "vo", "history" ], function ( $, _, Notify, background, date, controlbar, setting, i18n, shortcuts, files, topsites, version, progress, Waves, message, bookmarks, welcome, zen, options, noise, vo, history ) { progress.Init(); @@ -126,7 +127,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " background.Earth(); }); message.Subscribe( message.TYPE.HISTORY, function( event ) { - background.History( event.data ); + history.Get( event.data ); }); chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) { From 93c3c348098eaef664b0ba94837bf2daaee0a49f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 14:58:29 +0800 Subject: [PATCH 108/176] Remove old source. --- js/background.js | 62 ------------------------------------------------ 1 file changed, 62 deletions(-) diff --git a/js/background.js b/js/background.js index 5e5e294..6aea92a 100644 --- a/js/background.js +++ b/js/background.js @@ -116,7 +116,6 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar progress.Set( "loading" ); files.GetDataURI( url ).then( function( result ) { - //sessionStorage.setItem( "base64", result ); history.DataURI( result ); localStorage[ "simptab-background-update" ] == "true" && files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) @@ -261,30 +260,6 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar } } - /* - function history() { - var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), - idx = vo.new.enddate; - if ( history.length == MAX ) { - var del = history[0].enddate; - history = history.slice( 1 ); - files.DeleteAny( "history-" + del + ".jpg", function( url ) { - console.log( "History old background removed complete.", url ) - }); - } - history.push( vo.new ); - localStorage[ "simptab-history" ] = JSON.stringify( history ); - files - .SaveBgfromURI( "history-" + vo.new.enddate, sessionStorage.getItem( "base64" ) ) - .progress( function( result ) { console.log( "Write process:", result ); }) - .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { - console.log( "History background saved complete." ) - }); - } - */ - return { Get: function( is_random ) { @@ -524,42 +499,5 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar getEarth(); }, - /* - History: function ( type ) { - var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] ), - idx = !sessionStorage.getItem( "pointer" ) ? MAX : sessionStorage.getItem( "pointer" ), - saveImg = function( url, info ) { - files.GetDataURI( url ).then( function( result ) { - files.DataURI( result ); - files.Add( vo.constructor.BACKGROUND, result ) - .progress( function( result ) { console.log( "Write process:", result ); }) - .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { - console.log( "Write completed: ", result ); - message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); - console.log( "======= Current background download success.", vo ) - }); - }); - }; - type == "left" ? idx-- : idx++; - if ( idx < 0 ) { - idx = 0; - new Notify().Render( "当前已经是最后一张了。" ); - sessionStorage.setItem( "pointer", idx ); - return; - } - if ( idx > 4 ) { - idx = 4; - new Notify().Render( "当前已经是最新一张了。" ); - sessionStorage.setItem( "pointer", idx ); - return; - } - var item = history[ idx ], - url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; - saveImg( url, item.info ); - sessionStorage.setItem( "pointer", idx ); - } - */ }; }); From ef70294a6fa06af9fb82e4d836c2cff9e9f4e1a5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 14:59:53 +0800 Subject: [PATCH 109/176] Format source. --- js/history.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/history.js b/js/history.js index 4b46ae9..6bc7aec 100644 --- a/js/history.js +++ b/js/history.js @@ -9,8 +9,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct Add: function () { var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), - idx = vo.new.enddate; + history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ); if ( history.length == MAX ) { var del = history[0].enddate; history = history.slice( 1 ); @@ -24,7 +23,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct .SaveBgfromURI( "history-" + vo.new.enddate, base64 ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { + .done( function() { console.log( "History background saved complete." ) }); }, From 5f67b9c87ddee853787e685d3178bbf7144baaa8 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 15:50:49 +0800 Subject: [PATCH 110/176] Add history bar UI and logic. --- assets/css/main.css | 55 +++++++++++++++++++++++++++++++++++++++++++ js/history.js | 57 ++++++++++++++++++++++++++++++++++++++++++++- js/main.js | 2 ++ 3 files changed, 113 insertions(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index a1718ea..d32f2e6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2195,6 +2195,61 @@ img { transition: all .6s ease; } +/* +* history +*/ + +.history-overlay { + position: fixed; + + left: 30%; + right: 30%; + top: 0; + + height: 100px; +} + +.history { + position: fixed; + + left: 0; + top: 0; + + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + width: 100%; + height: 100px; + + background: rgba(0, 0, 0, .3); + opacity: 0; + transform: translateY(-300px); + transition: all .6s ease; +} + +.history img { + padding: 2px; + + max-width: 100px; + height: auto; + + background: transparent; + + border: none; + border-radius: 10px; + + opacity: .5; + transition: all .6s ease; + cursor: pointer; +} + + +.history img:hover { + opacity: 1; +} + /* * media */ diff --git a/js/history.js b/js/history.js index 6bc7aec..7934d3a 100644 --- a/js/history.js +++ b/js/history.js @@ -1,6 +1,52 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], function( $, _, Notify, i18n, files, vo, message ) { - var current, base64; + var current, base64, + saveImg = function( url, info ) { + files.GetDataURI( url ).then( function( result ) { + files.DataURI( result ); + files.Add( vo.constructor.BACKGROUND, result ) + .progress( function( result ) { console.log( "Write process:", result ); }) + .fail( function( result ) { console.log( "Write error: ", result ); }) + .done( function( result ) { + console.log( "Write completed: ", result ); + message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); + console.log( "======= Current background download success.", vo ) + }); + }); + }; + + function open() { + $( ".history" ).css({ "transform": "translateY(0px)", "opacity": 0.8 }).addClass( "open" ); + } + + function close() { + $( ".history" ).css({ "transform": "translateY(-300px)", "opacity": 0 }).removeClass( "open" ); + } + + function listen() { + $( ".history-overlay" ).mouseenter( function() { + open(); + }); + $( ".history" ).mouseleave( function() { + close(); + }); + $( ".history" ).on( "click", "img", function( event ) { + var history = JSON.parse( localStorage[ "simptab-history" ] ), + idx = event.target.dataset.idx, + item = history[ idx ], + url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; + saveImg( url, item.info ); + current = idx; + }); + } + + function render() { + var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), + tmpl = '.jpg">', + compiled = _.template( '<% jq.each( historys, function( idx, history ) { %>' + tmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), + html = compiled({ 'historys': history }); + $( ".history" ).html( html ); + } return { DataURI: function( value ) { @@ -25,6 +71,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function() { console.log( "History background saved complete." ) + render(); }); }, @@ -60,6 +107,14 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; saveImg( url, item.info ); current = idx; + }, + + Init: function () { + $( "body" ).append( '
    ' ); + setTimeout( function() { + render(); + listen(); + }, 10 ); } } }); \ No newline at end of file diff --git a/js/main.js b/js/main.js index 8dbb231..579f50a 100644 --- a/js/main.js +++ b/js/main.js @@ -139,4 +139,6 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " noise.Init(); + localStorage[ "simptab-background-mode" ] == "time" && history.Init(); + }); From 8e450862dd23c6502c5fc24cd18776754d6e0dd5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 15:51:53 +0800 Subject: [PATCH 111/176] Format source. --- js/history.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/js/history.js b/js/history.js index 7934d3a..af558c0 100644 --- a/js/history.js +++ b/js/history.js @@ -1,7 +1,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], function( $, _, Notify, i18n, files, vo, message ) { var current, base64, - saveImg = function( url, info ) { + saveImg = function( url, info ) { files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) @@ -76,22 +76,9 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct }, Get: function( type ) { - var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] ), - idx = current == undefined ? MAX : current, - saveImg = function( url, info ) { - files.GetDataURI( url ).then( function( result ) { - files.DataURI( result ); - files.Add( vo.constructor.BACKGROUND, result ) - .progress( function( result ) { console.log( "Write process:", result ); }) - .fail( function( result ) { console.log( "Write error: ", result ); }) - .done( function( result ) { - console.log( "Write completed: ", result ); - message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); - console.log( "======= Current background download success.", vo ) - }); - }); - }; + var MAX = 5, + history = JSON.parse( localStorage[ "simptab-history" ] ), + idx = current == undefined ? MAX : current; type == "left" ? idx-- : idx++; if ( idx < 0 ) { current = 0; From 8879ebe4a33fb0f253d5ad06ce8f359b82c1d606 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 15:54:29 +0800 Subject: [PATCH 112/176] Format source. --- js/history.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/history.js b/js/history.js index af558c0..68d83e6 100644 --- a/js/history.js +++ b/js/history.js @@ -1,6 +1,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], function( $, _, Notify, i18n, files, vo, message ) { var current, base64, + MAX = 5, saveImg = function( url, info ) { files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); @@ -54,8 +55,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct }, Add: function () { - var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ); + var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ); if ( history.length == MAX ) { var del = history[0].enddate; history = history.slice( 1 ); @@ -76,8 +76,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct }, Get: function( type ) { - var MAX = 5, - history = JSON.parse( localStorage[ "simptab-history" ] ), + var history = JSON.parse( localStorage[ "simptab-history" ] ), idx = current == undefined ? MAX : current; type == "left" ? idx-- : idx++; if ( idx < 0 ) { From ad2acf8f2086a8bf1a75d7d0f235f7d62f97e27c Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 15:58:47 +0800 Subject: [PATCH 113/176] Optimize history style. --- assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index d32f2e6..064ec71 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2223,7 +2223,7 @@ img { width: 100%; height: 100px; - background: rgba(0, 0, 0, .3); + background: rgba(255, 255, 255, .3); opacity: 0; transform: translateY(-300px); transition: all .6s ease; From 84cfbc2167f62b76ec72fcdea0160d6bd4fcdb43 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 16:14:02 +0800 Subject: [PATCH 114/176] Rework history.Get() logic. --- js/history.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/history.js b/js/history.js index 68d83e6..cf0a803 100644 --- a/js/history.js +++ b/js/history.js @@ -38,6 +38,8 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; saveImg( url, item.info ); current = idx; + $( ".history img" ).removeClass( "active" ); + $( event.target ).addClass( "active" ); }); } @@ -76,6 +78,20 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct }, Get: function( type ) { + current = $( ".history" ).find( "img.active" ).attr( "data-idx" ); + !current && ( current = $( ".history" ).find( "img" ).length - 1 ); + type == "left" ? current-- : current++; + console.log( current ) + if ( current < 0 ) { + new Notify().Render( "当前已经是最后一张了。" ); + return; + } + if ( current > 4 ) { + new Notify().Render( "当前已经是最新一张了。" ); + return; + } + $( ".history img" )[current].click(); + /* var history = JSON.parse( localStorage[ "simptab-history" ] ), idx = current == undefined ? MAX : current; type == "left" ? idx-- : idx++; @@ -93,6 +109,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; saveImg( url, item.info ); current = idx; + */ }, Init: function () { From 1314bddf5c8c0b855c3799009a7e3ba7b18053fb Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 18:32:28 +0800 Subject: [PATCH 115/176] Optimize selected history vo setting logic. --- js/history.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/history.js b/js/history.js index cf0a803..a83d813 100644 --- a/js/history.js +++ b/js/history.js @@ -2,7 +2,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct var current, base64, MAX = 5, - saveImg = function( url, info ) { + saveImg = function( url, cur_vo ) { files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) @@ -10,7 +10,9 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function( result ) { console.log( "Write completed: ", result ); - message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: info }); + message.Publish( message.TYPE.UPDATE_CONTROLBAR, { url: url, info: cur_vo.info }); + vo.cur = vo.Clone( cur_vo ); + vo.Set( vo.cur ); console.log( "======= Current background download success.", vo ) }); }); @@ -36,7 +38,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct idx = event.target.dataset.idx, item = history[ idx ], url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; - saveImg( url, item.info ); + saveImg( url, item ); current = idx; $( ".history img" ).removeClass( "active" ); $( event.target ).addClass( "active" ); From 79d7f70816cff1579b8f9c5c7d144d36dbd4c6d8 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 18:32:47 +0800 Subject: [PATCH 116/176] Remove old source. --- js/history.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/js/history.js b/js/history.js index a83d813..1414070 100644 --- a/js/history.js +++ b/js/history.js @@ -93,25 +93,6 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct return; } $( ".history img" )[current].click(); - /* - var history = JSON.parse( localStorage[ "simptab-history" ] ), - idx = current == undefined ? MAX : current; - type == "left" ? idx-- : idx++; - if ( idx < 0 ) { - current = 0; - new Notify().Render( "当前已经是最后一张了。" ); - return; - } - if ( idx > 4 ) { - current = 4; - new Notify().Render( "当前已经是最新一张了。" ); - return; - } - var item = history[ idx ], - url = 'filesystem:' + chrome.extension.getURL( "/" ) + 'temporary/history-' + item.enddate + '.jpg'; - saveImg( url, item.info ); - current = idx; - */ }, Init: function () { From 112d9c3d964579666911c8a6c259e6d4ffc891e0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 21 Dec 2018 18:38:56 +0800 Subject: [PATCH 117/176] Optimize left right logic. --- js/history.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/history.js b/js/history.js index 1414070..0d433d0 100644 --- a/js/history.js +++ b/js/history.js @@ -81,7 +81,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct Get: function( type ) { current = $( ".history" ).find( "img.active" ).attr( "data-idx" ); - !current && ( current = $( ".history" ).find( "img" ).length - 1 ); + !current && ( current = $( ".history" ).find( "img[id=" + vo.cur.enddate + "]" ).attr("data-idx") ); type == "left" ? current-- : current++; console.log( current ) if ( current < 0 ) { From 352c7276f0fd7ff78758f1b6cff2cdac253d52d3 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 10:44:32 +0800 Subject: [PATCH 118/176] Fix some boundary error. --- js/history.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/history.js b/js/history.js index 0d433d0..38d514d 100644 --- a/js/history.js +++ b/js/history.js @@ -50,6 +50,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct tmpl = '.jpg">', compiled = _.template( '<% jq.each( historys, function( idx, history ) { %>' + tmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), html = compiled({ 'historys': history }); + history.length == 0 && ( html = "暂时没有任何历史记录" ) $( ".history" ).html( html ); } @@ -82,13 +83,14 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct Get: function( type ) { current = $( ".history" ).find( "img.active" ).attr( "data-idx" ); !current && ( current = $( ".history" ).find( "img[id=" + vo.cur.enddate + "]" ).attr("data-idx") ); + !current && ( current = 0 ); type == "left" ? current-- : current++; console.log( current ) if ( current < 0 ) { new Notify().Render( "当前已经是最后一张了。" ); return; } - if ( current > 4 ) { + if ( current > $( ".history" ).find( "img" ).length - 1 ) { new Notify().Render( "当前已经是最新一张了。" ); return; } From b591e3a15e5658615d0d76857ee39a29e62412f2 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 10:48:55 +0800 Subject: [PATCH 119/176] Optimize history.Add(). --- js/background.js | 2 +- js/history.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index 6aea92a..0c242be 100644 --- a/js/background.js +++ b/js/background.js @@ -177,7 +177,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar isPinTimeout() ? vo.Set( vo.new ) : writePinBackground(); localStorage[ "simptab-background-update" ] == "true" && updateBackground(); console.log( "======= New Background Obj is ", vo ); - localStorage[ "simptab-background-mode" ] == "time" && history.Add(); + localStorage[ "simptab-background-mode" ] == "time" && history.Add( vo.new ); } } diff --git a/js/history.js b/js/history.js index 38d514d..97d76ff 100644 --- a/js/history.js +++ b/js/history.js @@ -59,7 +59,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct base64 = value; }, - Add: function () { + Add: function( cur_vo ) { var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ); if ( history.length == MAX ) { var del = history[0].enddate; @@ -68,10 +68,10 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct console.log( "History old background removed complete.", url ) }); } - history.push( vo.new ); + history.push( cur_vo ); localStorage[ "simptab-history" ] = JSON.stringify( history ); files - .SaveBgfromURI( "history-" + vo.new.enddate, base64 ) + .SaveBgfromURI( "history-" + cur_vo.enddate, base64 ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) .done( function() { From 57001144c6258cfa894122dc9c34520a65596195 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 10:49:23 +0800 Subject: [PATCH 120/176] Format source. --- js/history.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/history.js b/js/history.js index 97d76ff..33a33b9 100644 --- a/js/history.js +++ b/js/history.js @@ -46,8 +46,8 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct } function render() { - var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), - tmpl = '.jpg">', + var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ), + tmpl = '.jpg">', compiled = _.template( '<% jq.each( historys, function( idx, history ) { %>' + tmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), html = compiled({ 'historys': history }); history.length == 0 && ( html = "暂时没有任何历史记录" ) From c8270bb4d204e2113178d2f0b8f85351e7715c17 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 11:06:27 +0800 Subject: [PATCH 121/176] Add manage to history. --- js/manage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/manage.js b/js/manage.js index 744e163..3c393c8 100644 --- a/js/manage.js +++ b/js/manage.js @@ -1,5 +1,5 @@ -define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", "message", "unveil" ], function( $, _, Notify, i18n, vo, date, options, files, message, unveil ) { +define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", "message", "unveil", "history" ], function( $, _, Notify, i18n, vo, date, options, files, message, unveil, history ) { "use strict"; @@ -139,7 +139,11 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", vo.cur.url = new_vo.url; vo.cur.info = new_vo.info; vo.cur.name = new_vo.origin; + vo.cur.pin = -1; + vo.cur.dislike = -1; vo.cur.favorite = -1; + vo.cur.enddate = date.Now(); + vo.cur.version = "2.2"; delete vo.cur.apis_vo; } @@ -157,6 +161,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", // save url to background.jpg files.GetDataURI( url ).then( function( result ) { files.DataURI( result ); + history.DataURI( result ); files.Add( vo.constructor.BACKGROUND, result ) .progress( function( result ) { console.log( "Write process:", result ); }) .fail( function( result ) { console.log( "Write error: ", result ); }) @@ -171,6 +176,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", // complete notify notify && notify.complete(); new Notify().Render( i18n.GetLang( "notify_mange_setting_success" ) ); + history.Add( vo.cur ); }); }); } From 27457df5a9e90dda0b5210bf9f5a91be86333404 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 11:11:39 +0800 Subject: [PATCH 122/176] Add history shortcuts i18n. --- _locales/en/messages.json | 8 ++++++++ _locales/zh_CN/messages.json | 8 ++++++++ _locales/zh_TW/messages.json | 8 ++++++++ js/shortcuts.js | 4 ++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 8b5013f..2fc0402 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -321,6 +321,14 @@ "message": "Open White noise" }, + "shortcuts_key_left": { + "message": "Previous histor background" + }, + + "shortcuts_key_right": { + "message": "Next histor background" + }, + "about_content_more": { "message": "More about..." }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 83ff256..6583989 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -321,6 +321,14 @@ "message": "开启白噪音模式" }, + "shortcuts_key_left": { + "message": "向前一张历史背景" + }, + + "shortcuts_key_right": { + "message": "向后一张历史背景" + }, + "about_content_more": { "message": "查看更多..." }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 308b168..0de0dcd 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -321,6 +321,14 @@ "message": "開啟白噪音模式" }, + "shortcuts_key_left": { + "message": "向前一張歷史背景" + }, + + "shortcuts_key_right": { + "message": "向後一張歷史背景" + }, + "about_content_more": { "message": "查看更多..." }, diff --git a/js/shortcuts.js b/js/shortcuts.js index 90cf83d..52788b2 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -46,8 +46,8 @@ define([ "jquery", "mousetrap", "controlbar", "i18n", "topsites", "message" ], f { short: "z", long: "topsites" }, { short: "c", long: "zenmode" }, { short: "w", long: "noise" }, - { short: "left", long: "previous" }, - { short: "right", long: "next" }, + { short: "left", long: "left" }, + { short: "right", long: "right"}, ]; Object.defineProperties( Keys.prototype, { From 27069e2b6b458ebb35b2f10255df24a6c01c370e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 11:19:20 +0800 Subject: [PATCH 123/176] Add history i18n. --- _locales/en/messages.json | 12 ++++++++++++ _locales/zh_CN/messages.json | 12 ++++++++++++ _locales/zh_TW/messages.json | 12 ++++++++++++ js/history.js | 6 +++--- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 2fc0402..53b64f2 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -521,6 +521,10 @@ "message": "THUNDER" }, + "history_empty": { + "message": "There is no any history." + }, + "version_title": { "message": "SimpTab is updated" }, @@ -689,6 +693,14 @@ "message": "Update background image only once every hour, don't call it many times." }, + "notify_history_min": { + "message": "This is the first history background." + }, + + "notify_history_max": { + "message": "This is the latest history background." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 6583989..a1bd460 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -521,6 +521,10 @@ "message": "雷声" }, + "history_empty": { + "message": "暂时没有任何历史记录" + }, + "version_title": { "message": "简 Tab 版本提示" }, @@ -689,6 +693,14 @@ "message": "此功能每隔一小时才会刷新一次,请勿多次调用。" }, + "notify_history_min": { + "message": "当前已经是最后一张历史记录了。" + }, + + "notify_history_max": { + "message": "当前已经是最新一张历史记录了。" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 0de0dcd..2cfa521 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -521,6 +521,10 @@ "message": "雷聲" }, + "history_empty": { + "message": "暫時沒有任何歷史記錄" + }, + "version_title": { "message": "簡 Tab 版本提示" }, @@ -689,6 +693,14 @@ "message": "此功能每隔一小時才會刷新一次,請勿多次調用。" }, + "notify_history_min": { + "message": "當前已經是最後一張歷史記錄了。" + }, + + "notify_history_max": { + "message": "當前已經是最新一張歷史記錄了。" + }, + "version_detail": { "message": "" }, diff --git a/js/history.js b/js/history.js index 33a33b9..a5e6e35 100644 --- a/js/history.js +++ b/js/history.js @@ -50,7 +50,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct tmpl = '.jpg">', compiled = _.template( '<% jq.each( historys, function( idx, history ) { %>' + tmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), html = compiled({ 'historys': history }); - history.length == 0 && ( html = "暂时没有任何历史记录" ) + history.length == 0 && ( html = i18n.GetLang( "history_empty" ) ) $( ".history" ).html( html ); } @@ -87,11 +87,11 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct type == "left" ? current-- : current++; console.log( current ) if ( current < 0 ) { - new Notify().Render( "当前已经是最后一张了。" ); + new Notify().Render( i18n.GetLang( "notify_history_min" ) ); return; } if ( current > $( ".history" ).find( "img" ).length - 1 ) { - new Notify().Render( "当前已经是最新一张了。" ); + new Notify().Render( i18n.GetLang( "notify_history_max" ) ); return; } $( ".history img" )[current].click(); From f05b5c31f0a9b5792641db44342f5671c09a90a7 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 11:53:09 +0800 Subject: [PATCH 124/176] Add history to option. --- assets/css/main.css | 9 ++++++--- js/main.js | 2 +- js/options.js | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 064ec71..5a82111 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1967,7 +1967,8 @@ img { #devices-cbx:checked + .toggle:before, #topsites-cbx:checked + .toggle:before, #custom-unsplash-cbx:checked + .toggle:before, -#custom-tp-cbx:checked + .toggle:before { +#custom-tp-cbx:checked + .toggle:before, +#history-cbx:checked + .toggle:before { background: #4DB6AC; } @@ -1976,7 +1977,8 @@ img { #devices-cbx:checked + .toggle span, #topsites-cbx:checked + .toggle span, #custom-unsplash-cbx:checked + .toggle span, -#custom-tp-cbx:checked + .toggle span { +#custom-tp-cbx:checked + .toggle span, +#history-cbx:checked + .toggle span { background: #00796B; transform: translateX(20px); transition: all 0.2s cubic-bezier(0.8, 0.4, 0.3, 1.25), background 0.15s ease; @@ -1988,7 +1990,8 @@ img { #devices-cbx:checked + .toggle span:before, #topsites-cbx:checked + .toggle span:before, #custom-unsplash-cbx:checked + .toggle span:before, -#custom-tp-cbx:checked + .toggle span:before { +#custom-tp-cbx:checked + .toggle span:before, +#history-cbx:checked + .toggle span:before { transform: scale(1); opacity: 0; transition: all 0.4s ease; diff --git a/js/main.js b/js/main.js index 579f50a..755fad2 100644 --- a/js/main.js +++ b/js/main.js @@ -139,6 +139,6 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " noise.Init(); - localStorage[ "simptab-background-mode" ] == "time" && history.Init(); + localStorage[ "simptab-background-mode" ] == "time" && options.Storage.db.history && history.Init(); }); diff --git a/js/options.js b/js/options.js index e3061db..b8c1724 100644 --- a/js/options.js +++ b/js/options.js @@ -39,6 +39,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( }, mobile_host: "", carousel: "-1", + history: false, }; function Storage() { @@ -96,6 +97,12 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    \
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \
    \ +
    \ +
    是否启用历史记录功能?
    \ + ' + comps.Switches( "history-cbx" ) + '\ +
    \ +
    启用后会自动记录最多五张的历史记录,并且只在「随机更换壁纸」模型下使用,详细请看 历史记录
    \ +
    \
    \ '; return tmpl; @@ -110,6 +117,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( $( ".options .custom-unsplash .custom-unsplash-cbx" ).find( "input" ).prop( "checked", storage.db.subscribe.sequence ); $( ".options .custom-unsplash .custom-mobile" ).val( storage.db.mobile_host ); $( ".options .custom-unsplash .custom-unsplash-screen" ).val( storage.db.unsplash_screen ); + $( ".options .custom-unsplash .history-cbx" ).find( "input" ).prop( "checked", storage.db.history ); $( ".options" ).on( "change", ".custom-unsplash .custom-unsplash-cbx input", function( event ) { var $cb = $(this), value = $cb.prop( "checked" ); @@ -130,6 +138,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( storage.Set(); new Notify().Render( i18n.GetLang( "notify_carousel" ) ); }); + $( ".options" ).on( "change", ".history-cbx input", function( event ) { + var $cb = $(this), + value = $cb.prop( "checked" ); + $cb.val( value ); + storage.db.history = value; + storage.Set(); + }); } /********************************************* From be5b33af75006fd6e1080e34dfb2a53babc349f9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 12:02:16 +0800 Subject: [PATCH 125/176] Add history options i18n. --- _locales/en/messages.json | 8 ++++++++ _locales/zh_CN/messages.json | 8 ++++++++ _locales/zh_TW/messages.json | 8 ++++++++ js/options.js | 4 ++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 53b64f2..b0fd996 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -417,6 +417,14 @@ "message": "When playing automatically, it is not recommended to close the TAB, and white noise effect is better." }, + "options_history_label": { + "message": "History background is enabled?" + }, + + "options_history_notice": { + "message": "When enabled, up to five history background records and only used by 'Change background randomly' model." + }, + "options_custom_style": { "message": "Custom global Style" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index a1bd460..0cc2984 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -417,6 +417,14 @@ "message": "当自动播放时,不建议关闭标签页,并配合 白噪音 效果更好。" }, + "options_history_label": { + "message": "是否启用历史记录功能?" + }, + + "options_history_notice": { + "message": "启用后会自动记录最多五张的历史记录,并且只在「随机更换壁纸」模型下使用,详细请看 历史记录" + }, + "options_custom_style": { "message": "自定义样式( 全局 )" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 2cfa521..953ba1e 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -417,6 +417,14 @@ "message": "當自動播放時,不建議關閉標籤頁,並配合 白噪音 效果更好。" }, + "options_history_label": { + "message": "是否啟用歷史記錄功能?" + }, + + "options_history_notice": { + "message": "啟用後會自動記錄最多五張的歷史記錄,並且只在「隨機更換壁紙」模型下使用,詳細請看 歷史記錄" + }, + "options_custom_style": { "message": "自定義樣式( 全局 )" }, diff --git a/js/options.js b/js/options.js index b8c1724..9177076 100644 --- a/js/options.js +++ b/js/options.js @@ -98,10 +98,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function(
    ' + i18n.GetLang( "options_carousel_notice" ) + '
    \
    \
    \ -
    是否启用历史记录功能?
    \ +
    ' + i18n.GetLang( "options_history_label" ) + '
    \ ' + comps.Switches( "history-cbx" ) + '\
    \ -
    启用后会自动记录最多五张的历史记录,并且只在「随机更换壁纸」模型下使用,详细请看 历史记录
    \ +
    ' + i18n.GetLang( "options_history_notice" ) + '
    \
    \
    \ '; From 2e4436d4fdb7272b648d92ad64cd9471263a395e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 12:03:23 +0800 Subject: [PATCH 126/176] Fix shortcuts can'b usage at storage.history == false bug. --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 755fad2..f2a7b3c 100644 --- a/js/main.js +++ b/js/main.js @@ -127,7 +127,7 @@ requirejs([ "jquery", "lodash", "notify", "background", "date" , "controlbar", " background.Earth(); }); message.Subscribe( message.TYPE.HISTORY, function( event ) { - history.Get( event.data ); + options.Storage.db.history && history.Get( event.data ); }); chrome.permissions.contains({ permissions: [ 'bookmarks' ]}, function( result ) { From df5c8639fa394a318e1c56a81c9d98def370709d Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 14:18:27 +0800 Subject: [PATCH 127/176] Fix storage.history is false, can be usage it bug. --- js/history.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/history.js b/js/history.js index a5e6e35..7a749cf 100644 --- a/js/history.js +++ b/js/history.js @@ -1,4 +1,4 @@ -define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], function( $, _, Notify, i18n, files, vo, message ) { +define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message", "options" ], function( $, _, Notify, i18n, files, vo, message, options ) { var current, base64, MAX = 5, @@ -60,6 +60,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message" ], funct }, Add: function( cur_vo ) { + if ( !options.Storage.db.history ) { return; } var history = JSON.parse( localStorage[ "simptab-history" ] || '[]' ); if ( history.length == MAX ) { var del = history[0].enddate; From 6b16c9e7ae57200b04157062b563a954c8032ec1 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 14:27:03 +0800 Subject: [PATCH 128/176] Format source. --- js/history.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/history.js b/js/history.js index 7a749cf..163ea7f 100644 --- a/js/history.js +++ b/js/history.js @@ -86,7 +86,7 @@ define([ "jquery", "lodash", "notify", "i18n", "files", "vo", "message", "option !current && ( current = $( ".history" ).find( "img[id=" + vo.cur.enddate + "]" ).attr("data-idx") ); !current && ( current = 0 ); type == "left" ? current-- : current++; - console.log( current ) + console.log( "History current is ", current ) if ( current < 0 ) { new Notify().Render( i18n.GetLang( "notify_history_min" ) ); return; From 6f26e802a9ca3ba9436465f647058de073d7ffe3 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 14:29:17 +0800 Subject: [PATCH 129/176] Add tencent cloud cdn url. --- js/noise.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/noise.js b/js/noise.js index aa54ad6..28dddfc 100644 --- a/js/noise.js +++ b/js/noise.js @@ -4,10 +4,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] "use strict"; var noise = { - "cafe001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/cafe001.mp3", - "jazz001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/jazz001.mp3", - "rain001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/rain001.mp3", - "thun001": "https://simptab-1254315611.cos.ap-shanghai.myqcloud.com/noise/thun001.mp3", + "cafe001": "https://simptab-1254315611.file.myqcloud.com/noise/cafe001.mp3", + "jazz001": "https://simptab-1254315611.file.myqcloud.com/noise/jazz001.mp3", + "rain001": "https://simptab-1254315611.file.myqcloud.com/noise/rain001.mp3", + "thun001": "https://simptab-1254315611.file.myqcloud.com/noise/thun001.mp3", }, colors = { "cafe001": "#753F40", "jazz001": "#3D5AFE", From cb50055156eb06af9ba91b6b20836936ceb74e67 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 14:34:32 +0800 Subject: [PATCH 130/176] Fix controlbar style bug. --- assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/main.css b/assets/css/main.css index 5a82111..3b84324 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -122,7 +122,7 @@ img { align-items: flex-end; padding: 0; - width: 200px; + width: 100px; list-style: none; font-size: 15px; From 72f2e4bb83a6afccd909a7fe89de54c053d792f7 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 14:59:44 +0800 Subject: [PATCH 131/176] Optimize background mange style. --- assets/css/main.css | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 3b84324..57cf8f6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -806,6 +806,10 @@ img { /* * manage */ +.manage { + width: 786px; +} + .manage .tabs { display: flex; justify-content: center; @@ -851,7 +855,7 @@ img { .manage .album { display: none; flex-flow: row wrap; - justify-content: space-between; + justify-content: flex-start; width: 100%; height: 100%; @@ -874,7 +878,9 @@ img { flex-direction: column; justify-content: flex-start; align-items: center; +} +.manage .album .photograph { margin: 10px; } @@ -944,6 +950,10 @@ img { align-items: flex-start; } +.manage .album.subscribe .photograph img { + padding: 5px; +} + .manage .album.subscribe .photos .title { font-size: 17px; font-weight: bold; @@ -952,7 +962,7 @@ img { .manage .album.subscribe .photos .title, .manage .album.subscribe .photos .desc, .manage .album.subscribe .photos .author { - padding-left: 22px; + padding-left: 15px; } .manage .album.subscribe .photos .title, From 220d6c0b0f33c47b5affc8101f1a0c92d9cf225b Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 15:16:03 +0800 Subject: [PATCH 132/176] Optimize background mange style. --- assets/css/main.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 57cf8f6..1ea59a2 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -951,7 +951,7 @@ img { } .manage .album.subscribe .photograph img { - padding: 5px; + margin: 17px; } .manage .album.subscribe .photos .title { @@ -962,7 +962,7 @@ img { .manage .album.subscribe .photos .title, .manage .album.subscribe .photos .desc, .manage .album.subscribe .photos .author { - padding-left: 15px; + padding-left: 19px; } .manage .album.subscribe .photos .title, From 292a74400a0c1f00206cc61868967cdc809b41da Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 15:25:18 +0800 Subject: [PATCH 133/176] Add first loading earth refresh new tab logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/background.js | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b0fd996..0042fd4 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -697,6 +697,10 @@ "message": "Earth background loading..." }, + "notify_eartch_update_success": { + "message": "Earth background loading success, will refresh automatically after 2 seconds." + }, + "notify_eartch_update_failed": { "message": "Update background image only once every hour, don't call it many times." }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 0cc2984..738cbbb 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -697,6 +697,10 @@ "message": "地球影像获取中,请稍等..." }, + "notify_eartch_update_success": { + "message": "获取成功,2秒后,自动刷新本页才能生效。" + }, + "notify_eartch_update_failed": { "message": "此功能每隔一小时才会刷新一次,请勿多次调用。" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 953ba1e..ca656cf 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -697,6 +697,10 @@ "message": "地球影像獲取中,請稍等..." }, + "notify_eartch_update_success": { + "message": "獲取成功,2秒後,自動刷新本頁才能生效。" + }, + "notify_eartch_update_failed": { "message": "此功能每隔一小時才會刷新一次,請勿多次調用。" }, diff --git a/js/background.js b/js/background.js index 0c242be..e3d7fc0 100644 --- a/js/background.js +++ b/js/background.js @@ -493,6 +493,12 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar vo.Set( vo.new ); localStorage[ "simptab-background-position" ] == "mask" && new Notify().Render( i18n.GetLang( "notify_carousel" ) ); console.log( "======= Current background success.", vo ) + if ( is_notify ) { + new Notify().Render( i18n.GetLang( "notify_eartch_update_success" ) ); + setTimeout( function () { + window.location.reload(); + }, 2000 ); + } }); }); }; From cab7d6d3cd99b94c9e26fd74263dbafd0f666ca3 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 15:27:13 +0800 Subject: [PATCH 134/176] Optimzie bgearth css. --- assets/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/main.css b/assets/css/main.css index 1ea59a2..eca13cd 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -679,6 +679,7 @@ img { background-size: contain; background-repeat: no-repeat; background-color: black; + background-position: center; } .bgmask::before { From 60f21cc1bf259a0b2cf54cc9336faa645bd63d3a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 16:22:52 +0800 Subject: [PATCH 135/176] Optimize manage explore loading logic. --- js/manage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/manage.js b/js/manage.js index 3c393c8..139c7b0 100644 --- a/js/manage.js +++ b/js/manage.js @@ -89,7 +89,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( $( ".manage .album" )[idx] ).addClass( "album-active" ); if ( $( ".tabs .tab-active").attr("idx") == "2" ) { - $( ".albums .explore").find(".photograph").length == 12 && getExploreTmpl(); + getExploreTmpl(); localStorage["simptab-explore-notify"] != "false" && new Notify().Render({ content: i18n.GetLang( "notify_explore_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ localStorage["simptab-explore-notify"] = false; @@ -251,7 +251,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); return; } - var COUNT = 12, + var COUNT = 16, items = [], CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", screen = /\d+x\d+/.test( options.Storage.db.unsplash_screen ) ? options.Storage.db.unsplash_screen : "2560x1440", @@ -361,7 +361,6 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", albumLoadListenEvent(); getFavoriteTmpl(); getSubscribeTmpl(); - getExploreTmpl(); toolbarListenEvent(); scrollListenEvent(); }, 10 ); From c8198379b73ac462130eb862e02f05e742316596 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 16:23:20 +0800 Subject: [PATCH 136/176] Change 1.5.3 to 1.5.4. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ assets/images/version.svg | 2 +- js/version.js | 6 ++++++ js/welcome.js | 8 ++++++++ manifest.json | 2 +- 7 files changed, 28 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0042fd4..32f6754 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -757,6 +757,10 @@ "message": "Add: Zen mode, Golbal options, Quick bar support multi-search;" }, + "version_detail_9": { + "message": "Add: Earth every moment, White noise, Background explore;" + }, + "welcome_start_title": { "message": "Welcome" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 738cbbb..ca32fa1 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -757,6 +757,10 @@ "message": "新增:全新的禅模式,全局选项页,快捷搜索栏接入多种搜索引擎等;" }, + "version_detail_9": { + "message": "新增:地球每刻,白噪音,JSBox 版,探索频道等;" + }, + "welcome_start_title": { "message": "欢迎使用" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index ca656cf..e78a345 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -757,6 +757,10 @@ "message": "新增:全新的禪模式,全局選項頁,快捷搜索欄接入多種搜索引擎等;" }, + "version_detail_9": { + "message": "新增:地球每刻,白噪音,JSBox 版,探索頻道等;" + }, + "welcome_start_title": { "message": "歡迎使用" }, diff --git a/assets/images/version.svg b/assets/images/version.svg index 295cb9b..696d8f2 100644 --- a/assets/images/version.svg +++ b/assets/images/version.svg @@ -1 +1 @@ - 1.5.31.5.3 \ No newline at end of file + 1.5.41.5.4 \ No newline at end of file diff --git a/js/version.js b/js/version.js index b8bc65f..8d1e14e 100644 --- a/js/version.js +++ b/js/version.js @@ -78,6 +78,12 @@ define([ "jquery", "notify", "i18n" ], function( $, Notify, i18n ) { details : i18n.GetLang( "version_detail_8" ), permissions: [], removePermissions : [] + }, + "1.5.4" : { + level : 10, + details : i18n.GetLang( "version_detail_9" ), + permissions: [], + removePermissions : [] } }; diff --git a/js/welcome.js b/js/welcome.js index 8bba565..46dd713 100644 --- a/js/welcome.js +++ b/js/welcome.js @@ -54,6 +54,14 @@ define([ "jquery", "mousetrap", "lodash", "carousel", "i18n" ], function( $, Mou
    ' + i18n.GetLang( "welcome_153_desc_3" ) +'
    \
    \
    ', + "1.5.4": '\ + ', }, welcomeTmpl = '\
    \ diff --git a/manifest.json b/manifest.json index 9073bb6..c8e5c62 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name" : "__MSG_extension_name__", "short_name" : "SimpTab", - "version" : "1.5.3.1129", + "version" : "1.5.4", "default_locale" : "zh_CN", "description" : "__MSG_extension_desc__", "author" : "Kenshin", From 75fea3e72735a4e85f4870521d5ee9ebab7845aa Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 16:31:09 +0800 Subject: [PATCH 137/176] Fix earth mode about bug. --- js/about.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/about.js b/js/about.js index 70ca16a..fcfcace 100644 --- a/js/about.js +++ b/js/about.js @@ -50,6 +50,7 @@ define([ "jquery", "lodash", "notify", "i18n" ], function( $, _, Notify, i18n ) $( ".dialog" ).html( rTmpl ); closeListenEvent(); moreAbout(); + localStorage["simptab-background-mode"] == "earth" && $( ".dialog" ).width( 800 ); }, 10 ); } } From f9f864428a1e4d427a7be7f4dcb6fdda989431d9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 18:07:41 +0800 Subject: [PATCH 138/176] Format source. --- _locales/en/messages.json | 8 ++++---- _locales/zh_CN/messages.json | 8 ++++---- _locales/zh_TW/messages.json | 8 ++++---- js/manage.js | 3 ++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 32f6754..f18321f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -261,6 +261,10 @@ "message": "Remove Background" }, + "mange_explore_empty": { + "message": "Not any background image" + }, + "bm_foder_search": { "message": "Search" }, @@ -605,10 +609,6 @@ "message": "Setting successful." }, - "notify_mange_empty": { - "message": "Not any background image" - }, - "notify_mange_no_user": { "message": "anonymous" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index ca32fa1..90debe8 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -261,6 +261,10 @@ "message": "删除" }, + "mange_explore_empty": { + "message": "暂时没有任何背景" + }, + "bm_foder_search": { "message": "搜索" }, @@ -605,10 +609,6 @@ "message": "设置成功。" }, - "notify_mange_empty": { - "message": "暂时没有任何背景" - }, - "notify_mange_no_user": { "message": "暂无" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index e78a345..6b1509a 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -261,6 +261,10 @@ "message": "刪除" }, + "mange_explore_empty": { + "message": "暫時沒有任何背景" + }, + "bm_foder_search": { "message": "搜索" }, @@ -605,10 +609,6 @@ "message": "設置成功。" }, - "notify_mange_empty": { - "message": "暫時沒有任何背景" - }, - "notify_mange_no_user": { "message": "暫無" }, diff --git a/js/manage.js b/js/manage.js index 139c7b0..b1feae9 100644 --- a/js/manage.js +++ b/js/manage.js @@ -219,7 +219,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", function getSubscribeTmpl() { getSubscribe( function( albums, category, error ) { - if ( error ) $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + if ( error ) $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_empty" ) ); else { var html = ""; Object.keys( albums ).forEach( function( idx ) { @@ -251,6 +251,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); return; } + $( ".albums .explore").find(".photograph").length == 0 && $( ".manage .album .empty" ).text( "加载中,请稍等..." ); var COUNT = 16, items = [], CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", From dd7d55f9f64bd86423588e0c85e5d0ff7817f9ba Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 22 Dec 2018 18:14:45 +0800 Subject: [PATCH 139/176] Add manage explore init status and option loading complete logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/manage.js | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index f18321f..57ec186 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -265,6 +265,10 @@ "message": "Not any background image" }, + "mange_explore_loading": { + "message": "Loading..." + }, + "bm_foder_search": { "message": "Search" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 90debe8..bb3b244 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -265,6 +265,10 @@ "message": "暂时没有任何背景" }, + "mange_explore_loading": { + "message": "加载中,请稍等..." + }, + "bm_foder_search": { "message": "搜索" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 6b1509a..d9a9613 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -265,6 +265,10 @@ "message": "暫時沒有任何背景" }, + "mange_explore_loading": { + "message": "載入中,請稍等..." + }, + "bm_foder_search": { "message": "搜索" }, diff --git a/js/manage.js b/js/manage.js index b1feae9..a169b18 100644 --- a/js/manage.js +++ b/js/manage.js @@ -251,7 +251,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); return; } - $( ".albums .explore").find(".photograph").length == 0 && $( ".manage .album .empty" ).text( "加载中,请稍等..." ); + $( ".albums .explore").find(".photograph").length == 0 && $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_loading" ) ); var COUNT = 16, items = [], CLIENT = "86ec05bcde52b196fe41f4e5602d35219fdaeb54fd73508c61ec93e24225c94a", @@ -297,6 +297,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", html = compiled({ 'albums': items }); $( ".manage .albums .explore .empty" ).remove(); $( ".manage .albums .explore" ).append( html ); + $( ".manage .albums .explore").scroll() } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); }).fail( function( jqXHR, textStatus, errorThrown ) { getCollection(); From 96fff7bb49af4a7496bf9d0bba2ee0de4810475f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Tue, 25 Dec 2018 10:03:16 +0800 Subject: [PATCH 140/176] Fix earth mode bug. --- js/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index e3d7fc0..3edbbfc 100644 --- a/js/background.js +++ b/js/background.js @@ -464,8 +464,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar localStorage[ "simptab-background-update" ] = "true"; bgeffect( "add" ); this.Get( true ); + $( "body" ).removeClass( "bgearth" ); } - $( "body" ).removeClass( "bgearth" ); } }, From a409d716fc5a12f1c0d7c88faf7cb9eb6562cc9f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 10:25:57 +0800 Subject: [PATCH 141/176] Add config version verify. --- js/options.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/options.js b/js/options.js index 9177076..b167c74 100644 --- a/js/options.js +++ b/js/options.js @@ -63,6 +63,16 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( localStorage.removeItem( key ); } + Storage.prototype.Verify = function( target ) { + if ( target.version == "1.5.3" ) { + target.mobile_host = ""; + target.carousel = "-1"; + target.history = false; + target.version = "1.5.4"; + } + return target; + } + return new Storage(); })(); @@ -246,7 +256,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( onload = function( event ) { if ( event && event.target && event.target.result ) { try { - storage.db = JSON.parse( event.target.result ); + storage.db = storage.Verify( JSON.parse( event.target.result ) ); storage.Set(); new Notify().Render( i18n.GetLang( "notify_zen_mode_import_success" )); } catch ( error ) { From 5a38372ff4680f305db391c57fa567a765373ed9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 10:29:47 +0800 Subject: [PATCH 142/176] Add zen config version verify. --- js/zen.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/js/zen.js b/js/zen.js index 4f5dbf2..33e4b33 100644 --- a/js/zen.js +++ b/js/zen.js @@ -10,14 +10,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] var storage = ( function() { var _themes = [ "19CAAD", "8CC7B5", "A0EEE1", "BEE7E9", "BEEDC7", "D6D5B7", "D1BA74", "E6CEAC", "ECAD9E", "F4606C", "3D5AFE", "363b40", "222222", "ffffff", "random", "custom" ], _storage = { - theme: "#" + _themes[0], - size: "normal", - time: { color: "", display: "true" }, - day: { color: "", display: "true" }, - devices: { color: "", display: "true" }, + theme : "#" + _themes[0], + size : "normal", + time : { color: "", display: "true" }, + day : { color: "", display: "true" }, + devices : { color: "", display: "true" }, topsites: { display: "true" }, - css: "", - version: chrome.runtime.getManifest().version.replace( /.\d{2,}/, "" ), + css : "", + version : chrome.runtime.getManifest().version.replace( /.\d{2,}/, "" ), }, key = "simptab-tenmode-option", random = function( min, max ) { @@ -51,6 +51,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] return this.themes[ idx ]; } + Storage.prototype.Verify = function( target ) { + if ( target.version == "1.5.3" ) { + target.version = "1.5.4"; + } + return target; + } + return new Storage(); })(); @@ -268,7 +275,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] onload = function( event ) { if ( event && event.target && event.target.result ) { try { - storage.db = JSON.parse( event.target.result ); + storage.db = storage.Verify( JSON.parse( event.target.result ) ); storage.Set(); new Notify().Render( i18n.GetLang( "notify_zen_mode_import_success" )); } catch ( error ) { From 1fd7caef792358d1f824154c8a1e19323bbfdee0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 10:33:09 +0800 Subject: [PATCH 143/176] Format source. --- _locales/zh_CN/messages.json | 2 +- _locales/zh_TW/messages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index bb3b244..7350288 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -686,7 +686,7 @@ }, "notify_mobile_host_failed": { - "message": "输入的监听地址不清楚,请重新输入。" + "message": "输入的监听地址不正确,请重新输入。" }, "notify_carousel": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index d9a9613..d8b86cc 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -686,7 +686,7 @@ }, "notify_mobile_host_failed": { - "message": "輸入的監聽地址不清楚,請重新輸入。" + "message": "輸入的監聽地址不正確,請重新輸入。" }, "notify_carousel": { From 8dbe3cb3f96a712bac7f5f1dc8e6b5073cad150d Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 10:42:56 +0800 Subject: [PATCH 144/176] Fix earth mode to time mode bgearth cls logic bug. --- js/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/background.js b/js/background.js index 3edbbfc..8431f46 100644 --- a/js/background.js +++ b/js/background.js @@ -178,6 +178,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar localStorage[ "simptab-background-update" ] == "true" && updateBackground(); console.log( "======= New Background Obj is ", vo ); localStorage[ "simptab-background-mode" ] == "time" && history.Add( vo.new ); + localStorage[ "simptab-background-mode" ] == "time" && $( "body" ).hasClass("bgearth") && $( "body" ).removeClass( "bgearth" ); } } @@ -464,7 +465,6 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar localStorage[ "simptab-background-update" ] = "true"; bgeffect( "add" ); this.Get( true ); - $( "body" ).removeClass( "bgearth" ); } } }, From 455a070fa87a93f8d8d298943ea1203e63aafb58 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 10:53:55 +0800 Subject: [PATCH 145/176] Fix manage i18n bug. --- js/manage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/manage.js b/js/manage.js index a169b18..1581736 100644 --- a/js/manage.js +++ b/js/manage.js @@ -188,7 +188,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", var compiled = _.template( '<% jq.each( albums, function( idx, album ) { %>' + favTmpl + '<% }); %>', { 'imports': { 'jq': jQuery }} ), html = compiled({ 'albums': result }); $( ".manage .albums .favorite" ).html( html ); - } else $( ".manage .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + } else $( ".manage .empty" ).text( i18n.GetLang( "mange_explore_empty" ) ); }); } @@ -248,7 +248,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", function getExploreTmpl() { if ( !options.Storage.db.unsplash || ( options.Storage.db.unsplash.length == 1 && options.Storage.db.unsplash[0] == "" )) { - $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_empty" ) ); return; } $( ".albums .explore").find(".photograph").length == 0 && $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_loading" ) ); @@ -271,7 +271,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", getPhotos( page ); } }, function( jqXHR, textStatus, errorThrown ) { - $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_empty" ) ); }); }, getPhotos = function( page ) { @@ -298,7 +298,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", $( ".manage .albums .explore .empty" ).remove(); $( ".manage .albums .explore" ).append( html ); $( ".manage .albums .explore").scroll() - } else $( ".manage .album .empty" ).text( i18n.GetLang( "notify_mange_empty" ) ); + } else $( ".manage .album .empty" ).text( i18n.GetLang( "mange_explore_empty" ) ); }).fail( function( jqXHR, textStatus, errorThrown ) { getCollection(); }); From 2363a4514a51b7760891e7ed8da383f16c74a0fd Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 11:12:55 +0800 Subject: [PATCH 146/176] Fix background not set logic bug. --- js/controlbar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/controlbar.js b/js/controlbar.js index 7da2746..b9e426c 100644 --- a/js/controlbar.js +++ b/js/controlbar.js @@ -11,7 +11,8 @@ define([ "jquery", "i18n", "vo", "date", "files", "setting", "manage", "about", } function setBackground( url ) { - if ( localStorage[ "simptab-background-update" ] == "true" ) return; + // hack code + if ( $("body").css( "background-image" ) != "none" && localStorage[ "simptab-background-update" ] == "true" ) return; $("body").css({ "background-image": "url(" + url + ")" }); } From 7a59df45cf5c61036264a0c6d31ba401b6546725 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 11:38:29 +0800 Subject: [PATCH 147/176] Add favorite emtyp notify tips. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/setting.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 57ec186..9959933 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -669,6 +669,10 @@ "message": "Welcome to Earth every moment, earth background come from 向日葵-8號 ." }, + "notify_favorite_tips": { + "message": "When favorite empty and only usage favorite origin will be errors." + }, + "notify_zen_mode_tips_confirm": { "message": "Confirm" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 7350288..0a535b2 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -669,6 +669,10 @@ "message": "欢迎使用地球每刻,感谢 向日葵-8號 提供,详细请看 地球每刻 。" }, + "notify_favorite_tips": { + "message": "当收藏夹没有任何内容并仅启用收藏夹源的情况下会出现错误。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index d8b86cc..81cdceb 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -669,6 +669,10 @@ "message": "歡迎使用地球每刻,感謝 向日葵-8號 提供,詳細請看 地球每刻 。" }, + "notify_favorite_tips": { + "message": "當收藏夾沒有任何內容並僅啟用收藏夾源的情況下會出現錯誤。" + }, + "notify_zen_mode_tips_confirm": { "message": "不再提示" }, diff --git a/js/setting.js b/js/setting.js index 7a7cc95..478eba0 100644 --- a/js/setting.js +++ b/js/setting.js @@ -255,6 +255,10 @@ define([ "jquery", "waves", "i18n", "zen" ], function( $, Waves, i18n, zen ) { value = event.target.value == "true" ? "false" : "true"; updateCkState( idx + ":" + value ); setting.UpdateOriginsMode( idx, value ); + localStorage["simptab-favorite-notify"] != "false" && + new Notify().Render({ content: i18n.GetLang( "notify_favorite_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + localStorage["simptab-favorite-notify"] = false; + }}); }); // listen originstate checkbox button event From 040d721e823ddc48907439771e98833c53681868 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 15:38:53 +0800 Subject: [PATCH 148/176] Fix favorite empty workflow bug. --- js/apis.js | 3 ++- js/background.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/apis.js b/js/apis.js index 7537073..f9ec376 100644 --- a/js/apis.js +++ b/js/apis.js @@ -582,7 +582,8 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] var dtd = $.Deferred(), arr = JSON.parse( localStorage[ "simptab-favorites" ] || "[]" ); if ( !Array.isArray( arr ) || arr.length == 0 ) { - dtd.reject( new SimpError( "favorite", "Local storge 'simptab-favorites' not exist.", apis.vo )); + //dtd.reject( new SimpError( "favorite", "Local storge 'simptab-favorites' not exist.", apis.vo )); + dtd.resolve( vo.Create( vo.constructor.DEFAULT_BACKGROUND, vo.constructor.DEFAULT_BACKGROUND, "Wallpaper", "#", date.Now(), "Wallpaper", "default", {} )); return dtd; } diff --git a/js/background.js b/js/background.js index 8431f46..cd318ce 100644 --- a/js/background.js +++ b/js/background.js @@ -97,7 +97,8 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar console.log( "=== Current background image url: " + result.hdurl ) console.log( "=== Current background vo.new : ", vo.new ) // when result.hdurl == vo.constructor.DEFAULT_BACKGROUND, version.hdurl verify failed, re-set vo.new is vo.cur - result.hdurl != vo.constructor.DEFAULT_BACKGROUND ? def.resolve( true, result.hdurl ) : vo.new = vo.Clone( vo.cur ); + // result.hdurl != vo.constructor.DEFAULT_BACKGROUND ? def.resolve( true, result.hdurl ) : vo.new = vo.Clone( vo.cur ); + def.resolve( true, result.hdurl ); }); } else { From 184527ba32e0867bccd9d320f66245693e852a4a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 15:47:57 +0800 Subject: [PATCH 149/176] Add favorite empty i18n. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/apis.js | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 9959933..81a9eb1 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -721,6 +721,10 @@ "message": "This is the latest history background." }, + "notify_favorite_empty": { + "message": "Favorite origin is empty, re-set default background." + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 0a535b2..d192009 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -721,6 +721,10 @@ "message": "当前已经是最新一张历史记录了。" }, + "notify_favorite_empty": { + "message": "收藏夹背景源暂无任何内容,已自动设置默认背景。" + }, + "version_detail": { "message": "" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 81cdceb..264bc0c 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -721,6 +721,10 @@ "message": "當前已經是最新一張歷史記錄了。" }, + "notify_favorite_empty": { + "message": "收藏夾背景源暫無任何內容,已自動設置默認背景。" + }, + "version_detail": { "message": "" }, diff --git a/js/apis.js b/js/apis.js index f9ec376..9073e47 100644 --- a/js/apis.js +++ b/js/apis.js @@ -1,5 +1,5 @@ -define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ], function( $, i18n, setting, vo, date, SimpError, cdns, options ) { +define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options", "notify" ], function( $, i18n, setting, vo, date, SimpError, cdns, options, notify ) { "use strict"; @@ -583,6 +583,7 @@ define([ "jquery", "i18n", "setting", "vo", "date", "error", "cdns", "options" ] arr = JSON.parse( localStorage[ "simptab-favorites" ] || "[]" ); if ( !Array.isArray( arr ) || arr.length == 0 ) { //dtd.reject( new SimpError( "favorite", "Local storge 'simptab-favorites' not exist.", apis.vo )); + new Notify().Render( i18n.GetLang( "notify_favorite_empty" ) ); dtd.resolve( vo.Create( vo.constructor.DEFAULT_BACKGROUND, vo.constructor.DEFAULT_BACKGROUND, "Wallpaper", "#", date.Now(), "Wallpaper", "default", {} )); return dtd; } From fffb9c7334c5b9fdb2cc647826954fcef24184bb Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 15:50:23 +0800 Subject: [PATCH 150/176] Format source. --- _locales/en/messages.json | 40 ++++++++++++++++++------------------ _locales/zh_CN/messages.json | 40 ++++++++++++++++++------------------ _locales/zh_TW/messages.json | 40 ++++++++++++++++++------------------ 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 81a9eb1..08e63ca 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -549,6 +549,26 @@ "message": "Current version: #1. #4To learn more, please visit #2CHANGELOG#3." }, + "notify_zen_mode_tips": { + "message": "Welcome to zen mode. Use shortcut c or mouse to move the lower right corner to pop up the options." + }, + + "notify_explore_tips": { + "message": "Scroll down to load more, background loading depending on your network speed." + }, + + "notify_earth_tips": { + "message": "Welcome to Earth every moment, earth background come from 向日葵-8號 ." + }, + + "notify_favorite_tips": { + "message": "When favorite empty and only usage favorite origin will be errors." + }, + + "notify_zen_mode_tips_confirm": { + "message": "Confirm" + }, + "notify_upload_complete": { "message": "Background image uploaded successfully." }, @@ -657,26 +677,6 @@ "message": "Exit zen mode success, please refresh new tab." }, - "notify_zen_mode_tips": { - "message": "Welcome to zen mode. Use shortcut c or mouse to move the lower right corner to pop up the options." - }, - - "notify_explore_tips": { - "message": "Scroll down to load more, background loading depending on your network speed." - }, - - "notify_earth_tips": { - "message": "Welcome to Earth every moment, earth background come from 向日葵-8號 ." - }, - - "notify_favorite_tips": { - "message": "When favorite empty and only usage favorite origin will be errors." - }, - - "notify_zen_mode_tips_confirm": { - "message": "Confirm" - }, - "notify_mobile_send": { "message": "Send to mobile..." }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index d192009..fd7b61a 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -549,6 +549,26 @@ "message": "安装到 最新版本 #1,#4详细请看 #2更新日志#3" }, + "notify_zen_mode_tips": { + "message": "欢迎来到 禅模式,使用快捷键 c 或者鼠标移动右下角弹出选项卡。" + }, + + "notify_explore_tips": { + "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" + }, + + "notify_earth_tips": { + "message": "欢迎使用地球每刻,感谢 向日葵-8號 提供,详细请看 地球每刻 。" + }, + + "notify_favorite_tips": { + "message": "当收藏夹没有任何内容并仅启用收藏夹源的情况下会出现错误。" + }, + + "notify_zen_mode_tips_confirm": { + "message": "不再提示" + }, + "notify_upload_complete": { "message": "背景上传完毕。" }, @@ -657,26 +677,6 @@ "message": "已退出禅模式,页面刷新后生效。" }, - "notify_zen_mode_tips": { - "message": "欢迎来到 禅模式,使用快捷键 c 或者鼠标移动右下角弹出选项卡。" - }, - - "notify_explore_tips": { - "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" - }, - - "notify_earth_tips": { - "message": "欢迎使用地球每刻,感谢 向日葵-8號 提供,详细请看 地球每刻 。" - }, - - "notify_favorite_tips": { - "message": "当收藏夹没有任何内容并仅启用收藏夹源的情况下会出现错误。" - }, - - "notify_zen_mode_tips_confirm": { - "message": "不再提示" - }, - "notify_mobile_send": { "message": "正在发送,请稍等..." }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 264bc0c..b7bcc86 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -549,6 +549,26 @@ "message": "安裝到 最新版本 #1,#4詳細請看 #2更新日誌#3" }, + "notify_zen_mode_tips": { + "message": "歡迎來到 禪模式,使用快捷鍵 c 或者滑鼠移動右下角彈出選項卡。" + }, + + "notify_explore_tips": { + "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" + }, + + "notify_earth_tips": { + "message": "歡迎使用地球每刻,感謝 向日葵-8號 提供,詳細請看 地球每刻 。" + }, + + "notify_favorite_tips": { + "message": "當收藏夾沒有任何內容並僅啟用收藏夾源的情況下會出現錯誤。" + }, + + "notify_zen_mode_tips_confirm": { + "message": "不再提示" + }, + "notify_upload_complete": { "message": "背景上傳完畢。" }, @@ -657,26 +677,6 @@ "message": "已退出禪模式,頁面刷新後生效。" }, - "notify_zen_mode_tips": { - "message": "歡迎來到 禪模式,使用快捷鍵 c 或者滑鼠移動右下角彈出選項卡。" - }, - - "notify_explore_tips": { - "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" - }, - - "notify_earth_tips": { - "message": "歡迎使用地球每刻,感謝 向日葵-8號 提供,詳細請看 地球每刻 。" - }, - - "notify_favorite_tips": { - "message": "當收藏夾沒有任何內容並僅啟用收藏夾源的情況下會出現錯誤。" - }, - - "notify_zen_mode_tips_confirm": { - "message": "不再提示" - }, - "notify_mobile_send": { "message": "正在發送,請稍等..." }, From 02d4565502a8aba4676e94190b2b13c142d3e491 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 15:56:32 +0800 Subject: [PATCH 151/176] Optimize tips i18n. --- _locales/en/messages.json | 10 +++++----- _locales/zh_CN/messages.json | 10 +++++----- _locales/zh_TW/messages.json | 10 +++++----- js/background.js | 2 +- js/manage.js | 2 +- js/setting.js | 2 +- js/zen.js | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 08e63ca..5ef52c9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -549,23 +549,23 @@ "message": "Current version: #1. #4To learn more, please visit #2CHANGELOG#3." }, - "notify_zen_mode_tips": { + "tips_zen_mode": { "message": "Welcome to zen mode. Use shortcut c or mouse to move the lower right corner to pop up the options." }, - "notify_explore_tips": { + "tips_explore": { "message": "Scroll down to load more, background loading depending on your network speed." }, - "notify_earth_tips": { + "tips_earth": { "message": "Welcome to Earth every moment, earth background come from 向日葵-8號 ." }, - "notify_favorite_tips": { + "tips_favorite": { "message": "When favorite empty and only usage favorite origin will be errors." }, - "notify_zen_mode_tips_confirm": { + "tips_confirm": { "message": "Confirm" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index fd7b61a..1f20c10 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -549,23 +549,23 @@ "message": "安装到 最新版本 #1,#4详细请看 #2更新日志#3" }, - "notify_zen_mode_tips": { + "tips_zen_mode": { "message": "欢迎来到 禅模式,使用快捷键 c 或者鼠标移动右下角弹出选项卡。" }, - "notify_explore_tips": { + "tips_explore": { "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" }, - "notify_earth_tips": { + "tips_earth": { "message": "欢迎使用地球每刻,感谢 向日葵-8號 提供,详细请看 地球每刻 。" }, - "notify_favorite_tips": { + "tips_favorite": { "message": "当收藏夹没有任何内容并仅启用收藏夹源的情况下会出现错误。" }, - "notify_zen_mode_tips_confirm": { + "tips_confirm": { "message": "不再提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index b7bcc86..779e8c8 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -549,23 +549,23 @@ "message": "安裝到 最新版本 #1,#4詳細請看 #2更新日誌#3" }, - "notify_zen_mode_tips": { + "tips_zen_mode": { "message": "歡迎來到 禪模式,使用快捷鍵 c 或者滑鼠移動右下角彈出選項卡。" }, - "notify_explore_tips": { + "tips_explore": { "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" }, - "notify_earth_tips": { + "tips_earth": { "message": "歡迎使用地球每刻,感謝 向日葵-8號 提供,詳細請看 地球每刻 。" }, - "notify_favorite_tips": { + "tips_favorite": { "message": "當收藏夾沒有任何內容並僅啟用收藏夾源的情況下會出現錯誤。" }, - "notify_zen_mode_tips_confirm": { + "tips_confirm": { "message": "不再提示" }, diff --git a/js/background.js b/js/background.js index cd318ce..5ef32d0 100644 --- a/js/background.js +++ b/js/background.js @@ -472,7 +472,7 @@ define([ "jquery", "date", "i18n", "setting", "apis", "vo", "files", "controlbar Earth: function( is_notify ) { localStorage["simptab-earth-notify"] != "false" && - new Notify().Render({ content: i18n.GetLang( "notify_earth_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + new Notify().Render({ content: i18n.GetLang( "tips_earth" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ localStorage["simptab-earth-notify"] = false; }}); if ( vo.cur.type == "earth" && date.Now() - vo.cur.enddate < 10000 ) { diff --git a/js/manage.js b/js/manage.js index 1581736..6d533f8 100644 --- a/js/manage.js +++ b/js/manage.js @@ -91,7 +91,7 @@ define([ "jquery", "lodash", "notify", "i18n", "vo", "date", "options", "files", if ( $( ".tabs .tab-active").attr("idx") == "2" ) { getExploreTmpl(); localStorage["simptab-explore-notify"] != "false" && - new Notify().Render({ content: i18n.GetLang( "notify_explore_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + new Notify().Render({ content: i18n.GetLang( "tips_explore" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ localStorage["simptab-explore-notify"] = false; }}); } diff --git a/js/setting.js b/js/setting.js index 478eba0..4020cd5 100644 --- a/js/setting.js +++ b/js/setting.js @@ -256,7 +256,7 @@ define([ "jquery", "waves", "i18n", "zen" ], function( $, Waves, i18n, zen ) { updateCkState( idx + ":" + value ); setting.UpdateOriginsMode( idx, value ); localStorage["simptab-favorite-notify"] != "false" && - new Notify().Render({ content: i18n.GetLang( "notify_favorite_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + new Notify().Render({ content: i18n.GetLang( "tips_favorite" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ localStorage["simptab-favorite-notify"] = false; }}); }); diff --git a/js/zen.js b/js/zen.js index 33e4b33..4514f8a 100644 --- a/js/zen.js +++ b/js/zen.js @@ -409,7 +409,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] function notify() { localStorage["simptab-zenmode-notify"] != "false" && - new Notify().Render({ content: i18n.GetLang( "notify_zen_mode_tips" ), action: i18n.GetLang( "notify_zen_mode_tips_confirm" ), callback:function (){ + new Notify().Render({ content: i18n.GetLang( "tips_zen_mode" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ localStorage["simptab-zenmode-notify"] = false; }}); } From a66654ef6c7f9ba64944fc183def213fd83e63d9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 15:58:44 +0800 Subject: [PATCH 152/176] Optimize favorite empty setting favorite empty clicked logic. --- js/setting.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/setting.js b/js/setting.js index 4020cd5..39d6687 100644 --- a/js/setting.js +++ b/js/setting.js @@ -255,10 +255,12 @@ define([ "jquery", "waves", "i18n", "zen" ], function( $, Waves, i18n, zen ) { value = event.target.value == "true" ? "false" : "true"; updateCkState( idx + ":" + value ); setting.UpdateOriginsMode( idx, value ); - localStorage["simptab-favorite-notify"] != "false" && - new Notify().Render({ content: i18n.GetLang( "tips_favorite" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ - localStorage["simptab-favorite-notify"] = false; - }}); + if ( idx == "10" && value == "true" ) { + localStorage["simptab-favorite-notify"] != "false" && + new Notify().Render({ content: i18n.GetLang( "tips_favorite" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ + localStorage["simptab-favorite-notify"] = false; + }}); + } }); // listen originstate checkbox button event From c33e762a2d9edb9b00e601b2a02fd2082fbb6f85 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 16:08:10 +0800 Subject: [PATCH 153/176] Fix simptab update option data structure not update bug. --- js/options.js | 2 +- js/zen.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/options.js b/js/options.js index b167c74..2f65070 100644 --- a/js/options.js +++ b/js/options.js @@ -47,7 +47,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( if ( !this.db ) { this.db = $.extend( {}, _storage ); localStorage.setItem( key, JSON.stringify( this.db )); - } else this.db = JSON.parse( this.db ); + } else this.db = this.Verify( JSON.parse( this.db )); this.key = key; } diff --git a/js/zen.js b/js/zen.js index 4514f8a..273d6a3 100644 --- a/js/zen.js +++ b/js/zen.js @@ -29,7 +29,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] if ( !this.db ) { this.db = $.extend( {}, _storage ); localStorage.setItem( key, JSON.stringify( this.db )); - } else this.db = JSON.parse( this.db ); + } else this.db = this.Verify( JSON.parse( this.db )); this.themes = _themes; this.key = key; } From 989563c7a2c878054894a4b0b04975b560738611 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 16:12:51 +0800 Subject: [PATCH 154/176] Fix simptab update option data structure not update bug. --- js/options.js | 5 +++-- js/zen.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/options.js b/js/options.js index 2f65070..4fbb5ff 100644 --- a/js/options.js +++ b/js/options.js @@ -47,7 +47,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( if ( !this.db ) { this.db = $.extend( {}, _storage ); localStorage.setItem( key, JSON.stringify( this.db )); - } else this.db = this.Verify( JSON.parse( this.db )); + } else this.db = this.Verify( JSON.parse( this.db ), true ); this.key = key; } @@ -63,13 +63,14 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( localStorage.removeItem( key ); } - Storage.prototype.Verify = function( target ) { + Storage.prototype.Verify = function( target, is_save ) { if ( target.version == "1.5.3" ) { target.mobile_host = ""; target.carousel = "-1"; target.history = false; target.version = "1.5.4"; } + is_save && this.Set(); return target; } diff --git a/js/zen.js b/js/zen.js index 273d6a3..c65409e 100644 --- a/js/zen.js +++ b/js/zen.js @@ -35,7 +35,7 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] } Storage.prototype.Set = function() { - localStorage.setItem( key, JSON.stringify( this.db )); + localStorage.setItem( key, JSON.stringify( this.db ), true ); } Storage.prototype.Get = function() { @@ -51,10 +51,11 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] return this.themes[ idx ]; } - Storage.prototype.Verify = function( target ) { + Storage.prototype.Verify = function( target, is_save ) { if ( target.version == "1.5.3" ) { target.version = "1.5.4"; } + is_save && this.Set(); return target; } From 7a75733eb38c1abf1f16c08d513eabadfc8666f4 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Thu, 27 Dec 2018 16:26:33 +0800 Subject: [PATCH 155/176] Fix simptab update option data structure not update bug. --- js/options.js | 7 +++---- js/zen.js | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/options.js b/js/options.js index 4fbb5ff..bb92e28 100644 --- a/js/options.js +++ b/js/options.js @@ -46,9 +46,9 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( this.db = localStorage[ key ]; if ( !this.db ) { this.db = $.extend( {}, _storage ); - localStorage.setItem( key, JSON.stringify( this.db )); - } else this.db = this.Verify( JSON.parse( this.db ), true ); + } else this.db = this.Verify( JSON.parse( this.db )); this.key = key; + localStorage.setItem( key, JSON.stringify( this.db )); } Storage.prototype.Set = function() { @@ -63,14 +63,13 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps" ], function( localStorage.removeItem( key ); } - Storage.prototype.Verify = function( target, is_save ) { + Storage.prototype.Verify = function( target ) { if ( target.version == "1.5.3" ) { target.mobile_host = ""; target.carousel = "-1"; target.history = false; target.version = "1.5.4"; } - is_save && this.Set(); return target; } diff --git a/js/zen.js b/js/zen.js index c65409e..2dc04db 100644 --- a/js/zen.js +++ b/js/zen.js @@ -28,10 +28,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] this.db = localStorage[ key ]; if ( !this.db ) { this.db = $.extend( {}, _storage ); - localStorage.setItem( key, JSON.stringify( this.db )); } else this.db = this.Verify( JSON.parse( this.db )); this.themes = _themes; this.key = key; + localStorage.setItem( key, JSON.stringify( this.db )); } Storage.prototype.Set = function() { @@ -51,11 +51,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "message", "comps" ] return this.themes[ idx ]; } - Storage.prototype.Verify = function( target, is_save ) { + Storage.prototype.Verify = function( target ) { if ( target.version == "1.5.3" ) { target.version = "1.5.4"; } - is_save && this.Set(); return target; } From ca81e2174863470acf6bec1f02833f9898b6baf6 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 28 Dec 2018 13:57:54 +0800 Subject: [PATCH 156/176] Add white noise tips logic. --- _locales/en/messages.json | 4 ++++ _locales/zh_CN/messages.json | 4 ++++ _locales/zh_TW/messages.json | 4 ++++ js/noise.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 5ef52c9..bbcf04c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -565,6 +565,10 @@ "message": "When favorite empty and only usage favorite origin will be errors." }, + "tips_noise": { + "message": "Welcome usage White noise, shortcuts w startup it." + }, + "tips_confirm": { "message": "Confirm" }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 1f20c10..381ccd1 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -565,6 +565,10 @@ "message": "当收藏夹没有任何内容并仅启用收藏夹源的情况下会出现错误。" }, + "tips_noise": { + "message": "欢迎使用白噪音,快捷键 w 即可打开,更多细节请访问 白噪音 。" + }, + "tips_confirm": { "message": "不再提示" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 779e8c8..554d2c9 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -565,6 +565,10 @@ "message": "當收藏夾沒有任何內容並僅啟用收藏夾源的情況下會出現錯誤。" }, + "tips_noise": { + "message": "歡迎使用白噪音,快捷鍵 w 即可打開,更多細節請訪問 白噪音 。" + }, + "tips_confirm": { "message": "不再提示" }, diff --git a/js/noise.js b/js/noise.js index 28dddfc..5da304a 100644 --- a/js/noise.js +++ b/js/noise.js @@ -114,6 +114,10 @@ define([ "jquery", "mousetrap", "lodash", "notify", "i18n", "comps", "message" ] return { Init: function() { message.Subscribe( message.TYPE.OPEN_NOISE, function( event ) { + localStorage["simptab-noise-notify"] != "false" && + new Notify().Render({ content: i18n.GetLang( "tips_noise" ), action: i18n.GetLang( "tips_confirm" ), callback:function (){ + localStorage["simptab-noise-notify"] = false; + }}); if ( $( "body" ).find( ".noise-mode" ).length > 0 ) { open(); } else { From dd1a277e43afbdd62daf1bbd1131a3f95f191dc4 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 28 Dec 2018 14:57:54 +0800 Subject: [PATCH 157/176] Format source. --- _locales/zh_CN/messages.json | 2 +- _locales/zh_TW/messages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 381ccd1..20c7a07 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -554,7 +554,7 @@ }, "tips_explore": { - "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" + "message": "向下滚动即可加载更多,显示速度取决于你的网速,详细请看 探索 。" }, "tips_earth": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 554d2c9..658a96d 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -554,7 +554,7 @@ }, "tips_explore": { - "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" + "message": "向下滾動即可載入更多,顯示速度取決於你的網速,詳細請看 探索 。" }, "tips_earth": { From f7823e9eb6a0b447281b7ed7375fada52b019190 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 28 Dec 2018 15:25:38 +0800 Subject: [PATCH 158/176] Format source. --- _locales/en/messages.json | 2 +- _locales/zh_CN/messages.json | 4 ++-- _locales/zh_TW/messages.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bbcf04c..796f1a0 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -394,7 +394,7 @@ }, "options_custom_mobile_notice": { - "message": "First JSBox is required to be installed on iOS, for details Send to mobile" + "message": "First JSBox is required to be installed on iOS, for details Send to mobile" }, "options_carousel_label": { diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 20c7a07..d1fdf74 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -74,7 +74,7 @@ }, "controlbar_mobile": { - "message": "发送到手机端" + "message": "发送到手机" }, "controlbar_favorite": { @@ -394,7 +394,7 @@ }, "options_custom_mobile_notice": { - "message": "此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机端" + "message": "此功能需要在 iOS 端安装 JSBox,详细说明请访问 发送到手机" }, "options_carousel_label": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 658a96d..ed4bc43 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -74,7 +74,7 @@ }, "controlbar_mobile": { - "message": "發送到手機端" + "message": "發送到手機" }, "controlbar_favorite": { @@ -394,7 +394,7 @@ }, "options_custom_mobile_notice": { - "message": "此功能需要在 iOS 端安裝 JSBox,詳細說明請訪問 發送到手機端" + "message": "此功能需要在 iOS 端安裝 JSBox,詳細說明請訪問 發送到手機" }, "options_carousel_label": { From 841e2539fb9b1be1a4a75241649af2282586000b Mon Sep 17 00:00:00 2001 From: Kenshin Date: Fri, 28 Dec 2018 18:05:15 +0800 Subject: [PATCH 159/176] Update README.md. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f8b63e0..4c604cb 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@

    简 Tab - 极简的 Chrome 新标签页扩展

    望你每次打开都有好心情;去除多余功能,只关注标签页呈现效果。

    - + - +

    *** #### 马上使用: -* [Chrome 应用商店](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) 或者 [离线下载](http://ksria.com/simptab/crx/1.5.3/simptab.crx) +* [Chrome 应用商店](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) 或者 [离线下载](http://ksria.com/simptab/crx/1.5.4/simptab.crx) * 有任何问题请看 [帮助中心](http://ksria.com/simptab/docs/#) 或者 加入 **[SimpTab 的讨论群](https://gitter.im/Kenshin/simptab)** @@ -98,7 +98,7 @@ * #### 全部功能: -![全部功能:](http://st.ksria.cn/feature%201.5.3.png) +![全部功能:](http://st.ksria.cn/feature%201.5.4.png) #### 相关链接: * [更新日志](http://ksria.com/simptab/docs/#/CHANGELOG) From cdd2913b245e5bfbbb5eae98b9ff547205162dd0 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 09:53:24 +0800 Subject: [PATCH 160/176] Update README.md. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4c604cb..e2afcc6 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ * 只显示当前背景:永不更换背景源 + * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) 地球每刻:得益于 [向日葵-8號](http://himawari8.nict.go.jp/) 现在可以在新标签页显示地球自拍照了,详细请看 [地球每刻](http://ksria.com/simptab/docs/#/多种背景源?id=地球每刻) + - [多种类型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` @@ -55,6 +57,10 @@ > 点击 控制栏「收藏」后的背景集合 + * [探索](http://ksria.com/simptab/docs/#/多种背景源?id=探索) + + > 来自 Unsplash 的精美背景合辑 + - 多种布局; > 包括: `左上角对齐` · `居中对齐` · `相框效果` @@ -91,6 +97,12 @@ +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [历史记录](http://ksria.com/simptab/docs/#/多种背景源?id=历史记录) + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [白噪音](http://ksria.com/simptab/docs/#/白噪音) + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [发送到手机](http://ksria.com/simptab/docs/#/发送到手机) + #### 投票: * 简 Tab 是一个免费并开源的项目,如果觉得不错,请给我 [投票](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) From 455ae7e371fe1c8432063a4dd3a7f06eeb126445 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 09:56:09 +0800 Subject: [PATCH 161/176] Update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2afcc6..3d8610c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ > 点击 控制栏「收藏」后的背景集合 - * [探索](http://ksria.com/simptab/docs/#/多种背景源?id=探索) + * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [探索](http://ksria.com/simptab/docs/#/多种背景源?id=探索) > 来自 Unsplash 的精美背景合辑 From db4f27c41e001ce74846509e1d0ea37b50407c26 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 09:58:09 +0800 Subject: [PATCH 162/176] Update README.tw.md. --- README.tw.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.tw.md b/README.tw.md index 382e840..33afb5b 100644 --- a/README.tw.md +++ b/README.tw.md @@ -44,6 +44,8 @@ * 只顯示當前背景:永不更換背景源 + * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) 地球每刻:得益於 [向日葵-8號](http://himawari8.nict.go.jp/) 現在可以在新標籤頁顯示地球自拍照了,詳細請看 [地球每刻](http://ksria.com/simptab/docs/#/多种背景源?id=地球每刻) + - [多種類型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` @@ -55,6 +57,10 @@ > 點擊 控制欄「收藏」後的背景集合 + * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [探索](http://ksria.com/simptab/docs/#/多种背景源?id=探索) + + > 来自 Unsplash 的精美背景合辑 + - 多種布局; > 包括: `左上角對齊` · `居中對齊` · `相框效果` @@ -91,6 +97,12 @@ +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [歷史記錄](http://ksria.com/simptab/docs/#/多种背景源?id=历史记录) + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [白噪音](http://ksria.com/simptab/docs/#/白噪音) + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [發送到手機](http://ksria.com/simptab/docs/#/发送到手机) + #### 投票: * 簡 Tab 是一個免費並開源的項目,如果覺得不錯,請給我 [投票](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) From 5fcd08328c02638f95357fc3b9194beb43eb67f5 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:01:46 +0800 Subject: [PATCH 163/176] Update README.md. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3d8610c..b4fd7f2 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ - [多种类型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` - * ![1.5.1](https://img.shields.io/badge/1.5.1-red.svg) **SimpTab 精选集** + * SimpTab 精选集 > 独有功能,每周一期,每期 【一 ~ 九】 张手工采集精选壁纸,类似 iOS App 的做法,获取往期壁纸,请关注 简 Tab 精选集小秘 → https://weibo.com/u/6632928109 @@ -77,9 +77,9 @@ - 不再显示(删除)功能; -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [书签栏](http://ksria.com/simptab/docs/#/功能一览#主要功能之一); +- [书签栏](http://ksria.com/simptab/docs/#/功能一览#主要功能之一); -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [收藏与订阅管理器](http://ksria.com/simptab/docs/#/功能一览#主要功能之二); +- [收藏与订阅管理器](http://ksria.com/simptab/docs/#/功能一览#主要功能之二); - ![1.5.3](https://img.shields.io/badge/1.5.3-red.svg) [选项页](http://ksria.com/simptab/docs/#/选项页); @@ -110,7 +110,7 @@ * #### 全部功能: -![全部功能:](http://st.ksria.cn/feature%201.5.4.png) +![全部功能:](http://st.ksria.cn/feature%201.5.3.png) #### 相关链接: * [更新日志](http://ksria.com/simptab/docs/#/CHANGELOG) From eb3baf376787bcb91f157bff48662cceb55396e9 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:01:51 +0800 Subject: [PATCH 164/176] Update README.tw.md. --- README.tw.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.tw.md b/README.tw.md index 33afb5b..9044724 100644 --- a/README.tw.md +++ b/README.tw.md @@ -49,7 +49,7 @@ - [多種類型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` - * ![1.5.1](https://img.shields.io/badge/1.5.1-red.svg) **SimpTab 精選集** + * SimpTab 精選集 > 獨有功能,每周一期,每期 【一 ~ 九】 張手工採集精選壁紙,類似 iOS App 的做法,獲取往期壁紙,請關注 簡 Tab 精選集小秘 → https://weibo.com/u/6632928109 @@ -77,9 +77,9 @@ - 不再顯示(刪除)功能; -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [書籤欄](http://ksria.com/simptab/docs/#/功能一览#主要功能之一); +- [書籤欄](http://ksria.com/simptab/docs/#/功能一览#主要功能之一); -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [收藏與訂閱管理器](http://ksria.com/simptab/docs/#/功能一览#主要功能之二); +- [收藏與訂閱管理器](http://ksria.com/simptab/docs/#/功能一览#主要功能之二); - ![1.5.3](https://img.shields.io/badge/1.5.3-red.svg) [選項頁](http://ksria.com/simptab/docs/#/选项页); From a00be633eec4ff0499734581cb249bc3e8514afd Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:06:06 +0800 Subject: [PATCH 165/176] Update README.en.md. --- README.en.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 852bf6b..b5ef566 100644 --- a/README.en.md +++ b/README.en.md @@ -35,7 +35,7 @@ #### Features Details: - Automatically recognize the preferred language. ( Simplified & Traditional Chinese, English. -- Change the background daily/randomly/no-changed on new tab +- Change the background daily/randomly/no-changed/earth every moment on new tab - Multiples type background origins: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` @@ -44,6 +44,8 @@ * Favorite origins + * Explore + - Multiple layouts; (picture frame effect, top left aligned, center aligned) > include: `top left aligned` · `center aligned` · `photo frame` @@ -80,6 +82,12 @@ +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) History background image + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) White noise + +- ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) Send to phone + #### Vote: * If you like this application, please [Rate](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) it From 36d2281dac3937c2588e34023b82de7b00bdb292 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:06:54 +0800 Subject: [PATCH 166/176] Format source. --- README.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.en.md b/README.en.md index b5ef566..ae9f2de 100644 --- a/README.en.md +++ b/README.en.md @@ -40,7 +40,7 @@ - Multiples type background origins: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` - * ![1.5.1](https://img.shields.io/badge/1.5.1-red.svg) **SimpTab Subscribe** origins + * SimpTab Subscribe origins * Favorite origins @@ -62,9 +62,9 @@ - Dislike; ( Prevent the background from appearing again ) -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [Bookmarks](http://ksria.com/simptab/docs/#/功能一览#主要功能之一) ; +- [Bookmarks](http://ksria.com/simptab/docs/#/功能一览#主要功能之一) ; -- ![1.5.2](https://img.shields.io/badge/1.5.2-red.svg) [Background Manage](http://ksria.com/simptab/docs/#/功能一览#主要功能之二) ; +- [Background Manage](http://ksria.com/simptab/docs/#/功能一览#主要功能之二) ; - ![1.5.3](https://img.shields.io/badge/1.5.3-red.svg) [Options](http://ksria.com/simptab/docs/#/选项页); From f287ab4322b9aeb76e0dfcc329556764cee72ad4 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:08:21 +0800 Subject: [PATCH 167/176] Update README.*.md. --- README.en.md | 6 +++--- README.tw.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.en.md b/README.en.md index ae9f2de..1527468 100644 --- a/README.en.md +++ b/README.en.md @@ -2,10 +2,10 @@

    SimpTab - Minimalist Chrome new tab extension

    Hope to improve your mood every time you open a new tab. Clear & simple, focused on beautiful background images.

    - + - +

    @@ -13,7 +13,7 @@ *** #### Download: -* [Chrome Webstore](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) · [Offline Download](http://ksria.com/simptab/crx/1.5.3/simptab.crx) +* [Chrome Webstore](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) · [Offline Download](http://ksria.com/simptab/crx/1.5.4/simptab.crx) * If you have a good background and would like to share with you, please tell me and submission address → [Google Form](https://goo.gl/forms/oThieQCP6xk626GU2) diff --git a/README.tw.md b/README.tw.md index 9044724..f9a5047 100644 --- a/README.tw.md +++ b/README.tw.md @@ -2,17 +2,17 @@

    簡 Tab - 極簡的 Chrome 新標籤頁擴展

    望你每次打開都有好心情;去除多餘功能,只關註標簽頁呈現效果。

    - + - +

    *** #### 馬上使用: -* [Chrome 應用商店](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) 或者 [離線下載](http://ksria.com/simptab/crx/1.5.3/simptab.crx) +* [Chrome 應用商店](https://chrome.google.com/webstore/detail/simptab-new-tab/kbgmbmkhepchmmcnbdbclpkpegbgikjc) 或者 [離線下載](http://ksria.com/simptab/crx/1.5.4/simptab.crx) * 有任何問題請看 [幫助中心](http://ksria.com/simptab/docs/#) 或者 加入 **[SimpTab 的討論群](https://gitter.im/Kenshin/simptab)** From 2a8aaf0b2d4bff89aa57397fcb1eecb4421a4625 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 29 Dec 2018 10:33:48 +0800 Subject: [PATCH 168/176] Update README.*.md. --- README.md | 2 +- README.tw.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4fd7f2..d7845b9 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ * #### 全部功能: -![全部功能:](http://st.ksria.cn/feature%201.5.3.png) +![全部功能](http://st.ksria.cn/feature%201.5.4.png) #### 相关链接: * [更新日志](http://ksria.com/simptab/docs/#/CHANGELOG) diff --git a/README.tw.md b/README.tw.md index f9a5047..cc41eb0 100644 --- a/README.tw.md +++ b/README.tw.md @@ -110,7 +110,7 @@ * #### 全部功能: -![全部功能:](http://st.ksria.cn/feature%201.5.3.png) +![全部功能](http://st.ksria.cn/feature%201.5.4.png) #### 相關鏈接: * [更新日誌](http://ksria.com/simptab/docs/#/CHANGELOG) From daab2d0ea420462523ed2c90727179a92062977a Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 11:55:11 +0800 Subject: [PATCH 169/176] Add 1.5.4 welcome page. --- _locales/en/messages.json | 24 ++++++++++++++++++++++++ _locales/zh_CN/messages.json | 24 ++++++++++++++++++++++++ _locales/zh_TW/messages.json | 24 ++++++++++++++++++++++++ js/welcome.js | 20 +++++++++++++++++--- 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 796f1a0..fd7e92f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -853,6 +853,30 @@ "message": "Custom topsites, Custom Style, Custom Unsplash origins" }, + "welcome_154_title_1": { + "message": "Earth every moment" + }, + + "welcome_154_desc_1": { + "message": "Earth background image via 向日葵-8號" + }, + + "welcome_154_title_2": { + "message": "White Noise" + }, + + "welcome_154_desc_2": { + "message": "" + }, + + "welcome_154_title_3": { + "message": "Background History & Explore" + }, + + "welcome_154_desc_3": { + "message": "Record max five background image history and background manage add explore tab" + }, + "permissions": { "message": "Additional permissions are required for the update, allow them to update." }, diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index d1fdf74..84e6fb5 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -853,6 +853,30 @@ "message": "自定义站点,自定义样式,更丰富的 Unsplash 个性定制化" }, + "welcome_154_title_1": { + "message": "地球每刻" + }, + + "welcome_154_desc_1": { + "message": "来自 向日葵-8號 的地球自拍照,让你更爱这颗星球" + }, + + "welcome_154_title_2": { + "message": "白噪音" + }, + + "welcome_154_desc_2": { + "message": "从现在开始,内置 白噪音 的 简 Tab 会让你更加专注的工作、学习" + }, + + "welcome_154_title_3": { + "message": "岂止是一点点" + }, + + "welcome_154_desc_3": { + "message": "历史记录 · 精选自你的 Unsplash 源的 探索频道 · 发送背景到手机 " + }, + "permissions": { "message": "新版本需要取得新的权限。" }, diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index ed4bc43..cab4ae8 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -853,6 +853,30 @@ "message": "自定義站點,自定義樣式,更豐富的 Unsplash 個性定製化" }, + "welcome_154_title_1": { + "message": "地球每刻" + }, + + "welcome_154_desc_1": { + "message": "來自 向日葵-8號 的地球自拍照,讓你更愛這顆星球" + }, + + "welcome_154_title_2": { + "message": "白噪音" + }, + + "welcome_154_desc_2": { + "message": "從現在開始,內置 白噪音 的 簡 Tab 會讓你更加專註的工作、學習" + }, + + "welcome_154_title_3": { + "message": "豈止是一點點" + }, + + "welcome_154_desc_3": { + "message": "歷史記錄 · 精選自你的 Unsplash 源的 探索頻道 · 發送背景到手機" + }, + "permissions": { "message": "新版本需要取得新的許可權。" }, diff --git a/js/welcome.js b/js/welcome.js index 46dd713..e112a0d 100644 --- a/js/welcome.js +++ b/js/welcome.js @@ -56,10 +56,24 @@ define([ "jquery", "mousetrap", "lodash", "carousel", "i18n" ], function( $, Mou
    ', "1.5.4": '\ \ + \ + ', }, From 5b051b8240d2d77fbf2a6b3090c9ae7fa6ebecd8 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:00:44 +0800 Subject: [PATCH 170/176] Update README.*.md. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index d7845b9..a1af10c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ + + #### 主要功能一览: @@ -101,6 +103,10 @@ - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [白噪音](http://ksria.com/simptab/docs/#/白噪音) +
    截图 + +
    + - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [发送到手机](http://ksria.com/simptab/docs/#/发送到手机) #### 投票: From 01f2e553886d03909da22041f2177d3459bce12e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:01:50 +0800 Subject: [PATCH 171/176] Update README.*.md. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a1af10c..536c068 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ - @@ -48,6 +47,10 @@ * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) 地球每刻:得益于 [向日葵-8號](http://himawari8.nict.go.jp/) 现在可以在新标签页显示地球自拍照了,详细请看 [地球每刻](http://ksria.com/simptab/docs/#/多种背景源?id=地球每刻) +
    截图 + +
    + - [多种类型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` From 94e9e67b9387d408621338a7ebc19cb0bd492818 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:02:16 +0800 Subject: [PATCH 172/176] Update README.*.md. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 536c068..9ef33e6 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) 地球每刻:得益于 [向日葵-8號](http://himawari8.nict.go.jp/) 现在可以在新标签页显示地球自拍照了,详细请看 [地球每刻](http://ksria.com/simptab/docs/#/多种背景源?id=地球每刻) -
    截图 - -
    +
    截图 + +
    - [多种类型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` From 90bbbdecdbd2a9366bec21a7582c6b236572ae3f Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:03:16 +0800 Subject: [PATCH 173/176] Update README.*.md. --- README.tw.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.tw.md b/README.tw.md index cc41eb0..a091580 100644 --- a/README.tw.md +++ b/README.tw.md @@ -31,6 +31,7 @@ + #### 主要功能一覽: @@ -46,6 +47,10 @@ * ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) 地球每刻:得益於 [向日葵-8號](http://himawari8.nict.go.jp/) 現在可以在新標籤頁顯示地球自拍照了,詳細請看 [地球每刻](http://ksria.com/simptab/docs/#/多种背景源?id=地球每刻) +
    截圖 + +
    + - [多種類型的背景源](http://ksria.com/simptab/docs/#/多种背景源),包括: * `bing.com` · `wallhaven.cc` · `unsplash.com` · `googleartproject.com` · `desktoppr.co` · `visualhunt.com` @@ -101,6 +106,10 @@ - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [白噪音](http://ksria.com/simptab/docs/#/白噪音) +
    截圖 + +
    + - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) [發送到手機](http://ksria.com/simptab/docs/#/发送到手机) #### 投票: From 1aeaef71f03120cf484f64d9a94bf1c0d21822e8 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:04:43 +0800 Subject: [PATCH 174/176] Update README.*.md. --- README.md | 5 ++++- README.tw.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ef33e6..1ad9117 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ - #### 主要功能一览: @@ -66,6 +65,10 @@ > 来自 Unsplash 的精美背景合辑 +
    截图 + +
    + - 多种布局; > 包括: `左上角对齐` · `居中对齐` · `相框效果` diff --git a/README.tw.md b/README.tw.md index a091580..5776aa2 100644 --- a/README.tw.md +++ b/README.tw.md @@ -31,7 +31,6 @@ - #### 主要功能一覽: @@ -66,6 +65,10 @@ > 来自 Unsplash 的精美背景合辑 +
    截圖 + +
    + - 多種布局; > 包括: `左上角對齊` · `居中對齊` · `相框效果` From 76ab5313e3bc72bf9ae4a43753622a5c80a91647 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:10:12 +0800 Subject: [PATCH 175/176] Update README.*.md. --- README.en.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.en.md b/README.en.md index 1527468..e83dbe7 100644 --- a/README.en.md +++ b/README.en.md @@ -30,6 +30,7 @@ + #### Features Details: @@ -46,6 +47,10 @@ * Explore +
    Snapshot + +
    + - Multiple layouts; (picture frame effect, top left aligned, center aligned) > include: `top left aligned` · `center aligned` · `photo frame` @@ -86,6 +91,10 @@ - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) White noise +
    Snapshot + +
    + - ![1.5.4](https://img.shields.io/badge/1.5.4-red.svg) Send to phone #### Vote: From a68819cea9628cba37eeae5275c29f036a595c00 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sun, 30 Dec 2018 12:18:52 +0800 Subject: [PATCH 176/176] Format source. --- _locales/zh_CN/messages.json | 2 +- _locales/zh_TW/messages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 84e6fb5..0370cb3 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -774,7 +774,7 @@ }, "version_detail_9": { - "message": "新增:地球每刻,白噪音,JSBox 版,探索频道等;" + "message": "新增:地球每刻,白噪音,发送到手机,探索频道等;" }, "welcome_start_title": { diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index cab4ae8..12ff3d0 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -774,7 +774,7 @@ }, "version_detail_9": { - "message": "新增:地球每刻,白噪音,JSBox 版,探索頻道等;" + "message": "新增:地球每刻,白噪音,發送到手機,探索頻道等;" }, "welcome_start_title": {