From 7af9f4ba0573c893d1f6863ffdc897ea8eac3bb2 Mon Sep 17 00:00:00 2001 From: Petr Date: Sat, 3 Jun 2017 19:50:53 +0300 Subject: [PATCH] Updated version to 1.4.0 --- public/_locales/en/messages.json | 6 ++++- public/_locales/ru/messages.json | 6 ++++- resources/assets/js/newtab.js | 45 +++++++++++++++++++++++--------- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index a1b2c2fc..52354867 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -53,6 +53,10 @@ "message": "Extensions", "description": "Находится в подвале справа. Открывает страницу в браузере с установленными расширениями." }, + "chrome_apps": { + "message": "Apps", + "description": "Находится в подвале справа. Открывает страницу в браузере с установленными Chrome-приложениями (chrome://apps)." + }, "store_page": { "message": "The page in the store", "description": "!!! DEPRECATED !!! Находится в подвале справа. При нажатии на эту ссылку происходит переход в магазин расширений на страницу этого расширения." @@ -331,6 +335,6 @@ "message": "Who's the author of the default background picture?" }, "help_background_author_answer": { - "message": "

The photographer is Stefan Stefancik. The picture was taken from Pexels.

" + "message": "

The photographer is Joshua Nkolwa. The picture was taken from pexels.com.

Previous background images:

" } } diff --git a/public/_locales/ru/messages.json b/public/_locales/ru/messages.json index 7ce0ffd4..91a4eb37 100644 --- a/public/_locales/ru/messages.json +++ b/public/_locales/ru/messages.json @@ -53,6 +53,10 @@ "message": "Расширения", "description": "Находится в подвале справа. Открывает страницу в браузере с установленными расширениями." }, + "chrome_apps": { + "message": "Сервисы", + "description": "Находится в подвале справа. Открывает страницу в браузере с установленными Chrome-приложениями (chrome://apps)." + }, "store_page": { "message": "Страница в магазине", "description": "!!! DEPRECATED !!! Находится в подвале справа. При нажатии на эту ссылку происходит переход в магазин расширений на страницу этого расширения." @@ -331,6 +335,6 @@ "message": "Кто автор фоновой картинки, которая идет по умолчанию?" }, "help_background_author_answer": { - "message": "

Фотограф — Stefan Stefancik. Фотография была взята с фотостока Pexels.

" + "message": "

Фотограф — Joshua Nkolwa. Фотография была взята с фотостока pexels.com.

Предыдущие фоны:

" } } diff --git a/resources/assets/js/newtab.js b/resources/assets/js/newtab.js index f998490e..e826ac2b 100644 --- a/resources/assets/js/newtab.js +++ b/resources/assets/js/newtab.js @@ -17,7 +17,9 @@ Promise.all([ browser.sessions.getRecentlyClosed() ]) .then(([local_storage, sync_storage, browserBookmarks, extensionInfo, topSites, recentlyClosed]) => { - let allBookmarks = browserBookmarks[0]['children'][0]['children']; + let allBookmarks = browserBookmarks[0]['children']; + let mainBookmarks = allBookmarks[0]['children']; + let otherBookmarks = allBookmarks[1]['children']; let columnsCount = local_storage['columns_count']; let backgroundImage = local_storage['background_image']; let openBookmarksInNewTab = local_storage['bookmarks_in_new_tab']; @@ -81,8 +83,9 @@ Promise.all([ Vue.component('app-content', { data: function () { return { - allBookmarks: allBookmarks, - chunkedBookmarks: allBookmarks.chunk(columnsCount, true), + mainBookmarks: mainBookmarks, + chunkedMainBookmarks: mainBookmarks.chunk(columnsCount, true), otherBookmarks: otherBookmarks, + chunkedOtherBookmarks: otherBookmarks.chunk(columnsCount, true), allTopSites: allTopSites, chunkedTopSites: allTopSites.chunk(columnsCount, true), allClosedTabs: allClosedTabs, @@ -112,15 +115,24 @@ Promise.all([ :bookmarks="site"> + + +
` }); @@ -142,7 +154,7 @@ Promise.all([ browserVersion: 'v' + extensionInfo.version, isDevBuild: extensionInfo.installType === 'development', locale: i18nObject([ - 'search', 'manage_bookmarks', 'options', 'help', 'report_bug', 'extensions' + 'search', 'manage_bookmarks', 'options', 'help', 'report_bug', 'extensions', 'chrome_apps' ]) }; }, @@ -157,6 +169,9 @@ Promise.all([
  • {{ locale.extensions }}
  • +
  • + {{ locale.chrome_apps }} +
  • {{ locale.options }} @@ -545,6 +560,12 @@ Promise.all([ if (this.isBookmark === false) { return; } + + if (typeof this.clicksCount[this.bookmark.id] === 'undefined') { + this.clicksCount[this.bookmark.id] = 0; + } + + this.getClicksCount(); this.clicksCount[this.bookmark.id]++; browser.storage.local.set({click_counter: this.clicksCount}); @@ -556,13 +577,10 @@ Promise.all([ return false; } - this.clicksCount[this.bookmark.id] = - typeof this.clicksCount[this.bookmark.id] !== 'undefined' - && this.clicksCount[this.bookmark.id] > 0 + return typeof this.clicksCount[this.bookmark.id] !== 'undefined' + && this.clicksCount[this.bookmark.id] > 0 ? this.clicksCount[this.bookmark.id].roundThousands() : ''; - - return this.clicksCount[this.bookmark.id]; }, }, template: `
  • @@ -575,6 +593,7 @@ Promise.all([ :data-toggle="getDataToggle" :data-target="getDataTarget" :data-counter="getClicksCount()" + :data-id="bookmark.id" @mouseup="incClicksCount"> {{bookmark.title}} @@ -658,7 +677,7 @@ $(document).on('click', '[href^="chrome://"]', function (event) { }); $(window).on('keydown', function (event) { - if (event.keyCode === 114 || (event.ctrlKey && event.keyCode === 70)) { + if (event.keyCode === 114 || (event.ctrlKey && event.keyCode === 70) || (event.ctrlKey && event.keyCode === 71)) { event.preventDefault(); $('.modal').not('#modal-search').modal('hide'); // Hide all modals but search modal