TagSpaces is an offline, open source, document manager with tagging support
SaveAsBookmark
roobin23689ca4edde
diff --git a/data/_locales/en_US/messages.json b/data/_locales/en_US/messages.jsonindex a370492f3..6e838663b 100644--- a/data/_locales/en_US/messages.json+++ b/data/_locales/en_US/messages.json@@ -56,5 +56,13 @@"saveScreenshotLabel": {"message": "Screenshot","description": "Title of label."+ },+ "saveBookmarkTitle": {+ "message": "Bookmark the page",+ "description": "Title of bookmark button"+ },+ "saveBookmarkLabel": {+ "message": "Bookmark",+ "description": "Title of label."}}\ No newline at end of filediff --git a/data/chromelight/popup.html b/data/chromelight/popup.htmlindex 3a443957d..adb82ac72 100644--- a/data/chromelight/popup.html+++ b/data/chromelight/popup.html@@ -45,6 +45,9 @@ can be found in the LICENSE file.<a href="#" class="btn btn-primary" id="saveScreenshot" data-i18n-title="saveScreenshotTitle"><i class="fa fa-camera fa-lg fa-fw"></i> <span data-i18n="saveScreenshotLabel"></span></a>+ <a href="#" class="btn btn-primary" id="saveAsBookmark" data-i18n-title="saveBookmarkTitle">+ <i class="fa fa-bookmark fa-lg fa-fw"></i> <span data-i18n="saveBookmarkLabel"></span>+ </a></div></div><script type="text/javascript" src="../libs/jquery/jquery-2.1.1.min.js"></script>diff --git a/data/chromelight/popup.js b/data/chromelight/popup.jsindex 8f350ecef..e0905cd8e 100644--- a/data/chromelight/popup.js+++ b/data/chromelight/popup.js@@ -42,7 +42,8 @@});$("#saveAsMhtml").on('click', saveAsMHTML);-+ $("#saveAsBookmark").on('click', saveAsBookmark);+$("#saveSelectionAsHtml").on("click", function() {chrome.tabs.executeScript(null, {file: "chromelight/captureContent.js"@@ -89,6 +90,19 @@});}+ function saveAsBookmark() {+ var filename;+ tags = document.getElementById("tags").value;+ if (tags) {+ tags = tags.split(",").join(" ");+ filename = $('#title').val() + ' [' + tags + '].url';+ } else {+ filename = $('#title').val() + '.url';+ }+ var content = '[InternetShortcut]\r\nURL=' + tab.url;+ saveAs(content, filename);+ }+function saveAsMHTML() {var filename;tags = document.getElementById("tags").value;