Skip to content

Commit

Permalink
Updated version to 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr committed Jun 3, 2017
1 parent 37f9641 commit 7af9f4b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
6 changes: 5 additions & 1 deletion public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 !!! Находится в подвале справа. При нажатии на эту ссылку происходит переход в магазин расширений на страницу этого расширения."
Expand Down Expand Up @@ -331,6 +335,6 @@
"message": "Who's the author of the default background picture?"
},
"help_background_author_answer": {
"message": "<p>The photographer is <a href=\"https://www.facebook.com/stefancikphotography\" class=\"underlined\">Stefan Stefancik</a>. The picture was taken from <a href=\"https://www.pexels.com/u/stefanstefancik/\" class=\"underlined\">Pexels</a>.</p>"
"message": "<p>The photographer is <a href=\"https://www.pexels.com/u/joshua-nkolwa-141357/\" class=\"underlined\">Joshua Nkolwa</a>. The picture was taken from <a href=\"https://www.pexels.com/photo/clouds-countryside-dark-dawn-426613/\" class=\"underlined\">pexels.com</a>.</p><p>Previous background images:</p><ul><li><a href=\"https://www.facebook.com/stefancikphotography\" class=\"underlined\">Stefan Stefancik</a>: <a href=\"https://www.pexels.com/photo/nature-flowers-plant-rain-96920/\" class=\"underlined\">pexels.com</a> (from 1.3.0)</li></ul>"
}
}
6 changes: 5 additions & 1 deletion public/_locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
"message": "Расширения",
"description": "Находится в подвале справа. Открывает страницу в браузере с установленными расширениями."
},
"chrome_apps": {
"message": "Сервисы",
"description": "Находится в подвале справа. Открывает страницу в браузере с установленными Chrome-приложениями (chrome://apps)."
},
"store_page": {
"message": "Страница в магазине",
"description": "!!! DEPRECATED !!! Находится в подвале справа. При нажатии на эту ссылку происходит переход в магазин расширений на страницу этого расширения."
Expand Down Expand Up @@ -331,6 +335,6 @@
"message": "Кто автор фоновой картинки, которая идет по умолчанию?"
},
"help_background_author_answer": {
"message": "<p>Фотограф &mdash; <a href=\"https://www.facebook.com/stefancikphotography\" class=\"underlined\">Stefan Stefancik</a>. Фотография была взята с фотостока <a href=\"https://www.pexels.com/u/stefanstefancik/\" class=\"underlined\">Pexels</a>.</p>"
"message": "<p>Фотограф &mdash; <a href=\"https://www.pexels.com/u/joshua-nkolwa-141357/\" class=\"underlined\">Joshua Nkolwa</a>. Фотография была взята с фотостока <a href=\"https://www.pexels.com/photo/clouds-countryside-dark-dawn-426613/\" class=\"underlined\">pexels.com</a>.</p><p>Предыдущие фоны:</p><ul><li><a href=\"https://www.facebook.com/stefancikphotography\" class=\"underlined\">Stefan Stefancik</a>: <a href=\"https://www.pexels.com/photo/nature-flowers-plant-rain-96920/\" class=\"underlined\">pexels.com</a> (c 1.3.0)</li></ul>"
}
}
45 changes: 32 additions & 13 deletions resources/assets/js/newtab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -112,15 +115,24 @@ Promise.all([
:bookmarks="site"></bookmark-column>
</ul>
<ul class="bookmark-tree row pb-1"
v-if="mainBookmarks.length > 0">
<bookmark-column
v-for="bookmarks in chunkedMainBookmarks"
:key="bookmarks.id"
:bookmarks="bookmarks"></bookmark-column>
</ul>
<ul class="bookmark-tree row"
v-if="allBookmarks.length > 0">
v-if="otherBookmarks.length > 0">
<bookmark-column
v-for="bookmarks in chunkedBookmarks"
v-for="bookmarks in chunkedOtherBookmarks"
:key="bookmarks.id"
:bookmarks="bookmarks"></bookmark-column>
</ul>
<div class="py-3 pl-1 text-xs-center lead"
v-else
v-if="mainBookmarks.length === 0 && otherBookmarks.length === 0"
v-html="locale.add_bookmarks_to_browser"></div>
</main>`
});
Expand All @@ -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'
])
};
},
Expand All @@ -157,6 +169,9 @@ Promise.all([
<li class="list-inline-item">
<a href="chrome://extensions">{{ locale.extensions }}</a>
</li>
<li class="list-inline-item">
<a href="chrome://apps">{{ locale.chrome_apps }}</a>
</li>
<li class="list-inline-item">
<a
:href="optionsUrl">{{ locale.options }}</a>
Expand Down Expand Up @@ -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});
Expand All @@ -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: `<li>
Expand All @@ -575,6 +593,7 @@ Promise.all([
:data-toggle="getDataToggle"
:data-target="getDataTarget"
:data-counter="getClicksCount()"
:data-id="bookmark.id"
@mouseup="incClicksCount">
{{bookmark.title}}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7af9f4b

Please sign in to comment.