From 8f2e1499578c7ef8a1606a066a3876fba315db73 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 14 Jul 2009 22:25:06 -0400 Subject: [PATCH] clean up javascript leftovers --- addons/BookmarkWidget/temp.js | 103 ---------------------------------- js/bookmark.js | 81 ++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 103 deletions(-) delete mode 100644 addons/BookmarkWidget/temp.js create mode 100644 js/bookmark.js diff --git a/addons/BookmarkWidget/temp.js b/addons/BookmarkWidget/temp.js deleted file mode 100644 index 3461e0b..0000000 --- a/addons/BookmarkWidget/temp.js +++ /dev/null @@ -1,103 +0,0 @@ - - -
- -
- diff --git a/js/bookmark.js b/js/bookmark.js new file mode 100644 index 0000000..a6b5f42 --- /dev/null +++ b/js/bookmark.js @@ -0,0 +1,81 @@ +var cl = 31; + +/* Below are our functions for this little script */ + +function bmhome() { + if(document.getElementById) { + document.getElementById('gtc').src = imgGotoOn; + document.getElementById('rmc').src = imgClearOn; + } + createCookie("bm", comicPermalink, cl); +} + +function bm() { + if(document.getElementById) { + document.getElementById('gtc').src = imgGotoOn; + document.getElementById('rmc').src = imgClearOn; + } + createCookie("bm", window.location, cl); +} + +function bmc() { + if(document.getElementById) { + document.getElementById('gtc').src = imgGotoOff; + document.getElementById('rmc').src = imgClearOff; + } + createCookie("bm","",-1); +} + +function gto() { + var g = readCookie('bm'); + if(g) { + window.location = g; + } +} + +/* The follow functions have been borrowed from Peter-Paul Koch. Please find them here: http://www.quirksmode.org */ + +function createCookie(name,value,days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } else var expires = ""; + document.cookie = name+"="+value+expires+"; path="+comicDir; +} +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; +} + +function writeBookmarkWidget() { + createCookie('t', 1); + var c = readCookie('t'); + if (c && document.getElementById) { + var l = readCookie('bm'); + var gt = imgGotoOff; + var ct = imgClearOff; + if (l) { + gt = imgGotoOn; + ct = imgClearOn; + } + document.write(''); + if (isHome) { + document.write('Tag This Page'); + document.write('Goto Tag'); + document.write('Clear Tag'); + document.write(''); + } else if (isSingle) { + document.write('Tag This Page'); + document.write('Goto Tag'); + document.write('Clear Tag'); + document.write(''); + } + } +} \ No newline at end of file