Initial bookmarks.
[wolnelektury.git] / src / wolnelektury / static / js / book_text / marker.js
diff --git a/src/wolnelektury/static/js/book_text/marker.js b/src/wolnelektury/static/js/book_text/marker.js
new file mode 100644 (file)
index 0000000..5db4d7e
--- /dev/null
@@ -0,0 +1,36 @@
+(function($){$(function(){
+
+    class PMarker {
+        putBox(box) {
+
+            let $z = $(this).closest('.zakladka');
+            let $box = $("#zakladka-box");
+            $z.append($box);
+            $box.data('z', $z);
+
+            anchor = $z.data('anchor');
+            let note = anchor in zakladki ? zakladki[anchor].note : ''; 
+            $('textarea', $box).val(note);
+            
+            // TODO update note content here.
+            // And/or delete buttons.
+            $box.toggle();
+
+
+        }
+
+
+
+        showForAnchor(anchor) {
+        }
+
+        showForP(p) {
+        }
+    }
+
+    $.PMarker = PMarker;
+    
+    // There can be more than one marker.
+    // Some markers
+
+})})(jQuery);