X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d9c51b94bfe6b1cda1790d57a9108b83c6e1643b..f7d8acded4a58d423035c5759f6dee9a34396959:/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 index 000000000..2f9a502e8 --- /dev/null +++ b/src/wolnelektury/static/js/book_text/pbox-items.js @@ -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);