From 501bee1a423053d4a92eddb40c53977d5d23145f Mon Sep 17 00:00:00 2001 From: Gabriel Ivanica Date: Wed, 16 Jan 2019 13:52:47 +0200 Subject: [PATCH] version 3.1.3 - added support for drag-n-drop tabs into saved sessions - added option: reverse restore order - added context menu for SessionList - bugfixes: favicon-service, open edit menu on window save, homepage initialization --- _locales/en/messages.json | 5 ++++ data/home/home.js | 24 ++++++++------- data/lazy/lazy.html | 2 +- data/scripts/components/config-panel.js | 8 +++++ data/scripts/components/session-bookmark.js | 22 +++++++++++--- data/scripts/components/session-folder.js | 14 ++++++--- data/scripts/components/session-header-bar.js | 28 ++++++++++++++++- data/scripts/config.js | 1 + data/scripts/session-sync-ui.js | 4 +++ data/scripts/session/management.js | 10 +++++++ data/scripts/utils/field-edit-widget.js | 1 + manifest.json | 2 +- package.json | 2 +- scripts/favicon-service.js | 7 +---- scripts/main.js | 4 +-- scripts/session-management.js | 30 +++++++++++++++++-- 16 files changed, 131 insertions(+), 33 deletions(-) create mode 100644 _locales/en/messages.json diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..1fd8eb3 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,5 @@ +{ + "test": { + "message": "Restore in new window" + } +} \ No newline at end of file diff --git a/data/home/home.js b/data/home/home.js index 87656c9..31ef313 100644 --- a/data/home/home.js +++ b/data/home/home.js @@ -15,7 +15,7 @@ function load() { bullets = document.getElementById('bullets'); tooltip = document.getElementById('tooltip'); - bullets.addEventListener('mouseleave', function(e) { + bullets.addEventListener('mouseleave', function() { tooltip.removeAttribute('active'); }); @@ -47,17 +47,20 @@ var initTutorial = function initTutorial() { size = TutorialEntries.init(); initCarousel(); - updateActiveBullet(bullets.firstElementChild); + updateActiveBullet(bullets.firstElementChild.firstElementChild); }; function updateActiveBullet(node) { - console.log(node); if (activeBullet) { activeBullet.removeAttribute('active'); } + activeBullet = node; - activeBullet.setAttribute('active', ''); + + if (activeBullet) { + activeBullet.setAttribute('active', ''); + } } function setCarouselTo(index) @@ -80,13 +83,13 @@ function advanceCarousel(offset) } Carousel.style.left = -position + '%'; Carousel.setAttribute('advance', position); - updateActiveBullet(offset > 0 ? activeBullet.nextElementSibling : activeBullet.previousElementSibling); + updateActiveBullet(TutorialEntries.getEntryByIndex(position / 100).bullet); } function initCarousel() { - var moveLeft = document.getElementById("scroll-left"); - var moveRight = document.getElementById("scroll-right"); + var moveLeft = document.getElementById('scroll-left'); + var moveRight = document.getElementById('scroll-right'); moveLeft.addEventListener('click', advanceCarousel.bind(null, -100)); moveRight.addEventListener('click', advanceCarousel.bind(null, 100)); @@ -120,16 +123,16 @@ function HelpEntry(options) // Bullet var reference = document.createElement('a'); - reference.href = '#' + options.info; + reference.href = '#' + options.key; var bullet = document.createElement('div'); bullet.className = 'bullet'; bullet.setAttribute('left', options.index); bullet.setAttribute('tooltip', options.title); - bullet.addEventListener('click', function(e) { + bullet.addEventListener('click', function() { setCarouselTo(options.index); }); - bullet.addEventListener('mouseover', function(e) { + bullet.addEventListener('mouseover', function() { var pos = bullet.getBoundingClientRect(); tooltip.setAttribute('active', ''); tooltip.style.left = pos.x + pos.width / 2 + 'px'; @@ -224,6 +227,7 @@ var TutorialEntries = (function TutorialEntries() bullets.appendChild(entry.link); index++; }); + return entryList.length; } function getEntryByKey(key) { diff --git a/data/lazy/lazy.html b/data/lazy/lazy.html index 82ccc2f..5ea1717 100644 --- a/data/lazy/lazy.html +++ b/data/lazy/lazy.html @@ -18,7 +18,7 @@
If the page was not loaded automatically please check that lazy loading is enabled in addon configuration panel.
-
Firefox Addon API prevents loading certain URL types. This is not an addon issue.
+
Sadly, Firefox Addon API prevents loading certain URL types. This is not an addon issue but and API limitation.