mirror of
https://github.com/MatMoul/quickdial-webext.git
synced 2025-12-16 00:43:12 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a3072bbdc | |||
| 9c907f37e0 | |||
| 39f96b015b | |||
| d3cc6cf68f | |||
| b91255375f |
@@ -44,6 +44,7 @@
|
|||||||
<td><span>Image :</span></td>
|
<td><span>Image :</span></td>
|
||||||
<td>
|
<td>
|
||||||
<button id="ImageReset">Reset</button>
|
<button id="ImageReset">Reset</button>
|
||||||
|
<button id="ImageDefault">Default</button>
|
||||||
<button class="hidden" id="ImageRefresh">Refresh</button>
|
<button class="hidden" id="ImageRefresh">Refresh</button>
|
||||||
<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;">
|
||||||
|
|||||||
@@ -448,11 +448,14 @@ app.GridNodes.getNodeWithParents = function(id){
|
|||||||
app.GridNodes.updateNode = function(gridNode, value, callback){
|
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.image) gridNode.image = value.image;
|
||||||
|
else delete gridNode.image;
|
||||||
if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){
|
if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){
|
||||||
gridNode.url = value.url;
|
gridNode.url = value.url;
|
||||||
delete gridNode.image;
|
app.GridNodes.refreshNode(gridNode, function(){
|
||||||
|
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if(value.image) gridNode.image = value.image;
|
|
||||||
app.GridNodes.saveNode(gridNode);
|
app.GridNodes.saveNode(gridNode);
|
||||||
}
|
}
|
||||||
if(callback) callback(gridNode);
|
if(callback) callback(gridNode);
|
||||||
|
|||||||
@@ -17,11 +17,15 @@ app.init = function(){
|
|||||||
switch(node.type){
|
switch(node.type){
|
||||||
case app.GridNodes.GridNodeType.folder:
|
case app.GridNodes.GridNodeType.folder:
|
||||||
Url.parentNode.parentNode.style.display = 'none';
|
Url.parentNode.parentNode.style.display = 'none';
|
||||||
if(node.image) Image = node.image;
|
if(node.image){
|
||||||
else Image = app.settings.grid.folderIcon;
|
if(node.image.indexOf('url(')>0) Image = node.image;
|
||||||
ImagePreview.style.backgroundImage = Image;
|
else Image = 'url(' + node.image + ')';
|
||||||
|
} else Image = null;
|
||||||
|
if(Image==null) ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
|
||||||
|
else ImagePreview.style.backgroundImage = Image;
|
||||||
break;
|
break;
|
||||||
case app.GridNodes.GridNodeType.bookmark:
|
case app.GridNodes.GridNodeType.bookmark:
|
||||||
|
ImageDefault.style.display = 'none';
|
||||||
Url.value = node.url;
|
Url.value = node.url;
|
||||||
Image = 'url(' + node.image + ')';
|
Image = 'url(' + node.image + ')';
|
||||||
ImagePreview.style.backgroundImage = Image;
|
ImagePreview.style.backgroundImage = Image;
|
||||||
@@ -46,6 +50,17 @@ app.init = function(){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ImageDefault.onclick = function(){
|
||||||
|
switch(node.type){
|
||||||
|
case app.GridNodes.GridNodeType.folder:
|
||||||
|
Image = null;
|
||||||
|
ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
|
||||||
|
break;
|
||||||
|
case app.GridNodes.GridNodeType.bookmark:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
ImageFile.onclick = function(){
|
ImageFile.onclick = function(){
|
||||||
this.value = null;
|
this.value = null;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Quick Dial",
|
"name": "Quick Dial",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"author": "MatMoul",
|
"author": "MatMoul",
|
||||||
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
|
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
|
||||||
"developer": {
|
"developer": {
|
||||||
|
|||||||
Reference in New Issue
Block a user