浏览代码

Merge pull request #12 from gildas-lormeau/master

upd
solokot 5 年之前
父节点
当前提交
14e0ead17b

+ 8 - 0
_locales/de/messages.json

@@ -3,6 +3,14 @@
 		"message": "Speichern einer kompletten Webseite in eine einzige HTML-Datei",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Speichern der aktuellen Tab oder des ausgewählten Inhalts",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Speichern aller Tabs",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Speichern der Webseite mit SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/en/messages.json

@@ -3,6 +3,14 @@
 		"message": "Save a complete page into a single HTML file",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Save all tabs",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Save page with SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/es/messages.json

@@ -3,6 +3,14 @@
 		"message": "Guarda una página completa en un único archivo HTML",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Guardar la pestaña actual o el contenido seleccionado",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Guardar todas las pestañas",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Guardar página con SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/fr/messages.json

@@ -3,6 +3,14 @@
 		"message": "Sauvegardez une page complète dans un simple fichier HTML",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Sauver l'onglet courant ou le contenu sélectionné",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Sauver tous les onglets",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Sauver la page avec SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/ja/messages.json

@@ -3,6 +3,14 @@
 		"message": "完全なページを単一の HTML ファイルに保存する",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "すべてのタブを保存",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "SingleFile でページを保存",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/pl/messages.json

@@ -3,6 +3,14 @@
 		"message": "Zapisuj kompletną stronę w pojedynczym pliku HTML.",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Zapisz wszystkie karty",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Zapisz stronę z SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/ru/messages.json

@@ -3,6 +3,14 @@
 		"message": "Сохранение полной страницы в едином HTML-файле",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Сохранить все вкладки",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Сохранить страницу с помощью SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/uk/messages.json

@@ -3,6 +3,14 @@
 		"message": "Зберегти всю сторінку в один HTML-файл",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "Зберегти всі вкладки",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "Зберегти сторінку з допомогою SingleFile",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 8 - 0
_locales/zh_CN/messages.json

@@ -3,6 +3,14 @@
 		"message": "将一个完整的页面保存到单个 HTML 文件中",
 		"description": "Description of the extension."
 	},
