Compare commits

...
29 Commits
Author SHA1 Message Date
matmoul e16698ad39 Version 0.1.25 2026-11-16 22:54:33 +01:00
MatMoul 01cb753277 Merge pull request #195 from xan2622/fix-back-button
Fix Back button not returning to the parent folder
2026-11-16 22:50:55 +01:00
xan2622 f32a72210c Fix Back button not returning to the parent folder
The Back link used href="#" with an onclick calling history.back()
without preventing the default action: the fragment navigation was
applied before the asynchronous history traversal, which then only went
back to the same folder URL without '#'.

The Back link now targets the parent folder, so it also works when the
folder was opened in a new tab (no usable history). On a plain click,
when the previous history entry is the parent folder (checked with the
Navigation API when available), it goes back in history instead, so no
extra entry is added and the parent page state is restored. If the
traversal fails, the direct link is used. Modified clicks keep the
default link behavior.

Grid cells now reset their link target with removeAttribute('target'):
'delete link.target' is a no-op on an HTMLAnchorElement, so a cell that
had held a bookmark opened in a new tab kept target="_blank" after
paging, and a folder later shown there opened in a new tab despite the
'open folder' setting.

The dial URL building is shared by folder and Back links through
utils.getDialUrl, removing an unreachable branch (dial.path is never
empty).
2026-11-12 20:09:33 +01:00
MatMoul b1f76dadde Merge pull request #193 from manner82/fix/issue-192-context-menus-sendmessage
Fix context menus on dial page for Firefox 152+ (replace deprecated tabs.executeScript)
2026-06-28 15:34:52 +02:00
Robert Manner 7dc29e5a70 Version 0.1.24 2026-06-25 09:25:59 +02:00
Robert Manner 3fd4cd6d3b js: replace deprecated tabs.executeScript with tabs.sendMessage
The dial-page context menus invoked window.dial.* functions via
browser.tabs.executeScript. That API is deprecated since Firefox 149 and
removed in Firefox 152, which broke creating/editing bookmarks and folders
from the dial page (issue #192).

Switch the menu handlers to browser.tabs.sendMessage. New menu command IDs
(200-207) are added to the Commands enum in both background.js and dial.js,
and the existing runtime.onMessage listener in dial.js now dispatches these
commands to the corresponding dial.* functions using the page-side
_selectedItem state.

Fixes #192
2026-06-24 12:42:21 +02:00
matmoul 42800d31c1 Version 0.1.23 2026-02-25 22:48:40 +01:00
matmoul 9cab257540 Fix iframe onload event positioning 2026-02-25 22:48:17 +01:00
matmoul 5a8e8bb745 Version 0.1.22 2026-02-25 18:45:42 +01:00
matmoul 8a54056392 fix:ESR compatibility 2026-02-25 18:45:05 +01:00
matmoul 20c106d5fa Version 0.1.21 2026-02-25 01:49:12 +01:00
matmoul 137bd470cf Fix: Replace 'dial' with 'dial.html' in URL paths and context menu patterns 2026-02-25 01:35:46 +01:00
matmoul a312b0b2d4 Rename dial to dial.html, update background.js to use dial.html URL, modify manifest.json to use dial.html for newtab and add data_collection_permissions 2026-02-25 01:07:47 +01:00
matmoul 806e134b52 Version 0.1.20 2021-01-30 15:12:34 +01:00
matmoul 633c5756a1 Patch Context Menu 2021-01-30 15:09:03 +01:00
MatMoul d2ea81d2ca Merge pull request #165 from tamiros/locale/hebrew
Locale/hebrew
2021-01-27 20:04:19 +01:00
Tamir 86f8063b11 missed one 2021-01-27 10:53:56 +02:00
Tamir 95a1ca420d added heberw translation 2021-01-27 10:46:09 +02:00
matmoul 41fc29660f Version 0.1.19 2019-03-17 19:05:31 +01:00
matmoul 725ad53d92 Merge pull request #122 from WaldiSt/patch-1
Translation to Polish language
2019-01-23 00:08:02 +01:00
Waldemar Stoczkowski 929431e66f Translation to Polish language
Added translation to Polish language
2019-01-20 11:46:47 +01:00
matmoul 75a6649b6c Version 0.1.18 2019-01-03 21:09:25 +01:00
matmoul 941772844a Add startpage timeout settings 2019-01-03 21:06:23 +01:00
matmoul cc1006042d Merge pull request #117 from de-es/de-es-patch-1
Remove pt from font-family
2018-12-26 00:15:15 +01:00
matmoul f992b75f45 Merge pull request #114 from Gonimy-Vetrom/patch-1
Add Ukrainian
2018-12-26 00:14:53 +01:00
de-es 3a3337b19c Remove pt from font-family 2018-12-11 00:16:55 +01:00
Gonimy-Vetrom ab3072cc21 Create messages.json 2018-11-13 17:21:31 +02:00
matmoul 5bc78f7da6 Version 0.1.17 2018-10-21 23:27:31 +02:00
matmoul 67fea9aa9c Bug Can move tile when this is the first added item 2018-10-21 22:47:59 +02:00
9 changed files with 421 additions and 39 deletions

No files matched your search

+67
View File
@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "הוסף לחיוג מהיר",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "חדש",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "מועדף",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "הכנס קישור חדש למועדף :",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "תיקייה",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "הכנס שם חדש לתיקייה :",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "מאפיינים",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "רענן",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "צלם מסך כאן",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "צלם מסך בלשונית חדשה",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "מחק",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "האם למחוק $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "הגדרות חיוג מהיר",
"description": "Text of settings menu item."
}
}
+67
View File
@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Dodaj do Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Nowy",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Zakładka",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Wprowadź nowy adres URL zakładki:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Folder",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Wprowadź nazwę nowego folderu:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Właściwości",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Odśwież",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Zdjęcie tutaj",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Zdjęcie na nowej karcie",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Usuń",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Usuń $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Ustawienia Quick Dial",
"description": "Text of settings menu item."
}
}
+67
View File
@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Додати до Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Додати",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Закладку",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Введіть URL-адресу нової закладки:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Папку",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Введіть им'я нової папки:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Властивості",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Оновити",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Захватити тут",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Захватити на новій вкладці",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Видалити",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Видалити $1?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Налаштування Quick Dial",
"description": "Text of settings menu item."
}
}
View File
File renamed without changes.
+4
View File
@@ -68,6 +68,10 @@
<td><input id="ButtonOpenInNewPage" type="checkbox"></td> <td><input id="ButtonOpenInNewPage" type="checkbox"></td>
</tr> </tr>
<tr>
<td>Startpage timeout :</td>
<td><input id="StartupTimeout" type="number"></td>
</tr>
</table> </table>
+144 -23
View File
@@ -6,24 +6,28 @@ app.init = function(){ // Init module
browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged }); browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged });
browser.browserAction.onClicked.addListener(function(e){ browser.browserAction.onClicked.addListener(function(e){
if(app.settings.openQuickDialInNewPage) browser.tabs.create({}); if(app.settings.openQuickDialInNewPage) browser.tabs.create({});
else browser.tabs.update(e.id, {url: '/dial'}).then(); else browser.tabs.update(e.id, {url: '/dial.html'}).then();
});
app.GridNodes.sync(app.node, app.settings.grid.root, function(){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
app.Bookmarks.initListener();
app.ContextMenus.initMenu();
}); });
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
app.ContextMenus.initMenu();
window.setTimeout(function(){
app.GridNodes.sync(app.node, app.settings.grid.root, function(){
app.Bookmarks.initListener();
});
}, 500);
// Start page workaround : // Start page workaround :
setTimeout(function(){ if(app.settings.startpageTimeout>0){
browser.tabs.query({}).then( function(tabs) { setTimeout(function(){
tabs.forEach(function(itm){ browser.tabs.query({}).then( function(tabs) {
if(itm.url=='about:blank'){ tabs.forEach(function(itm){
browser.tabs.update(itm.id, {url: browser.extension.getURL('dial')}); if(itm.url=='about:blank'){
} browser.tabs.update(itm.id, {url: browser.runtime.getURL('dial.html')});
}); }
}); });
}, 500); });
}, app.settings.startpageTimeout);
}
}); });
}; };
@@ -42,7 +46,15 @@ app.Messages.Commands = {
refreshNode: 9, refreshNode: 9,
capturePage: 10, capturePage: 10,
settingsChanged: 100, settingsChanged: 100,
gridNodesLoaded: 101 gridNodesLoaded: 101,
menuCreateBookmark: 200,
menuCreateFolder: 201,
menuEditSettings: 202,
menuEditProperties: 203,
menuRefreshNode: 204,
menuCaptureHere: 205,
menuCapturePage: 206,
menuDeleteNode: 207
}; };
app.Messages.init = function(){ // Init Messages Listeners app.Messages.init = function(){ // Init Messages Listeners
browser.runtime.onMessage.addListener(function(request, sender, sendResponse){ browser.runtime.onMessage.addListener(function(request, sender, sendResponse){
@@ -239,6 +251,9 @@ app.Settings.init = function(callback){ // Load settings and nodes
if(!data.settings.openQuickDialInNewPage && data.settings.openQuickDialInNewPage != false){ if(!data.settings.openQuickDialInNewPage && data.settings.openQuickDialInNewPage != false){
data.settings.openQuickDialInNewPage = true; data.settings.openQuickDialInNewPage = true;
} }
if(!data.settings.startpageTimeout){
data.settings.startpageTimeout = 500;
}
//app.Settings.save(); //app.Settings.save();
} }
app.settings = data.settings; app.settings = data.settings;
@@ -269,15 +284,121 @@ app.ContextMenus.menuItemClicked = function(info, tab){
}); });
}; };
app.ContextMenus.initMenu = function(){ // (Called from app.init) Init context menu in all pages app.ContextMenus.initMenu = function(){ // (Called from app.init) Init context menu in all pages
// Create Add Context menu for all pages
if(app.settings.menuShowAdd){ if(app.settings.menuShowAdd){
browser.contextMenus.create({ // Create Context menu browser.contextMenus.create({
id: 'AddToQuickDial', id: 'AddToQuickDial',
title: browser.i18n.getMessage("menuAddToQuickDial"), title: browser.i18n.getMessage("menuAddToQuickDial"),
contexts: ["all"], contexts: ["all"],
documentUrlPatterns: [ 'http://*/*', 'https://*/*', 'file://*/*', 'ftp://*/*' ] documentUrlPatterns: [ 'http://*/*', 'https://*/*', 'file://*/*', 'ftp://*/*' ],
}, function(){}); onclick(info, tab) { app.ContextMenus.menuItemClicked(info, tab) }
browser.contextMenus.onClicked.addListener(app.ContextMenus.menuItemClicked); });
} }
// Create WebExt Page Context menu
browser.contextMenus.create({
id: "pagemenu",
title: "Quick Dial",
documentUrlPatterns: [ 'moz-extension://*/dial.html', 'moz-extension://*/dial.html?*' ],
contexts: ["page"]
});
browser.contextMenus.create({
id: "pagemenunew",
parentId: "pagemenu",
title: browser.i18n.getMessage("menuNew")
});
browser.contextMenus.create({
parentId: "pagemenunew",
title: browser.i18n.getMessage("menuNewBookmark"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateBookmark });
}
});
browser.contextMenus.create({
parentId: "pagemenunew",
title: browser.i18n.getMessage("menuNewFolder"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateFolder });
}
});
browser.contextMenus.create({ parentId: "pagemenu", type: "separator" });
browser.contextMenus.create({
parentId: "pagemenu",
title: browser.i18n.getMessage("menuSettings"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditSettings });
}
});
// Create WebExt Link Context menu
browser.contextMenus.create({
id: "itemmenu",
title: "Quick Dial",
documentUrlPatterns: [ 'moz-extension://*/dial.html', 'moz-extension://*/dial.html?*' ],
contexts: ["link"]
});
browser.contextMenus.create({
id: "itemmenunew",
parentId: "itemmenu",
title: browser.i18n.getMessage("menuNew")
});
browser.contextMenus.create({
parentId: "itemmenunew",
title: browser.i18n.getMessage("menuNewBookmark"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateBookmark });
}
});
browser.contextMenus.create({
parentId: "itemmenunew",
title: browser.i18n.getMessage("menuNewFolder"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCreateFolder });
}
});
browser.contextMenus.create({ parentId: "itemmenu", type: "separator" });
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuProperties"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditProperties });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuRefreshItem"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuRefreshNode });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuCaptureHere"),
visible: false,
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCaptureHere });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuCapturePage"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuCapturePage });
}
});
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuDeleteItem"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuDeleteNode });
}
});
browser.contextMenus.create({ parentId: "itemmenu", type: "separator" });
browser.contextMenus.create({
parentId: "itemmenu",
title: browser.i18n.getMessage("menuSettings"),
onclick(info, tab) {
browser.tabs.sendMessage(tab.id, { cmd: app.Messages.Commands.menuEditSettings });
}
});
}; };
app.ContextMenus.updateMenu = function(){ app.ContextMenus.updateMenu = function(){
browser.contextMenus.onClicked.removeListener(app.ContextMenus.menuItemClicked); browser.contextMenus.onClicked.removeListener(app.ContextMenus.menuItemClicked);
@@ -428,8 +549,8 @@ app.SiteInfos.fromFrame = function(url, callback){ // Retrieve infos from an ifr
iframe.style.position = 'absolute'; iframe.style.position = 'absolute';
iframe.scrolling = 'no'; iframe.scrolling = 'no';
var content = xmlHttp.responseText.replace('<head>', '<head><base href="' + url + '">'); var content = xmlHttp.responseText.replace('<head>', '<head><base href="' + url + '">');
iframe.onload = function(){ pageLoaded(); }
document.body.appendChild(iframe); document.body.appendChild(iframe);
iframe.onload = function(){ pageLoaded(); }
iframe.srcdoc = content; iframe.srcdoc = content;
setTimeout(function(){ pageLoaded(); }, 6000); setTimeout(function(){ pageLoaded(); }, 6000);
} }
@@ -521,7 +642,7 @@ app.GridNodes.sync = function(gridNode, rootPath, callback){ // Sync GridNodes w
delete app.GridNodes._syncing; delete app.GridNodes._syncing;
if(app.GridNodes._needSync == true) { if(app.GridNodes._needSync == true) {
delete app.GridNodes._needSync; delete app.GridNodes._needSync;
app.GridNodes.sync(gridNode, rootPath, callback); app.GridNodes.sync(gridNode, rootPath, callback);
} else { } else {
app.GridNodes.save(); app.GridNodes.save();
if(callback) callback(); if(callback) callback();
@@ -751,7 +872,7 @@ app.GridNodes.capturePage = function(gridNode, callback){
if(nodes){ if(nodes){
var path = ''; var path = '';
for(var i=1; i<nodes.length; i++) path = path + '/' + nodes[i].title; for(var i=1; i<nodes.length; i++) path = path + '/' + nodes[i].title;
app.SiteInfos.fromNewTab('/dial?path=' + path, function(infos){ app.SiteInfos.fromNewTab('/dial.html?path=' + path, function(infos){
if(infos){ if(infos){
gridNode.image = infos.screenshot; gridNode.image = infos.screenshot;
} else { } else {
+63 -12
View File
@@ -60,6 +60,11 @@ utils.getPath = function(){
if(path) return path + '/'; if(path) return path + '/';
else return '/'; else return '/';
}; };
utils.getDialUrl = function(path){
var url = '?bg=' + encodeURIComponent(app.settings.backgroundColor);
if(path) url += '&path=' + encodeURIComponent(path);
return url;
};
app.init = function(){ app.init = function(){
app.Messages.getSettings(function(settings){ app.Messages.getSettings(function(settings){
@@ -84,7 +89,15 @@ app.Messages.Commands = {
refreshNode: 9, refreshNode: 9,
capturePage: 10, capturePage: 10,
settingsChanged: 100, settingsChanged: 100,
gridNodesLoaded: 101 gridNodesLoaded: 101,
menuCreateBookmark: 200,
menuCreateFolder: 201,
menuEditSettings: 202,
menuEditProperties: 203,
menuRefreshNode: 204,
menuCaptureHere: 205,
menuCapturePage: 206,
menuDeleteNode: 207
}; };
app.Messages.init = function(){ app.Messages.init = function(){
browser.runtime.onMessage.addListener(function(request, sender, sendResponse){ browser.runtime.onMessage.addListener(function(request, sender, sendResponse){
@@ -95,6 +108,30 @@ app.Messages.init = function(){
case app.Messages.Commands.gridNodesLoaded: case app.Messages.Commands.gridNodesLoaded:
if(dial.skipUpdate!=true) app.Messages.getNode(dial.path, app.GridNodes._changed); if(dial.skipUpdate!=true) app.Messages.getNode(dial.path, app.GridNodes._changed);
break; break;
case app.Messages.Commands.menuCreateBookmark:
dial.createBookmark();
break;
case app.Messages.Commands.menuCreateFolder:
dial.createFolder();
break;
case app.Messages.Commands.menuEditSettings:
dial.editSettings();
break;
case app.Messages.Commands.menuEditProperties:
dial.editProperties(dial._selectedItem);
break;
case app.Messages.Commands.menuRefreshNode:
dial.refreshNode(dial._selectedItem);
break;
case app.Messages.Commands.menuCaptureHere:
dial.captureHere(dial._selectedItem);
break;
case app.Messages.Commands.menuCapturePage:
dial.capturePage(dial._selectedItem);
break;
case app.Messages.Commands.menuDeleteNode:
dial.deleteNode();
break;
} }
}); });
}; };
@@ -163,10 +200,11 @@ app.GridNodes._changed = function(node){
dial.init = function(){ dial.init = function(){
dial.initMenus(); //dial.initMenus();
dial.Title = document.createElement('title'); dial.Title = document.createElement('title');
document.head.appendChild(dial.Title); document.head.appendChild(dial.Title);
}; };
/*
dial.initMenus = function(){ dial.initMenus = function(){
document.body.setAttribute('contextmenu', 'page'); document.body.setAttribute('contextmenu', 'page');
dial.PageMenu = document.createElement('menu'); dial.PageMenu = document.createElement('menu');
@@ -250,6 +288,7 @@ dial.initMenus = function(){
dial.ItemMenu.appendChild(dial.ItemMenuSettings); dial.ItemMenu.appendChild(dial.ItemMenuSettings);
document.body.appendChild(dial.ItemMenu); document.body.appendChild(dial.ItemMenu);
} }
*/
dial.initStyles = function(){ dial.initStyles = function(){
function applyImageMode(imageMode, target){ function applyImageMode(imageMode, target){
switch(imageMode){ switch(imageMode){
@@ -279,7 +318,7 @@ dial.initStyles = function(){
document.head.appendChild(dial.Style); document.head.appendChild(dial.Style);
dial.styles = {}; dial.styles = {};
dial.styles.html = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('html { height: 100%; }')].style; dial.styles.html = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('html { height: 100%; }')].style;
dial.styles.body = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('body { user-select: none; -moz-user-select: none; display: flex; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: ' + app.settings.backgroundColor + '; background-image: ' + app.settings.backgroundImage + '; }')].style; dial.styles.body = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('body { user-select: none; -moz-user-select: none; display: flex; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: ' + app.settings.backgroundColor + '; background-image: ' + app.settings.backgroundImage + '; }')].style;
applyImageMode(app.settings.backgroundMode, dial.styles.body); applyImageMode(app.settings.backgroundMode, dial.styles.body);
dial.styles.grid = {}; dial.styles.grid = {};
dial.styles.grid.grid = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid { border-collapse: collapse; margin: auto; }')].style; dial.styles.grid.grid = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid { border-collapse: collapse; margin: auto; }')].style;
@@ -292,7 +331,7 @@ dial.initStyles = function(){
dial.styles.grid.linkPanelHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:first-child { }')].style; dial.styles.grid.linkPanelHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:first-child { }')].style;
if(app.settings.grid.cells.backgroundColorHover) dial.styles.grid.linkPanelHover.backgroundColor = app.settings.grid.cells.backgroundColorHover; if(app.settings.grid.cells.backgroundColorHover) dial.styles.grid.linkPanelHover.backgroundColor = app.settings.grid.cells.backgroundColorHover;
else dial.styles.grid.linkPanelHover.backgroundColor = 'transparent'; else dial.styles.grid.linkPanelHover.backgroundColor = 'transparent';
dial.styles.grid.linkTitle = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a>div:last-child { height: ' + app.settings.grid.cells.titleHeight + 'px; font-size: ' + app.settings.grid.cells.titleFontSize + 'pt; font-family: ' + app.settings.grid.cells.titleFont + 'pt; text-align: center; overflow: hidden; color: ' + app.settings.grid.cells.titleColor + '; border-top: ' + app.settings.grid.cells.titleBorderSize + 'px solid ' + app.settings.grid.cells.borderColor + '; }')].style; dial.styles.grid.linkTitle = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a>div:last-child { height: ' + app.settings.grid.cells.titleHeight + 'px; font-size: ' + app.settings.grid.cells.titleFontSize + 'pt; font-family: ' + app.settings.grid.cells.titleFont + '; text-align: center; overflow: hidden; color: ' + app.settings.grid.cells.titleColor + '; border-top: ' + app.settings.grid.cells.titleBorderSize + 'px solid ' + app.settings.grid.cells.borderColor + '; }')].style;
if(app.settings.grid.cells.titleBackgroundColor) dial.styles.grid.linkTitle.backgroundColor = app.settings.grid.cells.titleBackgroundColor; if(app.settings.grid.cells.titleBackgroundColor) dial.styles.grid.linkTitle.backgroundColor = app.settings.grid.cells.titleBackgroundColor;
else dial.styles.grid.linkTitle.backgroundColor = 'transparent'; else dial.styles.grid.linkTitle.backgroundColor = 'transparent';
dial.styles.grid.linkTitleHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:last-child { font-size: ' + app.settings.grid.cells.titleFontSizeHover + 'pt; color: ' + app.settings.grid.cells.titleColorHover + '; border-top-width: ' + app.settings.grid.cells.titleBorderSizeHover + 'px; border-top-color: ' + app.settings.grid.cells.borderColorHover + ' }')].style; dial.styles.grid.linkTitleHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:last-child { font-size: ' + app.settings.grid.cells.titleFontSizeHover + 'pt; color: ' + app.settings.grid.cells.titleColorHover + '; border-top-width: ' + app.settings.grid.cells.titleBorderSizeHover + 'px; border-top-color: ' + app.settings.grid.cells.borderColorHover + ' }')].style;
@@ -328,6 +367,7 @@ dial.initGrid = function(){
link.appendChild(document.createElement('div')); link.appendChild(document.createElement('div'));
link.onmousedown = function(){ link.onmousedown = function(){
dial._selectedItem = this; dial._selectedItem = this;
/*
if(dial._selectedItem.Node){ if(dial._selectedItem.Node){
switch(dial._selectedItem.Node.type){ switch(dial._selectedItem.Node.type){
case app.GridNodes.GridNodeType.folder: case app.GridNodes.GridNodeType.folder:
@@ -339,6 +379,7 @@ dial.initGrid = function(){
break; break;
} }
} }
*/
}; };
function dragstart_handler(ev) { function dragstart_handler(ev) {
@@ -346,6 +387,7 @@ dial.initGrid = function(){
ev.preventDefault(); ev.preventDefault();
return; return;
} }
if(dial.page == 0) dial.page = 1;
var index = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.getAttribute('gridindex')); var index = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.getAttribute('gridindex'));
if(app.settings.grid.backNode && dial.path != '/') index -= dial.page; if(app.settings.grid.backNode && dial.path != '/') index -= dial.page;
ev.dataTransfer.setData("text/plain", JSON.stringify({parentId: app.node.id, index: index})); ev.dataTransfer.setData("text/plain", JSON.stringify({parentId: app.node.id, index: index}));
@@ -480,7 +522,7 @@ dial.populateGrid = function(){
link.Node = null; link.Node = null;
link.className = 'Empty'; link.className = 'Empty';
link.childNodes[0].style.backgroundImage = ''; link.childNodes[0].style.backgroundImage = '';
if(link.target) delete link.target; link.removeAttribute('target');
link.href = null; link.href = null;
link.onclick = null; link.onclick = null;
link.removeAttribute('contextmenu'); link.removeAttribute('contextmenu');
@@ -490,9 +532,19 @@ dial.populateGrid = function(){
link.className = 'Back'; link.className = 'Back';
link.childNodes[0].style.backgroundImage = ''; link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = 'Back'; link.childNodes[1].innerText = 'Back';
if(link.target) delete link.target; link.removeAttribute('target');
link.href = '#'; var parentPath = dial.path.substring(0, dial.path.lastIndexOf('/', dial.path.length - 2));
link.onclick = function(){ window.history.back(); } link.href = utils.getDialUrl(parentPath);
link.onclick = function(e){
if(e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) return;
if(!window.navigation || !navigation.canGoBack) return;
var previousUrl = navigation.entries()[navigation.currentEntry.index - 1].url;
if(!previousUrl) return;
previousUrl = new URL(previousUrl);
if(previousUrl.pathname != location.pathname || (previousUrl.searchParams.get('path') || '') != parentPath) return;
e.preventDefault();
navigation.back().committed.catch(function(){ location.assign(link.href); });
};
link.removeAttribute('contextmenu'); link.removeAttribute('contextmenu');
} }
populateFolder = function(link, node){ populateFolder = function(link, node){
@@ -507,14 +559,13 @@ dial.populateGrid = function(){
link.childNodes[1].innerText = node.title; link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openFolderMethod){ switch(app.settings.grid.openFolderMethod){
case 0: case 0:
if(link.target) delete link.target; link.removeAttribute('target');
break; break;
case 1: case 1:
link.target = '_blank'; link.target = '_blank';
break; break;
} }
if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title); link.href = utils.getDialUrl(dial.path + node.title);
else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title);
link.onclick = null; link.onclick = null;
link.setAttribute('contextmenu', 'item'); link.setAttribute('contextmenu', 'item');
} }
@@ -534,7 +585,7 @@ dial.populateGrid = function(){
link.childNodes[1].innerText = node.title; link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openBookmarkMethod){ switch(app.settings.grid.openBookmarkMethod){
case 0: case 0:
if(link.target) delete link.target; link.removeAttribute('target');
break; break;
case 1: case 1:
link.target = '_blank'; link.target = '_blank';
+2
View File
@@ -28,6 +28,7 @@ app.init = function(){
BackgroundPreview.style.backgroundRepeat = 'no-repeat'; BackgroundPreview.style.backgroundRepeat = 'no-repeat';
BackgroundPreview.style.backgroundSize = '100% 100%'; BackgroundPreview.style.backgroundSize = '100% 100%';
ButtonOpenInNewPage.checked = app.settings.openQuickDialInNewPage; ButtonOpenInNewPage.checked = app.settings.openQuickDialInNewPage;
StartupTimeout.value = app.settings.startpageTimeout;
GridRoot.value = app.settings.grid.root; GridRoot.value = app.settings.grid.root;
GridRows.value = app.settings.grid.rows; GridRows.value = app.settings.grid.rows;
GridRatioX.value = app.settings.grid.ratioX; GridRatioX.value = app.settings.grid.ratioX;
@@ -88,6 +89,7 @@ app.init = function(){
app.settings.backgroundImage = BackgroundImage; app.settings.backgroundImage = BackgroundImage;
app.settings.backgroundMode = +(BackgroundMode.value); app.settings.backgroundMode = +(BackgroundMode.value);
app.settings.openQuickDialInNewPage = ButtonOpenInNewPage.checked; app.settings.openQuickDialInNewPage = ButtonOpenInNewPage.checked;
app.settings.startpageTimeout = StartupTimeout.value;
app.settings.grid.rows = +(GridRows.value); app.settings.grid.rows = +(GridRows.value);
app.settings.grid.margin = +(GridMargins.value); app.settings.grid.margin = +(GridMargins.value);
app.settings.grid.columns = +(GridColumns.value); app.settings.grid.columns = +(GridColumns.value);
+7 -4
View File
@@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "Quick Dial", "name": "Quick Dial",
"version": "0.1.16", "version": "0.1.25",
"author": "MatMoul", "author": "MatMoul",
"homepage_url": "https://github.com/MatMoul/quickdial-webext", "homepage_url": "https://github.com/MatMoul/quickdial-webext",
"developer": { "developer": {
@@ -37,13 +37,16 @@
}, },
"chrome_url_overrides" : { "chrome_url_overrides" : {
"newtab": "dial" "newtab": "dial.html"
}, },
"applications": { "browser_specific_settings": {
"gecko": { "gecko": {
"id": "quickdial@matmoul.com", "id": "quickdial@matmoul.com",
"strict_min_version": "52.0" "strict_min_version": "140.0",
"data_collection_permissions": {
"required": ["none"]
}
} }
}, },