diff --git a/addons/BookmarkWidget/BookmarkWidget.inc b/addons/BookmarkWidget/BookmarkWidget.inc
index aa5eb74..f277495 100644
--- a/addons/BookmarkWidget/BookmarkWidget.inc
+++ b/addons/BookmarkWidget/BookmarkWidget.inc
@@ -13,88 +13,15 @@ class ComicPressAddonBookmarkWidget extends ComicPressAddon {
wp_enqueue_script('prototype');
wp_enqueue_script('cookiejar', get_template_directory_uri() . '/js/cookiejar.js', array('prototype'));
+ wp_enqueue_script('bookmark', get_template_directory_uri() . '/js/bookmark.js', array('prototype', 'cookiejar'));
}
- function wp_head() {
- $last_comic = $this->comicpress->get_last_comic(); ?>
-
-
+
+
@@ -102,7 +29,6 @@ class ComicPressAddonBookmarkWidget extends ComicPressAddon {
-
COMIC BOOKMARK
Click "Tag Page" to bookmark a comic page. When you return to the site, click "Goto Tag" to continue where you left off.');
- if (isHome) {
- document.write('');
- document.write('');
- document.write('');
- document.write('');
- } else if (isSingle) {
- document.write('');
- document.write('');
- document.write('');
- document.write('');
- }
- }
-}
\ No newline at end of file
+ Event.observe(hrefs['tag-page'], 'click', function(e) {
+ Event.stop(e);
+ info.permalink = permalink;
+ bookmark_info.write(info);
+ });
+
+ Event.observe(hrefs['clear-tag'], 'click', function(e) {
+ Event.stop(e);
+ info.permalink = false;
+ bookmark_info.write(info);
+ });
+
+ Event.observe(hrefs['goto-tag'], 'click', function(e) {
+ if (hrefs['goto-tag'].href == "#") { Event.stop(e); }
+ });
+});
diff --git a/js/cookiejar.js b/js/cookiejar.js
index 9ddbfdd..a7c4a8d 100644
--- a/js/cookiejar.js
+++ b/js/cookiejar.js
@@ -107,7 +107,7 @@ CookieJar.prototype = {
get: function(name) {
name = this.appendString + name;
var cookies = document.cookie.match(name + '=(.*?)(;|$)');
- if (cookies) {
+ if (cookies) {
return (unescape(cookies[1])).evalJSON();
} else {
return null;