1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2025-12-16 17:03:12 +00:00

21 Commits

Author SHA1 Message Date
8abd79bc5f Version 0.1.15 2018-10-21 04:37:05 +02:00
723724f50b Bug White page on first install 2018-10-21 04:36:25 +02:00
ddd081672f Update makebeta 2018-10-21 04:11:04 +02:00
e03e684fb7 Version 0.1.14 2018-10-21 02:07:08 +02:00
14ed1f4dd6 Patch Quick Dial as start page 2018-10-21 02:01:02 +02:00
7ccd9be787 Merge pull request #69 from eridanired/patch-1
Add Spanish translation
2017-12-11 19:51:41 +01:00
Eridani
67d950bfea Add Spanish translation 2017-12-09 11:30:43 -06:00
ff0eebed69 Version 0.1.13 2017-11-26 19:02:25 +01:00
9fdcc91ec6 Project: Remove description from manifest 2017-11-26 18:52:07 +01:00
39ab845d58 Feature: Toolbar button can now open Quick Dial on current dial 2017-11-26 16:33:47 +01:00
6815551c8c Feature: Add open in new tab for tiles 2017-11-26 15:47:22 +01:00
ce82a4c67e Version 0.1.12 2017-11-26 15:04:11 +01:00
72ab3e5f6b Bug: Convert separator to empty cell 2017-11-26 13:20:10 +01:00
beb52273a2 Bug: Can't set cutom image on folder 2017-11-26 13:04:14 +01:00
2e5bbce72f Version 0.1.11 2017-11-24 22:50:35 +01:00
ddbd2f40c8 Feature: Lock settings for image on tiles 2017-11-24 22:36:53 +01:00
63569851d8 Feature: Option to diable context menu items 2017-11-24 21:54:08 +01:00
88b6a8d45d Merge pull request #61 from fernandosantucci/develop
Add Brazilian Portuguese translation
2017-11-22 19:16:26 +00:00
fernandosantucci
7b6e112038 Add Brazilian Portuguese translation 2017-11-22 12:21:55 -02:00
ee310a9546 Merge pull request #49 from Faenriis/develop
Add Serbian translation
2017-11-19 18:22:34 +01:00
Xabre
e400d07f01 Add Serbian translation 2017-11-19 14:19:49 +01:00
16 changed files with 381 additions and 104 deletions

View File

@@ -31,6 +31,7 @@ git checkout beta
version=$1 version=$1
sed -i "/\"version\":/c\ \ \"version\": \"$version\"," src/manifest.json sed -i "/\"version\":/c\ \ \"version\": \"$version\"," src/manifest.json
sed -i 's/quickdial@matmoul.com/quickdialtest@matmoul.com/' src/manifest.json
git commit -a -m "Beta Version $version" git commit -a -m "Beta Version $version"

View File

