diff --git a/TODO b/TODO index 3ba1710..06bfc09 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ Create style for popup -Add a setting to lock title from update Add a visual hint for multipage Need a best solution to update folder and bookmark when it are updated from Firefox Improve screenshot result diff --git a/src/html/properties.html b/src/html/properties.html index a2ea6db..26cd695 100644 --- a/src/html/properties.html +++ b/src/html/properties.html @@ -33,16 +33,17 @@ Title : + Url : - + Image : - + @@ -52,7 +53,7 @@ -
+
diff --git a/src/js/background.js b/src/js/background.js index f54efd8..35f2b63 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -461,6 +461,7 @@ app.GridNodes.getNodeWithParents = function(id){ app.GridNodes.updateNode = function(gridNode, value, callback){ if(value){ if(value.title) gridNode.title = value.title; + if(value.titleLocked) gridNode.titleLocked = value.titleLocked; if(value.image) gridNode.image = value.image; else delete gridNode.image; if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){ @@ -579,7 +580,7 @@ app.GridNodes.refreshNode = function(gridNode, callback){ // Refresh content of case app.GridNodes.GridNodeType.bookmark: app.SiteInfos.fromFrame(gridNode.url, function(infos){ if(infos){ - gridNode.title = infos.title; + if(gridNode.titleLocked!=true) gridNode.title = infos.title; gridNode.image = infos.screenshot; } else { gridNode.image = '0'; @@ -615,7 +616,7 @@ app.GridNodes.capturePage = function(gridNode, callback){ case app.GridNodes.GridNodeType.bookmark: app.SiteInfos.fromNewTab(gridNode.url, function(infos){ if(infos){ - gridNode.title = infos.title; + if(gridNode.titleLocked!=true) gridNode.title = infos.title; gridNode.image = infos.screenshot; } else { gridNode.image = '0'; diff --git a/src/js/properties.js b/src/js/properties.js index b37e711..1e7a9e2 100644 --- a/src/js/properties.js +++ b/src/js/properties.js @@ -23,6 +23,7 @@ app.init = function(){ ImagePreview.style.backgroundSize = '100% 100%'; switch(node.type){ case app.GridNodes.GridNodeType.folder: + TitleLocked.parentNode.style.display = 'none'; Url.parentNode.parentNode.style.display = 'none'; if(node.image){ if(node.image.indexOf('url(')>0) Image = node.image; @@ -32,6 +33,7 @@ app.init = function(){ else ImagePreview.style.backgroundImage = Image; break; case app.GridNodes.GridNodeType.bookmark: + TitleLocked.checked = node.titleLocked; ImageDefault.style.display = 'none'; Url.value = node.url; Image = 'url(' + node.image + ')'; @@ -97,7 +99,7 @@ app.init = function(){ app.Messages.updateNode(app.node.id, { title: Title.value, image: Image }) break; case app.GridNodes.GridNodeType.bookmark: - app.Messages.updateNode(app.node.id, { title: Title.value, url: Url.value, image: Image }) + app.Messages.updateNode(app.node.id, { title: Title.value, titleLocked: TitleLocked.checked, url: Url.value, image: Image }) break; } }