Gildas 3 rokov pred
rodič
commit
d44a9e8757

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
lib/single-file-extension-background.js


+ 8 - 5
lib/single-file-extension-editor.js

@@ -1135,6 +1135,7 @@ pre code {
 					element.style.setProperty(pointerEvents, "none", "important");
 				});
 				document.replaceChild(contentDocument.documentElement, document.documentElement);
+				document.querySelectorAll("[data-single-file-note-refs]").forEach(noteRefElement => noteRefElement.dataset.singleFileNoteRefs = noteRefElement.dataset.singleFileNoteRefs.replace(/,/g, " "));
 				deserializeShadowRoots(document);
 				document.querySelectorAll(NOTE_TAGNAME).forEach(containerElement => attachNoteListeners(containerElement, true));
 				document.documentElement.appendChild(getStyleElement(HIGHLIGHTS_WEB_STYLESHEET));
@@ -1170,6 +1171,7 @@ pre code {
 			const containerElement = document.createElement(NOTE_TAGNAME);
 			const noteElement = document.createElement("div");
 			const headerElement = document.createElement("header");
+			const blockquoteElement = document.createElement("blockquote");
 			const mainElement = document.createElement("textarea");
 			const resizeElement = document.createElement("div");
 			const removeNoteElement = document.createElement("img");
@@ -1177,13 +1179,15 @@ pre code {
 			const noteShadow = containerElement.attachShadow({ mode: "open" });
 			headerElement.appendChild(anchorIconElement);
 			headerElement.appendChild(removeNoteElement);
+			blockquoteElement.appendChild(mainElement);
 			noteElement.appendChild(headerElement);
-			noteElement.appendChild(mainElement);
+			noteElement.appendChild(blockquoteElement);
 			noteElement.appendChild(resizeElement);
 			noteShadow.appendChild(getStyleElement(NOTES_WEB_STYLESHEET));
 			noteShadow.appendChild(noteElement);
 			const notesElements = Array.from(document.querySelectorAll(NOTE_TAGNAME));
 			const noteId = Math.max.call(Math, 0, ...notesElements.map(noteElement => Number(noteElement.dataset.noteId))) + 1;
+			noteElement.cite = "https://www.w3.org/TR/annotation-model/#selector(type=CssSelector,value=[data-single-file-note-refs~=\"" + noteId + "\"])";
 			noteElement.classList.add(NOTE_CLASS);
 			noteElement.classList.add(NOTE_ANCHORED_CLASS);
 			noteElement.classList.add(color);
@@ -2069,8 +2073,7 @@ pre code {
 		}
 
 		function getAnchorElement(containerElement) {
-			return document.querySelector("[data-single-file-note-refs^=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs$=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs*=" + JSON.stringify("," + containerElement.dataset.noteId + ",") + "]")
-				|| document.documentElement;
+			return document.querySelector("[data-single-file-note-refs~=\"" + containerElement.dataset.noteId + "\"]") || document.documentElement;
 		}
 
 		function addNoteRef(anchorElement, noteId) {
@@ -2090,11 +2093,11 @@ pre code {
 		}
 
 		function getNoteRefs(anchorElement) {
-			return JSON.parse("[" + (anchorElement.dataset.singleFileNoteRefs || "") + "]");
+			return anchorElement.dataset.singleFileNoteRefs ? anchorElement.dataset.singleFileNoteRefs.split(" ") : [];
 		}
 
 		function setNoteRefs(anchorElement, noteRefs) {
-			anchorElement.dataset.singleFileNoteRefs = noteRefs.toString();
+			anchorElement.dataset.singleFileNoteRefs = noteRefs.join(" ");
 		}
 
 		function minifyText(text) {

+ 1 - 1
manifest.json

@@ -8,7 +8,7 @@
 		"64": "src/ui/resources/icon_64.png",
 		"128": "src/ui/resources/icon_128.png"
 	},
-	"version": "1.21.28",
+	"version": "1.21.29",
 	"description": "__MSG_extensionDescription__",
 	"content_scripts": [
 		{

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 	"name": "single-file",
-	"version": "1.0.20",
+	"version": "1.0.21",
 	"lockfileVersion": 2,
 	"requires": true,
 	"packages": {
 		"": {
 			"name": "single-file",
-			"version": "1.0.20",
+			"version": "1.0.21",
 			"license": "AGPL-3.0-or-later",
 			"dependencies": {
 				"single-file-cli": "1.0.23",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "single-file",
-	"version": "1.0.20",
+	"version": "1.0.21",
 	"description": "SingleFile",
 	"author": "Gildas Lormeau",
 	"license": "AGPL-3.0-or-later",

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov