Sfoglia il codice sorgente

fix missing notes in saved pages (fix 624)

Gildas 5 anni fa
parent
commit
0fa1eed337

File diff suppressed because it is too large
+ 0 - 0
dist/single-file-editor.js


File diff suppressed because it is too large
+ 0 - 0
dist/web/editor/editor-web.js


+ 34 - 0
extension/lib/single-file/single-file-editor.js

@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010-2020 Gildas Lormeau
+ * contact : gildas.lormeau <at> gmail.com
+ * 
+ * This file is part of SingleFile.
+ *
+ *   The code in this file is free software: you can redistribute it and/or 
+ *   modify it under the terms of the GNU Affero General Public License 
+ *   (GNU AGPL) as published by the Free Software Foundation, either version 3
+ *   of the License, or (at your option) any later version.
+ * 
+ *   The code in this file is distributed in the hope that it will be useful, 
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero 
+ *   General Public License for more details.
+ *
+ *   As additional permission under GNU AGPL version 3 section 7, you may 
+ *   distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU 
+ *   AGPL normally required by section 4, provided you include this license 
+ *   notice and a URL through which recipients can access the Corresponding 
+ *   Source.
+ */
+
+import * as serializer from "../../../lib/single-file/modules/html-serializer.js";
+
+const helper = {
+	serialize(doc, compressHTML) {
+		return serializer.process(doc, compressHTML);
+	}
+};
+
+export {
+	helper
+};

+ 3 - 3
extension/ui/content/content-ui-editor-web.js

@@ -23,9 +23,9 @@
 
 /* global globalThis, window, document, fetch, DOMParser, getComputedStyle, setTimeout, clearTimeout, NodeFilter, Readability, isProbablyReaderable, matchMedia, TextDecoder, Node */
 
-(() => {
+(globalThis => {
 
-	const singlefile = globalThis.singlefileBootstrap;
+	const singlefile = globalThis.singlefile;
 
 	const FORBIDDEN_TAG_NAMES = ["a", "area", "audio", "base", "br", "col", "command", "embed", "hr", "img", "iframe", "input", "keygen", "link", "meta", "param", "source", "track", "video", "wbr"];
 	const BUTTON_ANCHOR_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAgMAAAAOFJJnAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TtaIVETuIOASsThZERRylikWwUNoKrTqYXPohNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APEydFJ0UVK/F9SaBHjwXE/3t173L0DhFqJqWbbOKBqlpGMRcVMdkUMvKIbfQCG0SExU4+nFtLwHF/38PH1LsKzvM/9OXqUnMkAn0g8y3TDIl4nnt60dM77xCFWlBTic+Ixgy5I/Mh12eU3zgWHBZ4ZMtLJOeIQsVhoYbmFWdFQiaeIw4qqUb6QcVnhvMVZLVVY4578hcGctpziOs0hxLCIOBIQIaOCDZRgIUKrRoqJJO1HPfyDjj9BLplcG2DkmEcZKiTHD/4Hv7s185MTblIwCrS/2PbHCBDYBepV2/4+tu36CeB/Bq60pr9cA2Y+Sa82tfAR0LsNXFw3NXkPuNwBBp50yZAcyU9TyOeB9zP6pizQfwt0rbq9NfZx+gCkqaulG+DgEBgtUPaax7s7W3v790yjvx825XKP2aKCdAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+QLEQA4M3Y7LzIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAACVBMVEUAAAAAAACKioqjwG1pAAAAAXRSTlMAQObYZgAAAAFiS0dEAmYLfGQAAABkSURBVBjThc47CsNADIThWfD0bnSfbdIroP/+V0mhsN5gTNToK0YPaSvnF9B9wGykG54j/2GF1/hauE4E1AOuNxrBdA5KUXIqdiCnqC1zIZ2mFJQzKJ3wesOhcwDM4+fo7cOuD9C4HTQ9HAAQAAAAAElFTkSuQmCC";
@@ -1957,4 +1957,4 @@ table {
 			(firstDocumentChild.textContent.includes(COMMENT_HEADER) || firstDocumentChild.textContent.includes(COMMENT_HEADER_LEGACY));
 	}
 
-})();
+})(typeof globalThis == "object" ? globalThis : window);

+ 1 - 1
extension/ui/pages/editor.html

@@ -66,7 +66,7 @@
 		</div>
 	</div>
 	<iframe class="editor"
-		srcdoc="&lt;!DOCTYPE html&gt;&lt;body&gt;&lt;script src=/dist/single-file-bootstrap.js&gt;&lt;/script&gt;&lt;script src=/dist/web/editor/editor-web.js&gt;&lt;/script&gt;&lt;script src=/extension/lib/readability/Readability.js&gt;&lt;/script&gt;&lt;/script&gt;&lt;script src=/extension/lib/readability/Readability-readerable.js&gt;&lt;/script&gt;&lt;/body&gt;"
+		srcdoc="&lt;!DOCTYPE html&gt;&lt;body&gt;&lt;script src=/dist/single-file-editor.js&gt;&lt;/script&gt;&lt;script src=/dist/web/editor/editor-web.js&gt;&lt;/script&gt;&lt;script src=/extension/lib/readability/Readability.js&gt;&lt;/script&gt;&lt;/script&gt;&lt;script src=/extension/lib/readability/Readability-readerable.js&gt;&lt;/script&gt;&lt;/body&gt;"
 		sandbox="allow-scripts allow-modals"></iframe>
 	<script src="/dist/chrome-browser-polyfill.js"></script>
 	<script src="/dist/single-file.js"></script>

+ 1 - 1
manifest.json

@@ -77,7 +77,7 @@
 		}
 	},
 	"web_accessible_resources": [
-		"dist/single-file-bootstrap.js",
+		"dist/single-file-editor.js",
 		"dist/web/hooks/hooks-web.js",
 		"dist/web/hooks/hooks-frames-web.js",
 		"dist/web/infobar-web.js",

+ 8 - 0
rollup.config.dev.js

@@ -51,6 +51,14 @@ export default [{
 		format: "iife",
 		plugins: []
 	}]
+}, {
+	input: ["extension/lib/single-file/single-file-editor.js"],
+	output: [{
+		file: "dist/single-file-editor.js",
+		format: "umd",
+		name: "singlefile",
+		plugins: []
+	}]
 }, {
 	input: ["lib/single-file/processors/hooks/content/content-hooks-web.js"],
 	output: [{

+ 9 - 1
rollup.config.js

@@ -53,6 +53,14 @@ export default [{
 		format: "iife",
 		plugins: [terser()]
 	}]
+}, {
+	input: ["extension/lib/single-file/single-file-editor.js"],
+	output: [{
+		file: "dist/single-file-editor.js",
+		format: "umd",
+		name: "singlefile",
+		plugins: [terser()]
+	}]
 }, {
 	input: ["lib/single-file/processors/hooks/content/content-hooks-web.js"],
 	output: [{
@@ -86,7 +94,7 @@ export default [{
 	output: [{
 		file: "dist/web/editor/editor-web.js",
 		format: "iife",
-		plugins: [terser()]
+		plugins: []
 	}]
 }, {
 	input: ["extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],

Some files were not shown because too many files changed in this diff