Initial bookmarks.
[wolnelektury.git] / src / wolnelektury / static / js / book_text / pbox-items.js
diff --git a/src/wolnelektury/static/js/book_text/pbox-items.js b/src/wolnelektury/static/js/book_text/pbox-items.js
new file mode 100644 (file)
index 0000000..2f9a502
--- /dev/null
@@ -0,0 +1,38 @@
+// i18n for labels?
+// maybe move labels to templates after all?
+
+(function($){$(function(){
+
+    class PBoxItem {
+        update(pbox) {
+            if (this.isAvailable(pbox)) {
+                pbox.showButton(this, this.label, this.pboxClass);
+            }
+        }
+    }
+
+
+    class LoginPBI extends PBoxItem {
+        label = 'ZALOGUJ';
+        pboxClass = 'zakladka-tool_login';
+
+        isAvailable(pbox) {
+            return true;
+        }
+        
+        action() {
+            alert('akcja');
+        }
+    }
+
+
+    class BookmarkPBI extends PBoxItem {
+        label = 'DODAJ ZAKŁADKĘ'
+        
+    }
+    
+
+    $.pbox.addItem(new LoginPBI());
+
+
+})})(jQuery);