@@ -1,9 +1,4 @@
{ {
"extensionDescription": {
"message": "Quick Dial, eine Schnellwahl-Seite inspiriert von Fast Dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": { "menuAddToQuickDial": {
"message": "Zu Quick Dial hinzufügen", "message": "Zu Quick Dial hinzufügen",
"description": "Text of add bookmark menu item." "description": "Text of add bookmark menu item."

View File

@@ -1,9 +1,4 @@
{ {
"extensionDescription": {
"message": "Quick Dial, a dial page inspired from fast dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": { "menuAddToQuickDial": {
"message": "Add to Quick Dial", "message": "Add to Quick Dial",
"description": "Text of add bookmark menu item." "description": "Text of add bookmark menu item."

View File

@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Agregar a Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Nuevo",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Marcador",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Dirección del nuevo marcador:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Carpeta",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Nombre de la nueva carpeta:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Propiedades",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Actualizar",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Capturar aquí",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Capturar en una nueva pestaña",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Eliminar",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "¿Eliminar $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Propiedades de Quick Dial",
"description": "Text of settings menu item."
}
}

View File

@@ -1,9 +1,4 @@
{ {
"extensionDescription": {
"message": "Quick Dial, page dial inspirée de fast dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": { "menuAddToQuickDial": {
"message": "Ajouter à Quick Dial", "message": "Ajouter à Quick Dial",
"description": "Text of add bookmark menu item." "description": "Text of add bookmark menu item."

View File

@@ -1,9 +1,4 @@
{ {
"extensionDescription": {
"message": "Quick Dial, una dial page inspirata a fast dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": { "menuAddToQuickDial": {
"message": "Aggiungi a Quick Dial", "message": "Aggiungi a Quick Dial",
"description": "Text of add bookmark menu item." "description": "Text of add bookmark menu item."

View File

@@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Adicionar ao Quick Dial",
"description": "Texto do iten de menu adicionar ao Quick Dial."
},
"menuNew": {
"message": "Novo",
"description": "Texto do item de menu novo."
},
"menuNewBookmark": {
"message": "Favorito",
"description": "Texto do iten de menu adicionar favorito."
},
"AddBookmarkPrompt": {
"message": "Entre com a url do novo favorito :",
"description": "Texto do rótulo adicionar favorito."
},
"menuNewFolder": {
"message": "Pasta",
"description": "Texto do item de menu adicionar pasta."
},
"AddFolderPrompt": {
"message": "Entre com o nome da nova pasta :",
"description": "Texto do rótulo adicionar pasta."
},
"menuProperties": {
"message": "Propriedades",
"description": "Texto do item de menu propriedades."
},
"menuRefreshItem": {
"message": "Atualizar",
"description": "Texto do item de menu atualizar."
},
"menuCaptureHere": {
"message": "Capturar aqui",
"description": "Texto do item de menu capturar aqui."
},
"menuCapturePage": {
"message": "Capturar em uma nova guia",
"description": "Texto do item de menu capturar em uma nova guia."
},
"menuDeleteItem": {
"message": "Excluir",
"description": "Texto do item de menu excluir."
},
"deleteItemConfimation": {
"message": "Excluir $1 ?",
"description": "Texto de confirmação da exclusão."
},
"menuSettings": {
"message": " Configurações do Quick Dial",
"description": "Texto do item de menu configurações."
}
}

View File

@@ -1,9 +1,4 @@
{ {
"extensionDescription": {
"message": "Quick Dial, вдохновление умершим расширением Fast Dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": { "menuAddToQuickDial": {
"message": "Добавить в Quick Dial", "message": "Добавить в Quick Dial",
"description": "Text of add bookmark menu item." "description": "Text of add bookmark menu item."

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."
}
}

View File

@@ -43,7 +43,7 @@
<tr> <tr>
<td><span>Image :</span></td> <td><span>Image :</span></td>
<td colspan="2"> <td>
<select id="ImageMode"> <select id="ImageMode">
<option value="-1">Default</option> <option value="-1">Default</option>
<option value="0">Stretch</option> <option value="0">Stretch</option>
@@ -57,6 +57,7 @@
<button class="hidden" id="ImageCapture">Capture</button> <button class="hidden" id="ImageCapture">Capture</button>
<input id="ImageFile" type="file" style="width:180px;"> <input id="ImageFile" type="file" style="width:180px;">
</td> </td>
<td style="width:20px"><input id="ImageLocked" type="checkbox" title="Lock image"></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>

View File

@@ -58,6 +58,18 @@
<td>Preview :</td> <td>Preview :</td>
<td><div id="BackgroundPreview" style="width: 300px; height: 180px;"></div></td> <td><div id="BackgroundPreview" style="width: 300px; height: 180px;"></div></td>
</tr> </tr>
<tr>
<td>Show "Add to ..." :</td>
<td><input id="MenuShowAdd" type="checkbox"></td>
</tr>
<tr>
<td>Open QD in new page :</td>
<td><input id="ButtonOpenInNewPage" type="checkbox"></td>
</tr>
</table> </table>
</div> </div>
<div class="hidden"> <div class="hidden">
@@ -80,6 +92,24 @@
<td><span>Margins :</span></td> <td><span>Margins :</span></td>
<td><input id="GridMargins" type="number" min="0"></td> <td><input id="GridMargins" type="number" min="0"></td>
</tr> </tr>
<tr>
<td><span>Open Bookmarks In :</span></td>
<td>
<select id="GridOpenBookmarksIn">
<option value="0">Default</option>
<option value="1">New Tab</option>
</select>
</td>
</tr>
<tr>
<td><span>Open Folders In :</span></td>
<td>
<select id="GridOpenFoldersIn">
<option value="0">Default</option>
<option value="1">New Tab</option>
</select>
</td>
</tr>
<tr> <tr>
<td><span>Back Button :</span></td> <td><span>Back Button :</span></td>
<td><input id="GridBackNode" type="checkbox"></td> <td><input id="GridBackNode" type="checkbox"></td>

View File

@@ -4,8 +4,9 @@ app.init = function(){ // Init module
app.Settings.init(function(){ app.Settings.init(function(){
app.Messages.init(); app.Messages.init();
browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged }); browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged });
browser.browserAction.onClicked.addListener(function(){ browser.browserAction.onClicked.addListener(function(e){
browser.tabs.create({}); if(app.settings.openQuickDialInNewPage) browser.tabs.create({});
else browser.tabs.update(e.id, {url: '/dial'}).then();
}); });
app.GridNodes.sync(app.node, app.settings.grid.root, function(){ app.GridNodes.sync(app.node, app.settings.grid.root, function(){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded }); browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
@@ -49,6 +50,7 @@ app.Messages.init = function(){ // Init Messages Listeners
} else { } else {
browser.runtime.sendMessage( { cmd: app.Messages.Commands.gridNodesLoaded } ); browser.runtime.sendMessage( { cmd: app.Messages.Commands.gridNodesLoaded } );
} }
app.ContextMenus.updateMenu();
break; break;
case app.Messages.Commands.getNodeByID: case app.Messages.Commands.getNodeByID:
var nodes = app.GridNodes.getNodeWithParents(request.id); var nodes = app.GridNodes.getNodeWithParents(request.id);
@@ -100,13 +102,15 @@ app.Messages.init = function(){ // Init Messages Listeners
app.Settings = {}; // Settings helper object app.Settings = {}; // Settings helper object
app.Settings.init = function(callback){ // Load settings and nodes app.Settings.init = function(callback){ // Load settings and nodes
browser.storage.local.get().then(function(data){ browser.storage.local.get().then(function(data){
if(Object.keys(data).length == 0) { if(Object.keys(data).length == 0 || ! data.settings) {
data = { data = {
version: 3, version: 3,
settings: { settings: {
backgroundColor: '#3c4048', backgroundColor: '#3c4048',
backgroundImage: null, backgroundImage: null,
backgroundMode: 0, backgroundMode: 0,
menuShowAdd: true,
openQuickDialInNewPage: true,
grid: { grid: {
margin: 10, margin: 10,
rows: 4, rows: 4,
@@ -119,6 +123,8 @@ app.Settings.init = function(callback){ // Load settings and nodes
folderIcon: 'url(/img/folder.png)', folderIcon: 'url(/img/folder.png)',
folderIconMode: 0, folderIconMode: 0,
loadingIcon: 'url(/img/throbber.gif)', loadingIcon: 'url(/img/throbber.gif)',
openBookmarkMethod: 0,
openFolderMethod: 0,
cells: { cells: {
margin: 4, margin: 4,
marginHover: 4, marginHover: 4,
@@ -211,6 +217,16 @@ app.Settings.init = function(callback){ // Load settings and nodes
data.settings.grid.ratioX = 4; data.settings.grid.ratioX = 4;
data.settings.grid.ratioY = 3; data.settings.grid.ratioY = 3;
} }
if(!(data.settings.menuShowAdd == true) && !(data.settings.menuShowAdd == false)){
data.settings.menuShowAdd = true;
}
if(!data.settings.grid.openBookmarkMethod && data.settings.grid.openBookmarkMethod != 0){
data.settings.grid.openBookmarkMethod = 0;
data.settings.grid.openFolderMethod = 0;
}
if(!data.settings.openQuickDialInNewPage && data.settings.openQuickDialInNewPage != false){
data.settings.openQuickDialInNewPage = true;
}
//app.Settings.save(); //app.Settings.save();
} }
app.settings = data.settings; app.settings = data.settings;
@@ -223,31 +239,39 @@ app.Settings.update = function(settings, callback){ // Save new settings
app.Settings.save(callback); app.Settings.save(callback);
}; };
app.Settings.save = function(callback){ // Save settings app.Settings.save = function(callback){ // Save settings
if(! app.settings) return;
var data = { version: 4 }; var data = { version: 4 };
data.settings = app.settings; data.settings = app.settings;
data.node = app.node; data.node = app.node;
browser.storage.local.set(data).then(function(){ browser.storage.local.set(data).then(function(){
if(callback) callback(); if(callback) callback();
}, function(){ console.log('Error saving settings'); }); }, function(){ console.log('Error saving settings'); });
} };
app.init(); app.init();
app.ContextMenus = {} // ContextMenu helper Object app.ContextMenus = {} // ContextMenu helper Object
app.ContextMenus.menuItemClicked = function(info, tab){
if (info.menuItemId == "AddToQuickDial") app.GridNodes.createBookmark(app.node, info.pageUrl, tab.title, function(){
browser.runtime.sendMessage( { cmd: app.Messages.Commands.gridNodesLoaded } );
});
};
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
if(app.settings.menuShowAdd){
browser.contextMenus.create({ // Create Context menu browser.contextMenus.create({ // Create Context menu
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(){}); }, function(){});
browser.contextMenus.onClicked.addListener(function(info, tab) { // Context menu click event browser.contextMenus.onClicked.addListener(app.ContextMenus.menuItemClicked);
if (info.menuItemId == "AddToQuickDial") }
app.GridNodes.createBookmark(app.node, info.pageUrl, tab.title, function(){ };
browser.runtime.sendMessage( { cmd: app.Messages.Commands.gridNodesLoaded } ); app.ContextMenus.updateMenu = function(){
}); browser.contextMenus.onClicked.removeListener(app.ContextMenus.menuItemClicked);
}); browser.contextMenus.removeAll();
} app.ContextMenus.initMenu();
};
app.Bookmarks = {} // Bookmarks helper object app.Bookmarks = {} // Bookmarks helper object
app.Bookmarks._onCreated = function(){ app.GridNodes.sync(app.node, app.settings.grid.root, function(){ browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded }); }); } app.Bookmarks._onCreated = function(){ app.GridNodes.sync(app.node, app.settings.grid.root, function(){ browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded }); }); }
@@ -424,13 +448,15 @@ app.GridNodes.sync = function(gridNode, rootPath, callback){ // Sync GridNodes w
function syncNode(gridNode, bookmarkItem){ function syncNode(gridNode, bookmarkItem){
gridNode.id = bookmarkItem.id; gridNode.id = bookmarkItem.id;
gridNode.title = bookmarkItem.title; gridNode.title = bookmarkItem.title;
if(bookmarkItem.url){ switch(bookmarkItem.type){
case 'bookmark':
gridNode.type = app.GridNodes.GridNodeType.bookmark; gridNode.type = app.GridNodes.GridNodeType.bookmark;
if(gridNode.url != bookmarkItem.url){ if(gridNode.url != bookmarkItem.url){
gridNode.url = bookmarkItem.url; gridNode.url = bookmarkItem.url;
delete gridNode.image; delete gridNode.image;
} }
} else if(bookmarkItem.children){ break;
case 'folder':
gridNode.type = app.GridNodes.GridNodeType.folder; gridNode.type = app.GridNodes.GridNodeType.folder;
var EmptyNodes = []; var EmptyNodes = [];
if(! gridNode.children) gridNode.children = []; if(! gridNode.children) gridNode.children = [];
@@ -472,8 +498,10 @@ app.GridNodes.sync = function(gridNode, rootPath, callback){ // Sync GridNodes w
syncNode(childGridNode, child); syncNode(childGridNode, child);
} }
EmptyNodes.length = 0; EmptyNodes.length = 0;
} else { break;
default:
gridNode.type = app.GridNodes.GridNodeType.empty; gridNode.type = app.GridNodes.GridNodeType.empty;
break;
} }
} }
@@ -532,8 +560,14 @@ app.GridNodes.updateNode = function(gridNode, value, callback){
if(value){ if(value){
if(value.title) gridNode.title = value.title; if(value.title) gridNode.title = value.title;
if(value.titleLocked!=null) gridNode.titleLocked = value.titleLocked; if(value.titleLocked!=null) gridNode.titleLocked = value.titleLocked;
if(value.imageLocked!=null){
gridNode.imageLocked = value.imageLocked;
if(value.image) gridNode.image = value.image; if(value.image) gridNode.image = value.image;
else delete gridNode.image; else delete gridNode.image;
} else if(gridNode.imageLocked != true){
if(value.image) gridNode.image = value.image;
else delete gridNode.image;
}
if(value.imageMode || value.imageMode == 0) { if(value.imageMode || value.imageMode == 0) {
if(value.imageMode == -1) delete gridNode.imageMode; if(value.imageMode == -1) delete gridNode.imageMode;
else gridNode.imageMode = value.imageMode; else gridNode.imageMode = value.imageMode;
@@ -676,12 +710,15 @@ app.GridNodes.refreshNode = function(gridNode, callback){ // Refresh content of
break; break;
case app.GridNodes.GridNodeType.bookmark: case app.GridNodes.GridNodeType.bookmark:
app.SiteInfos.fromFrame(gridNode.url, function(infos){ app.SiteInfos.fromFrame(gridNode.url, function(infos){
if(gridNode.imageLocked!=true){
if(infos){ if(infos){
if(gridNode.titleLocked!=true) gridNode.title = infos.title; if(gridNode.titleLocked!=true) gridNode.title = infos.title;
gridNode.image = infos.screenshot; gridNode.image = infos.screenshot;
} else { } else {
gridNode.image = '0'; gridNode.image = '0';
} }
}
delete gridNode.__isLoading; delete gridNode.__isLoading;
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
if(callback) callback(infos); if(callback) callback(infos);
@@ -716,12 +753,14 @@ app.GridNodes.capturePage = function(gridNode, callback){
break; break;
case app.GridNodes.GridNodeType.bookmark: case app.GridNodes.GridNodeType.bookmark:
app.SiteInfos.fromNewTab(gridNode.url, function(infos){ app.SiteInfos.fromNewTab(gridNode.url, function(infos){
if(gridNode.imageLocked!=true){
if(infos){ if(infos){
if(gridNode.titleLocked!=true) gridNode.title = infos.title; if(gridNode.titleLocked!=true) gridNode.title = infos.title;
gridNode.image = infos.screenshot; gridNode.image = infos.screenshot;
} else { } else {
gridNode.image = '0'; gridNode.image = '0';
} }
}
delete gridNode.__isLoading; delete gridNode.__isLoading;
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
if(callback) callback(infos); if(callback) callback(infos);

View File

@@ -10,6 +10,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
document.body.style.backgroundColor = utils.getBackgroundColor(); document.body.style.backgroundColor = utils.getBackgroundColor();
app.init(); app.init();
dial.init(); dial.init();
window.setTimeout(function(){
if(! app.settings) app.init();
}, 500);
}); });
window.addEventListener('resize', function(){ window.addEventListener('resize', function(){
@@ -102,7 +105,7 @@ app.Messages.getSettings = function(callback){
} else { } else {
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback, callback); browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback, callback);
} }
}); }, callback);
}; };
app.Messages.getNode = function(path, callback){ app.Messages.getNode = function(path, callback){
browser.runtime.getBackgroundPage().then(function(page){ browser.runtime.getBackgroundPage().then(function(page){
@@ -477,6 +480,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.href = null; link.href = null;
link.onclick = null; link.onclick = null;
link.removeAttribute('contextmenu'); link.removeAttribute('contextmenu');
@@ -486,6 +490,7 @@ 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.href = '#'; link.href = '#';
link.onclick = function(){ window.history.back(); } link.onclick = function(){ window.history.back(); }
link.removeAttribute('contextmenu'); link.removeAttribute('contextmenu');
@@ -500,6 +505,14 @@ dial.populateGrid = function(){
else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')'; else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
} else link.childNodes[0].style.backgroundImage = ''; } else link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = node.title; link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openFolderMethod){
case 0:
if(link.target) delete link.target;
break;
case 1:
link.target = '_blank';
break;
}
if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title); if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title);
else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title); else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title);
link.onclick = null; link.onclick = null;
@@ -519,6 +532,14 @@ dial.populateGrid = function(){
dial.refreshNode(link); dial.refreshNode(link);
} }
link.childNodes[1].innerText = node.title; link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openBookmarkMethod){
case 0:
if(link.target) delete link.target;
break;
case 1:
link.target = '_blank';
break;
}
link.href = node.url; link.href = node.url;
link.onclick = null; link.onclick = null;
link.setAttribute('contextmenu', 'item'); link.setAttribute('contextmenu', 'item');

View File

@@ -26,6 +26,7 @@ app.init = function(){
switch(node.type){ switch(node.type){
case app.GridNodes.GridNodeType.folder: case app.GridNodes.GridNodeType.folder:
TitleLocked.parentNode.style.display = 'none'; TitleLocked.parentNode.style.display = 'none';
ImageLocked.parentNode.style.display = 'none';
Url.parentNode.parentNode.style.display = 'none'; Url.parentNode.parentNode.style.display = 'none';
if(node.image){ if(node.image){
if(node.image.indexOf('url(')>=0) Image = node.image; if(node.image.indexOf('url(')>=0) Image = node.image;
@@ -36,6 +37,7 @@ app.init = function(){
break; break;
case app.GridNodes.GridNodeType.bookmark: case app.GridNodes.GridNodeType.bookmark:
TitleLocked.checked = (node.titleLocked==true); TitleLocked.checked = (node.titleLocked==true);
ImageLocked.checked = (node.imageLocked==true);
ImageDefault.style.display = 'none'; ImageDefault.style.display = 'none';
Url.value = node.url; Url.value = node.url;
if(node.image.indexOf('url(')>=0) Image = node.image; if(node.image.indexOf('url(')>=0) Image = node.image;
@@ -102,7 +104,7 @@ app.init = function(){
app.Messages.updateNode(app.node.id, { title: Title.value, image: Image, imageMode: +(ImageMode.value) }) app.Messages.updateNode(app.node.id, { title: Title.value, image: Image, imageMode: +(ImageMode.value) })
break; break;
case app.GridNodes.GridNodeType.bookmark: case app.GridNodes.GridNodeType.bookmark:
app.Messages.updateNode(app.node.id, { title: Title.value, titleLocked: TitleLocked.checked, url: Url.value, image: Image, imageMode: +(ImageMode.value) }) app.Messages.updateNode(app.node.id, { title: Title.value, titleLocked: TitleLocked.checked, imageLocked: ImageLocked.checked, url: Url.value, image: Image, imageMode: +(ImageMode.value) })
break; break;
} }
} }

View File

@@ -19,6 +19,7 @@ app.init = function(){
}); });
app.Messages.getSettings(function(settings){ app.Messages.getSettings(function(settings){
app.settings = settings; app.settings = settings;
MenuShowAdd.checked = app.settings.menuShowAdd;
BackgroundColor.value = app.settings.backgroundColor; BackgroundColor.value = app.settings.backgroundColor;
BackgroundImage = app.settings.backgroundImage; BackgroundImage = app.settings.backgroundImage;
BackgroundMode.value = app.settings.backgroundMode; BackgroundMode.value = app.settings.backgroundMode;
@@ -26,12 +27,15 @@ app.init = function(){
BackgroundPreview.style.backgroundImage = app.settings.backgroundImage; BackgroundPreview.style.backgroundImage = app.settings.backgroundImage;
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;
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;
GridRatioY.value = app.settings.grid.ratioY; GridRatioY.value = app.settings.grid.ratioY;
GridMargins.value = app.settings.grid.margin; GridMargins.value = app.settings.grid.margin;
GridColumns.value = app.settings.grid.columns; GridColumns.value = app.settings.grid.columns;
GridOpenBookmarksIn.value = app.settings.grid.openBookmarkMethod;
GridOpenFoldersIn.value = app.settings.grid.openFolderMethod;
GridBackNode.checked = app.settings.grid.backNode; GridBackNode.checked = app.settings.grid.backNode;
GridBackMode.value = app.settings.grid.backIconMode; GridBackMode.value = app.settings.grid.backIconMode;
GridBackImage = app.settings.grid.backIcon; GridBackImage = app.settings.grid.backIcon;
@@ -79,14 +83,18 @@ app.init = function(){
window.frameElement.popup.close(); window.frameElement.popup.close();
} }
BtnApply.onclick = function(){ BtnApply.onclick = function(){
app.settings.menuShowAdd = MenuShowAdd.checked;
app.settings.backgroundColor = BackgroundColor.value; app.settings.backgroundColor = BackgroundColor.value;
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.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);
app.settings.grid.ratioX = GridRatioX.value; app.settings.grid.ratioX = GridRatioX.value;
app.settings.grid.ratioY = GridRatioY.value; app.settings.grid.ratioY = GridRatioY.value;
app.settings.grid.openBookmarkMethod = +(GridOpenBookmarksIn.value);
app.settings.grid.openFolderMethod = +(GridOpenFoldersIn.value);
app.settings.grid.backNode = GridBackNode.checked; app.settings.grid.backNode = GridBackNode.checked;
app.settings.grid.backIconMode = +(GridBackMode.value); app.settings.grid.backIconMode = +(GridBackMode.value);
app.settings.grid.backIcon = GridBackImage; app.settings.grid.backIcon = GridBackImage;

View File

@@ -2,14 +2,13 @@
"manifest_version": 2, "manifest_version": 2,
"name": "Quick Dial", "name": "Quick Dial",
"version": "0.1.10", "version": "0.1.15",
"author": "MatMoul", "author": "MatMoul",
"homepage_url": "https://github.com/MatMoul/quickdial-webext", "homepage_url": "https://github.com/MatMoul/quickdial-webext",
"developer": { "developer": {
"name": "MatMoul", "name": "MatMoul",
"url": "https://github.com/MatMoul/quickdial-webext" "url": "https://github.com/MatMoul/quickdial-webext"
}, },
"description": "__MSG_extensionDescription__",
"icons": { "icons": {
"24": "img/24.png", "24": "img/24.png",