+    "commandSaveTab": {
+        "message": "Save the current tab or the selected content",
+        "description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+    },
+    "commandSaveAllTabs": {
+        "message": "保存所有标签页",
+        "description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+    },
 	"menuSavePage": {
 		"message": "使用 SingleFile 保存页面",
 		"description": "Menu entry: 'Save page with SingleFile'"

+ 9 - 1
_locales/zh_TW/messages.json

@@ -3,6 +3,14 @@
 		"message": "將一個完整的頁面保存到單個 HTML 文件中",
 		"description": "Description of the extension."
 	},
+	"commandSaveTab": {
+		"message": "Save the current tab or the selected content",
+		"description": "Command (Ctrl+Shift+Y): 'Save the current tab or the selected content'"
+	},
+	"commandSaveAllTabs": {
+		"message": "保存所有標籤頁",
+		"description": "Command (Ctrl+Shift+U): 'Save all tabs'"
+	},
 	"menuSavePage": {
 		"message": "使用 SingleFile 保存頁面",
 		"description": "Menu entry: 'Save page with SingleFile'"
@@ -374,7 +382,7 @@
 	"optionAutoSaveExternalSave": {
 		"message": "使用 SingleFile Companion 保存頁面",
 		"description": "Options page label: 'save the page with SingleFile Companion'"
-	},	
+	},
 	"optionsEditorSubTitle": {
 		"message": "標註編輯器",
 		"description": "Options sub-title: 'Annotation editor'"

+ 4 - 4
cli/README.MD

@@ -62,17 +62,17 @@ SingleFile can be launched from the command line by running it into a (headless)
 
   - Dump the processed content of https://www.wikipedia.org into the console
 
-  `single-file https://www.wikipedia.org` --filename-template=""
+  `single-file https://www.wikipedia.org --filename-template=""`
 
-  - Save https://www.wikipedia.org into `wikipedia.html`
+  - Save https://www.wikipedia.org into `wikipedia.html` in the current folder
 
   `single-file https://www.wikipedia.org wikipedia.html`
 
-  - Save https://www.wikipedia.org into `wikipedia.html` with Firefox instead of Chrome
+  - Save https://www.wikipedia.org into `wikipedia.html` in the current folder with Firefox instead of Chrome
 
   `single-file https://www.wikipedia.org wikipedia.html --back-end=webdriver-gecko`
 
-  - Save a list of URLs stored into `list-urls.txt`
+  - Save a list of URLs stored into `list-urls.txt` in the current folder
 
   `single-file --urls-file=list-urls.txt`
 

+ 1 - 3
cli/singlefile-cli-api.js

@@ -1,5 +1,3 @@
-#!/usr/bin/env node
-
 /*
  * Copyright 2010-2020 Gildas Lormeau
  * contact : gildas.lormeau <at> gmail.com
@@ -204,4 +202,4 @@ function getFilename(filename, index = 1) {
 
 function escapeRegExp(string) {
 	return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-}
+}

+ 5 - 3
common/ui/content/content-infobar-web.js

@@ -99,7 +99,7 @@
 			setProperty(closeElement, "opacity", .7);
 			setProperty(closeElement, "padding-right", "8px");
 			setProperty(closeElement, "cursor", "pointer");
-			setProperty(closeElement, "color", "#9aa0a6");
+			setProperty(closeElement, "color", "rgb(126 135 140)");
 			setProperty(closeElement, "line-height", "24px");
 			closeElement.onmouseover = () => setProperty(closeElement, "opacity", 1);
 			closeElement.onmouseout = () => setProperty(closeElement, "opacity", .7);
@@ -110,11 +110,13 @@
 			};
 			const infoElement = createElement("span", infobarElement);
 			setProperty(infoElement, "font-family", "Arial");
-			setProperty(infoElement, "color", "#9aa0a6");
+			setProperty(infoElement, "color", "#2d2d2d");
 			setProperty(infoElement, "font-size", "14px");
 			setProperty(infoElement, "line-height", "22px");
 			setProperty(infoElement, "word-break", "break-word");
 			setProperty(infoElement, "white-space", "pre-wrap");
+			setProperty(infoElement, "position", "relative");
+			setProperty(infoElement, "top", "1px");
 			infoElement.textContent = infoData;
 			const linkElement = createElement("a", infobarElement);
 			setProperty(linkElement, "display", "inline-block");
@@ -160,7 +162,7 @@
 		setProperty(infobarElement, "width", "auto");
 		setProperty(infobarElement, "background-color", "#f9f9f9");
 		setProperty(infobarElement, "cursor", "auto");
-		setProperty(infobarElement, "color", "#9aa0a6");
+		setProperty(infobarElement, "color", "#2d2d2d");
 		setProperty(infobarElement, "padding-left", "8px");
 		setProperty(infobarElement, "padding-right", "4px");
 		setProperty(infobarElement, "padding-top", "2px");

+ 4 - 2
lib/single-file/modules/css-fonts-alt-minifier.js

@@ -165,6 +165,7 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
 			}));
 		});
 		fontsDetails.medias.forEach(mediaFontsDetails => processFontDetails(mediaFontsDetails));
+		fontsDetails.supports.forEach(supportsFontsDetails => processFontDetails(supportsFontsDetails));
 	}
 
 	async function processFontFaceRules(cssRules, sheetIndex, fontsDetails, fontURLs, stats) {
@@ -182,9 +183,10 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
 				await processFontFaceRules(ruleData.block.children, sheetIndex, fontsDetails.supports.get("supports-" + sheetIndex + "-" + supportsIndex + "-" + supportsText), fontURLs, stats);
 				supportsIndex++;
 			} else if (ruleData.type == "Atrule" && ruleData.name == "font-face") {
-				const fontInfo = fontsDetails.fonts.get(getFontKey(ruleData));
+				const key = getFontKey(ruleData);
+				const fontInfo = fontsDetails.fonts.get(key);
 				if (fontInfo) {
-					fontsDetails.fonts.delete(getFontKey(ruleData));
+					fontsDetails.fonts.delete(key);
 					await processFontFaceRule(ruleData, fontInfo, fontURLs, stats);
 				} else {
 					removedRules.push(cssRule);

+ 3 - 3
manifest.json

@@ -8,7 +8,7 @@
 		"64": "extension/ui/resources/icon_64.png",
 		"128": "extension/ui/resources/icon_128.png"
 	},
-	"version": "1.18.0",
+	"version": "1.18.1",
 	"description": "__MSG_extensionDescription__",
 	"content_scripts": [
 		{
@@ -130,13 +130,13 @@
 			"suggested_key": {
 				"default": "Ctrl+Shift+Y"
 			},
-			"description": "Save the current tab or the selected content"
+			"description": "__MSG_commandSaveTab__"
 		},
 		"save-all-tabs": {
 			"suggested_key": {
 				"default": "Ctrl+Shift+U"
 			},
-			"description": "Save all tabs"
+			"description": "__MSG_commandSaveAllTabs__"
 		}
 	},
 	"web_accessible_resources": [

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "single-file",
-	"version": "0.1.0",
+	"version": "0.1.1",
 	"description": "SingleFile",
 	"author": "Gildas Lormeau",
 	"license": "AGPL-3.0-or-later",
@@ -18,4 +18,4 @@
 		"strong-data-uri": "^1.0.6",
 		"yargs": "^15.4.1"
 	}
-}
+}