-insipid-config.cgi
.project
-.htaccess
-phantomjs
+.buildpath
+.settings/
+
-current development starting from 2011:
+Development starting from 2016/17:
+https://www.bananas-playground.net/projekt/insipid/
+
+Development starting from 2011 to 2013:
https://github.com/jumpin-banana/insipid
creator:
+verion 2.0 (tba)
+
+
version 1.6 (tba)
* code fixes
* new options in htaccess file
Insipid is a web-based bookmark manager similar to the Delicious service.
-
-This is a heavily modified version of insipid createted by Luke Reeves.
-This release was done by https://github.com/jumpin-banana/insipid
-
-Rename the insipid-config.cgi.example to insipid-config.cgi and edit it,
-replacing the example values with those that match your system.
-
-Create a user and password for the database if you don't have one assigned
-to you by your adiministrator or ISP. Doing this is beyond the scope of this
-readme file - refer to the server documentation for more help.
-
-Rename the htaccess file to .htaccess and add a "RewriteBase" clause to the
-top, such as:
-
- RewriteBase /~luke/
-
-You can optionally add "insipid.cgi" to the list of files in the
-DirectoryIndex line (for example, "DirectoryIndex index.cgi insipid.cgi").
-
-The non-standard Perl packages required for use (with their Debian package
-names) are:
-
- Module Debian Package
- -------------- ------------------------------------
- Date::Format libtimedate-perl
- XML::Parser libxml-parser-perl
- XML::Writer libxml-writer-perl
-
-Once the configuration is finished, access the insipid.cgi through your
-web browser at the URL you've configured and the database should be
-automatically configured.
-
-If you ever upgrade Insipid, the database schema will be automatically
-updated upon access.
-
-Using Screenshots
-If you plan to use the screenshot feature you need to install phantomjs
-http://phantomjs.org/
-and set the path to it in the configuration file.
-
+https://www.bananas-playground.net/projekt/insipid/
\ No newline at end of file
TODO / Feature list
==========================================================================
-- Optionally use LWP to automatically import Delicious marks
-- Pageable snapshot list
-- An inbox of links that people submit, either through a public interface
- or XML-RPC (Rest of course)
-- A way to publish links to friends via their exposed RPC interface
-- Add a new column to the bookmark table for a "Via" field (which can be
- filled in automatically when a mark is pushed and accepted)
-- Add - (subtractive) filtering
-- Share the iteration code between export and display
+++ /dev/null
-- October 11, 2011 :
-* Upped browsers maxVersion to 15.0 in both /ff_ext/inspd@danny/install.rdf and /ff_ext/utils/inspd_update.xml
-===========================
-- November 26, 2010 :
-* Added FF_EXT_ChangeLog file to keep track of changes in FireFox extension
-===========================
-- August 30, 2010 :
-* Fixed a bug in tags suggestion where backslashes were not properly escaped.
-===========================
-- August 19, 2010 :
-* Fixed "save to Insipid" links on del.icio.us pages. [2]
-===========================
-- August 06, 2010 :
-* Fixed "save to Insipid" links on del.icio.us pages.
-===========================
-- April 11, 2010 :
-* Fixed a bug in tags suggestion where double quotes were not properly escaped.
-===========================
-- April 05, 2010 :
-* Cleaned up some old and redundant js lines.
-* Fixed a bug in tags suggestion where long tags were mistakenly truncated.
-===========================
-- March 30, 2010 :
-* Fixed a bug when getting popular tags.
-* Wider popup post page. (800px)
-* Created an "archives" directory for saving xpi files.
-* Upped the version to 0.0.2.9 (updated install.rdf and inspd_update.xml)
-===========================
-- August 19, 2009 :
-* Initial import.
+++ /dev/null
-This extension is not working at the moment
+++ /dev/null
-content inspd chrome/inspd/content/ \r
-content inspd chrome/inspd/content/ contentaccessible=yes \r
-\r
-overlay chrome://browser/content/browser.xul chrome://inspd/content/inspdoverlay.xul\r
-\r
-skin inspd classic/1.0 chrome/inspd/skin/classic/\r
-style chrome://browser/content/browser.xul chrome://inspd/skin/inspd.css\r
-style chrome://global/content/customizeToolbar.xul chrome://inspd/skin/inspd.css
\ No newline at end of file
+++ /dev/null
-function $id(elid,doc){if(!doc){doc=document;} return doc.getElementById(elid); }\r
-if(typeof(Insipid) == 'undefined') var Insipid = {}; \r
-var Inspd_gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);\r
-var prefs_getBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);\r
-var prefs_getservice = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);\r
-var $prefs = {\r
-\r
- set : function(pref_name, pref_value) {\r
- var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);\r
- str.data = $utils.trim(pref_value);\r
- prefs_getBranch.setComplexValue('extensions.inspd.'+pref_name, Components.interfaces.nsISupportsString, str);\r
- },\r
- \r
- set2 : function(pref_name, pref_value) {\r
- var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);\r
- str.data = $utils.trim(pref_value);\r
- prefs_getBranch.setComplexValue(pref_name, Components.interfaces.nsISupportsString, str);\r
- },\r
- \r
- \r
-\r
- get : function(pref_name){\r
- try{\r
- return prefs_getBranch.getComplexValue('extensions.inspd.'+pref_name,Components.interfaces.nsISupportsString).data;\r
- }\r
- catch(e){ return false;}\r
- },\r
-\r
- remove : function(pref_name){\r
- try{prefs_getBranch.clearUserPref('extensions.inspd.'+pref_name)\r
- }catch(e){}\r
- },\r
- \r
- remove_all : function(pref_name){\r
- try{prefs_getBranch.deleteBranch('extensions.inspd.'+pref_name,'')\r
- }catch(e){}\r
- },\r
- \r
- \r
- branch : function(pref_name){\r
- var serialBranch = prefs_getservice.getBranch('extensions.inspd.'+pref_name+'.');\r
- return serialBranch.getChildList("",{});\r
- }\r
-}\r
-\r
-\r
-var $ajax = {\r
-\r
- get : function(url,func){\r
- var http_request = new XMLHttpRequest();\r
- http_request.onreadystatechange = function() { func(http_request); };\r
- http_request.open('GET', url, true);\r
- http_request.setRequestHeader("Connection", "close");\r
- http_request.setRequestHeader("Keep-Alive", "");\r
- http_request.send(null);\r
- }\r
-\r
-}\r
-\r
-\r
-var $effects = {\r
-\r
- toggleFade: function(elid) {\r
- if ($id(elid).style.display == 'none'){\r
- this.fadeIn(elid);\r
- }else{\r
- this.fadeOut(elid);\r
- }\r
- },\r
- \r
- toggleShow: function(elid) {\r
- if ($id(elid).style.display == 'none'){\r
- $id(elid).style.display = 'block';\r
- }\r
- else{\r
- $id(elid).style.display = 'none';\r
- }\r
- },\r
- \r
-\r
-\r
- fadeOut : function(elid) {\r
- var opacs = ["0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"];\r
- opacs.reverse();\r
- for (var i = 0; i < 11; i++) {\r
- setTimeout('$id(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40);\r
- }\r
- setTimeout('$id(\''+elid+'\').style.display = "none";', i * 40);\r
- },\r
-\r
- \r
- fadeIn : function(elid) {\r
- var opacs = [".1",".2",".3",".4",".5",".6",".7",".8",".9","1"];\r
- $id(elid).style.opacity = '0';\r
- $id(elid).style.display = 'block';\r
- for (var i = 0; i < 10; i++) {\r
- setTimeout('$id(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40);\r
- }\r
- \r
- },\r
- \r
- hide : function(elid,delay){\r
- setTimeout('$effects.fadeOut(\''+elid+'\');',parseInt(delay)*1000) \r
- },\r
- \r
- initializedrag : function(e,main_id,drag_id){\r
- var crossobj=$id(main_id) ;\r
- var firedobj= e.target ;\r
- var topelement= "body" ;\r
- while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!=drag_id){\r
- firedobj=firedobj.parentNode ;\r
- }\r
- \r
- if (firedobj.id==drag_id){\r
- var offsetx= e.clientX ;\r
- var offsety= e.clientY ;\r
- \r
- var tempx=parseInt(crossobj.style.left) ;\r
- var tempy=parseInt(crossobj.style.top) ;\r
- \r
- dragapproved=true ;\r
- document.onmousemove=(function(e){\r
- if (dragapproved){\r
- crossobj.style.left=tempx+e.clientX-offsetx+"px"\r
- crossobj.style.top=tempy+e.clientY-offsety+"px"\r
- return false\r
- }\r
- return false;\r
- }) \r
- }\r
- \r
- },\r
- \r
- pos2Anchor : function(obj,e,commentbox) {\r
- \r
- \r
- var tempX = 0;\r
- var tempY = 0;\r
- var offset = 5;\r
- \r
- obj = $id(obj);\r
- \r
- tempX = e.pageX;\r
- tempY = e.pageY;\r
- if (tempX < 0){tempX = 0}\r
- if (tempY < 0){tempY = 0}\r
- \r
- \r
- \r
- obj.style.top = (tempY + offset) + 'px';\r
- if (commentbox == true){\r
- obj.style.left = ((tempX + offset)+0) + 'px'; \r
- }\r
- else {\r
- obj.style.left = ((tempX + offset)-155) + 'px';\r
- }\r
- \r
- \r
- },\r
- \r
- show : function(obj,show) {\r
-\r
- $id(obj).style.display = show ? 'block' : 'none';\r
- //obj.style.visibility = show ? 'visible' : 'hidden';\r
- },\r
- \r
- \r
- getAnchorPos: function(anchorname) {\r
- // This function will return an Object with x and y properties\r
- var useWindow=false;\r
- var coordinates=new Object();\r
- var x=0,y=0;\r
- var use_gebi=false, use_css=false, use_layers=false;\r
- if (document.getElementById) { use_gebi=true; }\r
- else if (document.all) { use_css=true; }\r
- else if (document.layers) { use_layers=true; }\r
- if (use_gebi && document.all) {\r
- x=this.AnchorPosition_getPageOffsetLeft(document.all[anchorname]);\r
- y=this.AnchorPosition_getPageOffsetTop(document.all[anchorname]);\r
- }\r
- else if (use_gebi) {\r
- var o=document.getElementById(anchorname);\r
- x=this.AnchorPosition_getPageOffsetLeft(o);\r
- y=this.AnchorPosition_getPageOffsetTop(o);\r
- }\r
- else if (use_css) {\r
- x=this.AnchorPosition_getPageOffsetLeft(document.all[anchorname]);\r
- y=this.AnchorPosition_getPageOffsetTop(document.all[anchorname]);\r
- }\r
- else if (use_layers) {\r
- var found=0;\r
- for (var i=0; i<document.anchors.length; i++) {\r
- if (document.anchors[i].name==anchorname) { found=1; break; }\r
- }\r
- if (found==0) {\r
- coordinates.x=0; coordinates.y=0; return coordinates;\r
- }\r
- x=document.anchors[i].x;\r
- y=document.anchors[i].y;\r
- }\r
- else {\r
- coordinates.x=0; coordinates.y=0; return coordinates;\r
- }\r
- coordinates.x=x;\r
- coordinates.y=y;\r
- return coordinates;\r
- },\r
- \r
- AnchorPosition_getPageOffsetLeft: function(el) {\r
- var ol=el.offsetLeft;\r
- while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }\r
- return ol;\r
- },\r
- \r
- AnchorPosition_getWindowOffsetLeft: function(el) {\r
- return this.AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;\r
- },\r
- \r
- AnchorPosition_getPageOffsetTop: function(el){\r
- var ot=el.offsetTop;\r
- while((el=el.offsetParent) != null) { ot += el.offsetTop; }\r
- return ot;\r
- },\r
- \r
- AnchorPosition_getWindowOffsetTop: function(el) {\r
- return this.AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;\r
- } \r
- \r
- \r
- }\r
-\r
-\r
-\r
-var $utils = {\r
-\r
- trim : function(str){\r
- if(str){\r
- return str.replace(/^\s*|\s*$/g,'');\r
- }\r
- else{\r
- return "";\r
- } \r
- },\r
-\r
- replace : function(str,txt1,txt2){\r
- return str.replace(new RegExp(txt1,'g'),txt2);\r
- },\r
- \r
- instr : function(strSearch, charSearchFor){\r
- for (i=0; i < Len(strSearch); i++){\r
- if (charSearchFor == Mid(strSearch, i, 1)){\r
- return i;\r
- }\r
- }\r
- return -1;\r
- },\r
-\r
- \r
- \r
- console : function(txt){\r
- Components.utils.reportError(txt);\r
- },\r
- \r
- addEvent : function(event, elid, handler, bubble) {\r
- elid.addEventListener(event, handler, bubble);\r
- },\r
- \r
- delEvent : function(event, elid, handler, bubble) {\r
- elid.removeEventListener(event, handler, bubble);\r
- },\r
-\r
- qs : function(Query_String_Name,url) {\r
- var i, pos, argname, argvalue, queryString, pairs;\r
- if(!url){url = location.href}\r
- queryString = url.substring(url.indexOf("?")+1);\r
- pairs = queryString.split("&");\r
- for (i = 0; i < pairs.length; i++) { \r
- pos = pairs[i].indexOf('='); \r
- if (pos == -1) {\r
- continue; \r
- }\r
- argname = pairs[i].substring(0,pos);\r
- argvalue = pairs[i].substring(pos+1); \r
- if (argname == Query_String_Name) {\r
- // return unescape(argvalue.replace(/\+/g, " "));\r
- return argvalue;\r
- }\r
- }\r
- return false;\r
- },\r
- \r
- inc : function(filename){\r
- var jssubscript_Include = new Components.Constructor('@mozilla.org/moz/jssubscript-loader;1','mozIJSSubScriptLoader');\r
- var jssubscript_gInc = new jssubscript_Include();\r
- jssubscript_gInc.loadSubScript(filename);\r
- },\r
- \r
- set_title : function(obj,txt){\r
- obj.title = txt;\r
- },\r
- \r
- showImage: function(img){ \r
- return (function(){ img.style.display=''; }) \r
- },\r
- \r
- cutHex: function(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h},\r
-\r
- Hex2RGB: function(strhex){\r
- var rr = parseInt((this.cutHex(strhex)).substring(0,2),16) ;\r
- var gg = parseInt((this.cutHex(strhex)).substring(2,4),16);\r
- var bb = parseInt((this.cutHex(strhex)).substring(4,6),16);\r
- var rgb = [rr,gg,bb];\r
- return rgb;\r
- },\r
- \r
- encode: function(str){\r
- return $utils.replace(''+encodeURIComponent(str)+'',"'","%27");\r
- },\r
- \r
- decode: function(str){\r
- if (str){\r
- return decodeURIComponent(str);\r
- }\r
- else {\r
- return '';\r
- }\r
- \r
- },\r
- get_deliciousUser: function(){\r
- var domain = ".delicious.com";\r
- var name = "_user";\r
- var user = "";\r
- var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);\r
- var iter = cookieManager.enumerator;\r
- while ( iter.hasMoreElements() ){\r
- cookie = iter.getNext();\r
- if ( cookie instanceof Components.interfaces.nsICookie && domain.endsWith(cookie.host) && (cookie.name == name)){\r
- user = cookie.value.split(/%20/)[0];\r
- break;\r
- }\r
- }\r
-\r
- return user;\r
- },\r
- \r
- appendjs : function(filename,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('script');\r
- element.type = 'text/javascript';\r
- //element.innerHTML = '';\r
- element.setAttribute('src',filename);\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- \r
- appendjsHTML : function(txtHTML,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('script');\r
- element.type = 'text/javascript';\r
- element.innerHTML = txtHTML ;\r
- //element.setAttribute('src',filename);\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- appendcssfile : function(filename,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('link');\r
- element.type = 'text/css';\r
- element.setAttribute('rel','stylesheet');\r
- element.setAttribute('href',filename);\r
- //element.innerHTML = '';\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- appendFavIcon : function(filename,doc){\r
- if (!doc){doc = document;}\r
- var element=doc.createElement('link');\r
- element.type = 'image/x-icon';\r
- element.setAttribute('rel','shortcut icon');\r
- element.setAttribute('href',filename);\r
- //element.innerHTML = '';\r
- doc.getElementsByTagName('head').item(0).appendChild(element);\r
- \r
- \r
- }\r
- \r
- \r
- \r
- \r
- \r
-\r
- \r
- \r
-\r
- \r
-}\r
-\r
-\r
-var $stars = {\r
-\r
- add : function(img,urlmd5,url,tags,title,notes,dt){\r
- if((img.src).match('star_on')){\r
- img.src = (img.src).replace('_on','_off');\r
- img.setAttribute('title','Star this bookmark');\r
- img.setAttribute('onclick','$stars.add(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');');\r
- }\r
- else{\r
- img.src = (img.src).replace('_off','_on'); \r
- img.setAttribute('title','Unstar this bookmark');\r
- img.setAttribute('onclick','$stars.remove(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');');\r
- }\r
- var CurStarsTMP = $prefs.get('stars.list');\r
- $prefs.set('stars.list',''+urlmd5+' '+url+' '+title+' '+tags+' '+notes+' '+dt+' END_'+urlmd5+'|'+CurStarsTMP+'')\r
- //$utils.console(''+urlmd5+' '+url+' '+title+' '+tags+' '+notes+'|'+CurStarsTMP+'');\r
- },\r
- \r
- remove : function(img,urlmd5,url,tags,title,notes,dt){\r
- if((img.src).match('star_on')){\r
- img.src = (img.src).replace('_on','_off');\r
- img.setAttribute('title','Star this bookmark');\r
- img.setAttribute('onclick','$stars.add(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');');\r
- }\r
- else{\r
- img.src = (img.src).replace('_off','_on'); \r
- img.setAttribute('title','Unstar this bookmark');\r
- img.setAttribute('onclick','$stars.remove(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');');\r
- }\r
- var CurStarsTMP = $prefs.get('stars.list');\r
- $prefs.set('stars.list',''+(''+CurStarsTMP+'').replace((''+(''+$prefs.get('stars.list')+'').match(''+urlmd5+'.*END_'+urlmd5+'\\|')+''),'')+'');\r
- },\r
- \r
- show_header : function(obj){\r
- if (typeof obj[0] !== 'undefined'){\r
- var headertxt = '<a href="#" title="click to remove all your stars" onclick="$stars.remove_all();return false;">» Remove all my stars</a>';\r
- return headertxt ;\r
- }\r
- else {\r
- var helpIMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAADPCAYAAACN6qhpAAAnfUlEQVR4Xuycv6riQBTGv5UVEUUQLBQbuzQKIjaKYKuFiFho5QvY+QpWgqCtjyD4FKY0nTYWClYXxObeW92/u8xAWNiwOciEvYT7/ZqYOScnM8fh8M0k+sNxnF8ghBCCCLwQQggLIiGEsCASQgjBT/hCqtUqFI7jhKofciyNYUzCvLMgmhcWr021m8SVJxphnsznrHm+3biES2bvZNDnQU02TjgXEvicIlSIeHl5wfF4xO12QyaTwcPDAyqVCpLJJGzbRjabdW2wLAuxWAwifxShOgpK0nMe+FJFtsv9+wt3bPfdzxtfUtWuTYhrqLblvgn3FmIbxBVyH4y//F1/hxULFeL7+zu22y2en58xGo3QbDbRaDSw3++x2+3Q7/d1W71eVz7KV10jqThhmWykPH2KhEdBSnapGEoK1S+esvnYReUsjdNU2dzXt/tzLI1LypXUX2N/AYNxhhYqxMPhgMfHR3Q6HSyXS32ey+VQKpW0UpzP5/pYLBbdSaV9yuWyNJlcfz+7j8IS92fc+CF4qCGMR+iHYA/T3qOghL8YQoV4Op2QSCRwuVzQ7Xbx+vqK4XCoVWK73Uar1VJt2haPx5Wvuoab+QIBqwh56cZcmUNYENPpNK7XKz4/P7HZbPDx8YHZbIbpdIrFYoHVaqXalE35KF91TZBKIfjiGf4nhPJSMPh8EcKCaFmW3hs8n8+o1WoYj8fo9XooFArKpj6rNmVTPspXt5sQ/B6i/mxgD7goeu9nGsMz/qAeQslxYJBj81x9PXJ/wwf51587KNWn9wjX6zVSqRSi0ag7OfXy2LZt7fP29oanpycMBgO9xxiJRMLzMjSX7WZ5N78/8xwK+FBFF7Z8Po/JZAIv0EqR8MVj/kpDHGf49nWpEAkhhETgAyGEsCASQggLIiGEsCASQgj5zd4doLgNA1EA1YacNblGr9HTtnhhmYKanZqPKi/7HhjZtSzbYfqRY8L+egdABWICQCACCEQAgQggEAEEIoBABBCIj8fjr8ta/XV8dWNM67H5cwnOcXWs+b/Q14tAbP99fRjuPP+GgtsViILz+tbX/xjq4HAbF3X8iYL1gLe39zhM+S3z8/n8WF7t+1hvj7t+0dTyb/tq+8Ux8Rj5PdR6cD37VY019RjX6tk6zseZ7685burbXl+FIecfmWu92VfrzXFbHxnGqLbpM233+6btYIzskbm/h/h65s8zf0SstlF1trRW+31l4Tj9mMfiO8Tz7p/M/l49xtZ67+hXY2UzgGOsBY8K1Z7XHXdi3K1j5GPVvvBznWvnz7btP1ldq3Vs2Dc/X34O7sEH2hZPftz+MKz+zb5AMEZwjrTvpUJxZa324VkBFPTNry3HPZ6x1faZIt8ahvmsaA7W2k7Hz+XXWX0va3+tTmNmffN7ynEbue7L4PbYPAzzWUw+06pxrj5bPH+/0ew7Mc0Om77ra7XWd8/ktoWhlyr9F9lHe3Zf9wXytOx4qVL9anmxL3yRUct8TPhSpb/O/Hr2v1SZ6m5xrZ6py3yc/ro/67frpYqf7gUBi892a42pVW7fZAoPfa3C//gd8gaYIe6sVTwyAwhEAIEIIBABBCKAQAQQiAACEUAgAghEAIH4YxzN9261Wq32WMsBeGQGEIgAAhFAIAIIRACBCCAQAQQigEAE4Dc7dUwEMAhFQfAN8xXgFx94xEQEpKHIUJDd7gxcZcNaK6eNMTLnzCkAlU1VlZsBtHwKwBABDLH3/uo/AQzxugkCtIedMwZpJIjC8PO4XrhCO+3cRlAQRFvtBNNZbGGnixZWpoyFkFJBsDm0tHDbYGWRiIUoFkLARqskRUSLkHTp7nj8xc/jFXtcVhbv5oPlZd78Y2Z24OfNrip5481Sr0+tKHd3RcbGRD4+hIjmeBHVaQ7jlGZT32prjvlGQzzQyvExtaWSSJqKDAaSyeurH3t+jvl8RTodrMff88L2MhvO8XMIBEPs9Xo0NqI57WM/taZ/VNbWEJ+frekRtqHjuIcHkfl5kWqVWv1tn9VVkasrMaQptOUyc6qJY5HNTfedzkijyI9NEpGtra9pitPTXA8pbC+LJhAM0ZtiEczNId7cMPf2psG3qYNB3d0hd3+v/0ccV7uNXKlkq6E4RqNet9pKBeZ2eioOmqwf2++LHB1hbK0m/wRYWyF7qQQC4S3z1JTI+jqqvMGABqbs7LANVAf9zIzI/j7MaWmJ/d2uHatcX9PQVlbsd+/twdi2t7MNcXaWufFxVIdKkvjjNY6PGtH2xz6rw/HV5VyF1Wio2fNn2GM7852O9rGdplZj9f4z18JHEpxT3nv5p/cuQxcIhphnlUhYNfJozDxzeQCDU1otmoKysWHbzSb1Fj7fW15G/+EhBU9PiAsL4piYUGOFOQLP2Rni5CSMBfOBKbKqogFEEU1UYxQhb7G6clmNx+cuLowZuscBSQKNPxJbo45jGGQ2fi14JME51Wp57uUI987rAsEQ8zRB32bO5vNkcRHx8ZFGIMJq7vaW/dQTashw6Co8NbC/ANVjpUJjiSL3QsZVo+02j+XMWy4vraZaZe7lxd4L5eREg/ZB8/5uNM7E+33o6nVbydLAvaH7tfh5JkmeeznKvdMLn6n7rwl/uvebPStGYRAIgiGkzw8Sq0th4R/SXRFtRPQB3iu280rBb6SN+YFlfhB/4QsMxyKDHEYkSWG4AdllT5bdO3aZZf8BQYBFRRSxTgTJIxiYkefZPuoay5MsY59F8a0I2VcccyErZWIxHxqUEEMOYGiAsdtjeZpi1BwgJUshpnNsW+OPY5lCkjCDRTNaDqXsOPv+F2+5/O6ktHWl8J+DY4irBtF4QeH7Y9k0fE70jumheLW2x7iu+7xx5zkYXFmyvarsogZgn8dUbmiEYQiGqvWMn1W85fK7Q37QHRx2L/bOmLdpKIjjB2IuzUKkDhUTE1E3IqaqdKgYYqZKNFJGiBkyVMlYJlC6uPJolHjzAGo3MmRiYApLlW5VMqIs8eT0CwRdTuGwnkqa4KLK/v+kp/ec3Mvz89M73bu7yHRDcrkc3XV2dniDi1WiloPWlmUesU5O5AgWBH/fFKWSbKrzc7aWTD/Z2Zn4uEw/oo7N/aNoPo4GdRoNOZJ7nhGxTRzX5XmIpbi1JXNeX0/DWi7/7CYTmb+0dZ1TAYCFKBFcZWND6z8pFrW9tiYK4vQ0nm+ogRBhb0/q3V3OXYwrw+NjVmqiFK+jXJbacXTzqeWiEVQdV+9jOFw2+XhxtLtYFOV9eUm3wuK5JLWWq4/n+9rudlOjEAF8iBrttW3d9JubWqulJ3KC+KgkQVqKysl3mg4ijveDA4lCKypfqZCJ+qjm6SRcDA4PTeXLY3ExZVbHcUR55/Om9asW02K0HyscUUTqe1s8l/39JNdytWfXaHAx+icHgIXYbrfpniai0WQy4etYuU22t9UHpagFVi6bG8/349Ygt32fvzN9ixcX8d8ulURRBoEhb/irgoBlpY8qKA2oqPKVz2xbx+j1ROZfqddlfnrvail1u8sGiXQuV1dkcN1cJJczybVc7dmpHNd8Lf0zDJjegDAMF8qMx+Op4zhTIpqVOYPBYHbdarWmy1CtVqf/EwAASMxCzOfzFEWRITAajYgpFAqUCQAAODI7jkMfzKQ96vf7xDSbTbIsi4Zp/38UAAAKsc7OKZOZ1djr9SgIAup0OuS6LmURAACizIbVyG/S8zyPMgQAAHmI+jpRjiyHYfj7aJ1JAABQiLVajWzb5qDLTBlWKhVKAQAApN0kyN1PuwEAIO0GAABwZAYAAESZf7F3BykMwkAUQEOpF+jxvZG4KHiQpkcoWZTZBNoSShh8D4I4guDmE8nif6PWWgDsEAEEIoBf5k/l851ulJF5PMsAEIidcvm4/3GePwQBv8zjARbB+L62lRmgdW+0W7m7c5wF4DIzDFMDBOJ4GMY7sgMcqvROjtvqnSb/NM8EEIgRXP1nA3MAvcx/ta5tTXhvQq0SZ9/j246jnBMCEbatdeDEYFnKqcD1xc4VrDgIQ8Gw7A/4k+03daH/0V7tcU/uQQ/xYMHTQumCBfGU5S0sA4l1QiJoJQ+CzWOezhsmwutBX2CWZQqRYrdTm4vrFb2lSJFG5g2MfJeLjHtylX04rq6VOp8FI1fZT4/MuC/Gzb63cdg/HkpVFfZ1Pe8of7sJb+Hj17fLkdXFP5PrwUf6vmceWFZX7ieE9AIN5LfkuO+QJ3xXo2OYp7hO7DwynTb0xeyuM+ZweLYYTvLAFMU4RmtgfO6b5zZummNZmshwORQF73ucF6uLf6a/HlITipH8Urr6+2kYjDmdXIzkhsHlMc6P8F2NjmGe4jrFn8cXfSEe51tpTR62soRZYTTJu6ZqGpjWv/Y/h7q2Rd7mobVteC+u0RHfI2rud5e71qhzew5/IYLvunTU2u6de4rrxHJcp7//EH/Zs2IVCWEgGuQICP6ACNnCNPbbWvsfFvdZlnZ+wNWp7gu2slh7LSxTbfFYwjK7zu4NBwp5zQuZGd7kIVM4x0GnIv7T15ZEpgnc9/S+qh7v8hys9ee1ZRnqikIROAe2Fpxl5F8npyeA5I3gywVLK2Oe9z6OwQcAZ+cQs1ba7758NIaenWO+qQ98co7qIG/bpyQOw4C4KOpeLVreutdaVCsAqyeA/I3n830o4j/VMIDnmeZrTbRE/Wu9fx9x5vN4n+Q6XzQUEYdiK96qy2uPosdrpqlSdY3BuCxKrWtYEjQN+HTCwPE+DAHvQ2wL3h/Nx7+9k/eJ1WGR3Ng7n9c0oiCOf8WusKSFtCAIIT+IpVDMYgI9iS/Y4NWbzSF6Sv+Q0v+iFCn0kkMoFKS5eomIQq2UPWQJCWiyoqCSQLE2vdjuDmWQpXnI65Yu9APv8tw3szPwvs7bUTbY1WFScfwfMoTgLil17rgz6MNaJVvq/vy4L+5k3tzQ44C1NW9FE4/zkfD3x2im22UxoDXByqNleY/oKyuQIc8Tx8C22aeEP1ghTiYTVKtVmKbp/mZxNBohn8+7/1culUrOnPuiKsMwkE6noes61Ejib/My9AR+8mL6EQoo5PEzZuEqcXkZLpUKjV8YBiQorJ3D1vq6P/4Y9RiFIDE5PMQMOzsgQEK5ukrXsfDQHAsF2zo6AhHQPNbrNBj6opAgydPtMWxt+SyII+s97NpbRPQlXH4Lw/ryEIVCAePxGLZto1wuu8KXy+UQDofR6/XQbDbdz4rFIjRNC4wYsmhNfRLbEJh/QRS5ebG7C5im0xigDbq5CSwuwoPa2vltbWyQkPjhj1CNkZsqmkaVTKdD18Tjs40SXQe2t4F2mwVRCBKJSMRrizc5zR0cBCuPe3tAq+XY5xgkNdIcefLGIITjg3zeRmj6E0gYDAaIRqOe+U+vnuHR0+eILMQwPP2Ar3fv4V1lglqthlgs5lSDrggOh0P0+32kUikkEgk0Gg1ks1lkMpkf7N1faFvlH8fx93POSZMmsW260q5NZ5M1bLj/3eY2thWdF6PF0SrI2BT0hyujThTb3SjIdCiDDSpTFEo39Ea86MVcEfyNgs7qqoLdsLXttqZzDtaFxrZpmiZNmuQcIWULTKbTNtmYzwuemwfO7Yfv93ue5xzupLGxkdbWVuZ8fG8DMV0hZjQQ0xVi9v05EF9koUlSW1t25rxtbengtdtJGR2Fjo65YKyuzsAMscC9ldiEj4mhM+SV5VHmzGP/0/nE43H27NmTao1ra2upqalJ7TU1NeF2u7FarfT29pIJkiRJW7bcPDqUnuF2dKTHAxlpmd07X+N6ZwtGdBBznhlDdWG2u3hyU4SjR49is9kAUi20ruupvbq6ulTFWVlZyYPqRjDJgF8QT8KKYnAVKmTeBtLg9g7cMM7zXyFJa9aA1Qo+X6plvjluSM0Znc4MBaIQgvKdBxnuOExgyEe+5zImk07DgZfxuL+is8+G2WymoqKCkpISFEWhu7ubaDTKxo0byYRY4AbDXx4nMlmMOTfJ4lUeijbUo6ga2TI6rWCxgBkYj4CrEEmSsnwkyuOZW9XVWfy4gxAC9643mQhUMHnZAokrWMyXWFm1jtq1Sfbu3YvX66Wrq4vOzk56enpobm7G5XKRCd7/t4MoZ/3uw7g27yN49Xf8PZ+jx6Nkg38qTmjW4OE8waoSQVIxuB5Icv+TJEljAWiaxvKn3mD0u5Nc/f5rNEc3Y8MqVdsa6Tv/IS0tbWRLbDLBuvqD6NEAZns+zvXPEZ85R+DiCQqW70M1W8mksYiKlqNQaAW7CUwmBX9Yp9zBgjpy2kkkppDQITqb5PgL3HuSJAMxXSmWVDcQ+iaH/va3Wb91Ow/NjjPQ388TZE/ekgomfutFEwnCwRFU0xil2//HtL+UwMAJHCv3o5pzWSgjgTjRpMAwQFPg8rjKsmKwmUAAFmAwAItyE8R1EAIsqoHTYWI+dMNgbYWFyKyOAgghbrsbe4V7QpJkIKZD0fP48+QWOrh27lO++OQjzl4Y4hWyx7PrGS62n0QJBTCX2ildYSNy/QPs7tfBgMnBNgpWvoS6AJdn+0cN/FMKhioQghRF6DhyBAoKAA4rWKyC4aCCEIABim4wMaOzukzh34rEEoSiCXwTCfJzVe4vkiQDMf2iZW1dam0DDpBdQgge2d2Ar6MVhVmSpmKE4iXy67vYPYcAQWCglaKqV5kv75hgsUNlaT7oBuiAhoHDwi1FVtjsFETjAlWAIsAXBq/fYHUZd814/wxoGhggZsKELM8SKbQzE9fJUVkAkiRpPICEEJTWNzJy+gT+by9R/NgO9KmzhIcPY688hFAUhjrfY9nOZuZjkSVJeFZFqFBqYQ6CNNAEFFkACynBBATHoShXB1Tu2mQUHt0EU0HIMTF9TSMc05meSWISSJIkfyHw16HorG8AxcZoVx9K3g5ULUTkyjvYyqsoWFJDX0cL87Gi2MBqJPjFZzDgh4TOHSV0GJqACyMGWiKRevafMBL6XBj++AMEJwnGDMKxJKFoknAMNjT9xCnvMdoHj/HZz0c4HzrF0qWBW+vvSZKk/MFu3eMQEIRhHP9jJASbbCLxcQKduIJ2E1dwAKdwB1dQOoRCoxFKhY7ERxCbnWHs7NhsodJsK/trnuZ52zcP/ytZgi1vGGeF03yDcPoUSwrOEyiEkO+wnI6//ZE3II16TdBtWhply/YYsbuB/vEULbCXsD6AKyy9tk1u0zBSwTsEreGluQcG9YzwlcGP00h4SJer73AJqsxWC9LJZDIC4MPeHbzGUYZxHP++7+zs7mxMSmQ3mBTa0LI5tJWqWXtpEby1Sj3k0IMQQQ8iSCF/gGAED3qTglIPDaTeK0YFwRwsiIfUSyBk6yXVtpGYpN1Jd3dmd2dmX8vAHhJW2TSG7ZrnAy/vu7CXHdgfz8PM7tOB+LfFvchKphi+MMnv383y27e/kC3kqZSWWZr/hHNvzuKXR7nx2QdMTH3M59/PsVt9js0pB8p+k426YcQokm0C0Qvg0vMKAGMMu2U8H2p1qHpQrxN4AXHLXGuSTkZoX9NvZVlxi4wOHiGohOwDISQQc7lc/EcLvcpKOxx5bZLlb65z66sfSWytkR8eQC3NMHLuMqW1T1sV4hOFYiOMKDc0+ayizyIWGGK2Ag2ceFa1ghClWufONSs++B5sbILvE1WacbtcqoY4SYvIj3D9h9wv3WUg9QzViocQQlrmtuxMHycn3mZo7BRmYIhDZ98lc/wV7tycYWHpAUAchk/iTzckoskhCxRQC+H2ZryoBvwnjFtCpdOoM2cgkybcqhEBuX4bg6JRraO1Ip87hq0V5UdlhBByl/kfJVJpxt+6zL3Fnyn+8DUPtzxuLq/jeuGeKkS3kWDQaWJZGi9QFNcNd13AwAPP8NKIZq++9F/AzLmYqA9d2WLDeKze+ItEENCoG8JalS+u/EEztKjXXNxHLyOEkED8V5ZtM1p4NV4Al4jtqUKMIvCjBGs1xco6OLrJ+TFFAsPCPcNPK5q9mpp/Y/trWpLESAEX6SohpGUWWSeEyFBcheeckPHD4Nga27Z48TAc72+wk1IqXv8rQkiFKI5mU49X+0uaSSU4OcJO226wtHzIgSWEBKJoH46mK6MEhBC6Nc/jKd0PZDgqVaD74ut/oHbZZVfmMZ56Mz03hnR6x3l6eyXY4fnXLgyY6sEhU0JIy7zYQSh2b27ytCpsC7d2LXLrvAsShkJIIL7TvkpksYfaYNXJ+7r4+YQQmn0hjLnWm4/VSHUoJBDliyqhKGEohP6bPTu2ARiEgQD4yahkkkxu6OgjBYF017hyY8nf/Fkt0HPs027bXc27ahlNs35Hkk87awGplQSiMASBSJLNAxG4MwCQXDV09s7gRmEYiKIDSgVpgFbiSqgkfXClEqcVuEZKC0E+jEA70c56DVYs3pMie2zmR758MU4Uy7+AEILkME1TqoXdw7GGYZC/ATFG2QnAi9kQ4zXjJMDTGzUhhLO0C2CIwDcQATBEyHsX8a4BAHDIFAAAhgj5+5H1832dWtr1AUrmeZ6lNuM46lnQTRvVut7SWGpLSmHVKP9dOQDsIXZdJ7B7M2rCDAEomTHLdP2IzZi2hRp23mDn/XFfbyvf17L5jZfPwFNm0PL4NbZ9G2uZa/pKpsZvOl6+tt64F2t/e23++tvcBgAMse97WZbFxF+Kb0rPOSe/kRLev0/O+ts2Q6BkVhOEfAPR6wOotpalVf8Zl6/fatcA4Phg1wpSIIRh4Ai+wIPXfZHefYfv8Ac+wLsv8QOCHj0IvmCXksN0CYi620DdHQiYVkKGkiEpRShQLJ35flAxHQagaVzRiZUl0HXAtv07VgNRNI89z3LeBM8+ZpBHGK5JQlsWEBCf+wbcdvwo7xDdiKxHZXCN3/6/Xx6vRfiqCm/oe7GiANoWyHPTJzd+QavO7TB0jDO57I/tOtej61dF8RP+istDwqCucUeYcB1HqQv6P36H+GLnilkaiYLw3HGtCFdY5hpBLETBRhvltDJgOsWrrklCLFKdhUUsQlJGEGyObCmYq32IWMTTQhQL0UqSSu28QvQX3DF8yMcy7C3ZjbjCfiDz5pvH23lv3xtmnkn6GRTfCvf3DIbttsjcHHnPE6nXRba3RWq1N8nGaLN6MGftIeMZGd/XcJ/Ddbb7NVbI3CTpSNQ89vdFpqZ8+nufW/qxm8NDGwwVmYxIuSzSaIgUCjYlv75GWb26Slu3q7raVUIHiKMjSZHA8pJtWwZ6Hm2eB86OgdKUfVF5+AEul/NdywQCe8l/bbOxwf0FwE7OzCm0nHTO+BOKZhPJAqE6eCD6OlLGK4l55rjmfHZyAyLKX5s1mtL4Ncrly0vIyUlrGxpCmZHJWNvEBDbS8DAzypEREXxJRqXqyvtfzPy8JB4pGGjyeZFikZy2lVMbwdKUfVF5eB71zU1wzjEQqR4UhGZnIW9v6U+9zv2lOuzs3xvgXy5n/AnF2Bjv3iHJx13H+LBnzjn/s3d2EhYQbRC0Ojk/3z8wgA0OSk/Y20P6ns/7M827O+UhyQNbW5IiceVlcBl2cICD1Gyyn7adg80P2J6e0K/d5uF7wdqaCvbpdBg4CWJ0FPLmhhIwPPub+f1/rgMD1mfrT7BvFxeU4KOvI2yUrRb4qyuJCJ65TgdjPjzwXfQR6QezZ2b8gdQ5ZgkA+UKBQRQ/UPoefqQ0xe4u5PKyCraLRdhWVsDRxv3A6xeiVEJmt74uks2i8mCAshgfhzw5wbNOT6E3GjjQuMODnf17w8KC9TkcmGepxP3tnOrgo6+j/UdnqxVtXkxceJ3lHAN3ANKAuLiIhXp+7iVLtH2Zkgfz3S428vHxb7GZCu9IqFvO6nH7WZyfi0xPSyDOznAQ++tLFN2C62zeiRknDM7Zd422HZu2YFSrL1WJ/nH/1WrBh75SQZlcrTKrWVrSNvhyWcdCvwiAzxGRzfLe0TkGn7jryGCIYBkJdi+8Kj79Y++MVdsIgjB8CeljN1Z37ixcBKeyotYujG0iVwbboNLWplBhkvJSBAW7OXCpILlzccHqHEKq1JfGKAFDcMCFghtdpfgFFFY/5EdIcsZ3klCc+cDM3d54dxlGszc7CydVnJ6e/icC4vk5VkjASnOtBgd03eRVsKMjOs7CApxiasoZMQz2uJZUD2XVxcFj0LZAridn1HambySfM/eky2UEt4sLx7m6Yko9KJgsLkKenDBAui4DJdqhN27SaabYuE9qR+gxGI7dF7TKvLICubyMNyOAYHh4iNWlVpNV3bC6cWXqrgay4JLJwKmx9zMqOCfu0+BM5WC4cW8M93IorQPb59Aj7Jfj0dnlepNl550dyNNTSFzzWdyKdquFxXdjg0Hg9qDDt8P1dUq0U2/czM313CewI09uJA+GsX1BA6LrcvM2m6XTzs5aYyIA5PPywLq9bfugg+7vU8f3IVMp6GSz6L93xeTxAAHCOfHHOBg6zNrabc5NPRYMOAaKBPzBy/Xi23lzc/h2XlqC3t4e52yvbdvqavwFKp22fWF+liCQB535eUpBMBL4VPJFlzKuHXlyo9tfKWMg8IUJDojVapUfUupM9pe97/obFVtbqGR5XrcTBQFSkpkZSWBFJcsY/n8YwlEBjvDAcdg/3phYbSuV6MA3N04iOCc6bakkS5czmcHOTT3SaHAcz8M97SbVi2dnnCEdtp0xr+Nj9gUboi3O3tvuLuaCcSElqaHv014YF9Lz+Lw/SX1KdvyGcrR2lCP2heHRFhBF0V91ms1m2/f9tu0S3YLLy8vOfaVSad+FQqHQkQoT3UaDbWGINmOGOYZY716iKEOrMqdSKcfrUyK7vr7GyoOlJwYKjmcg/SdMMRVFmbCU2fd9p9Qnj6vX6x15cHDg5HI554etUih3TheCAOklwPXZGVJMRVEmKWUmPSmz53ntMAzbrVar026MuUcps6IomjLL6XlrtF/SK5fLzqShKIrycByfE7WV5SiK/qTW/yWKomhALBaLjjHGFl06wTCfzzv3G0VRdA9RzkTuISqKovRJmRVFUTRlVhRF0e8y/2bvDlIYhIEoDA8SL9DjewDPUnFR8CDGhQcosyhZRGjlCdPg/0EonRBaojwMLuYXOWcDAJ4QAYBABACOzN+az1e9UbR6mWsDAAKxNJyvvp+stx+CADgy6wFWgvHz6SMaACQTiL2VD58cowBAFxmG/wQAOjUMlUBtHQBeqhy9OfZR1dyZeiQASNJRt57T6joAoA3pvpsti7T2UsPgQ1qj/3b89WjGtpnNc9m7wP8O/Z4nEMfRG9Rfvxb32NNp8v4/pdD3dkNI73bONjSKKwrD785uotvuukk22URXNxptaSQmBpQupZuCEmybHyEIlgYstlrbQPujIkhR+q8/rP5oodqmUCgR2iKYUmlAf2iFLaXF0GIlRpM16Go0fmVDk+x2N9lMvb3YwzJZZ9yzq1HuA5c7c+45Ofd758wdAouUlpbCOort2/EYobh8WY2bWm+A9mQ8LhvCRcM1QfLstpJEAujvJ7m4FjKCyu7cAY4fB8Lh7L6Hh4WO4e8VeKELX9JvJALCYhvDYSlPpUgmQ0tZJhHlJGP0KYNsY0EhsaybyMW9yfwxsWP4NNhOTGT2SSRiJaSnfjPxx8S6/0iE5jfNNys6fKyvN2qPlD2B/zG7s9OYSJ5N//62yaSuHztmKBMyUZbV95kzs/u+epVkRn2DDQPyce6c0d/gIOmZt1HoS9nt22RDuqQnyuXfZ/Qpi+x9Oz5OMkpCnm0OmNlxfWbzmzl2EmGTs46QszH3L9pNcsN8M9dhkOt6o7kokbA3RAAZyeXQ9E9XV+in1y/We++mUy/59dPrFs+a9teXszbE7B1ibUPMrkcLmwZdXssBNNpeukSLnuTGzo/FpCAeN6kHA5poVB+aIFbbaNzoBCMjGRNM3Bs2TkafsjCOBfmgzUHmVI9s9TW34/skmXGcsvcRbVCW6srG3L/xBzIWy0GHQQ7rzTBnRe5AHrHbgM9Wl+PlSieuJNL4ZGAMK93FeGeZG7NRWqxhrnLxosyXLxcZXYfDsmzFCmSwcKHMi4sxKxs2UOghwtibN1FwAgGqj9+fWxu9Xim/fl3e37gBAYJBeWgSjQKVlbIcIH1GnzIxjkU0Sgc9EpLX1iILZnZ8n9QH9x8nGYZT/7hc9M7MYl1ZmPuXPvr75eFUIJC7Dh/r6628XGSyzOuVuQN55LUlbjT7nOiKTqA77cXSYBDzz/+MxIyOGR142m57zF6y00SlayojqMwIDYyYCGRbWKhO/DY2NsoT2DVr6OS4pkZcS3ldnZjoQo/jr3DtpraYyXOwI58cWwbm/gqPnBuC/n6ZBNXVUu71WtexDn+9lZRI/+Ew/TBryBPeeXZsW7YAHWdGMfR8G3pO/YL6hgb47spTMzoOXZmADY+eVAom0ECRPl1T2YNx9qwYHPnL1d4ObNmChwS/jT6fzAcHaYN0uUROctJj+Cv4SaQhMewYtnOujXycTiAUAjZvBlpaxLWc7729lnQYcNYbRSvRaJ5PmZsqnNgxkMDre7/Al52dqKiowNDQEPxOO4psNvwwPInJtI5HwfAwLT4RmplDHUX6xpDPOvSL6PPJzSQWw0OC30aPR2T0dBgIUE5y0mP4KwihEJ1w0gkjhYIMO7Ytv/58f3z/dJKbTMqwf+lSigos6DDgrbeqKpmfPClzB/JEz8g/2Lb9DbjdbsTjcbhcLgxFBuF3OpBI67g8OYULE1No9BQX6GmHPjERA1hbK3I5aD09D27r99PjtEikSxuBdeid26FDRr+pFCNsYmDaRgotMigtzcxJj9WnBWPJEpr0It1j1SqOHdeWX/+aGoa/vPqntXb4MDJYt86SDgPeenO56N2mKNfAB5qmITU9jYMHD6K1tRUNDQ04ceIExq9FUVak4Voyjfj0DEZTMwV8h0Fh19QUvcSVnU2hXnu7mS2FAE1NchBpQIUst82rvl7Y08CIejU10eP6w+XB2xgMUh/KMpGLeypn9mkBoEm/aZOYD9T/ra20gTPsGLa8+re00AEMzx/fP601WUZznA5iTHQY8NdbIEBRCvuzG7vdrm/bulXXNC3j8xtvWZn+ymKPPtxSrX+0suw/2ffBKv3Kq9X/p6/X+Bif3SgUCoXhkxoWGpgsWrQI+/bvR1tbG2w2Oja5MzqKF0oc0HXgx2uTcDk0POsqQr5QKBSKSITC4sZGsNHAxOPxiISuri4cOHAAzc3NCIVCKPfIT3B+HU3ir7Ek1vuegq+Y3NkA3EqmkSsKhUIRi1E4XlcHNg4wGRgYQHd3NzZu3IiOjg7cDXVx5MgRHN75Nqrm2/Fm702Uz7Pjw+dKoIOIxKex98IYdiE3FAqFYu1amfKFBibrvUXY995W7Nm9G319fWJzxMc73seuZ9zY0xfD2NQMvllbCf98O+4xMa3j3T9uIZZKY66gUCgUGpiIj66/ayyB82gnPmgO4ujOt/D5Cgd+GknAXaTh2IsLUb+A3h3qAHb1jeL83ynMJRQKheJfg+BG1fId+qkAAAAASUVORK5CYII=';\r
-\r
- var headertxt = 'Star your Insipid bookmarks and come back here to see them!<br/>The bookmarks will be saved locally in your preferences.<br/><img style="margin:20px;padding:5px;border: 1px outset #377700;" src="'+helpIMG+'" border="0"/>';\r
- $id('nav').style.display= 'none';\r
- return headertxt ;\r
- }\r
- },\r
- \r
- remove_all : function(){\r
- if (confirm('Are you sure you want to delete all your stars?')){\r
- $prefs.set('stars.list','');\r
- document.location.href = Inspd_JSON_HOME_PAGE ;\r
- }\r
- else {\r
- return false;\r
- }\r
- return false;\r
- }\r
- \r
- \r
- \r
-\r
-\r
-\r
-\r
-}\r
-\r
-var $conditions = { \r
- \r
- page_with_qs_tags : function() {\r
- if ($utils.qs('tag') && $utils.qs('tag').split('+').length < 2){\r
- return true ;\r
- }\r
- else {\r
- return false ; \r
- }\r
- },\r
- gate : function(){\r
- if (!document.location.href.match(Inspd_JSON_BOOKMARKS_PAGE) && $utils.qs('tag')){\r
- document.location.href = Inspd_JSON_BOOKMARKS_PAGE+'?tag='+$utils.qs('tag')+'' ;\r
- }\r
- \r
- else if (!document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) && $utils.qs('q')){\r
- document.location.href = Inspd_JSON_ALLITEMS_PAGE+'?q='+$utils.qs('q')+'' ;\r
- }\r
- else if (document.location.href.match(Inspd_JSON_HOME_PAGE) && $utils.qs('tag')){\r
- document.location.href = Inspd_JSON_BOOKMARKS_PAGE+'?tag='+$utils.qs('tag')+'' ;\r
- }\r
- else if (document.location.href.match(Inspd_JSON_HOME_PAGE) && $utils.qs('q')){\r
- document.location.href = Inspd_JSON_ALLITEMS_PAGE+'?q='+$utils.qs('q')+'' ;\r
- }\r
- else if (document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) && $utils.qs('q') == ''){\r
- document.location.href = Inspd_JSON_HOME_PAGE ;\r
- }\r
- else if (document.location.href.match(Inspd_JSON_BOOKMARKS_PAGE) && $utils.qs('tag') == ''){\r
- document.location.href = Inspd_JSON_HOME_PAGE ;\r
- }\r
- },\r
- \r
- getProtocol : function(url,protocol_name){\r
- if(url.split(':')[0] == protocol_name){\r
- return true ;\r
- }\r
- else{\r
- return false;\r
- }\r
- \r
- \r
- }\r
- \r
- \r
- \r
-\r
-}\r
-\r
-\r
-var $delpage = {\r
- \r
- draw_postToInsipid : function(doc){\r
- var posts = this.getNodes("//div[@class='data']//h4", doc,doc);\r
- for (var i = 0, k = posts.snapshotLength ; i < k ; i++) {\r
- var row = posts.snapshotItem(i) ; \r
- var url , title , tags, user ;\r
- var extended = '';\r
- var metaNode = null;\r
- var tagsNode = null ;\r
- var original_save_link_href = row.getElementsByTagName('a')[1].getAttribute('href'); \r
- if(original_save_link_href.match(/^\/save;_y(.*)\?/)){\r
- original_save_link_href = original_save_link_href.replace(/^\/save;_y(.*)\?/,$prefs.get('defurl')+'?op=add_bookmark&');\r
- }\r
- else{\r
- original_save_link_href = original_save_link_href.replace(/^\/save\?/,$prefs.get('defurl')+'?op=add_bookmark&');\r
- }\r
- original_save_link_href = original_save_link_href.replace(/jump=(.*)original_user=/,'copy_user=');\r
- original_save_link_href = original_save_link_href.replace(/%20/g,'+');\r
- var new_save_link_href = original_save_link_href ; \r
- row.innerHTML += ' <a class="inlinesave" target="_blank" title="save this bookmark to Insipid" href="'+new_save_link_href+'">SAVE TO INSIPID</a>';\r
- }\r
- \r
- },\r
- \r
- getNodes: function(what, where, doc) {\r
- return doc.evaluate(what, where, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r
- }\r
-\r
-}\r
-\r
-var $alt_Post = {\r
-\r
- trigger : function(doc){\r
- //$utils.appendFavIcon('chrome://inspd/content/v2/json/images/inspd_icon7_posttoinsipid_icon_1616.ico',doc);\r
- $utils.appendcssfile(''+Inspd_BASE_ALTPOST_URL+'altpost.css',doc);\r
- $utils.appendjsHTML(''+$alt_Post.write_jsoptions()+'',doc);\r
- \r
- var title_tmp = doc.evaluate("//div[@class='title']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML ;\r
- doc.evaluate("//div[@class='title']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML = '<span style="color:#000000;">Post to</span> '+title_tmp+'<span style="color:#000000;">.</span> <span style="-moz-box-sizing:border-box;-moz-border-radius: 6px 6px 9px 9px ;padding: 5px;color:#377700;background-color:#FFFFCC;font-size:80%;border:1px solid #FFFF9D;" id="title_line2">With tag autocompletion.</span>';\r
- \r
- doc.evaluate("//div[@class='search']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML = '';\r
- \r
- doc.forms[0].getElementsByTagName('input')[1].setAttribute('value',(''+(''+doc.forms[0].getElementsByTagName('input')[1].value+'').replace(/</g,'<')+'').replace(/>/g,'>'));\r
- \r
- if (doc.evaluate("//span[@class='formtext']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML.match('already bookmarked')){\r
- //'this is an edit'\r
- var linkdelete = ''+$prefs.get('defurl')+'?op=delete_bookmark&id=\'+document.forms[0].id.value+\'';\r
- doc.forms[0].innerHTML += ' <a onfocus="this.blur();" title="delete this bookmark" style="font-size:70%;color:#ff0000;" href="#" onclick="if (confirm(\'Are you sure you want to delete this bookmark?\')){document.location.href= \''+linkdelete+'\';}else{return false;}">» delete this bookmark</a>';\r
- }\r
- else{\r
- doc.evaluate("//span[@class='formtext']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML ='<span style="color:green;">URL (new bookmark):</span>';\r
- \r
- }\r
- \r
- doc.forms[0].innerHTML +='<div class="postui" id="main"><table><tr style="visibility:hidden;" id="suggestions">'+\r
- '<td class="rs"></td><td colspan="2"><div id="suggest"></div></td></tr></table>'+\r
- '<ul class="bundles" style="list-style-type:none;">'+\r
- '<li class="bundle fold" id="copy"><div class="label"><span></span></div></li>'+\r
- '<li class="bundle fold" id="rec"><div class="label"><span></span></div></li>'+\r
- '<li class="bundle fold" id="pop" style="line-height:1.5;display:block"><div class="label"><span id="poptags_msg" class="poptags_msg"></span></div></li>'+\r
- '<li class="bundle fold" id="pop3" style="line-height:1.5;margin-top:10px;"><div class="label"><span id="pop3tags_msg" style="color:#000000;display:block;"></span></div></li>'+\r
- '<li class="bundle fold" id="pop2" style="line-height:1.5;margin-top:10px;"><div class="label"><span id="pop2tags_msg" style="color:#000000;display:block;"></span></div></li>'+\r
- '<li class="bundle fold" id="yourtags"><span class="smaller right" id="sort"><!--» sort: <a id="alphasort" class="noclicky" href="javascript:sort(\'alpha\')">alphabetically</a> | <a id="freqsort" href="javascript:sort(\'freq\')">by frequency</a>--></span><div class="label"><span><!--my tags--></span></div><div id="alpha"></div><div id="freq"></div></li>'+\r
- '<li class="bundle fold" id="network"><div class="label"><span></span></div></li></div>'+\r
- '</ul>';\r
- \r
- $utils.appendjs('chrome://inspd/content/inc/vars.js',doc)\r
- $utils.appendjs('chrome://inspd/content/inc/md5.js',doc)\r
- $alt_Post.setInitialUI(doc);\r
- //$utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc)\r
- \r
- },\r
- \r
- write_jsoptions : function(){\r
- \r
- var jstxt = 'window.focus();var tagRec = [];var tagPop = [];var tagPop2 = []; var tagPop3 = []; var tagFor = [];var copyuser = "" ; var copytags = [];'; \r
- \r
- $utils.get_deliciousUser() ? jstxt +='var Inspd_delicious_username=\''+$utils.get_deliciousUser()+'\';' : jstxt+='';\r
- return jstxt ;\r
- },\r
- \r
- setInitialUI : function(doc){\r
- var url = doc.getElementsByTagName('input')[0].getAttribute('value') ;\r
- if($prefs.get('delintegratecommontags') != '0' && !url.match(''+$prefs.get('defurl')+'') && !url.match('^chrome|about|color\\:') && url.match('^http||https\\://') && !url.match('^.*\\://(localhost|127.0.0.|192.168.0.|10.0.0.)') ){\r
- doc.evaluate("//span[@class='poptags_msg']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML += '<span style="color:#377700;font-weight:bold;background-color:#FFFFCC;-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;border:1px solid #FFFF9D;">getting popular tags for this url from del.icio.us ....</span>';\r
- \r
- $utils.appendjsHTML('Inspd_delintegrate_commontags = 1;',doc);\r
- $alt_Post.GetPopTagsFromDeliciousChooser(doc,''+$prefs.get('delintegratecommontags')+'');\r
- \r
- \r
- }\r
- else{\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags = 0;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- },\r
- \r
- \r
- \r
- GetPopTagsFromDeliciousPersonal : function(doc){\r
- //var urlDeliciousPersonal = 'http://del.icio.us/'+$utils.get_deliciousUser()+'?v=4&noui&jump=close&url='+doc.getElementsByTagName('input')[0].getAttribute('value')+'';\r
- var urlDeliciousPersonal = 'http://feeds.delicious.com/v2/json/tags/'+$utils.get_deliciousUser() ;\r
-\r
-\r
- \r
- var http_requestDeliciousPersonal = new XMLHttpRequest();\r
- http_requestDeliciousPersonal.onreadystatechange = function() { \r
- if (http_requestDeliciousPersonal.readyState == 4) {\r
- try{\r
- if (http_requestDeliciousPersonal.status == 200) {\r
- //if(http_requestDeliciousPersonal.responseText.match('tagPop = \\[.*\\]') != 'tagPop = []'){\r
- //$utils.appendjsHTML('Inspd_delintegrate_commontags_found = 1;'+(''+http_requestDeliciousPersonal.responseText.match('var tagPop = \\[.*\\]')+'').toLowerCase()+';tagPop = tagpop;',doc) ;\r
- var tags_txt = http_requestDeliciousPersonal.responseText ; \r
- tags_txt = tags_txt.replace(/\{|\}|\:[0-9]{1}|\:[0-9]{2}|\:[0-9]{3}|\:[0-9]{4}/g,''); \r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 1; tagPop = ['+tags_txt.toLowerCase()+'];',doc) ;\r
- //}\r
- //else{\r
- //$utils.appendjsHTML('Inspd_delintegrate_commontags_found = 2;',doc);\r
- //}\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- } \r
- else {\r
- //alert(e);\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- }\r
- catch(e){ \r
- //alert(e);\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- }\r
- };\r
- //http_requestDeliciousPersonal.overrideMimeType('text/xml');\r
- http_requestDeliciousPersonal.open('GET', urlDeliciousPersonal, true); \r
- http_requestDeliciousPersonal.setRequestHeader("Connection", "close");\r
- http_requestDeliciousPersonal.setRequestHeader("Keep-Alive", "");\r
- http_requestDeliciousPersonal.send(null);\r
- },\r
- \r
- GetPopTagsFromDeliciousFetchURL : function(doc){\r
- //$utils.inc('chrome://inspd/content/inc/md5.js'); \r
- var urlDeliciousURL = 'http://delicious.com/url/'+hex_md5(''+doc.getElementsByTagName('input')[0].getAttribute('value')+'')+'?settagview=cloud';\r
- \r
- var http_requestDeliciousURL = new XMLHttpRequest();\r
- http_requestDeliciousURL.onreadystatechange = function() { \r
- if (http_requestDeliciousURL.readyState == 4) {\r
- try{\r
- if (http_requestDeliciousURL.status == 200) {\r
- //var alphacloud_txt = (''+http_requestDeliciousURL.responseText.match(/<div class="alphacloud">[\s\S]+/)+'').replace(/<div class="sidebar-break">[\s\S]+/,'');\r
- var alphacloud_txt = (''+http_requestDeliciousURL.responseText.match(/<ul class="list">[\s\S]+/)+'').replace(/<div class="clr">[\s\S]+/,'');\r
- //alert(alphacloud_txt);\r
- \r
- if(http_requestDeliciousURL.responseText.match('There is no del.icio.us history for this url\\.')){\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 2;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- else if(alphacloud_txt){\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 1;var Inspd_delintegrate_commontags_found_url=1;',doc);\r
- doc.evaluate("//div[@class='title']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML += '<span id="hidden_span_Inspd_delintegrate_commontags_found_1" style="display:none;">'+alphacloud_txt+'</span>';\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- \r
- }\r
- else {\r
- //$utils.console('well something else is going on!');\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 5;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- } \r
- else {\r
- //alert('error!');\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- }\r
- catch(e){ \r
- //$utils.console('errror:: '+e);\r
- //alert('errror:: '+e);\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- \r
- }\r
- }\r
- };\r
- //http_requestDeliciousURL.overrideMimeType('text/xml');\r
- http_requestDeliciousURL.open('GET', urlDeliciousURL, true); \r
- http_requestDeliciousURL.setRequestHeader("Connection", "close");\r
- http_requestDeliciousURL.setRequestHeader("Keep-Alive", "");\r
- http_requestDeliciousURL.send(null);\r
- \r
- }, \r
- \r
- \r
- \r
- \r
- \r
- GetPopTagsFromDeliciousChooser : function(doc,sysname){\r
- if (sysname == 'personal'){\r
- if($utils.get_deliciousUser()){\r
- $alt_Post.GetPopTagsFromDeliciousPersonal(doc);\r
- }\r
- else{\r
- $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 4;',doc);\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ;\r
- }\r
- }\r
- else if(sysname=='url'){\r
- $alt_Post.GetPopTagsFromDeliciousFetchURL(doc);\r
- }\r
- }\r
- \r
- \r
- \r
-\r
-\r
-\r
-\r
-\r
-}\r
-\r
-\r
-var $$date = {\r
-\r
- year : function(mydate){\r
- return ((''+mydate.split(" ")[0]+'').split("-")[0]) ;\r
- },\r
- \r
- month : function(mydate){\r
- var monthnames = ["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];\r
- return monthnames[parseInt(''+((''+mydate.split(" ")[0]+'').split("-")[1]).replace(/^0/,'')+'')];\r
- },\r
- \r
- day : function(mydate){\r
- return ((''+mydate.split(" ")[0]+'').split("-")[2].replace(/^0/,''));\r
- }\r
-}\r
-\r
-String.prototype.endsWith = function (s) {\r
- if ( this.length < s.length )\r
- return false;\r
- return this.substr( this.length-s.length ) == s;\r
-}\r
-\r
-String.prototype.beginsWith = function (s) {\r
- if ( this.length < s.length )\r
- return false;\r
- return this.substr( 0, s.length ) == s;\r
-}\r
-\r
-\r
-\r
-\r
-\r
-var qs_count, qs_page, qs_tag,backfromlast;\r
-if ($utils.qs('setcount')){ qs_count = $utils.qs('setcount'); $prefs.set('defcount',''+$utils.qs('setcount')+'') } else { qs_count = $prefs.get('defcount'); }\r
-if ($utils.qs('page') && parseInt($utils.qs('page')) != 0 ){ qs_page = parseInt($utils.qs('page')); } else { qs_page = 1; }\r
-if ($utils.qs('tag')){ qs_tag = '&tag='+$utils.qs('tag')+''; } else if ($utils.qs('q')){qs_tag = '&q='+$utils.qs('q')+''; } else { qs_tag = ''; }\r
-\r
-\r
-\r
-\r
+++ /dev/null
-/*\r
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r
- * Digest Algorithm, as defined in RFC 1321.\r
- * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r
- * Distributed under the BSD License\r
- * See http://pajhome.org.uk/crypt/md5 for more info.\r
- */\r
-var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\r
-var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */\r
-var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */\r
-\r
-function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}\r
-function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}\r
-function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}\r
-function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }\r
-function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }\r
-function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }\r
-\r
-function md5_vm_test()\r
-{\r
- return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";\r
-}\r
-\r
-/*\r
- * Calculate the MD5 of an array of little-endian words, and a bit length\r
- */\r
-function core_md5(x, len)\r
-{\r
- /* append padding */\r
- x[len >> 5] |= 0x80 << ((len) % 32);\r
- x[(((len + 64) >>> 9) << 4) + 14] = len;\r
-\r
- var a = 1732584193;\r
- var b = -271733879;\r
- var c = -1732584194;\r
- var d = 271733878;\r
-\r
- for(var i = 0; i < x.length; i += 16)\r
- {\r
- var olda = a;\r
- var oldb = b;\r
- var oldc = c;\r
- var oldd = d;\r
-\r
- a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r
- d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r
- c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r
- b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r
- a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r
- d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r
- c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r
- b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r
- a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r
- d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r
- c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r
- b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r
- a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r
- d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r
- c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r
- b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r
-\r
- a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r
- d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r
- c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r
- b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r
- a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r
- d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r
- c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r
- b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r
- a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r
- d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r
- c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r
- b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r
- a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r
- d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r
- c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r
- b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r
-\r
- a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r
- d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r
- c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r
- b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r
- a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r
- d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r
- c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r
- b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r
- a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r
- d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r
- c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r
- b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r
- a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r
- d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r
- c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r
- b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r
-\r
- a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r
- d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r
- c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r
- b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r
- a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r
- d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r
- c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r
- b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r
- a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r
- d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r
- c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r
- b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r
- a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r
- d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r
- c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r
- b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r
-\r
- a = safe_add(a, olda);\r
- b = safe_add(b, oldb);\r
- c = safe_add(c, oldc);\r
- d = safe_add(d, oldd);\r
- }\r
- return Array(a, b, c, d);\r
-\r
-}\r
-\r
-/*\r
- * These functions implement the four basic operations the algorithm uses.\r
- */\r
-function md5_cmn(q, a, b, x, s, t)\r
-{\r
- return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r
-}\r
-function md5_ff(a, b, c, d, x, s, t)\r
-{\r
- return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r
-}\r
-function md5_gg(a, b, c, d, x, s, t)\r
-{\r
- return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r
-}\r
-function md5_hh(a, b, c, d, x, s, t)\r
-{\r
- return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r
-}\r
-function md5_ii(a, b, c, d, x, s, t)\r
-{\r
- return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r
-}\r
-\r
-/*\r
- * Calculate the HMAC-MD5, of a key and some data\r
- */\r
-function core_hmac_md5(key, data)\r
-{\r
- var bkey = str2binl(key);\r
- if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r
-\r
- var ipad = Array(16), opad = Array(16);\r
- for(var i = 0; i < 16; i++)\r
- {\r
- ipad[i] = bkey[i] ^ 0x36363636;\r
- opad[i] = bkey[i] ^ 0x5C5C5C5C;\r
- }\r
-\r
- var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r
- return core_md5(opad.concat(hash), 512 + 128);\r
-}\r
-\r
-/*\r
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r
- * to work around bugs in some JS interpreters.\r
- */\r
-function safe_add(x, y)\r
-{\r
- var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r
- return (msw << 16) | (lsw & 0xFFFF);\r
-}\r
-\r
-/*\r
- * Bitwise rotate a 32-bit number to the left.\r
- */\r
-function bit_rol(num, cnt)\r
-{\r
- return (num << cnt) | (num >>> (32 - cnt));\r
-}\r
-\r
-/*\r
- * Convert a string to an array of little-endian words\r
- * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.\r
- */\r
-function str2binl(str)\r
-{\r
- var bin = Array();\r
- var mask = (1 << chrsz) - 1;\r
- for(var i = 0; i < str.length * chrsz; i += chrsz)\r
- bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);\r
- return bin;\r
-}\r
-\r
-/*\r
- * Convert an array of little-endian words to a string\r
- */\r
-function binl2str(bin)\r
-{\r
- var str = "";\r
- var mask = (1 << chrsz) - 1;\r
- for(var i = 0; i < bin.length * 32; i += chrsz)\r
- str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);\r
- return str;\r
-}\r
-\r
-/*\r
- * Convert an array of little-endian words to a hex string.\r
- */\r
-function binl2hex(binarray)\r
-{\r
- var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";\r
- var str = "";\r
- for(var i = 0; i < binarray.length * 4; i++)\r
- {\r
- str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r
- hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r
- }\r
- return str;\r
-}\r
-\r
-/*\r
- * Convert an array of little-endian words to a base-64 string\r
- */\r
-function binl2b64(binarray)\r
-{\r
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\r
- var str = "";\r
- for(var i = 0; i < binarray.length * 4; i += 3)\r
- {\r
- var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)\r
- | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )\r
- | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);\r
- for(var j = 0; j < 4; j++)\r
- {\r
- if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;\r
- else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);\r
- }\r
- }\r
- return str;\r
-}\r
-\r
+++ /dev/null
-const Inspd_BASE_JSON_URL = 'chrome://inspd/content/v2/json/';\r
-const Inspd_JSON_HOME_PAGE = 'chrome://inspd/content/v2/json/home.html';\r
-const Inspd_JSON_CLOUD_PAGE = 'chrome://inspd/content/v2/json/mytags.html';\r
-const Inspd_JSON_STARS_PAGE = 'chrome://inspd/content/v2/json/mystars.html';\r
-const Inspd_JSON_BOOKMARKS_PAGE = 'chrome://inspd/content/v2/json/mybookmarks.html';\r
-const Inspd_JSON_ALLITEMS_PAGE = 'chrome://inspd/content/v2/json/allitems.html';\r
-const Inspd_ALPOST_Q_PAGE = 'chrome://inspd/content/v2/altpost/qpost.html';\r
-const Inspd_BASE_ALTPOST_URL = 'chrome://inspd/content/v2/altpost/';
\ No newline at end of file
+++ /dev/null
-var $buttons = {\r
- \r
- open_in_new_tab: function(url){\r
- getBrowser().selectedTab = getBrowser().addTab(url);\r
- },\r
- \r
- open_in_same_tab: function(url){\r
- top.content.document.location = url;\r
- },\r
- \r
- open_as_popup: function(url){\r
- var mypopup = window.open(url,'popuppage','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=400,left=30,top=30');\r
- mypopup.focus();\r
- },\r
- \r
- \r
- focus: function(inspd_obj){\r
- inspd_obj.focus();\r
- },\r
- \r
- \r
- cclick : function(aEvent,url){\r
- if (aEvent.button == 2){\r
- this.open_as_popup(url);\r
- }\r
- else if ((aEvent.ctrlKey) || (aEvent.button == 1) || (aEvent.metaKey)){\r
- this.open_in_new_tab(url);\r
- } \r
- else {\r
- this.open_in_same_tab(url);\r
- this.focus(window._content);\r
- }\r
- \r
- },\r
- \r
- \r
- click : function (aEvent,actionname) {\r
- \r
- if ($utils.trim($prefs.get('defurl')) == "") {\r
- $Chrome.set_options_action('defurl'); \r
- }\r
- \r
- if ($utils.trim($prefs.get('defurl')) != "") {\r
- if (actionname == 'home') {\r
- if ($prefs.get('searchstyle') == 'json'){\r
- this.cclick(aEvent,Inspd_JSON_HOME_PAGE);\r
- }\r
- else {\r
- this.cclick(aEvent,$prefs.get('defurl'));\r
- }\r
- }\r
- else if (actionname =='posttoinsipid'){\r
- var redirect = ''; if (aEvent.button == 0){redirect = 'true';}else{redirect = 'false';}\r
- \r
- var url = '';\r
- if ($prefs.get('altpost') == '2'){\r
- url = ''+Inspd_ALPOST_Q_PAGE+'?op=add_bookmark&url='+encodeURIComponent(window._content.location.href)+'&title='+encodeURIComponent(window._content.document.title)+'&redirect='+redirect+'';\r
- }\r
- else{\r
- url = ''+$prefs.get('defurl')+'?op=add_bookmark&url='+encodeURIComponent(window._content.location.href)+'&title='+encodeURIComponent(window._content.document.title)+'&redirect='+redirect+'';\r
- }\r
- this.cclick(aEvent,url);\r
- \r
- }\r
- else if (actionname =='mytagcloud'){\r
- if ($prefs.get('searchstyle') == 'json'){\r
- this.cclick(aEvent,Inspd_JSON_CLOUD_PAGE);\r
- }\r
- else {\r
- this.cclick(aEvent,$prefs.get('defurl'));\r
- }\r
- }\r
- \r
- else if (actionname =='mystars'){\r
- this.cclick(aEvent,Inspd_JSON_STARS_PAGE);\r
- }\r
- \r
- \r
- else if (actionname =='searchgo' && $utils.trim($id('inspd-searchbar-textbox').value) != ''){\r
- var q1 = ''; if ($prefs.get('defsearchselection') == 'allitems'){q1 = 'q';}else{q1 = 'tag';}\r
- if ($prefs.get('searchstyle') == 'json'){\r
- if ($prefs.get('defsearchselection') == 'mytags' && $utils.trim($id('inspd-searchbar-textbox').value).match("\\+") ){\r
- alert('Plus (\'+\') sign will not work while viewing related tags.\nPlease remove it or search your bookmarks instead.');\r
- return false;\r
- }\r
- \r
- else {\r
- \r
- this.cclick(aEvent,Inspd_BASE_JSON_URL+$prefs.get('defsearchselection')+'.html?'+q1+'='+$id('inspd-searchbar-textbox').value);\r
- }\r
- }\r
- else {\r
- \r
- this.cclick(aEvent,$prefs.get('defurl')+'?'+q1+'='+$id('inspd-searchbar-textbox').value);\r
- }\r
- if ($prefs.get('searchbar.autocomp') == '1'){\r
- // var inspd_formhistory1 = Components.classes['@mozilla.org/satchel/form-history;1'].getService(Components.interfaces.nsIFormHistory);\r
- var inspd_formhistory1 = Components.classes["@mozilla.org/satchel/form-history;1"].getService (Components.interfaces.nsIFormHistory ? Components.interfaces.nsIFormHistory : Components.interfaces.nsIFormHistory2);\r
- inspd_formhistory1.addEntry('inspdsearchbarq', $id('inspd-searchbar-textbox').value);\r
- $prefs.set('lastsearchq',$id('inspd-searchbar-textbox').value) ;\r
- }\r
- $id('inspd-searchbar-textbox').focus();\r
- }\r
- else if (actionname =='searchgotextbox' && $utils.trim($id('inspd-searchbar-textbox').value) != '' && aEvent.keyCode == aEvent.DOM_VK_RETURN ){\r
- this.click(aEvent,'searchgo');\r
- }\r
- \r
- }\r
- return false;\r
- }\r
- \r
-}\r
-\r
-\r
-\r
-var $Chrome = {\r
-\r
- set_icon : function(elid,prefname) {\r
- try{\r
- $id(elid).setAttribute('style',"list-style-image: url('chrome://inspd/skin/searchtb/"+elid+"-"+$prefs.get(prefname)+".png');");\r
- $id('inspd-searchbar-dropdown-'+$prefs.get(prefname)).setAttribute('checked','true'); \r
- }catch(e){}\r
- \r
- },\r
- \r
- set_defsearchselection: function(selectionval) {\r
- $prefs.set('defsearchselection', selectionval);\r
- this.set_icon('inspd-searchbar-dropdown','defsearchselection');\r
- },\r
- \r
- set_options_ui_all: function(){\r
- this.set_icon('inspd-searchbar-dropdown','defsearchselection');\r
- \r
- if ($prefs.get('searchstyle') == 'json') {\r
- $id('inspd-searchbar-dropdown-options-json').setAttribute('checked','true');\r
- }\r
- \r
- if ($prefs.get('searchbar.autocomp') == '1') {\r
- $id('inspd-searchbar-dropdown-options-searchbarautocomp').setAttribute('checked','true');\r
- } \r
- \r
- if ($prefs.get('delintegrate') == '1') {\r
- $id('inspd-searchbar-dropdown-options-delintegrate').setAttribute('checked','true');\r
- }\r
- \r
- \r
- \r
- $id('inspd-searchbar-dropdown-options-delintegratecommontags_'+$prefs.get('delintegratecommontags')+'').setAttribute('checked','true');\r
- \r
- \r
- \r
- if ($prefs.get('bookmarks.showfavicon') == '1') {\r
- $id('inspd-searchbar-dropdown-options-showfavicon').setAttribute('checked','true');\r
- }\r
- \r
- /* ======= */\r
- $id('inspd-searchbar-dropdown-options-altpost_'+$prefs.get('altpost')+'').setAttribute('checked','true');\r
- /* ======*/\r
- \r
- \r
- if ($prefs.get('showgo') == '1') {\r
- $id('inspd-searchbar-dropdown-options-showgo').setAttribute('checked','true');\r
- } \r
- else {\r
- $effects.show('inspd-searchbar-go',false);\r
- }\r
- },\r
-\r
-\r
- \r
- \r
- set_options_action: function(actionname,secondVal){\r
- \r
- if (actionname == 'defurl'){\r
- var query = prompt('Please enter the full URL of your insipid.cgi\nExample:\nhttp://localhost/insipid/insipid.cgi',''+$prefs.get('defurl')+'');\r
- try{\r
- if ($utils.trim(query)) {\r
- $prefs.set('defurl', query);\r
- }\r
- else {\r
- return false;\r
- }\r
- }catch(e){}\r
- }\r
- \r
- if (actionname == 'json'){\r
- if ($prefs.get('searchstyle') == 'json'){\r
- $id('inspd-searchbar-dropdown-options-json').setAttribute('checked','false');\r
- $prefs.set('searchstyle','classic')\r
- }\r
- else {\r
- $id('inspd-searchbar-dropdown-options-json').setAttribute('checked','true');\r
- $prefs.set('searchstyle','json')\r
- }\r
- \r
- }\r
- \r
- \r
- \r
- if (actionname == 'delintegrate'){\r
- if ($prefs.get('delintegrate') == '1'){\r
- $id('inspd-searchbar-dropdown-options-delintegrate').setAttribute('checked','false');\r
- $prefs.set('delintegrate','0');\r
- }\r
- else {\r
- $id('inspd-searchbar-dropdown-options-delintegrate').setAttribute('checked','true');\r
- $prefs.set('delintegrate','1');\r
- }\r
- \r
- }\r
- \r
- if (actionname == 'delintegratecommontags'){\r
- $id('inspd-searchbar-dropdown-options-delintegratecommontags_'+secondVal+'').setAttribute('checked','true');\r
- $prefs.set('delintegratecommontags',''+secondVal+'')\r
- \r
- }\r
- \r
- \r
- \r
- if (actionname == 'searchbarautocomp'){\r
- if ($prefs.get('searchbar.autocomp') == '1'){\r
- $id('inspd-searchbar-dropdown-options-searchbarautocomp').setAttribute('checked','false');\r
- $prefs.set('searchbar.autocomp','0');\r
- // var inspd_formhistory1 = Components.classes['@mozilla.org/satchel/form-history;1'].getService(Components.interfaces.nsIFormHistory);\r
- var inspd_formhistory1 = Components.classes["@mozilla.org/satchel/form-history;1"].getService (Components.interfaces.nsIFormHistory ? Components.interfaces.nsIFormHistory : Components.interfaces.nsIFormHistory2);\r
- try{\r
- inspd_formhistory1.removeEntriesForName('inspdsearchbarq');\r
- }catch(e){}\r
- //$prefs.set('lastsearchq','');\r
- $id('inspd-searchbar-textbox').focus();\r
- }\r
- else {\r
- $id('inspd-searchbar-dropdown-options-searchbarautocomp').setAttribute('checked','true');\r
- $prefs.set('searchbar.autocomp','1');\r
- if ($utils.trim($id('inspd-searchbar-textbox').value) == ''){$id('inspd-searchbar-textbox').value = $$prefs.get('lastsearchq');}\r
- $id('inspd-searchbar-textbox').focus();\r
- \r
- }\r
- \r
- }\r
- \r
- \r
- \r
- \r
- if (actionname == 'showgo'){\r
- if ($prefs.get('showgo') == '1'){\r
- $id('inspd-searchbar-dropdown-options-showgo').setAttribute('checked','false');\r
- $prefs.set('showgo','0')\r
- $effects.fadeOut('inspd-searchbar-go');\r
- }\r
- else {\r
- $id('inspd-searchbar-dropdown-options-showgo').setAttribute('checked','true');\r
- $prefs.set('showgo','1')\r
- $effects.fadeIn('inspd-searchbar-go');\r
- }\r
- }\r
- \r
- \r
- \r
- if (actionname == 'showfavicon'){\r
- if ($prefs.get('bookmarks.showfavicon') == '1'){\r
- $id('inspd-searchbar-dropdown-options-showfavicon').setAttribute('checked','false');\r
- $prefs.set('bookmarks.showfavicon','0')\r
- }\r
- else {\r
- $id('inspd-searchbar-dropdown-options-showfavicon').setAttribute('checked','true');\r
- $prefs.set('bookmarks.showfavicon','1')\r
- }\r
- }\r
- \r
- \r
- if (actionname == 'altpost'){\r
- $id('inspd-searchbar-dropdown-options-altpost_'+secondVal+'').setAttribute('checked','true');\r
- $prefs.set('altpost',''+secondVal+'')\r
- }\r
- \r
- \r
- \r
- return false; \r
- }\r
- \r
- \r
- \r
-}\r
-\r
-\r
-\r
-var $moz = {\r
- inc : function(filename){\r
- var jssubscript_Include = new Components.Constructor('@mozilla.org/moz/jssubscript-loader;1','mozIJSSubScriptLoader');\r
- var jssubscript_gInc = new jssubscript_Include();\r
- jssubscript_gInc.loadSubScript(filename);\r
- }\r
-}\r
-\r
-\r
-\r
-\r
-var $inspd = {\r
- \r
- initChrome: function() {\r
- $Chrome.set_options_ui_all();\r
- if ($prefs.get('searchbar.autocomp') == '1') {\r
- $id('inspd-searchbar-textbox').value = $prefs.get('lastsearchq') ;\r
- }\r
- },\r
- \r
- \r
- initAll: function() {\r
- if($id('appcontent')) {\r
- $id('appcontent').addEventListener('DOMContentLoaded', this.onPageLoad, true);\r
- }\r
- },\r
-\r
- \r
- onPageLoad: function(aEvent) {\r
- if (aEvent.originalTarget.nodeName == '#document'){\r
- var doc = aEvent.originalTarget;\r
- if(doc.location.href.match(/^http:\/\/delicious.com\/|^http:\/\/www.delicious.com\//) && $prefs.get('delintegrate') == '1' ){\r
- $delpage.draw_postToInsipid(doc);\r
- }\r
- else if (doc.location.href.match('^'+$prefs.get('defurl')+'\\?op=add_bookmark') && $prefs.get('altpost') !== '0' && doc.forms[1]){\r
- $alt_Post.trigger(doc);\r
- }\r
- }\r
- }\r
- \r
-}\r
-\r
-\r
-$moz.inc('chrome://inspd/content/inc/vars.js');\r
-$moz.inc('chrome://inspd/content/inc/globals.js');\r
-$utils.inc('chrome://inspd/content/inc/md5.js');\r
-$utils.addEvent('load', window, $inspd.initChrome, false);\r
-// window.addEventListener("DOMContentLoaded", function() { $inspd_start.initAll(); }, false);\r
-$utils.addEvent('DOMContentLoaded', window, function() { $inspd.initAll(); }, false);\r
+++ /dev/null
-<?xml version="1.0" encoding='UTF-8'?>\r
-\r
-<?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css"?>\r
-<?xml-stylesheet href="chrome://inspd/skin/inspd.css" type="text/css"?>\r
-\r
-<overlay id="InspdOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">\r
-\r
-\r
-<script type="application/x-javascript" src="chrome://inspd/content/inspdoverlay.js" charset="utf8"></script>\r
-\r
- \r
-<toolbarpalette id="BrowserToolbarPalette">\r
- \r
-\r
-<toolbaritem context="" id="inspd-searchbar-container" align="center" class="chromeclass-toolbar-additional" \r
- title="Insipid Searchbar">\r
- \r
-\r
- <toolbarbutton onpopupshowing="$Chrome.set_options_ui_all();" id="inspd-searchbar-dropdown" type="menu" tooltiptext="Insipid search options" >\r
- <menupopup>\r
- \r
- <menuitem id="inspd-searchbar-dropdown-allitems" oncommand="$Chrome.set_defsearchselection('allitems');" label="All items" type="radio" name="inspd-searchmarker" tooltiptext="Search all my items"/>\r
- <menuitem id="inspd-searchbar-dropdown-mybookmarks" oncommand="$Chrome.set_defsearchselection('mybookmarks');" label="My bookmarks" type="radio" name="inspd-searchmarker" tooltiptext="Search my bookmarks"/>\r
- <menuitem id="inspd-searchbar-dropdown-mytags" oncommand="$Chrome.set_defsearchselection('mytags');" label="My tags" type="radio" name="inspd-searchmarker" tooltiptext="Search my tags"/>\r
- \r
- \r
- <menuseparator style="margin-bottom:2px;margin-top:1px;"/>\r
- <menu id="inspd-searchbar-dropdown-options" label="Options" tooltiptext="">\r
- <menupopup>\r
- <menuitem id="inspd-searchbar-dropdown-options-defurl" oncommand="$Chrome.set_options_action('defurl');" label="Default insipid.cgi URL..." tooltiptext="enter the URL of your insipid.cgi"/>\r
- <menuitem id="inspd-searchbar-dropdown-options-json" oncommand="$Chrome.set_options_action('json');" label="Use JSON" type="checkbox" tooltiptext="Use Javascript and render the results locally."/>\r
- <menuitem id="inspd-searchbar-dropdown-options-delintegrate" oncommand="$Chrome.set_options_action('delintegrate');" label="del.icio.us integration" type="checkbox" tooltiptext="Add a 'post to Insipid' link in del.icio.us pages" />\r
- <menuitem id="inspd-searchbar-dropdown-options-searchbarautocomp" oncommand="$Chrome.set_options_action('searchbarautocomp');" label="Searchbar autocomplete" type="checkbox" tooltiptext="Enable/disable autocomplete in searchbar" />\r
- <menuitem id="inspd-searchbar-dropdown-options-showgo" oncommand="$Chrome.set_options_action('showgo');" label="Show 'Go' button" type="checkbox" tooltiptext="Show 'Go' button beside searchbar" />\r
- <menuitem id="inspd-searchbar-dropdown-options-showfavicon" oncommand="$Chrome.set_options_action('showfavicon');" label="Show bookmarks' favicon" type="checkbox" tooltiptext="Show favicons of websites" />\r
- \r
- <menu tooltiptext="Integrate some tweaks on your Insipid post page" label="'Alternative' post page">\r
- <menupopup>\r
- <menuitem name="inspd-searchbar-dropdown-options-altpost" id="inspd-searchbar-dropdown-options-altpost_0" oncommand="$Chrome.set_options_action('altpost',0);" label="Disabled" type="radio" tooltiptext="Disable all tweaks on Insipid post page and load it normally" />\r
- <menuitem name="inspd-searchbar-dropdown-options-altpost" id="inspd-searchbar-dropdown-options-altpost_1" oncommand="$Chrome.set_options_action('altpost',1);" label="Tag autocompletion" type="radio" tooltiptext="Enable tag autocompletion on Insipid post page" />\r
- <menuitem name="inspd-searchbar-dropdown-options-altpost" id="inspd-searchbar-dropdown-options-altpost_2" oncommand="$Chrome.set_options_action('altpost',2);" label="Quick post" type="radio" tooltiptext="Post from a very simple html page without waiting" />\r
- <menuseparator style="margin-bottom:2px;margin-top:1px;"/>\r
- <menu tooltiptext="Get popular tags from del.icio.us for links you post to your Insipid" label="Get Popular tags">\r
- <menupopup>\r
- <menuitem name="inspd-searchbar-dropdown-options-delintegratecommontags" id="inspd-searchbar-dropdown-options-delintegratecommontags_0" oncommand="$Chrome.set_options_action('delintegratecommontags',0);" label="Disabled" type="radio" tooltiptext="Don't get popular tags from del.icio.us" />\r
- <menuitem name="inspd-searchbar-dropdown-options-delintegratecommontags" id="inspd-searchbar-dropdown-options-delintegratecommontags_url" oncommand="$Chrome.set_options_action('delintegratecommontags','url');" label="from url's history page" type="radio" tooltiptext="Get popular tags from del.icio.us md5(url) page" />\r
- <menuitem name="inspd-searchbar-dropdown-options-delintegratecommontags" id="inspd-searchbar-dropdown-options-delintegratecommontags_personal" oncommand="$Chrome.set_options_action('delintegratecommontags','personal');" label="from personal post page" type="radio" tooltiptext="Get popular tags from your del.icio.us post page" />\r
- </menupopup>\r
- </menu>\r
- \r
- \r
- </menupopup>\r
- </menu>\r
- \r
- \r
- \r
- </menupopup>\r
- </menu>\r
- \r
- </menupopup>\r
- \r
- </toolbarbutton>\r
- \r
- <textbox onfocus="$Chrome.set_options_ui_all();" type="autocomplete" id="inspd-searchbar-textbox" value="" oninput="" \r
- onkeypress="" onblur="" tabscrolling="true" persist="width" autocompletesearch="form-history" \r
- completeselectedindex="true" autocompletesearchparam="inspdsearchbarq" onkeyup="$buttons.click(event,'searchgotextbox');"/>\r
- \r
- <splitter context="" id="inspd-searchbar-resizer" state="open" collapse="none" resizebefore="closest" resizeafter="grow" />\r
- <toolbaritem context="" id="inspd-searchbar-dummyforresize"/>\r
- <toolbarbutton context="" id="inspd-searchbar-go" onclick="$buttons.click(event,'searchgo');" class="toolbarbutton-1" tooltiptext="Go" flex="0"/>\r
- \r
-</toolbaritem>\r
- \r
- \r
- \r
- \r
-<toolbaritem context="" id="inspd-allin1button-container" style="list-style-image: url('chrome://inspd/content/v2/json/images/inspd_icon1_1616.png');" align="center" class="chromeclass-toolbar-additional" \r
- title="Insipid all-in-1 button">\r
- \r
-\r
- <toolbarbutton id="inspd-allin1button-dropdown" type="menu" tooltiptext="Insipid all-in-1" >\r
- <menupopup>\r
- <menuitem label=" My Home" \r
- style="list-style-image: url('chrome://inspd/content/v2/json/images/inspd_icon2_home.png');"\r
- class="menuitem-iconic"\r
- tooltiptext="Open my Insipid front page"\r
- onclick="$buttons.click(event,'home');" />\r
- \r
- <menuitem label=" Post" \r
- style="list-style-image: url('chrome://inspd/skin/searchtb/inspd_icon_post1.png');"\r
- class="menuitem-iconic"\r
- tooltiptext="Post this page to Insipid"\r
- onclick="$buttons.click(event,'posttoinsipid');" />\r
- \r
- <menuitem label=" My Cloud" \r
- style="list-style-image: url('chrome://inspd/content/v2/json/images/inspd_icon3_mytagcloud_html_icon_1616.png');"\r
- class="menuitem-iconic"\r
- tooltiptext="Open my Insipid tag cloud"\r
- onclick="$buttons.click(event,'mytagcloud');" />\r
- \r
- \r
- \r
- <menuitem label=" My Stars" \r
- style="list-style-image: url('chrome://inspd/content/v2/json/images/inspd_star_gold.png');"\r
- class="menuitem-iconic"\r
- tooltiptext="Open my stars page"\r
- onclick="$buttons.click(event,'mystars');" />\r
- \r
- \r
- \r
- </menupopup>\r
- </toolbarbutton>\r
-</toolbaritem> \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
- \r
-<toolbarbutton id="inspd-button1-home"\r
- context=""\r
- label="Insipid Home"\r
- tooltiptext="Open my Insipid front page"\r
- class="toolbarbutton-1"\r
- onclick="$buttons.click(event,'home');" >\r
- </toolbarbutton>\r
-\r
-\r
- \r
-<toolbarbutton id="inspd-button2-posttoinsipid"\r
- context=""\r
- label="Post to Insipid"\r
- tooltiptext="Post this page to Insipid"\r
- class="toolbarbutton-1"\r
- onclick="$buttons.click(event,'posttoinsipid');" />\r
- \r
-<toolbarbutton id="inspd-button3-mytagcloud"\r
- context=""\r
- label="Insipid tag cloud"\r
- tooltiptext="Open my Insipid tag cloud"\r
- class="toolbarbutton-1"\r
- onclick="$buttons.click(event,'mytagcloud');" />\r
- \r
-\r
-<toolbarbutton id="inspd-button4-mystars"\r
- context=""\r
- label="My Stars"\r
- tooltiptext="Open my stars page"\r
- class="toolbarbutton-1"\r
- onclick="$buttons.click(event,'mystars');" />\r
-\r
- \r
- \r
-</toolbarpalette>\r
- \r
- \r
- \r
-<toolbox id="navigator-toolbox" iconsize="small" mode="icons">\r
-\r
- <toolbar id="inspd-Toolbar1" accesskey="" class="chromeclass-toolbar" \r
- context="toolbar-context-menu"\r
- toolbarname="Insipid Toolbar" \r
- hidden="false" persist="hidden" customizable="true"\r
- defaultset="inspd-button1-home,inspd-button2-posttoinsipid,inspd-button3-mytagcloud,inspd-button4-mystars,inspd-searchbar-container"\r
- iconsize="small" mode="icons" />\r
-\r
-</toolbox>\r
-\r
- \r
-</overlay>\r
+++ /dev/null
-form { margin: 0; padding: 0; }\r
-ul, ol, li { margin: 0 0 0.5em 0; padding: 0; }\r
-li { margin-left: 2em; }\r
-\r
-\r
-#inline-suggestions { border: 2px solid #eee; border-top: none; position: absolute; background-color: #fff; padding: 2px; }\r
-#inline-suggestions .tag { font-size: 80%; display: block; color: #000; cursor: default; }\r
-\r
-\r
-/* ========================================== */\r
-/*popup suggestions hover with hand color*/\r
-#inline-suggestions .selected, #suggestions .tag:hover { background-color: #377700 !important; color: #fff !important; text-decoration: none; cursor: pointer; }\r
-/*============================================*/\r
-\r
-.postui { font-size: 14px }\r
-.postui .tag { padding: 2px; text-decoration: none; }\r
-.postui ul { list-style-type: none; }\r
-/* =================================================== */\r
-/*suggestion popup select*/\r
-.postui .selected, .postui .tag:hover { background-color: #800000 !important; color: #fff !important; text-decoration: none; }\r
-/*==================================================*/\r
-.postui .recommended { color: #080; }\r
-.postui input { margin-left: 0; padding-left: 0; text-indent: 0; }\r
-.postui .bundle .tag, #suggest .tag { font-size: 90%; }\r
-a.noclicky, a.noclicky:hover { cursor: default; color: #000; text-decoration: none; }\r
-a.clicky { color: blue; cursor: pointer; }\r
-.postui ul li.bundle { padding: 0.25em 0.6em; text-align: justify; display: none; }\r
-.postui ul li.bundle {padding:0;margin:0 0 0.3em}\r
-.postui .bundle .label { display: inline; }\r
-.postui .fold { display: block; }\r
-.postui #notes { font-family: arial, sans-serif; font-size: 80%; }\r
-.postui .label span { text-align: left; font-weight: bolder; font-size: 100%; }\r
-.postui #sort { font-size: 85%; float: right; _margin-top: -25px; margin-top: 0.2em; white-space: nowrap; }\r
-.postui .bundles .label { color: #000; }\r
-.postui .bundles { margin-top: 0.5em; }\r
-.postui .bundle { margin: 0 0 0 1em; }\r
-/*======================================================= popupbg:*/\r
-.postui .popup { position: absolute; background-color: #FFFFCC; border-top: 2px solid #ccc; padding:2px 5px 5px 5px; }\r
-/*=================================================================*/\r
-\r
-\r
+++ /dev/null
-String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g,'') }\r
-String.prototype.unescHtml = function(){ var i,e={'<':'<','>':'>','&':'&','"':'"'},t=this; for(i in e) t=t.replace(new RegExp(i,'g'),e[i]); return t }\r
-\r
-function loadTags(t) { tags = t }\r
-\r
-// styling functions\r
-function isA(o,klass){ if(!o.className) return false; return new RegExp('\\b'+klass+'\\b').test(o.className) }\r
-function addClass(o,klass){ if(!isA(o,klass)) o.className += ' ' + klass }\r
-function rmClass(o,klass){ o.className = o.className.replace(new RegExp('\\s*\\b'+klass+'\\b'),'') }\r
-function swapClass(o,klass,klass2){ var swap = isA(o,klass) ? [klass,klass2] : [klass2,klass]; rmClass(o,swap[0]); addClass(o,swap[1]) }\r
-function getStyle(o,s) {\r
- if (document.defaultView && document.defaultView.getComputedStyle) return document.defaultView.getComputedStyle(o,null).getPropertyValue(s)\r
- else if (o.currentStyle) { return o.currentStyle[s.replace(/-([^-])/g, function(a,b){return b.toUpperCase()})] }\r
-}\r
-// shorter names for grabbing stuff\r
-//function $id(id){ return document.getElementById(id) }\r
-function $tags(t,o){ o=o||document; return o.getElementsByTagName(t) }\r
-function $tag(t,o,i) { o=o||document; return o.getElementsByTagName(t)[i||0] }\r
-// get elements by class name, eg $c('post', document, 'li')\r
-function $c(c,o,t) { o=o||document;\r
- if (!o.length) o = [o]\r
- else if(o.length == 1 && !o[0]) o = [o] // opera, you're weird\r
- var elements = []\r
- for(var i = 0, e; e = o[i]; i++) {\r
- if(e.getElementsByTagName) {\r
- var children = e.getElementsByTagName(t || '*')\r
- for (var j = 0, child; child = children[j]; j++) if(isA(child,c)) elements.push(child)\r
- }}\r
- return elements\r
-}\r
-\r
-// get mouse pointer position\r
-function pointerX(e) { return e.pageX || (e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) }\r
-function pointerY(e) { return e.pageY || (e.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) }\r
-\r
-// get window size\r
-function windowHeight() { return self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0 }\r
-function windowWidth() { return self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0 }\r
-\r
-// get pixel position of an object\r
-function getY(o){ var y = 0\r
- if (o.offsetParent) while (o.offsetParent) { y += o.offsetTop; o = o.offsetParent }\r
- return y\r
-}\r
-function getX(o){ var x = 0\r
- if (o.offsetParent) while (o.offsetParent) { x += o.offsetLeft; o = o.offsetParent }\r
- return x\r
-}\r
-\r
-\r
-// event functions\r
-function falseFunc(){ return false }\r
-\r
-// the following two functions ganked from prototype (see http://prototype.conio.net)\r
-// (c) 2005 Sam Stephenson\r
-var Class = {\r
- create: function() {\r
- return function() { this.initialize.apply(this, arguments) }\r
-}}\r
-Function.prototype.bind = function(o) {\r
- var __method = this\r
- return function() { return __method.apply(o, arguments) }\r
-}
\ No newline at end of file
+++ /dev/null
-String.prototype.escRegExp = function(){ return this.replace(/[\\$*+?()=!|,{}\[\]\.^]/g,'\\$&') }\r
-String.prototype.unescHtml = function(){ var i,t=this; for(i in e) t=t.replace(new RegExp(i,'g'),e[i]); return t }\r
-function Suggestions() { this.length=1; this.picked=0; this[0] = 'dummy' }\r
-var suggestions = new Suggestions()\r
-var tagSearch='', lastEdit=''\r
-var h={}, sections=[{},{},{},{},{}], selected={}, currentTag={}, e={'<':'<','>':'>','&':'&','"':'"'}, reco = {}\r
-\r
-function init() { var elements = ['rec','pop','pop2','network','pop3'], divs={}, freqSort=[], freqMap={}, t,i\r
- for(i in elements) divs[elements[i]] = makeDiv(elements[i] + 'tags')\r
- elements = elements.concat('suggest','tags')\r
- for(i in elements) h[elements[i]] = $id(elements[i])\r
- for(t in tags) {\r
- if (!freqMap[tags[t]]) { freqMap[tags[t]] = {}; freqSort[freqSort.length] = tags[t] }\r
- freqMap[tags[t]][t] = true;\r
- }\r
- freqSort.sort(function(a,b){return b-a})\r
- for(i in freqSort) { for(t in freqMap[freqSort[i]]) tagSearch += t + ' ' }\r
- for(t in tagFor) { t = 'for:'+tagFor[t] \r
- sections[2][t.toLowerCase()] = makeTag(divs.network, t, 'swap')\r
- tagSearch += t + ' '\r
- }\r
- if(tagFor.length > 0) { h.network.style.display = 'block'; h.network.appendChild(divs.network) }\r
- \r
- \r
- \r
- \r
- for(t in tagPop) { t = tagPop[t]\r
- sections[0][t.toLowerCase()] = makeTag(divs.pop, t, 'swap')\r
- // if(!sections[0][t.toLowerCase()] && !sections[4][t.toLowerCase()]) tagSearch += t + ' '\r
- }\r
- if(tagPop.length > 0) { h.pop.style.display = 'block'; h.pop.appendChild(divs.pop) }\r
- \r
- \r
- for(t in tagPop2) { t = tagPop2[t]\r
- sections[3][t.toLowerCase()] = makeTag(divs.pop2, t, 'swap')\r
- //if(!sections[0][t.toLowerCase()] && !sections[4][t.toLowerCase()]) tagSearch += t + ' '\r
- }\r
- if(tagPop2.length > 0) { h.pop2.style.display = 'block'; h.pop2.appendChild(divs.pop2) }\r
- \r
- \r
- \r
- for(t in tagPop3) { t = tagPop3[t]\r
- sections[4][t.toLowerCase()] = makeTag(divs.pop3, t, 'swap')\r
- //if(!sections[0][t.toLowerCase()] && !sections[4][t.toLowerCase()]) tagSearch += t + ' '\r
- }\r
- if(tagPop3.length > 0) { h.pop3.style.display = 'block'; h.pop3.appendChild(divs.pop3) }\r
- \r
- \r
- \r
- \r
- \r
- \r
- for(t in tagRec) { t = tagRec[t]\r
- reco[t.toLowerCase()] = true\r
- sections[1][t.toLowerCase()] = makeTag(divs.rec, t, 'swap')\r
- for(i in sections) {\r
- if(sections[i][t.toLowerCase()]) addClass(sections[i][t.toLowerCase()], 'recommended')\r
- }}\r
- if(tagRec.length > 0) { h.rec.style.display = 'block'; h.rec.appendChild(divs.rec) }\r
- \r
- document.onkeyup = keyup\r
- h.tags.onkeypress = keypress; h.tags.onkeydown = keydown\r
-\r
- $id('url').onfocus = $id('title').onfocus = $id('description').onfocus = dropdownBlur\r
- $id('tags').onfocus = dropdownFocus\r
- \r
- addClass($id('suggest'), 'popup')\r
- $id('suggest').style.top = getY($id('tags')) + h.tags.offsetHeight - 1 + 'px'\r
- inviso = document.createElement('div')\r
- inviso.style.top = inviso.style.left = 0\r
- inviso.style.position = 'absolute'; inviso.style.visibility = 'hidden'\r
- inviso.style.fontSize = getStyle($id('tags'), 'font-size')\r
- inviso.style.fontFamily = getStyle($id('tags'), 'font-family')\r
- \r
- h.tags.parentNode.appendChild(inviso)\r
- updateHilight()\r
- //$id('title_line2').innerHTML = ''; \r
- //$id('poptags_msg').innerHTML = 'popular tags for this url from del.icio.us:';\r
- /*if (Inspd_delicious_username != 0 && Inspd_delintegrate_commontags == 1 && !document.forms[0].url.value.match(''+Inspd_defurl+'') && !document.forms[0].url.value.match('chrome\\://') && document.forms[0].url.value.match('^http\\://') && !document.forms[0].url.value.match('^http\\://localhost') && !document.forms[0].url.value.match('^http\\://127.0.0.') && !document.forms[0].url.value.match('^http\\://192.168.0.') && !document.forms[0].url.value.match('^http\\://10.0.0.')){\r
- */\r
- var bulletIconTXT = '<img src="chrome://inspd/content/v2/altpost/images/inspd_altpost_arrow1.png" width="16" height="16" align="absmiddle"/>';\r
- $id('pop2tags_msg').innerHTML = ''+bulletIconTXT+' tags used in your 30 most recent bookmarks:';\r
- \r
- if($utils.qs('copytags') && $utils.qs('copytags') != 'null'){\r
- if ($utils.qs('copyuser') && $utils.qs('copyuser') != 'null' && $utils.qs('copyuser') != false ){\r
- $id('pop3tags_msg').innerHTML = ''+bulletIconTXT+' you copied this bookmark from user <a title="Go to this user\'s home page" href="http://del.icio.us/'+$utils.qs('copyuser')+'" target="_blank">'+$utils.decode($utils.qs('copyuser'))+'</a> with tags:';\r
- }\r
- else {\r
- $id('pop3tags_msg').innerHTML = ''+bulletIconTXT+' tags copied with this bookmark from del.icio.us:';\r
- }\r
- } \r
- \r
- if(typeof(Inspd_delintegrate_commontags_found)!='undefined') {\r
- if(Inspd_delintegrate_commontags_found == 1){\r
- if(typeof(Inspd_delintegrate_commontags_found_url)!='undefined' && Inspd_delintegrate_commontags_found_url == 1){\r
- $id('poptags_msg').innerHTML = '<span style="color:#000000;display:block;">'+bulletIconTXT+' <small style="font-size:100%;color:#FE6601;">popular</small> tags for this URL from <small style="font-size:100%;color:#0201FD;"><a title="go to this url's history page" href="http://del.icio.us/url/'+hex_md5(document.forms[0].url.value)+'" target="_blank">del.icio.us</a>:</small> <small style="font-size:80%;color:#000000;">[ <b style="cursor:pointer;color:#ff0000;" id="loggedindelusername" onmouseover="this.innerHTML=\'you are hitting del.icio.us history pages to get popular tags. Hit with caution!\'" onmouseout="this.innerHTML=\'....\'">....</b> ]</small></span>';\r
- }\r
- else{\r
- $id('poptags_msg').innerHTML = '<span style="color:#000000;display:block;">'+bulletIconTXT+' <small style="font-size:100%;color:#FE6601;">popular</small> tags for this URL from <small style="font-size:100%;color:#0201FD;"><a title="go to your del.icio.us home page" href="http://del.icio.us/'+Inspd_delicious_username+'" target="_blank">your del.icio.us post page</a>:</small> <small style="font-size:80%;color:#000000;">[ <b style="cursor:pointer;color:#006625;" id="loggedindelusername" onmouseover="this.innerHTML=\'you are logged into del.icio.us as: '+Inspd_delicious_username+'\'" onmouseout="this.innerHTML=\'....\'">....</b></a> ]</small></span>';\r
- }\r
- }\r
- else if(Inspd_delintegrate_commontags_found == 2){\r
- //$id('poptags_msg').innerHTML = '<span style="color:#CC0001;background-color:#FFFFCC;'+\r
- //'-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;'+\r
- //'border: 0px solid #cccccc;">no popular tags were found for this url on del.icio.us</span>';\r
- setTimeout('$id(\'poptags_msg\').innerHTML=\'\';$id(\'poptags_msg\').innerHTML=\'<span style="color:#CC0001;background-color:#FFFFCC;-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;border:1px solid #FFFF9D;">no popular tags were found for this url on del.icio.us</span>\';',500);\r
- //setTimeout('$effects.fadeOut(\'poptags_msg\');',6000);\r
- setTimeout('$id(\'poptags_msg\').setAttribute("style","visibility:hidden;");',6000);\r
- }\r
- \r
- else if(Inspd_delintegrate_commontags_found == 3){\r
- setTimeout('$id(\'poptags_msg\').innerHTML=\'\';$id(\'poptags_msg\').innerHTML=\'<span style="color:#CC0001;background-color:#FFFFCC;-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;border:1px solid #FFFF9D;">Could not connect to del.icio.us</span>\';',500);\r
- //setTimeout('$effects.fadeOut(\'poptags_msg\');',6000);\r
- setTimeout('$id(\'poptags_msg\').setAttribute("style","visibility:hidden;");',6000);\r
- }\r
- \r
- else if(Inspd_delintegrate_commontags_found == 4){\r
- setTimeout('$id(\'poptags_msg\').innerHTML=\'\';$id(\'poptags_msg\').innerHTML=\'<span style="color:#CC0001;background-color:#FFFFCC;-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;border:1px solid #FFFF9D;">You have chosen to get popular tags from your del.icio.us posting page but you are not logged in! Login first!</span>\';',500);\r
- //setTimeout('$effects.fadeOut(\'poptags_msg\');',10000);\r
- setTimeout('$id(\'poptags_msg\').setAttribute("style","visibility:hidden;");',10000);\r
- }\r
- \r
- else if(Inspd_delintegrate_commontags_found == 5){\r
- setTimeout('$id(\'poptags_msg\').innerHTML=\'\';$id(\'poptags_msg\').innerHTML=\'<span style="color:#CC0001;background-color:#FFFFCC;-moz-box-sizing:border-box;-moz-border-radius: 5px 5px 5px 5px ;padding:5px;border:1px solid #FFFF9D;">You are hitting del.icio.us history page too much! Please switch back to "Get popular tags from personal page" for a while.</span>\';',500);\r
- //setTimeout('$effects.fadeOut(\'poptags_msg\');',10000);\r
- setTimeout('$id(\'poptags_msg\').setAttribute("style","visibility:hidden;");',10000);\r
- }\r
- \r
- }\r
- else{\r
- setTimeout('$effects.fadeOut(\'poptags_msg\');',1);\r
- }\r
- \r
- \r
-\r
-}\r
-\r
-var tagsFocused = false\r
-function dropdownBlur() { tagsFocused = false; hideSuggestions() }\r
-function dropdownFocus() { tagsFocused = true }\r
-\r
-function makeDiv(id) { var obj=document.createElement('div'); obj.id=id; return obj }\r
-\r
-var tagHeight = 0\r
-function makeTag(parent, tag, js, post, display) {\r
- parent.appendChild(document.createTextNode(' '))\r
- var obj = document.createElement('a')\r
- if (display) obj.style.display = display\r
- obj.className = 'tag'\r
- obj.setAttribute('href','javascript:'+js+'("'+tag.replace(/"/g,'\\"')+'")')\r
- var text = tag\r
- if(post) text += post\r
- obj.appendChild(document.createTextNode(text))\r
- \r
- var tagCountTXT //= '' ;\r
- if (tags[tag] !== undefined){tagCountTXT = tags[tag];}else{tagCountTXT = 0;tags[tag]= 0;}\r
- \r
- \r
- \r
- if(reco[tag.toLowerCase()]) addClass(obj, 'recommended')\r
- else if(tagCountTXT < 2) obj.style.color = '#66f'\r
- else if(tagCountTXT == 2) obj.style.color = '#44f'\r
- \r
- \r
- \r
- \r
- //if(tags[tag] > 10) obj.style.fontSize = '90%'\r
- parent.appendChild(obj)\r
- if (tagHeight == 0) tagHeight = obj.offsetHeight\r
- return obj\r
-}\r
-\r
-function select(t) { var i; t=t.toLowerCase()\r
- selected[t] = true; for(i in sections) if(sections[i][t]) addClass(sections[i][t], 'selected')\r
-}\r
-function deselect(t) { var i; t=t.toLowerCase()\r
- delete selected[t]; for(i in sections) if(sections[i][t]) rmClass(sections[i][t], 'selected')\r
-}\r
-\r
-function swap(tag){\r
- var tagArray = h.tags.value.trim().split(' '), present=false, t, tl=tag.toLowerCase()\r
- if (tagArray[0].trim() == '') tagArray.splice(0,1);\r
- for (t=0; t<tagArray.length; t++) {\r
- if (tagArray[t].toLowerCase() == tl) { tagArray.splice(t,1); deselect(tag); present=true; t-=1 }\r
- }\r
- if (!present) { tagArray.push(tag); select(tag) }\r
- var content = tagArray.join(' ')\r
- lastEdit = h.tags.value = (content.length > 1) ? content + ' ' : content\r
- hideSuggestions()\r
- focusTo(h.tags)\r
-}\r
-\r
-function complete(tag) { var tagArray=h.tags.value.split(' ')\r
- if(typeof tag == 'undefined') tag = suggestions[suggestions.picked].innerHTML.replace(/ \([0-9]+\)$/, '').unescHtml() // tab complete rather than click complete\r
- tagArray[currentTag.index] = tag\r
- var text = tagArray.join(' ')\r
- h.tags.value = (text.substr(-1,1) == ' ' ? text : text + ' ' )\r
- hideSuggestions()\r
- updateHilight()\r
- focusTo(h.tags)\r
- //$id("tags").blur(); //hack to "wake up" safari\r
- //$id("tags").focus();\r
-}\r
-\r
-// focus the caret to end of a form input (+ optionally select some text)\r
-var range=0 //ie\r
-function focusTo(obj, selectFrom) {\r
- if (typeof selectFrom == 'undefined') selectFrom = obj.value.length\r
- if(obj.createTextRange){ //ie + opera\r
- if (range == 0) range = obj.createTextRange()\r
- range.moveEnd("character",obj.value.length)\r
- range.moveStart("character",selectFrom)\r
- setTimeout('range.select()', 10)\r
- } else if (obj.setSelectionRange){ //ff\r
- obj.select()\r
- obj.setSelectionRange(selectFrom,obj.value.length)\r
- } else { //safari :(\r
- obj.blur()\r
- obj.focus()\r
-}}\r
-\r
-function updateHilight() { var tagArray=h.tags.value.toLowerCase().split(' '), tagHash={}\r
- if (tagArray[0].trim() == '') tagArray.splice(0,1);\r
- for (t in tagArray) {\r
- if(tagArray[t] != '') {\r
- select(tagArray[t])\r
- tagHash[tagArray[t]] = true\r
- }}\r
- for (t in selected) {if (!tagHash[t]) deselect(t)}\r
- return [tagArray, tagHash]\r
-}\r
-\r
-function hideSuggestions() {\r
- h.suggest.parentNode.parentNode.style.visibility='hidden'\r
- $id('suggest').style.left = '700px'\r
-}\r
-function showSuggestions() {\r
- suggest(0)\r
- var pos = 0, tagz = h.tags.value.split(' '), s = $id('suggest'), t = $id('tags')\r
- \r
- for(var i=0; i<currentTag.index; i++) { pos += tagz[i].length+1 }\r
- var text = h.tags.value.substr(0,pos)\r
- var esc = {'<':'[','>':']',' ':' '}\r
- for(var i in esc) text=text.replace(new RegExp(i,'g'), esc[i])\r
- inviso.innerHTML = text\r
- s.style.height = 'auto'; s.style.width = 'auto'; s.style.overflow = 'visible'\r
- var suggestHeight = getY(s) + s.offsetHeight\r
- if(windowHeight() < suggestHeight) {\r
- s.style.height = windowHeight() - getY(s) - 2 + 'px'\r
- s.style.overflow = 'auto'\r
- s.scrollTop = 0\r
- if(s.clientWidth < s.scrollWidth) s.style.width = s.scrollWidth + (s.scrollWidth - s.clientWidth) + 'px' // get rid of horizontal scrollbars on ie overflow divs\r
- }\r
- s.style.left = getX(t) + inviso.offsetWidth + 'px' // put dropdown right below current typed tag\r
- if(getX(s) + s.offsetWidth > getX(t) + t.offsetWidth) { // force dropdown to right align to tags input\r
- s.style.left = getX(s) - (getX(s) + s.offsetWidth - getX(t) - t.offsetWidth) + 'px'\r
- }\r
- h.suggest.parentNode.parentNode.style.visibility='visible'\r
-}\r
-\r
-function scrollDropdown() {\r
- var amt = Math.ceil((Math.ceil($id('suggest').offsetHeight - tagHeight) / tagHeight) / 2 )\r
- var scrollTo = (suggestions.picked * tagHeight) - (amt * tagHeight)\r
- $id('suggest').scrollTop = (scrollTo < 0) ? 0 : scrollTo\r
-}\r
-\r
-function updateSuggestions() {\r
- if(!getCurrentTag() || !currentTag.text || !tagsFocused) { hideSuggestions(); return false }\r
-\r
- while (h.suggest.hasChildNodes()) h.suggest.removeChild(h.suggest.firstChild)\r
- delete suggestions; suggestions = new Suggestions();\r
- var tagArray = h.tags.value.toLowerCase().split(' '), txt=currentTag.text.escRegExp(), tagHash={}, t\r
- for(t in tagArray) tagHash[tagArray[t]] = true\r
-\r
- var search = tagSearch.match(new RegExp(("(?:^| )("+txt+"[^ ]+)"), "gi"))\r
- if(search){\r
- for (i=0; i<search.length; i++) {\r
- tl = search[i].trim()\r
- if(tagHash[tl]) continue // do not suggest already typed tag\r
- var text = tags[tl] ? ' ('+tags[tl]+')' : ''\r
- suggestions[suggestions.length] = makeTag(h.suggest, tl, 'complete', text, 'block')\r
- suggestions.length++\r
- }}\r
- if (suggestions.length > 1) showSuggestions()\r
- else hideSuggestions()\r
-}\r
-\r
-function suggest(index) {\r
- if(suggestions.length == 1) index = 0\r
- if(suggestions[suggestions.picked].className) rmClass(suggestions[suggestions.picked], 'selected')\r
- addClass(suggestions[suggestions.picked = index], 'selected')\r
-}\r
-\r
-function getCurrentTag() {\r
- if(h.tags.value == lastEdit) return true // no edit\r
- if(h.tags == '') return false\r
- currentTag = {}\r
- var tagArray=h.tags.value.toLowerCase().split(' '), oldArray=lastEdit.toLowerCase().split(' '), currentTags = [], matched=false, t,o\r
- for (t in tagArray) {\r
- for (o in oldArray) {\r
- if(typeof oldArray[o] == 'undefined') { oldArray.splice(o,1); break }\r
- if(tagArray[t] == oldArray[o]) { matched = true; oldArray.splice(o,1); break; }\r
- }\r
- if(!matched) currentTags[currentTags.length] = t\r
- matched=false\r
- }\r
- // more than one word changed... abort\r
- if(currentTags.length > 1) { hideSuggestions(); return false }\r
- currentTag = { text:tagArray[currentTags[0]], index:currentTags[0] }\r
- return true\r
-}\r
-\r
-function prevent(e) {\r
- if (window.event) window.event.returnValue = false\r
- else e.preventDefault()\r
-}\r
-\r
-function keydown(e) { e=e||window.event\r
- if(h.suggest.parentNode.parentNode.style.visibility == 'visible') {\r
- switch(e.keyCode) {\r
- case 40:\r
- suggest((suggestions.picked + 1) % suggestions.length)\r
- scrollDropdown()\r
- prevent(e)\r
- break\r
- case 38:\r
- suggest(suggestions.picked == 0 ? suggestions.length - 1 : suggestions.picked - 1)\r
- scrollDropdown()\r
- prevent(e)\r
- break\r
-}}}\r
-\r
-function keypress(e) { e=e||window.event\r
- switch(e.keyCode){\r
- case 38: case 40:\r
- prevent(e)\r
- break\r
- case 9:\r
- if(h.suggest.parentNode.parentNode.style.visibility == 'visible') prevent(e)\r
- break\r
- case 13:\r
- if(h.suggest.parentNode.parentNode.style.visibility == 'visible' && suggestions.picked > 0) prevent(e)\r
- break\r
- default: lastEdit = h.tags.value\r
-}}\r
-\r
-function keyup(e) { e=e||window.event\r
- switch(e.keyCode){\r
- case 38: case 40:\r
- prevent(e)\r
- break\r
- case 9:\r
- if(h.suggest.parentNode.parentNode.style.visibility == 'visible') {\r
- if (suggestions.picked == 0) suggest(1)\r
- complete()\r
- prevent(e)\r
- }\r
- break\r
- case 13:\r
- if(h.suggest.parentNode.parentNode.style.visibility == 'visible' && suggestions.picked > 0) {\r
- complete()\r
- prevent(e)\r
- }\r
- break\r
- case 35: //end\r
- case 36: //home\r
- case 39: //right\r
- case 37: //left\r
- case 32: //space\r
- hideSuggestions()\r
- break\r
- default: updateSuggestions()\r
-}}
\ No newline at end of file
+++ /dev/null
-function $id(id){ return document.getElementById(id) }\r
- \r
-\r
- \r
-var $utils = {\r
- \r
- addEvent : function(event, elid, handler, bubble) {\r
- elid.addEventListener(event, handler, bubble);\r
- },\r
- \r
- appendjs : function(filename,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('script');\r
- element.type = 'text/javascript';\r
- //element.innerHTML = '';\r
- element.setAttribute('src',filename);\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- \r
- appendjsHTML : function(txtHTML,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('script');\r
- element.type = 'text/javascript';\r
- element.innerHTML = txtHTML ;\r
- //element.setAttribute('src',filename);\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- appendcssfile : function(filename,doc,elid){\r
- if (!doc){doc = document;}\r
- if (!elid){elid = 'head';}\r
- var element=doc.createElement('link');\r
- element.type = 'text/css';\r
- element.setAttribute('rel','stylesheet');\r
- element.setAttribute('href',filename);\r
- //element.innerHTML = '';\r
- doc.getElementsByTagName(elid).item(0).appendChild(element);\r
- },\r
- \r
- replace : function(str,txt1,txt2){\r
- return str.replace(new RegExp(txt1,'g'),txt2);\r
- },\r
- trim : function(str){\r
- if(str){\r
- return str.replace(/^\s*|\s*$/g,'');\r
- }\r
- else{\r
- return "";\r
- } \r
- },\r
- \r
- decode: function(str){\r
- return decodeURIComponent(str);\r
- },\r
- \r
- encode: function(str){\r
- return encodeURIComponent(str);\r
- },\r
- \r
- qs : function(Query_String_Name) {\r
- var i, pos, argname, argvalue, queryString, pairs;\r
- queryString = location.href.substring(location.href.indexOf("?")+1);\r
- pairs = queryString.split("&");\r
- for (i = 0; i < pairs.length; i++) { \r
- pos = pairs[i].indexOf('='); \r
- if (pos == -1) {\r
- continue; \r
- }\r
- argname = pairs[i].substring(0,pos);\r
- argvalue = pairs[i].substring(pos+1); \r
- if (argname == Query_String_Name) {\r
- // return unescape(argvalue.replace(/\+/g, " "));\r
- return argvalue;\r
- }\r
- }\r
- return false;\r
- }\r
- \r
- \r
- \r
- \r
- \r
-}\r
-\r
-var $effects = {\r
- \r
- fadeOut : function(elid) {\r
- var opacs = ["0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"];\r
- opacs.reverse();\r
- for (var i = 0; i < 11; i++) {\r
- setTimeout('$id(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40);\r
- }\r
- setTimeout('$id(\''+elid+'\').style.display = "none";', i * 40);\r
- },\r
-}\r
-\r
-\r
-\r
-var $altp = {\r
- initPage : function(){\r
- $altp.setInitialFormValues();\r
- \r
- if(typeof(Inspd_delintegrate_commontags_found_url) !='undefined'){\r
- if(Inspd_delintegrate_commontags_found_url==1){\r
- $utils.appendjsHTML($altp.scrap_tagPop(),document);\r
- }\r
- }\r
- \r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost1.js',document)\r
- $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost2_popup.js',document)\r
- \r
- $utils.appendjsHTML($altp.scrapTags(),document);\r
- \r
- if ($utils.qs('copytags') && $utils.qs('copytags') != 'null'){\r
- $utils.appendjsHTML($altp.scrap_tagCopyUser(),document);\r
- }\r
- \r
- $altp.setSwapForRecentLinks();\r
- \r
- setTimeout('init();',1);\r
- \r
- },\r
- \r
- \r
- scrapTags : function(){\r
- var txtTagsObj = 'loadTags({';\r
- var tagsfromtbl = document.evaluate("//table[@class='tagsummarytable']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0);\r
- var j = tagsfromtbl.getElementsByTagName('a').length ;\r
- for(var i = 0;i<j;i++){\r
- //tagsfromtbl.getElementsByTagName('a')[i].setAttribute('onclick','swap(this.innerHTML);return false;');\r
- txtTagsObj +='"'+tagsfromtbl.getElementsByTagName('a')[i].innerHTML+'":'+tagsfromtbl.getElementsByTagName('span')[i].innerHTML.match(/\d+/)+'';\r
- if (i < j-1 ){txtTagsObj += ',';}\r
- }\r
- txtTagsObj += '})'; \r
- return txtTagsObj;\r
- },\r
- \r
- scrap_tagPop : function(){\r
- try{\r
- var txtTagsObj = 'tagPop = [';\r
- // hidden_span_Inspd_delintegrate_commontags_found_1\r
- var tagsfromtbl = document.evaluate("//span[@id='hidden_span_Inspd_delintegrate_commontags_found_1']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r
- \r
- \r
- //alert(tagsfromtbl.snapshotLength);\r
- //alert(tagsfromtbl.snapshotItem(0).innerHTML);\r
- \r
- var tagsfromtbl_all_anchors = tagsfromtbl.snapshotItem(0).getElementsByTagName('span') ; \r
- var j = tagsfromtbl_all_anchors.length ;\r
- \r
- if (j == 0 ){\r
- var txtTagsObj = 'Inspd_delintegrate_commontags_found = 2';\r
- return txtTagsObj; \r
- }\r
- for(var i = 0;i<j;i++){\r
- var tag_name = $utils.trim(tagsfromtbl_all_anchors[i].title.replace(/\((.*)\)/,'')).toLowerCase() ; \r
- tag_name = tag_name.replace(/"/g,'\\"');\r
- tag_name = tag_name.replace(/\\/g,'');\r
- //alert(tag_name);\r
- txtTagsObj +='"'+tag_name+'"';\r
- if (i < j-1 ){txtTagsObj += ',';}\r
- }\r
- txtTagsObj += '];';\r
- // alert(txtTagsObj);\r
- }\r
- catch(e){\r
- //alert(e);\r
- var txtTagsObj = 'Inspd_delintegrate_commontags_found = 2';\r
- //alert(e);\r
- }\r
- \r
- return txtTagsObj;\r
- },\r
- \r
- \r
- scrap_tagCopyUser : function(){\r
- \r
- if ($utils.qs('copytags') && $utils.qs('copytags') != 'null'){\r
- var txtTagsObj = 'tagPop3 = [';\r
- var tagsfromtbl = ($utils.decode($utils.qs('copytags'))).split('+') ; \r
- var j = tagsfromtbl.length ;\r
- for(var i = 0;i<j;i++){\r
- txtTagsObj +='"'+(tagsfromtbl[i]).toLowerCase()+'"';\r
- if (i < j-1 ){txtTagsObj += ',';}\r
- }\r
- txtTagsObj += ']';\r
- return txtTagsObj;\r
- }\r
- },\r
- \r
- \r
- \r
- \r
- setInitialFormValues : function(){\r
- //document.forms[0].setAttribute('id','InspdForm');\r
- //document.forms[0].setAttribute('name','InspdForm');\r
- document.forms[0].url.setAttribute('id','url'); \r
- document.forms[0].title.setAttribute('id','title');\r
- document.forms[0].description.setAttribute('id','description'); \r
- document.forms[0].tags.setAttribute('id','tags'); \r
- document.forms[0].tags.setAttribute('autocomplete','off');\r
- \r
- \r
- },\r
- \r
- setSwapForRecentLinks : function(){\r
- var alldivs = document.evaluate("//div[@class='bookmarkOperations']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r
- var j = 30 ;\r
- var jstxt = '';\r
- for (var i=0; i<j; i++) {\r
- var div = alldivs.snapshotItem(i);\r
- for(var k = 0;k<div.getElementsByTagName('a').length;k++){\r
- //div.getElementsByTagName('a')[k].setAttribute('onclick','swap(this.innerHTML);return false;');\r
- if ( div.getElementsByTagName('a')[k].className == 'bookmarkTag'){\r
- jstxt += ''+div.getElementsByTagName('a')[k].innerHTML+' ';\r
- }\r
- }\r
- }\r
- //jstxt += '';\r
- $utils.appendjsHTML('tagPop2 = ['+$altp.removeDuplicateTags($utils.trim(jstxt))+'];',document);\r
- },\r
- \r
- removeDuplicateTags : function(strtxt) { \r
- var temp = strtxt; \r
- var array = temp.split(" "); \r
- array.sort(); \r
- temp = array.join(" "); \r
- do { \r
- var newTemp = temp; \r
- var temp = newTemp.replace(/\s(\w+\s)\1/, " $1"); \r
- } while (temp.length != newTemp.length); \r
- temp = temp.replace(/^(\w+\s)\1/, "$1"); \r
- temp = temp.replace(/(\s\w+)\1$/, "$1"); \r
- var orig = strtxt.split(" "); \r
- var finalStr = ""; \r
- for (var i=0; i<orig.length; i++) { \r
- if (temp.indexOf(orig[i] + " ") != -1) { \r
- finalStr += orig[i] + " "; \r
- temp = temp.split(orig[i] + " ").join(" "); \r
- } else if (temp.indexOf(" " + orig[i]) != -1) { \r
- finalStr += orig[i] + " "; \r
- temp = temp.split(" " + orig[i]).join(" "); \r
- } \r
- } \r
- if (finalStr.substring(finalStr.length-1, finalStr.length) == " ") { \r
- finalStr = finalStr.substring(0, finalStr.length-1); \r
- } \r
- var finalArray = '';\r
- var newArray = finalStr.split(' ');\r
- for(var j=0;j<newArray.length;j++){\r
- //if (newArray[j] != ''){\r
- finalArray +='"'+newArray[j]+'"';\r
- if(j<((newArray.length)-1)){finalArray +=',';}\r
- //}\r
- }\r
- // return finalStr; \r
- return finalArray; \r
- } \r
- \r
-\r
-\r
-}\r
-\r
-$altp.initPage();\r
-//init();\r
-//$utils.addEvent('load', window, function() { $altp.initPage(); }, false);\r
-\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html id="inspd">\r
-<head>\r
- <title>Quick post to Insipid</title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\r
- <script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
- <script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
- <script type="text/javascript" src="chrome://inspd/content/v2/altpost/qpost.js"></script>\r
- <link rel="shortcut icon" type="image/x-icon" href="chrome://inspd/content/v2/json/images/inspd_icon7_posttoinsipid_icon_1616.png" />\r
-\r
-<style>\r
-\r
-html, body, form { margin: 0; padding: 0; }\r
-body { font-family: arial, sans-serif; background-color: #fff; }\r
-h1, p { margin: 0 0 0.5em 0; padding: 0; }\r
-input { text-indent: 2px; _text-indent: 0; }\r
-input[type="submit"] { text-indent: 0; }\r
-h1 { font-size: 130%; }\r
-#header-mini { background-color: #ddd; padding: 0.3em 0.5em; margin: 0; }\r
-#header-mini h1 { font-size: 130%; margin: 0; padding: 0 0 0 26px; }\r
-#main { margin: 0px 1em 0 1em; }\r
-.postui { font-size: 14px }\r
-.postui .tag { padding: 2px; text-decoration: none; }\r
-.postui input { margin-left: 0; padding-left: 0; text-indent: 0; }\r
-td.rs { text-align: right; }\r
-\r
-</style>\r
-</head>\r
-\r
-<body>\r
-\r
-\r
-<div id="header-mini">\r
-<h1 style="display:inline">Quick post to Insipid</h1>\r
-</div>\r
-\r
- \r
-<div class="postui" id="main">\r
-<form id="InspdForm" name="InspdForm" method="post" action="">\r
-<table>\r
- <tbody>\r
- \r
- <tr id="msgurltr">\r
- <td> </td>\r
- <td align="left" id="msgurl" class="smaller"></td>\r
- </tr>\r
- \r
- <tr>\r
- <td class="rs">url</td>\r
- <td><input name="url" autocomplete="off" id="url" value="" size="80" type="text" /></td>\r
- </tr>\r
- <tr>\r
- <td class="rs">Title</td>\r
- <td><input name="title" autocomplete="off" id="title" value="" size="80" type="text" /></td><td>\r
- </td>\r
- </tr>\r
- <tr>\r
- <td class="rs">Description</td>\r
- <td>\r
- <textarea name="description" id="description" rows="2" cols="40"></textarea>\r
- </td>\r
- <td></td>\r
- </tr>\r
- <tr>\r
- <td class="rs">tags</td>\r
- <td><input id="tags" name="tags" value="" size="80" type="text" autocomplete="off" /></td><td align="left" class="smaller"><!--space separated--></td>\r
- </tr>\r
- \r
-\r
- <tr>\r
- \r
- <td></td>\r
- \r
- <td><span id="snapshotspan">\r
- <label class="smaller" for="snapshot">Snapshot:</label>\r
- <input type="checkbox" name="snapshot" id="snapshot"/>\r
- \r
- </span>\r
- \r
- <label class="smaller" for="access_level">Public:</label>\r
- <input type="checkbox" id="access_level" name="access_level" checked="true"/>\r
- \r
- <label class="smaller" for="redirect">Return:</label>\r
- <input type="checkbox" id="redirect" name="redirect"/>\r
- \r
-\r
- </td>\r
- \r
- \r
- \r
- \r
- </tr>\r
- \r
- \r
- \r
- <tr>\r
- <td class="rs"><input id="submitbtn" name="submitbtn" value="Save" type="submit" /></td>\r
- <td align="right">\r
-\r
- </td>\r
- <td></td>\r
- </tr>\r
-\r
- \r
- </tbody></table>\r
- <input type="hidden" id="save" name="save" value="true" />\r
- <input type="hidden" id="op" name="op" value="add_bookmark" />\r
-</form>\r
-\r
-</div>\r
-<script type="text/javascript">\r
-$id('url').style.width = $id('title').style.width = $id('tags').style.width = '500px'\r
-$id('description').style.width = $id('tags').offsetWidth - 4 + 'px'\r
-</script>\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-var $qpost = {\r
-\r
- pageLoad : function(){\r
- \r
- document.forms[0].setAttribute('action',''+$prefs.get('defurl')+'');\r
- document.forms[0].setAttribute('onsubmit','return $qpost.validateForm();');\r
- if ($utils.qs('redirect') == 'true'){\r
- document.forms[0].redirect.setAttribute('checked','true');\r
- }\r
- else {\r
- document.forms[0].redirect.removeAttribute('checked');\r
- }\r
- \r
- if($utils.qs('url')){\r
- document.forms[0].url.value = $utils.decode($utils.qs('url'));\r
- \r
- }\r
- \r
- if($utils.qs('title')){\r
- document.forms[0].title.value = $utils.decode($utils.qs('title'));\r
- \r
- }\r
- \r
- \r
- },\r
- \r
- validateForm : function(){\r
- if(!$utils.trim(document.forms[0].url.value)){\r
- alert('Please enter a URL for your post');\r
- return false;\r
- }\r
- else if(!$utils.trim(document.forms[0].title.value) ){\r
- alert('Please enter a title for your post');\r
- return false;\r
- }\r
- else {\r
- return true;\r
- }\r
- \r
- }\r
-\r
-\r
-\r
-}\r
-\r
-\r
-$utils.addEvent('DOMContentLoaded', window, function() { $qpost.pageLoad(); }, false);\r
-\r
-\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
-<title>All items</title>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/md5.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/inspd_json_lib.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/home.js"></script>\r
-<link rel="stylesheet" type="text/css" href="chrome://inspd/content/v2/json/style.css">\r
-<link rel="shortcut icon" href="chrome://inspd/content/v2/json/images/inspd_icon6_allitems_icon_1616.png" />\r
-</head>\r
-\r
-<body>\r
- <h1 id="header"><img src="images/inspd_icon6_allitems_html_icon_1616.png" align="absmiddle" style="margin-right:5px;"/>All items</h1>\r
- <div id="cont">\r
- <div id="nav">\r
- <div id="inspd_cloud_mini_header" class="inspd_cloud_mini_header" style="display:block;visibility:hidden;">\r
- » Search tags inline: <input size="11" name="qq" id="qq" type="text" onkeyup="$id('inspd_cloud').innerHTML = $cloud.g_draw(Insipid.tags,this.value)" />\r
- </div>\r
- \r
- <span><ul id="inspd_cloud" class="inspd_cloud_mini">\r
- <li style="font-size: 20px;">Loading your tags...</li>\r
- </ul>\r
- </span>\r
- \r
- </div>\r
- \r
- <span id="contposts"><div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Loading your bookmarks...</div></span>\r
-\r
- </div>\r
- \r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
-<title>Home</title>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/md5.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/inspd_json_lib.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/home.js"></script>\r
-<link rel="stylesheet" type="text/css" href="chrome://inspd/content/v2/json/style.css">\r
-<link rel="shortcut icon" href="chrome://inspd/content/v2/json/images/inspd_icon1_1616.png" />\r
-</head>\r
-\r
-<body>\r
- <h1 id="header"><img src="images/inspd_icon2_home.png" align="absmiddle" style="margin-right:5px;"/>Home</h1>\r
- <div id="cont">\r
- <div id="nav">\r
- <div id="inspd_cloud_mini_header" class="inspd_cloud_mini_header" style="display:block;visibility:hidden;">\r
- » Search tags inline: <input size="11" name="qq" id="qq" type="text" onkeyup="$id('inspd_cloud').innerHTML = $cloud.g_draw(Insipid.tags,this.value)" />\r
- </div>\r
- <span><ul id="inspd_cloud" class="inspd_cloud_mini">\r
- <li style="font-size: 20px;">Loading your tags...</li>\r
- </ul>\r
- </span>\r
- </div>\r
- \r
- <span id="contposts"><div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Loading your bookmarks...</div></span>\r
- \r
-\r
- </div>\r
- \r
-\r
-\r
- \r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-var $home = {\r
- draw_body_page: function(){\r
- if ($utils.qs('tag') != ''){\r
- document.title = document.title+' ['+$utils.decode($utils.qs('tag'))+']';\r
- $id('header').innerHTML = $id('header').innerHTML+' ['+$utils.decode($utils.qs('tag'))+']';\r
- }\r
- else if ($utils.qs('q') != ''){\r
- document.title = document.title+' ['+$utils.decode($utils.qs('q'))+']';\r
- $id('header').innerHTML = $id('header').innerHTML+' ['+$utils.decode($utils.qs('q'))+']';\r
- }\r
- \r
- \r
- \r
- if ($conditions.page_with_qs_tags()){\r
- $ajax.get(''+$prefs.get('defurl')+'?op=json_tags'+qs_tag+'&d='+new Date().valueOf()+'', this.draw_cloud_mini);\r
- }\r
- \r
- \r
- this.draw_contposts();\r
-\r
- },\r
- \r
- \r
- draw_cloud_mini: function(http_request){\r
- if (http_request.readyState == 4) {\r
- try{\r
- if (http_request.status == 200) {\r
- eval(http_request.responseText);\r
- \r
- $id('inspd_cloud_mini_header').style.visibility = 'visible';\r
- \r
- var tags = Insipid.tags ;\r
- \r
- var keyArray = new Array();\r
- var i = 0 ; \r
- for (t in tags){\r
- keyArray[i] = t;\r
- i++;\r
- }\r
- \r
- if ($prefs.get('cloud.sortby') == 'alphabetic'){\r
- $cloud.p_sort(keyArray, tags, 'alpha','');\r
- }\r
- else {\r
- $cloud.p_sort(keyArray, tags, 'freq',''); \r
- }\r
- \r
- \r
- } \r
- else {\r
- // error\r
- }\r
- }\r
- catch(e){\r
- //error\r
- }\r
- }\r
- },\r
- \r
- draw_contposts: function(){\r
- \r
- var url = ''+$prefs.get('defurl')+'?op=json_posts&count='+qs_count+'&page='+qs_page+''+qs_tag+'&d='+new Date().valueOf()+'';\r
- var http_request = new XMLHttpRequest();\r
- http_request.onreadystatechange = function() { \r
- if (http_request.readyState == 4) {\r
- try{\r
- if (http_request.status == 200) {\r
- eval(http_request.responseText);\r
- if (typeof Insipid.posts[0] == 'undefined'){\r
- \r
- $id('nav').style.display = 'none';\r
- if ($utils.qs('page')){\r
- \r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Page '+(parseInt($utils.qs('page')))+'</span> does not exists. <a href="'+Inspd_JSON_HOME_PAGE+'">Return to Home</a>.</div>';\r
- }\r
- else if (qs_tag != ''){\r
- qs_tag = $utils.replace(qs_tag,'&tag=','');\r
- qs_tag = $utils.replace(qs_tag,'&q=','');\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">'+$utils.decode(qs_tag)+'</span> returned no results. <a href="'+Inspd_JSON_HOME_PAGE+'">Return to Home</a>.</div>';\r
- }\r
- \r
- }\r
- else {\r
- $id('contposts').innerHTML = '';\r
- $id('inspd_cloud_mini_header').style.visibility = 'visible';\r
- //$id('inspd_cloud').innerHTML = '' ;\r
- $posts.g_draw('contposts',Insipid.posts);\r
- if ($utils.qs('tag') == '' || $utils.qs('tag').match("\\+")){\r
- //$id('inspd_cloud_mini_header').style.visibility = 'visible';\r
- $cloud.extract_tags_from_posts('inspd_cloud', Insipid.posts);\r
- }\r
- }\r
- \r
- } \r
- else {\r
- // error\r
- \r
- $id('nav').style.display = 'none';\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- \r
- }\r
- \r
- }\r
- catch(e){\r
- //$utils.console(e);\r
- $id('nav').style.display = 'none';\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- }\r
- \r
- }\r
- \r
- }\r
- \r
- http_request.open('GET', url, true);\r
- http_request.setRequestHeader("Connection", "close");\r
- http_request.setRequestHeader("Keep-Alive", "");\r
- http_request.send(null);\r
-\r
- },\r
- \r
- draw_posts_inline : function(page,tag){\r
- \r
- qs_page = parseInt(page);\r
- \r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Loading your bookmarks...</div>'; \r
- scroll(0,0);\r
- var url = ''+$prefs.get('defurl')+'?op=json_posts&count='+qs_count+'&page='+page+''+$utils.decode(tag)+'&d='+new Date().valueOf()+'';\r
- var http_request = new XMLHttpRequest();\r
- http_request.onreadystatechange = function() { \r
- \r
- if (http_request.readyState == 4) {\r
- try{\r
- if (http_request.status == 200) {\r
- \r
- eval(http_request.responseText);\r
- if (typeof Insipid.posts[0] == 'undefined'){\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Page '+(page-1)+' was the last. Reloading...</div>';\r
- backfromlast = true ;\r
- setTimeout('$home.draw_posts_inline('+(page-1)+',"'+tag+'")',2000);\r
- \r
- }\r
- else{ \r
- $id('contposts').innerHTML = ''; \r
- \r
- $posts.g_draw('contposts',Insipid.posts);\r
- if (($utils.qs('tag') && $utils.qs('tag').match("\\+")) || document.location.href.match(Inspd_JSON_HOME_PAGE) || document.location.href.match(Inspd_JSON_ALLITEMS_PAGE)){\r
- $cloud.extract_tags_from_posts('inspd_cloud', Insipid.posts);\r
- }\r
- \r
- \r
- } \r
- } \r
- else {\r
- // error\r
- $id('nav').style.display = 'none';\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- \r
- }\r
- \r
- }\r
- catch(e){\r
- $id('nav').style.display = 'none';\r
- $id('contposts').innerHTML = '<div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- \r
- }\r
- \r
- }\r
- };\r
- \r
- http_request.open('GET', url, true);\r
- http_request.setRequestHeader("Connection", "close");\r
- http_request.setRequestHeader("Keep-Alive", "");\r
- http_request.send(null);\r
-\r
- },\r
- \r
- \r
- pageLoad: function(){\r
- $conditions.gate();\r
- this.draw_body_page();\r
- \r
- }\r
- \r
-}\r
-\r
-\r
- \r
- \r
-$utils.addEvent('DOMContentLoaded', window, function() { $home.pageLoad(); }, false);\r
-\r
+++ /dev/null
-The pictures used in the icons are originally created by:\r
-mjames at gmail dot com.\r
-licensed under Creative Commons Attribution 2.5 License.\r
-http://creativecommons.org/licenses/by/2.5/\r
-\r
-They were downloaded from: \r
-http://www.famfamfam.com/lab/icons/silk/\r
+++ /dev/null
-var $cloud = {\r
- \r
- // extract_tags_from_posts() from the example code sent to pwlin by Darrel Huston from Flock Inc. \r
- extract_tags_from_posts:function (\r
- container, // the id of a div or a span that we want to write our cloud to it\r
- posts_obj // an object containing the posts which our tags are supposed to be extracted from. e.g Delicious.posts\r
- ){\r
- \r
- \r
- \r
- var sorted_tags = {} ;\r
- var posts = posts_obj;\r
- var tmptxt = '' ; \r
- \r
- \r
- \r
- \r
- // var tags = new Object();\r
- var tags = [];\r
-\r
- \r
- var tags_idx = new Array();\r
-\r
- for(var i = 0; i < posts.length; i++){\r
- \r
- var tags_array = posts[i].t;\r
-\r
- \r
- if(typeof tags_array == 'undefined'){\r
- tags_array = new Array('system:unfiled');\r
- }\r
-\r
- for(var j = 0; j< tags_array.length; j++){\r
- \r
- if(typeof tags[tags_array[j]] == 'undefined'){\r
- tags[tags_array[j]] = new Array();\r
- tags_idx[tags_idx.length] = tags_array[j];\r
- }\r
-\r
- tags[tags_array[j]][tags[tags_array[j]].length] = posts[i].u;\r
-\r
- }\r
- }\r
-\r
- \r
- tags_idx.sort();\r
-\r
- \r
- for(var i = 0; i < tags_idx.length; i++){\r
- sorted_tags[''+tags_idx[i]+''] = tags[tags_idx[i]].length ;\r
- }\r
-\r
- \r
- \r
- // $cloud.p_sort(tags_idx, sorted_tags, action,'');\r
- \r
- if ($prefs.get('cloud.sortby') == 'alphabetic'){\r
- $cloud.p_sort(tags_idx, sorted_tags, 'alpha','');\r
- }\r
- else {\r
- $cloud.p_sort(tags_idx, sorted_tags, 'freq',''); \r
- }\r
- \r
- \r
- \r
- \r
- },\r
- // tag cloud routine, originally from del.icio.us bits. \r
- g_draw : function(ts,q){\r
- \r
- !q ? q = '' : q = $utils.trim(q); \r
- q = q.replace(/[\\$*+?()=!|,{}\[\]\.^]/g,'\\$&') ;\r
- var pattern = "^"+q+"";\r
- var reg = new RegExp(pattern, "i");\r
- var all_tags = 0, matched_tags = 0 , output_tmp = '';\r
- var delCount = new Array();\r
- for (p in ts){\r
- if (!delCount[ts[p]]){\r
- delCount[ts[p]] = new Array(ts[p])\r
- }\r
- }\r
- var ta = 0,tz=delCount.length-1;\r
- \r
- output_tmp += '<li style="font-size:70%;text-align:left;display:block;color:#666666">'+this.p_draw_cloud_header()+'</li>';\r
- \r
- var ca=$utils.Hex2RGB($prefs.get('cloud.mincolor')),cz=$utils.Hex2RGB($prefs.get('cloud.maxcolor')),c=[] ;\r
- \r
- for(var t in ts){\r
- all_tags ++;\r
- for (var i=0;i<3;i++) {c[i]=this.p_spread(ca[i],cz[i],ts[t]-ta,tz)} ;\r
- if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- var fs = this.p_spread(parseInt($prefs.get('cloud.minfont')),parseInt($prefs.get('cloud.maxfont')),ts[t]-ta,tz) ;\r
- }\r
- else {\r
- var fs = this.p_spread(14,21,ts[t]-ta,tz) ;\r
- }\r
- \r
- if (q != '' ){\r
- if (ar = reg.test(t)){\r
- if (ts[t] >= parseInt($prefs.get('cloud.mintag'))){\r
- output_tmp += this.p_draw_single_tag(fs,t,ts[t],$prefs.get('cloud.showcounts'),c[0],c[1],c[2]);\r
- matched_tags++;\r
- }\r
- }\r
- }\r
- else{\r
- if (ts[t] >= parseInt($prefs.get('cloud.mintag'))){\r
- output_tmp += this.p_draw_single_tag(fs,t,ts[t],$prefs.get('cloud.showcounts'),c[0],c[1],c[2]);\r
- }\r
- }\r
- }\r
- return output_tmp ;\r
- },\r
- \r
- //tag cloud spread calculation originally from del.icio.us bits.\r
- p_spread : function(a,b,i,x) {\r
- if(a>b){\r
- var m=(a-b)/Math.log(x),v=a-Math.floor(Math.log(i)*m);\r
- }\r
- else{\r
- var m=(b-a)/Math.log(x),v=Math.floor(Math.log(i)*m+a) ;\r
- }\r
- return v ;\r
- },\r
- \r
- \r
- \r
- p_draw_single_tag : function(fs,t,count,show_counts,c0,c1,c2){\r
- var strtxt = '';\r
- var target = '';\r
- if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- target = 'target="_blank"';\r
- }\r
- if (isNaN(c0) || isNaN(c1) || isNaN(c2) || isNaN(fs) ){ fs = parseInt($prefs.get('cloud.minfont')) ; c0 = $utils.Hex2RGB($prefs.get('cloud.mincolor')); c2 = c0[2]; c1 = c0[1]; c0 = c0[0];}\r
- \r
- strtxt +='<li style="font-size:'+fs+'px;line-height:1.3;"><a '+target+' style="color:rgb('+c0+','+c1+','+c2+');" href="'+Inspd_JSON_BOOKMARKS_PAGE+'?tag='+t+'" onfocus="this.blur();">'+t+'</a>';\r
- \r
- if (show_counts == '1'){\r
- if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- strtxt +='<small style="font-size:10px;margin-left:0px;color:#666666;"><a href="#" onclick="$mytags.showBlob(\''+$utils.encode(t)+'maindragholder\',event,\''+count+'\');return false;" onfocus="this.blur();">('+count+')</a></small> ';\r
- \r
- }\r
- else {\r
- strtxt +='<small style="font-size:10px;margin-left:0px;color:#666666;">('+count+')</small>';\r
- if (document.location.href.match(Inspd_JSON_HOME_PAGE) || document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) ){\r
- strtxt += '\n';\r
- }\r
- \r
- }\r
- }\r
- else if (document.location.href.match(Inspd_JSON_CLOUD_PAGE) || document.location.href.match(Inspd_JSON_HOME_PAGE) || document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) ){\r
- \r
- strtxt += '\n';\r
- }\r
- \r
- \r
- \r
- \r
- \r
- if (document.location.href.match(Inspd_JSON_CLOUD_PAGE) || document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) ){\r
- \r
- }\r
- else {\r
- strtxt += this.p_draw_single_plusminus(t);\r
- }\r
- \r
- \r
- strtxt +='</li>';\r
- \r
- if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- strtxt +='<div id="'+$utils.encode(t)+'maindragholder"'+ \r
- 'style="position:absolute;width:350px;display:none;"></div>'+\r
- '';\r
- }\r
- \r
- return strtxt ;\r
- },\r
- \r
- p_draw_single_plusminus : function(t){\r
- var strtxt = '';\r
- if (qs_tag && $prefs.get('cloud.showadd')=='1'){\r
- var matched_qstag = false;\r
- var unmatched_qstag = 0;\r
- var qstags_Array = $utils.qs('tag').split('+');\r
- var unmatched_qstags_Array = [];\r
- for (var j = 0; j<qstags_Array.length;j++){\r
- if (qstags_Array[j] == t){\r
- matched_qstag = true ;\r
- }\r
- else {\r
- unmatched_qstags_Array[unmatched_qstag] = qstags_Array[j] ;\r
- unmatched_qstag++ ; \r
- }\r
- }\r
- if (!matched_qstag){\r
- strtxt +='<a onfocus="this.blur();" style="color:#326712;text-decoration:none;font-size:15px;" title="add \''+t+'\'" href="?'+qs_tag+'+'+(t)+'">+</a> ';\r
- }\r
- else {\r
- strtxt += '<a onfocus="this.blur();"'+\r
- 'style="color:#ff0000;text-decoration:none;font-size:25px;"'+\r
- ' title="remove \''+t+'\'" href="?tag='+\r
- '';\r
- for (var unmatched_qs in unmatched_qstags_Array){\r
- strtxt +=''+unmatched_qstags_Array[unmatched_qs]+'+';\r
- }\r
- //strtxt = $utils.replace(strtxt,'^\\+','') ;\r
- strtxt = $utils.replace(strtxt,'\\+$','') ;\r
- //strtxt = $utils.replace(strtxt,'\\+\\+','+') ;\r
- strtxt += '">-</a> '\r
- }\r
- }\r
- else {\r
- strtxt += '\n';\r
- } \r
- return strtxt ;\r
- },\r
- \r
- \r
- \r
- \r
- \r
- \r
- p_sort : function(keyArray, tags, action,anchor_id){\r
- var keyArraytmp=[];\r
- Insipid.Curtags = {} ;\r
- \r
- if (action == 'freq'){\r
- $prefs.set('cloud.sortby','tagscount');\r
- \r
- if (anchor_id){\r
- $id(anchor_id).removeAttribute('href');\r
- $id($utils.replace(''+anchor_id+'','_freq_','_alpha_')).setAttribute('href','#');\r
- $id($utils.replace(''+anchor_id+'','_freq_','_alpha_')).setAttribute('onclick','$mytags.do_sort(this.id,\'alpha\');return false;');\r
- } \r
- \r
- if ($prefs.get('cloud.sorttype') == 'asc'){\r
- keyArraytmp = keyArray.sort(function(a,b){return tags[a]-tags[b];});\r
- }\r
- else {\r
- keyArraytmp = keyArray.sort(function(a,b){return tags[b]-tags[a];}); \r
- }\r
- }\r
- else if (action == 'alpha'){\r
- $prefs.set('cloud.sortby','alphabetic');\r
- \r
- if (anchor_id){\r
- $id(anchor_id).removeAttribute('href');\r
- $id($utils.replace(''+anchor_id+'','_alpha_','_freq_')).setAttribute('href','#');\r
- $id($utils.replace(''+anchor_id+'','_alpha_','_freq_')).setAttribute('onclick','$mytags.do_sort(this.id,\'freq\');return false;');\r
- }\r
- \r
- if ($prefs.get('cloud.sorttype') == 'asc'){\r
- // keyArraytmp = keyArray.sort();\r
- keyArraytmp = keyArray;\r
- \r
- }\r
- else {\r
- keyArraytmp = keyArray.reverse(); \r
- }\r
- }\r
- else if (action == 'asc'){\r
- $prefs.set('cloud.sorttype','asc');\r
- \r
- if (anchor_id){\r
- $id(anchor_id).removeAttribute('href');\r
- $id($utils.replace(''+anchor_id+'','_asc_','_desc_')).setAttribute('href','#');\r
- $id($utils.replace(''+anchor_id+'','_asc_','_desc_')).setAttribute('onclick','$mytags.do_sort(this.id,\'desc\');return false;');\r
- }\r
- \r
- if ($prefs.get('cloud.sortby') == 'tagscount'){\r
- keyArraytmp = keyArray.sort(function(a,b){return tags[a]-tags[b];});\r
- }\r
- else {\r
- // keyArraytmp = keyArray.sort();\r
- keyArraytmp = keyArray;\r
- }\r
- }\r
- \r
- \r
- else if (action == 'desc'){\r
- $prefs.set('cloud.sorttype','desc');\r
- \r
- if (anchor_id){\r
- $id(anchor_id).removeAttribute('href');\r
- $id($utils.replace(''+anchor_id+'','_desc_','_asc_')).setAttribute('href','#');\r
- $id($utils.replace(''+anchor_id+'','_desc_','_asc_')).setAttribute('onclick','$mytags.do_sort(this.id,\'asc\');return false;');\r
- }\r
- \r
- if ($prefs.get('cloud.sortby') == 'tagscount'){\r
- keyArraytmp = keyArray.sort(function(a,b){return tags[b]-tags[a];}); \r
- }\r
- else {\r
- keyArraytmp = keyArray.reverse(); \r
- }\r
- }\r
- \r
- \r
- \r
- \r
- for (i=0;i<keyArraytmp.length;i++){\r
- Insipid.Curtags[''+keyArraytmp[i]+''] = tags[keyArraytmp[i]] ;\r
- }\r
- \r
- $id('qq').setAttribute('onkeyup','$id(\'inspd_cloud\').innerHTML = $cloud.g_draw(Insipid.Curtags,this.value)');\r
- $id('inspd_cloud').innerHTML = this.g_draw(Insipid.Curtags,$id('qq').value) ;\r
- \r
- \r
- \r
- \r
- },\r
- \r
- p_draw_cloud_header : function(){\r
- var strtxt = '';\r
- try {\r
- if ( document.location.href.match(Inspd_JSON_HOME_PAGE)){\r
- strtxt += '» Tags in this page :';\r
- }\r
- else if ($utils.qs('tag') == '' && !document.location.href.match(Inspd_JSON_CLOUD_PAGE) ){\r
- strtxt += '» Tags in this page :';\r
- }\r
- else if ($utils.qs('tag') !==''){\r
- if ($utils.qs('tag').match("\\+") && !document.location.href.match(Inspd_JSON_CLOUD_PAGE) ){\r
- strtxt += '» Tags in this page :';\r
- }\r
- else {\r
- strtxt += '» Tags related to \' '+$utils.qs('tag')+' \' :';\r
- }\r
- }\r
- }catch(e){}\r
- \r
- return strtxt ;\r
- }\r
- \r
- \r
-\r
-}\r
-\r
-\r
-var $posts = {\r
-\r
-\r
-\r
-\r
- // draw bookmarks routine, originally from del.icio.us JSON help and example page.\r
- g_draw : function(container,posts_obj){\r
- \r
- var ul = document.createElement('ul')\r
- ul.className = 'posts';\r
- \r
- var liheader = document.createElement('span')\r
- liheader.className = 'pagination';\r
- \r
- if (document.location.href.match(Inspd_JSON_STARS_PAGE)){\r
- liheader.innerHTML = $stars.show_header(posts_obj);\r
- }\r
- else if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- liheader.innerHTML = '';\r
- }\r
- else{\r
- liheader.innerHTML = this.draw_pagination(posts_obj);\r
- }\r
- \r
- ul.appendChild(liheader)\r
- \r
- for (var i=0, post; post = posts_obj[i]; i++) {\r
- var li = document.createElement('li');\r
- li.innerHTML = '<div id="menu_post">'+this.p_draw_datebox(post.dt,post.u,post.t,post.d,post.n)+'</div><div id="content_post">'+this.p_draw_link(post.u,post.d,post.t,post.n)+'</div>';\r
- ul.appendChild(li)\r
- }\r
- \r
- \r
- if (document.location.href.match(Inspd_JSON_STARS_PAGE)){\r
- \r
- var lifooter = document.createElement('span')\r
- lifooter.className = 'pagination';\r
- lifooter.innerHTML = '';\r
- //10, 25, 50, 100 items per page';\r
- ul.appendChild(lifooter)\r
- }\r
- else if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- }\r
- else if (typeof posts_obj[0] == 'undefined'){\r
- }\r
- else{\r
- var lifooter = document.createElement('span')\r
- lifooter.className = 'pagination';\r
- lifooter.innerHTML = liheader.innerHTML+'<br/> '+this.draw_footer();\r
- //10, 25, 50, 100 items per page';\r
- ul.appendChild(lifooter)\r
- }\r
- \r
- \r
- $id(container).innerHTML = '' ;\r
- $id(container).appendChild(ul)\r
- },\r
- \r
- \r
- p_draw_datebox : function(dt,url,tags,title,notes){\r
- return '<div class="post-cal-2"><span class="post-month-2">'+$$date.month(dt)+'</span><span class="post-date-2">'+$$date.day(dt)+'</span><span class="post-dateyear-2">'+$$date.year(dt)+'</span><span class="post-dateicon-2">'+this.p_draw_favico(url,tags,title,notes,dt)+'</span></div>';\r
- },\r
- \r
- \r
- p_draw_favico: function(url,tags,title,notes,dt){\r
- var favicotxt = '<div style="text-align:left;position:absolute;display:none;" id="span_pointer_'+hex_md5(url)+'"></div>'+\r
- '<span title="Bookmark\'s options" onclick="$posts.draw_blob_comment_box(\''+hex_md5(url)+'\',\''+$utils.encode(url)+'\',\''+$utils.encode(tags)+'\',\''+$utils.encode(title)+'\',\''+$utils.encode(notes)+'\',\''+$utils.encode(dt)+'\');"'+\r
- ' class="favico_span">';\r
- var linksrc = '' ;\r
- var defimgsrc = '';\r
- if ($prefs.get('bookmarks.showfavicon') == '1' && url.match('^http://') ){\r
- linksrc = ''+url.split('/').splice(0,3).join('/')+'/favicon.ico'+'';\r
- }\r
- if($conditions.getProtocol(url,'color')){\r
- defimgsrc +=''+Inspd_BASE_JSON_URL+'/images/inspd_color_swatch.png'\r
- }\r
- else{\r
- defimgsrc += ''+Inspd_BASE_JSON_URL+'/images/inspd_links2.png';\r
- }\r
- favicotxt +='<img id="favico_default_'+hex_md5(url)+'" width="16" height="16" src="'+defimgsrc+'" "/><img id="favico_'+hex_md5(url)+'" width="16" height="16" style="display:none;" onload="this.previousSibling.style.display=\'none\';this.removeAttribute(\'style\');" src="'+linksrc+'" /><img id="favico_edit_'+hex_md5(url)+'" style="display:none;position:absolute;right:8px;" src="'+Inspd_BASE_JSON_URL+'/images/inspd_edit.png" />'+\r
- '</span>';\r
- return favicotxt ;\r
- \r
- },\r
- \r
- p_draw_link: function(url,title,tags,notes){\r
- var linktxt = '';\r
- if($conditions.getProtocol(url,'color')){\r
- linktxt += ''+this.p_draw_link_color_protocol(url,title)+'';\r
- }else {\r
- linktxt +='<a href="'+url+'" class="a_posts" target="_blank" onfocus="this.blur();" >'+(''+(''+title+'').replace(/</,'<')+'').replace(/>/,'>')+'</a>';\r
- }\r
- linktxt += ''+this.p_draw_tags(tags,notes)+'';\r
- return linktxt ; \r
- \r
- },\r
- \r
- p_draw_link_color_protocol : function(url,title){\r
- colors = ((url.replace('color:','')).replace('#','')).split(',');\r
- var link_colortxt = '';\r
- link_colortxt += '<div class="a_posts_link_color_protocol_container">';\r
- for(var i = 0;i<colors.length;i++){\r
- if(colors[i]){\r
- link_colortxt += '<span title="click for copying #'+colors[i]+' to clipboard" onclick="Inspd_gClipboardHelper.copyString(\'#'+colors[i]+'\');self.status=\'#'+colors[i]+' was placed into your clipboard\'; " class="colorBar" style="background-color:#'+colors[i]+';"> </span> '; \r
- }\r
- }\r
- link_colortxt += ' '+title+'</div>';\r
- return link_colortxt ;\r
- \r
- },\r
- \r
- \r
- p_draw_tags : function(tags,notes){\r
- var notestxt = '';\r
- if(notes && notes != 'undefined'){\r
- notestxt +='<span class="post_notes">'+notes+'</span>';\r
- }\r
- var tagstxt = '';\r
- tagstxt +='<span class="post_tags">';\r
- \r
- if (tags){\r
- var array_tags = $utils.decode(tags);\r
- array_tags = array_tags.split(",");\r
- for (var j = 0, tag; tag = array_tags[j]; j++){\r
- tagstxt += ' <a onfocus="this.blur()" class="a_post_tags" href="'+Inspd_JSON_BOOKMARKS_PAGE+'?tag='+tag+'">'+tag+'</a> ';\r
- }\r
- }\r
- else if(!notes){\r
- tagstxt +=' ';\r
- }\r
- tagstxt +='</span>';\r
- return notestxt+tagstxt ;\r
- },\r
- \r
- \r
- \r
- \r
- \r
- \r
-\r
-\r
- \r
- \r
- g_draw_mini : function(container,posts_obj,classname){\r
- \r
- var ul = document.createElement('ul')\r
- ul.className = classname;\r
- \r
- var liheader = document.createElement('span')\r
- liheader.className = classname+'_pagination';\r
- \r
- /*\r
- if (document.location.href.match(Inspd_JSON_STARS_PAGE)){\r
- liheader.innerHTML = $stars.show_header(posts_obj);\r
- }\r
- else if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- liheader.innerHTML = '';\r
- }\r
- */\r
- if (typeof posts_obj[0] == 'undefined'){\r
- //$id('nav').style.display = 'none';\r
- liheader.innerHTML = '<span style="color:#ff0000;">'+$utils.decode($utils.replace(container,'maindragholder-content',''))+'</span> returned no results. Please choose another tag.</a>'\r
- }\r
- \r
- /*\r
- else{\r
- liheader.innerHTML = this.draw_pagination(posts_obj);\r
- }\r
- */\r
- ul.appendChild(liheader)\r
- \r
- for (var i=0, post; post = posts_obj[i]; i++) {\r
- \r
- var li = document.createElement('li');\r
- \r
- //li.className = 'posts';\r
- var a = document.createElement('a')\r
- // a.className = classname+'_a_posts'\r
- a.setAttribute('onfocus','this.blur();');\r
- a.setAttribute('target','_blank');\r
- if ($prefs.get('bookmarks.showfavicon') == '1'){\r
- a.style.marginLeft = '20px';\r
- \r
- \r
- var img = document.createElement('img');\r
- img.style.position = 'absolute';\r
- //img.setAttribute('align','absmiddle');\r
- img.style.paddingTop = '5px';\r
- img.style.display = 'none';\r
- img.height = img.width = 16;\r
- if (post.u.match('^http://')){\r
- img.src = post.u.split('/').splice(0,3).join('/')+'/favicon.ico';\r
- img.onload = $utils.showImage(img);\r
- li.appendChild(img);\r
- }\r
- }\r
- \r
- a.setAttribute('href', post.u);\r
- //a.setAttribute('title', post.dt);\r
- a.appendChild(document.createTextNode(post.d));\r
- \r
- if (post.n){\r
- var span_desc = document.createElement('span');\r
- span_desc.className = classname+'_notes' ;\r
- span_desc.innerHTML = ''+post.n+'';\r
- }\r
- \r
- \r
- var span_tags = document.createElement('span');\r
- span_tags.className = classname+'_tags' ;\r
- \r
- if (post.t){\r
- var array_tags = $utils.decode(post.t);\r
- array_tags = array_tags.split(",");\r
-\r
- \r
- var tagstxt = '';\r
- for (var j = 0, tags; tags = array_tags[j]; j++){\r
- tagstxt += ' <a onfocus="this.blur()" href="'+Inspd_JSON_BOOKMARKS_PAGE+'?tag='+tags+'">'+tags+'</a> ';\r
- }\r
- \r
- }\r
- \r
- //li.appendChild(img)\r
- li.appendChild(a)\r
- \r
- if (post.n){\r
- li.appendChild(span_desc);\r
- }\r
- \r
- //if (post.t){\r
- span_tags.innerHTML = tagstxt ;\r
- li.appendChild(span_tags) ;\r
- //}\r
- \r
- \r
- ul.appendChild(li)\r
- }\r
- \r
- \r
- if (document.location.href.match(Inspd_JSON_STARS_PAGE)){\r
- }\r
- else if (document.location.href.match(Inspd_JSON_CLOUD_PAGE)){\r
- }\r
- \r
- else if (typeof posts_obj[0] == 'undefined'){\r
- \r
- }\r
- \r
- else{\r
- var lifooter = document.createElement('span')\r
- lifooter.className = 'pagination';\r
- lifooter.innerHTML = liheader.innerHTML+'<br/> '+this.draw_footer();\r
- \r
- \r
- ul.appendChild(lifooter)\r
- }\r
- \r
- \r
- $id(container).innerHTML = '' ;\r
- $id(container).appendChild(ul)\r
- },\r
-\r
- \r
- \r
- draw_blob_comment_box : function(urlmd5,url,tags,title,notes,dt){\r
- \r
- if($id('favico_edit_'+(urlmd5)+'').style.display == 'none'){$id('favico_edit_'+(urlmd5)+'').style.display = 'inline';}else{$id('favico_edit_'+(urlmd5)+'').style.display = 'none';}\r
- var strtxt = '<div class="blob_comment_box_div">';\r
- strtxt += '<a onfocus="this.blur();" target="_blank" title="Edit this bookmark" href="'+$prefs.get('defurl')+'?op=add_bookmark&url='+(url)+'"><img width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_edit2.png" /></a>'+\r
- //'<a onfocus="this.blur();" title="Star this bookmark" href="#"><img width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_star_off.png" /></a>'+\r
- ''+this.p_draw_star_icon(urlmd5,url,tags,title,notes,dt)+''+\r
- //'<a onfocus="this.blur();" target="_blank" title="Find similar links in similicio.us" href="http://similicio.us/search.php?url='+url+'"><img width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_similar.png" /></a>'+\r
- '<a onfocus="this.blur();" target="_blank" title="URL history on del.icio.us" href="http://del.icio.us/url/'+urlmd5+'"><img width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_delicious_history.png" /></a>'+\r
- '';\r
- strtxt += '</div>';\r
- $id('span_pointer_'+urlmd5+'').innerHTML = strtxt ;\r
- $effects.toggleShow('span_pointer_'+urlmd5+'',true);\r
- \r
- },\r
- \r
- p_draw_star_icon : function(urlmd5,url,tags,title,notes,dt){\r
- var startxt = ''\r
- startxt += '<img style="cursor:pointer;" title="Star this bookmark" onclick="$stars.add(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');return false;" width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_star_off.png" />'; \r
- var CurStarsArray = $prefs.get('stars.list').split("|");\r
- for(var i = 0 ; i<CurStarsArray.length;i++){\r
- var CurStarArray = CurStarsArray[i].split(" "); \r
- if(CurStarArray[0] == urlmd5){\r
- startxt = '<img style="cursor:pointer;" title="Unstar this bookmark" onclick="$stars.remove(this,\''+urlmd5+'\',\''+url+'\',\''+tags+'\',\''+title+'\',\''+notes+'\',\''+dt+'\');return false;" width="16" height="16" src="'+Inspd_BASE_JSON_URL+'/images/inspd_star_on.png" />'; \r
- break;\r
- }\r
- }\r
- return startxt;\r
- \r
- },\r
- \r
- \r
- \r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
- \r
- \r
- \r
- draw_footer : function(){\r
- var rangeitemspp = [5,10,15,25,50,80,100] ;\r
- var footer_txt = '<br/>» Showing ';\r
- for (itemspp in rangeitemspp){\r
- if (rangeitemspp[itemspp] == parseInt($prefs.get('defcount'))){\r
- footer_txt +=' '+rangeitemspp[itemspp]+',';\r
- }\r
- else {\r
- footer_txt +=' <a href="?setcount='+rangeitemspp[itemspp]+''+qs_tag+'">'+rangeitemspp[itemspp]+'</a>,';\r
- \r
- }\r
- \r
- }\r
- footer_txt = $utils.replace(footer_txt,',$','');\r
- footer_txt = $utils.replace(footer_txt,',',', ');\r
- footer_txt +=' items per page.';\r
- return footer_txt ;\r
- },\r
- \r
- draw_pagination : function(obj){\r
- var headertxt = 'Page '+qs_page+' ';\r
- if (qs_tag != ''){\r
- // 'tag is not zero '\r
- if (typeof obj[parseInt($prefs.get('defcount'))-1] == 'undefined' || backfromlast == true ){\r
- backfromlast = false;\r
- if (qs_page == 1){\r
- headertxt += '<a>« earlier</a> | <a>later »</a>';\r
- }\r
- else{\r
- headertxt += '<a>« earlier</a> | <a href="?page='+(qs_page-1)+''+qs_tag+'" onclick="$home.draw_posts_inline('+(qs_page-1)+',\''+$utils.encode(qs_tag)+'\');return false;">later »</a>'; \r
- }\r
- } \r
- \r
- else{\r
- \r
- if (qs_page == 1){\r
- headertxt += '<a onclick="$home.draw_posts_inline('+(qs_page+1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page+1)+''+qs_tag+'">« earlier</a> | <a>later »</a>';\r
- }\r
- else{\r
- headertxt += '<a onclick="$home.draw_posts_inline('+(qs_page+1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page+1)+''+qs_tag+'">« earlier</a> | <a onclick="$home.draw_posts_inline('+(qs_page-1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page-1)+''+qs_tag+'">later »</a>'; \r
- headertxt +='<span> » pages so far: </span>';\r
- for (var i=1;i<(qs_page);i++){\r
- headertxt +='<a onclick="$home.draw_posts_inline('+(i)+',\''+$utils.encode(qs_tag)+'\');return false;" title="page '+i+'" href="?page='+(i)+''+qs_tag+'">'+i+'</a> '\r
- }\r
- }\r
- \r
- \r
- }\r
- \r
- }\r
- \r
- else {\r
- // tag is zero i.e. we are in home page ;\r
- if (qs_page == 1){\r
- headertxt += '<a onclick="$home.draw_posts_inline('+(qs_page+1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page+1)+'">« earlier</a> | <a class="gray">later »</a>';\r
- }\r
- else{\r
- \r
- if (typeof obj[parseInt($prefs.get('defcount'))-1] !== 'undefined'){\r
- headertxt += '<a onclick="$home.draw_posts_inline('+(qs_page+1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page+1)+'">« earlier</a> | <a onclick="$home.draw_posts_inline('+(qs_page-1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page-1)+'">later »</a>'; \r
- headertxt +='<span> » pages so far: </span>';\r
- for (var i=1;i<(qs_page);i++){\r
- headertxt +='<a onclick="$home.draw_posts_inline('+(i)+',\''+$utils.encode(qs_tag)+'\');return false;" title="page '+i+'" href="?page='+(i)+'">'+i+'</a> '\r
- }\r
- }\r
- else {\r
- headertxt += '<a>« earlier</a> | <a onclick="$home.draw_posts_inline('+(qs_page-1)+',\''+$utils.encode(qs_tag)+'\');return false;" href="?page='+(qs_page-1)+'">later »</a>'; \r
- \r
- }\r
- }\r
- \r
- }\r
- return headertxt ;\r
- \r
- }\r
-\r
-\r
-\r
-\r
-\r
-}\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
-<title>My bookmarks</title>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/md5.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/inspd_json_lib.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/home.js"></script>\r
-<link rel="stylesheet" type="text/css" href="chrome://inspd/content/v2/json/style.css">\r
-<link rel="shortcut icon" href="chrome://inspd/content/v2/json/images/inspd_icon5_mybookmarks_1616.png" />\r
-</head>\r
-\r
-<body>\r
- <h1 id="header"><img src="images/inspd_links.png" align="absmiddle" style="margin-right:5px;"/>My Bookmarks</h1>\r
- <div id="cont">\r
- <div id="nav">\r
- <div id="inspd_cloud_mini_header" class="inspd_cloud_mini_header" style="display:block;visibility:hidden;">\r
- » Search tags inline: <input size="11" name="qq" id="qq" type="text" onkeyup="$id('inspd_cloud').innerHTML = $cloud.g_draw(Insipid.tags,this.value)" />\r
- </div>\r
- \r
- <span><ul id="inspd_cloud" class="inspd_cloud_mini">\r
- <li style="font-size: 20px;">Loading your tags...</li>\r
- </ul>\r
- </span>\r
- \r
- </div>\r
- \r
- <span id="contposts"><div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Loading your bookmarks...</div></span>\r
- \r
- </div>\r
- \r
-\r
- \r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
-<title>My Stars</title>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/md5.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/inspd_json_lib.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/mystars.js"></script>\r
-<link rel="stylesheet" type="text/css" href="chrome://inspd/content/v2/json/style.css">\r
-<link rel="shortcut icon" href="chrome://inspd/content/v2/json/images/inspd_icon8_mystars_icon_1616.png" />\r
-</head>\r
-<body>\r
- <h1 id="header"><img src="images/inspd_star_gold.png" align="absmiddle" style="margin-right:5px;"/>My Stars</h1>\r
- <div id="cont">\r
- <div id="nav">\r
- <div id="inspd_cloud_mini_header" class="inspd_cloud_mini_header" style="display:block;visibility:hidden;">\r
- » Search tags inline: <input size="11" name="qq" id="qq" type="text" onkeyup="$id('inspd_cloud').innerHTML = $cloud.g_draw(Insipid.tags,this.value)" />\r
- </div>\r
- <span><ul id="inspd_cloud" class="inspd_cloud_mini">\r
- <li style="font-size: 20px;">Loading your tags...</li>\r
- </ul>\r
- </span>\r
- </div>\r
- \r
- <span id="contposts"><div style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif ;">Loading your stars...</div></span>\r
-\r
- </div> \r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-var $mystars = {\r
- \r
- extract_stars : function(){\r
- var stars = $prefs.get('stars.list').split('|');\r
- var CurStars = [];\r
- if (!stars[0]){\r
- $id('contposts').innerHTML = '<span class="pagination">'+$stars.show_header(stars[0])+'</span>';\r
- }\r
- else { \r
- if(!stars[(stars.length)]){stars.length = stars.length-1}\r
- for(var i = 0; i<stars.length;i++){\r
- CurStars[i] = {\r
- 'u': $utils.decode(stars[i].split(" ")[1]),\r
- 'd': $utils.decode(stars[i].split(" ")[2]),\r
- 't': $utils.decode(stars[i].split(" ")[3]).split(","),\r
- 'n': $utils.decode(stars[i].split(" ")[4]), \r
- 'dt' : $utils.decode(stars[i].split(" ")[5]),\r
- };\r
- }\r
- $id('contposts').innerHTML = '';\r
- $id('inspd_cloud_mini_header').style.visibility = 'visible';\r
- $cloud.extract_tags_from_posts('inspd_cloud', CurStars);\r
- $posts.g_draw('contposts',CurStars);\r
- }\r
- \r
- },\r
- \r
- pageLoad: function(){\r
- this.extract_stars();\r
- }\r
- \r
-}\r
-\r
-\r
- \r
- \r
-$utils.addEvent('DOMContentLoaded', window, function() { $mystars.pageLoad(); }, false);\r
-\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
-<title>My tags</title>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/vars.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/md5.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/inc/globals.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/inspd_json_lib.js"></script>\r
-<script type="text/javascript" src="chrome://inspd/content/v2/json/mytags.js"></script>\r
-<link rel="stylesheet" type="text/css" href="chrome://inspd/content/v2/json/style.css">\r
-<link rel="shortcut icon" href="chrome://inspd/content/v2/json/images/inspd_icon3_mytagcloud_1616.png" />\r
-</head>\r
-\r
-<body>\r
- <h1 id="header"><img src="images/inspd_icon3_mytagcloud_html_icon_1616.png" align="absmiddle" style="margin-right:5px;"/> My tags</h1>\r
- <div id="cont">\r
- <div id="nav" style="display:none;">\r
- <div id ="cloud_header_div_searchbar" class="cloud_header_div_searchbar"></div>\r
- <span id="navtags"></span>\r
- </div>\r
- \r
- <div class="inspd_tags">\r
- \r
- <span class="tags_search" id="tags_search" style="display:block;visibility:hidden;">\r
- » Search tags inline: <input size="11" name="qq" id="qq" type="text" onkeyup="$id('inspd_cloud').innerHTML = $cloud.g_draw(Insipid.tags,this.value)" />\r
- <a onfocus="this.blur();" href="#" id="anchor_show_options" onclick="$mytags.showOptionsDiv('nav',this.id);return false;">» Show options</a>\r
- </span>\r
- \r
- <ul id="inspd_cloud" class="inspd_cloud">\r
- <li style="font-size: 20px;">Loading your tags...</li>\r
- </ul>\r
- \r
- </div>\r
- \r
- </div>\r
- \r
-\r
-\r
- \r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-var dragswitch=0 ;\r
-document.onmouseup=new Function("dragapproved=false")\r
-\r
-var $mytags = {\r
-\r
- pageLoad : function(){\r
- \r
- if ($utils.qs('tag') != ''){\r
- document.title = document.title+' ['+$utils.decode($utils.qs('tag'))+']';\r
- $id('header').innerHTML = $id('header').innerHTML+' ['+$utils.decode($utils.qs('tag'))+']';\r
- }\r
- \r
- $ajax.get(''+$prefs.get('defurl')+'?raw=1&op=json_tags'+qs_tag+'&d='+new Date().valueOf()+'', this.getTags);\r
- \r
- },\r
- \r
- getTags : function(http_request){\r
- if (http_request.readyState == 4) {\r
- try{\r
- if (http_request.status == 200) {\r
- if (http_request.responseText.match("^{}")){\r
- $id('inspd_cloud').innerHTML = '<li style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">'+$utils.decode($utils.qs('tag'))+'</span> returned no results. <a href="'+Inspd_JSON_HOME_PAGE+'">Return to Home</a>.</li>';\r
- }\r
- else {\r
- $id('tags_search').style.visibility = 'visible';\r
- eval("Insipid.tags = "+http_request.responseText);\r
- if ($prefs.get('cloud.sortby') == 'alphabetic'){\r
- $mytags.do_sort('','alpha'); \r
- }\r
- else {\r
- $mytags.do_sort('','freq'); \r
- }\r
- \r
- \r
- }\r
- } \r
- else {\r
- $id('tags_search').style.visibility = 'hidden';\r
- $id('inspd_cloud').innerHTML = '<li style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</li>';\r
- }\r
- \r
- }\r
- catch(e){\r
- $id('tags_search').style.visibility = 'hidden';\r
- $id('inspd_cloud').innerHTML = '<li style="font-size: 20px;padding:30px 8px 8px 8px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</li>';\r
-\r
- }\r
- }\r
- },\r
- \r
- \r
- \r
- showBlob : function(container,e,count){\r
- \r
- $effects.pos2Anchor(container,e);\r
- var t = $utils.decode($utils.replace(container,'maindragholder','')) ;\r
- \r
- var strtxt = '';\r
- strtxt +='<div id="'+container+'-dragbar" class="tooltip_dragbar" onmousedown="$effects.initializedrag(event,\''+container+'\',\''+container+'-dragbar\');">'+\r
- '<span class="span_dragbar_title">'+t+' - Last 10 posts:</span><span class="span_closex">'+\r
- '<a href="#" title="close this box" onfocus="this.blur();" onclick="$effects.show(\''+container+'\',false);return false;">'+\r
- '<img align="absmiddle" src="images/cancel.png" border="0"/></a>'+\r
- '</span>'+\r
- '</div>'+\r
- '<div class="span_drag_content" id="'+container+'-content"><i>Loading your bookmarks...</i></div>'\r
- $id(container).innerHTML = strtxt ;\r
- $effects.show(container,true); \r
- this.getPosts_in_Blob(container,t);\r
- \r
- \r
- \r
- \r
- },\r
- \r
- \r
- getPosts_in_Blob: function(container,t){\r
- var url = ''+$prefs.get('defurl')+'?raw=1&op=json_posts&count=10&page='+qs_page+'&tag='+t+'&d='+new Date().valueOf()+'';\r
- var http_request = new XMLHttpRequest();\r
- http_request.onreadystatechange = function() { \r
- \r
- if (http_request.readyState == 4) {\r
- try{\r
- if (http_request.status == 200) {\r
- eval("Insipid.posts ="+http_request.responseText);\r
- $posts.g_draw_mini(''+container+'-content',Insipid.posts,'mini_posts');\r
- } \r
- else {\r
- // error\r
- $id(''+container+'-content').innerHTML = '<div style="font-size: 20px;padding:5px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- }\r
- }\r
- catch(e){\r
- $id(''+container+'-content').innerHTML = '<div style="font-size: 20px;padding:5px;font-family: verdana,arial,sans-serif;"><span style="color:#ff0000">Connection error!</span> Please try again.</div>';\r
- }\r
- }\r
- };\r
- \r
- http_request.open('GET', url, true);\r
- http_request.setRequestHeader("Connection", "close");\r
- http_request.setRequestHeader("Keep-Alive", "");\r
- http_request.send(null);\r
- \r
- \r
- \r
- },\r
- \r
- showOptionsDiv : function(container,anchor){\r
- \r
- if ($id(container).style.display == 'none'){\r
- $id(container).style.display = 'block' ; \r
- $id(anchor).innerHTML = '« Hide options' ;\r
- }\r
- else {\r
- $id(container).style.display = 'none' ; \r
- $id(anchor).innerHTML = '» Show options' ;\r
- }\r
- $id(container).innerHTML = this.private_showOptions();\r
- },\r
- \r
- \r
- private_showOptions : function(){\r
- \r
- var strtxt = '';\r
- \r
- strtxt = ''+\r
- '<span class="cloud_options_span">» Sort by: '+\r
- '';\r
- \r
- if ($prefs.get('cloud.sortby') == 'alphabetic'){\r
- \r
- strtxt +='<a onfocus="this.blur();" id="cloud_options_sort_alpha_anchor">alpha</a> | <a onfocus="this.blur();" href="#" id="cloud_options_sort_freq_anchor" onclick="$mytags.do_sort(this.id,\'freq\');return false;">freq</a> ';\r
- }\r
- else {\r
- \r
- strtxt +='<a onfocus="this.blur();" href="#" id="cloud_options_sort_alpha_anchor" onclick="$mytags.do_sort(this.id,\'alpha\');return false;">alpha</a> | <a onfocus="this.blur();" id="cloud_options_sort_freq_anchor">freq</a> ';\r
- \r
- }\r
- \r
- \r
- \r
- strtxt += '<br/>» Sort type: ';\r
- \r
- if ($prefs.get('cloud.sorttype') == 'asc'){\r
- \r
- strtxt +='<a onfocus="this.blur();" id="cloud_options_sort_asc_anchor">asc</a> | <a onfocus="this.blur();" id="cloud_options_sort_desc_anchor" onclick="$mytags.do_sort(this.id,\'desc\');return false;" href="#">desc<a>';\r
- }\r
- else {\r
- strtxt +='<a onfocus="this.blur();" id="cloud_options_sort_asc_anchor" onclick="$mytags.do_sort(this.id,\'asc\');return false;" href="#">asc</a> | <a onfocus="this.blur();" id="cloud_options_sort_desc_anchor">desc<a>';\r
- \r
- \r
- }\r
- \r
- \r
- \r
- // use minimum: 1, 2, 5 \r
- \r
- strtxt +='<br/>' +\r
- '» Use minimum tags: ';\r
- \r
- var range_min_tags = [1,2,5,10] ;\r
- for (mintag in range_min_tags){\r
- if (range_min_tags[mintag] == parseInt($prefs.get('cloud.mintag'))){\r
- strtxt +=' <a onfocus="this.blur();" id="cloud_options_mintag_anchor_'+range_min_tags[mintag]+'">'+range_min_tags[mintag]+'</a> ';\r
- }\r
- else {\r
- strtxt +=' <a onfocus="this.blur();" id="cloud_options_mintag_anchor_'+range_min_tags[mintag]+'" '\r
- +'href="#" onclick="$prefs.set(\'cloud.mintag\',\''+range_min_tags[mintag]+'\');$id(\'inspd_cloud\').innerHTML = $cloud.g_draw(Insipid.Curtags,$id(\'qq\').value); $mytags.showOptionsDiv(\'nav\',this.id);$mytags.showOptionsDiv(\'nav\',this.id);return false;">'+range_min_tags[mintag]+'</a> ';\r
- }\r
- \r
- }\r
- \r
- strtxt += '<br/>' +\r
- '» Font <small>(px)</small>: min: <input maxlength="2" onkeyup="$mytags.do_options(\'minfont\',this.value)" value="'+$prefs.get('cloud.minfont')+'" size="1" type="text"> max: <input maxlength="2" onkeyup="$mytags.do_options(\'maxfont\',this.value)" value="'+$prefs.get('cloud.maxfont')+'" size="1" type="text">'+\r
- '<br/>' +\r
- '» Color <small>(hex)</small>: min: <input maxlength="7" value="#'+$prefs.get('cloud.mincolor')+'" onkeyup="$mytags.do_options(\'mincolor\',this.value)" size="6" type="text"> max: <input maxlength="7" onkeyup="$mytags.do_options(\'maxcolor\',this.value)" value="#'+$prefs.get('cloud.maxcolor')+'" size="6" type="text">'+\r
- '<br/>'+\r
- '» Counts: '+\r
- \r
- '';\r
- \r
- if ($prefs.get('cloud.showcounts') == '1'){\r
- strtxt +='<a onfocus="this.blur();" id="cloud_options_counts_show_anchor">show</a> | <a href="#" onfocus="this.blur();" onclick="$prefs.set(\'cloud.showcounts\',\'0\');$id(\'inspd_cloud\').innerHTML = $cloud.g_draw(Insipid.Curtags,$id(\'qq\').value); $mytags.showOptionsDiv(\'nav\',this.id);$mytags.showOptionsDiv(\'nav\',this.id);return false;" id="cloud_options_counts_hide_anchor">hide</a>'+\r
- '';\r
- }\r
- else {\r
- strtxt +='<a href="#" onfocus="this.blur();" onclick="$prefs.set(\'cloud.showcounts\',\'1\');$id(\'inspd_cloud\').innerHTML = $cloud.g_draw(Insipid.Curtags,$id(\'qq\').value); $mytags.showOptionsDiv(\'nav\',this.id);$mytags.showOptionsDiv(\'nav\',this.id);return false;" id="cloud_options_counts_show_anchor">show</a> | <a onfocus="this.blur();" id="cloud_options_counts_hide_anchor">hide</a>'+\r
- '';\r
- }\r
-\r
-\r
- \r
-\r
- \r
- strtxt +='</span>'+\r
- '';\r
- \r
- \r
- \r
- return strtxt ;\r
- \r
- },\r
- \r
- do_sort : function(anchor_id,action){\r
- var tags = Insipid.tags ;\r
- var keyArray = new Array();\r
- var i = 0 ; \r
- for (t in tags){\r
- keyArray[i] = t;\r
- i++;\r
- }\r
- $cloud.p_sort(keyArray, tags, action,anchor_id);\r
- },\r
- \r
- do_options : function (action,act_val){\r
- act_val = $utils.replace(''+act_val+'','#','')\r
- $prefs.set('cloud.'+action+'',''+act_val+'');\r
- \r
- if ($prefs.get('cloud.sortby') == 'alphabetic'){\r
- $mytags.do_sort('','alpha'); \r
- }\r
- else {\r
- $mytags.do_sort('','freq'); \r
- }\r
- } \r
- \r
- \r
- \r
-}\r
-\r
-\r
-$utils.addEvent('DOMContentLoaded', window, function() { $mytags.pageLoad(); }, false);\r
-\r
-\r
+++ /dev/null
-html { \r
- padding:0px;\r
- margin:0px;\r
-}\r
-\r
-body {\r
- background-color: #f9f9f9 ;\r
- padding:5px 40px 500px 40px;\r
- margin:0px;\r
- \r
-}\r
-\r
-p {\r
- margin: 0px;\r
- padding: 5px;\r
-} \r
- \r
-#header {\r
- font-size: 70%;\r
- width: 100%;\r
- text-align: left;\r
- color: #000;\r
- background-color: #cccccc;\r
- margin: 0px;\r
- padding: 5px 10px;\r
- -moz-box-sizing:border-box ;\r
- -moz-border-radius:12px 12px 0px 0px ;\r
- font-family: verdana,arial,sans-serif ;\r
- \r
-}\r
-\r
-\r
-#cont {\r
- border:0px solid #cccccc; \r
- border-top: 0px solid #fff;\r
- background-color:#fff;\r
-}\r
-\r
-#cont #nav {\r
- border-left:1px dotted #800000; \r
- border-bottom:1px dotted #800000;\r
- float:right;\r
- width:350px;\r
- background-color:#eeeeee;\r
- margin:0px 0px 5px 5px;\r
- padding: 0px 5px 0px 5px;\r
-}\r
-\r
-\r
-.tags_search {\r
- background-color: #fff ;\r
- padding: 4px 0px;\r
- font-size: 70%;\r
- color: #666666 ;\r
- \r
-\r
-}\r
-\r
-#inspd_cloud_mini_header{\r
- \r
- font-size: 70%;\r
- color: #666666 ;\r
-}\r
-\r
-\r
-.cloud_options_span{\r
- font-family: verdana,arial,sans-serif ;\r
- font-size: 85%;\r
- padding: 4px;\r
- display: block;\r
- line-height: 2;\r
- \r
-}\r
-\r
-\r
-.inspd_tags{\r
- font-family: verdana,arial,sans-serif ;\r
- padding: 0px 5px 5px 5px;\r
-}\r
-\r
-.inspd_tags a img{\r
- border:0;\r
- display:inline;\r
- margin:0 0 0 3px;\r
- padding:0;\r
-}\r
-\r
-.inspd_tags a{\r
- text-decoration:none;\r
-}\r
-\r
-.inspd_tags a:hover{\r
- text-decoration:underline;\r
-}\r
-\r
-.inspd_tags ul{\r
- list-style-type:none;\r
- margin:0;\r
- padding:0;\r
- text-align:justify;\r
-}\r
-\r
-.inspd_cloud{\r
-text-align:justify;\r
-}\r
-\r
-.inspd_cloud li{\r
- display:inline;\r
- background-image:none !important;\r
- padding:2px;\r
- padding-left: 0px;\r
- margin:0;\r
-\r
-}\r
-\r
-.inspd_cloud .inspd_tag-count{\r
- padding-left:0.2em;\r
- font-size:20px ;\r
-}\r
-\r
-.inspd_cloud li:before{\r
- content:"" !important\r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-.inspd_cloud_mini li{\r
- font-family: verdana,arial,sans-serif ;\r
- display:inline;\r
- background-image:none !important;\r
- padding:2px;\r
- margin:0;\r
-\r
-}\r
-\r
-.inspd_cloud_mini {\r
- list-style-type:none;\r
- margin:0;\r
- padding:5px 8px 8px 8px;\r
- text-align:justify;\r
- \r
-}\r
-\r
-.inspd_cloud_mini li:before{\r
- content:"" !important\r
-}\r
-\r
-\r
-\r
-.inspd_cloud_mini a img{\r
- border:0;\r
- display:inline;\r
- margin:0 0 0 3px;\r
- padding:0;\r
-}\r
-\r
-.inspd_cloud_mini a{\r
- text-decoration:none;\r
-}\r
-\r
-.inspd_cloud_mini a:hover{\r
- text-decoration:underline;\r
-}\r
-\r
-.inspd_cloud_mini_header{\r
- font-family: verdana,arial,sans-serif ;\r
- font-size: 90%;\r
- margin:0;\r
- padding:5px 8px 0px 8px;\r
- text-align:left;\r
- \r
- \r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-.tooltip_dragbar {\r
- cursor:move;\r
- width:350px;\r
- background-color:#e2e2e2;\r
- padding-top: 8px;\r
- padding-bottom: 8px;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 0px 0px ;\r
- border: 1px solid #cccccc;\r
-}\r
-\r
-.span_closex {\r
- top:8px;\r
- padding:0px;\r
- margin:0px;\r
- float:right;\r
- right:8px;\r
- position:absolute;\r
-}\r
-\r
-.span_dragbar_title{\r
- padding-left:8px;\r
- font-family:verdana;\r
- font-size: 13px;\r
- color: #880000;\r
-}\r
-\r
-.span_drag_content{\r
- background-color: #ffffff;\r
- padding-left: 8px;\r
- padding-right: 8px;\r
- padding-bottom: 5px;\r
- padding-top: 5px; \r
- border-left:1px solid #cccccc; \r
- border-right:1px solid #cccccc; \r
- border-bottom:1px solid #cccccc;\r
- margin-bottom: 90px;\r
- \r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
-/* Start mini posts */\r
-.mini_posts li { \r
- display:block; \r
- text-align: left; \r
- background-color: #fff; \r
- border: 1px dotted #800000; \r
- border-width: 1px 0; \r
- margin: 5px 0; \r
- padding: 5px 0;\r
-}\r
-\r
-.mini_posts ul { \r
- background-color: #fff; \r
- margin: 5px 0; \r
- /* padding: 5px 0; */\r
- list-style-type: none; \r
- padding: 0 0 0.75em 0;\r
-}\r
-\r
-.mini_posts a { \r
- display: block;\r
- font: bold 100% arial, sans-serif;\r
- padding: 5px; \r
- text-decoration: none;\r
-}\r
-.mini_posts a:link { \r
- text-decoration: none;\r
- color: #00f;\r
-}\r
-\r
-.mini_posts a:visited {\r
- text-decoration: none;\r
- color: #639;\r
-}\r
- \r
-.mini_posts a:hover { \r
- text-decoration: underline;\r
- background: #eeeeee;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 8px 8px ;\r
-}\r
-.mini_posts a:active { \r
- text-decoration: underline; \r
-}\r
-\r
-\r
-.mini_posts_tags {\r
- margin-left: 15px;\r
- display: block ;\r
- font: bold 100% arial, sans-serif;\r
- text-decoration: none;\r
- padding: 5px;\r
- text-align: justify ;\r
-}\r
-\r
-\r
-.mini_posts_tags a:link { \r
- text-decoration: none;\r
- color: #9999FF;\r
- padding: 5px;\r
- display: inline;\r
-}\r
- \r
-.mini_posts_tags a:visited {\r
- text-decoration: none;\r
- color: #639;\r
-}\r
- \r
-.mini_posts_tags a:hover { \r
- text-decoration: underline;\r
- background: #FFEAEA;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 8px 8px ;\r
-}\r
-\r
-.mini_posts_tags a:active { \r
- text-decoration: underline; \r
-}\r
-\r
-.mini_posts_notes {\r
- margin-left: 20px;\r
- color: #666666;\r
- display: block; \r
- font: normal 90% Verdana, arial, sans-serif;\r
- padding: 5px; \r
-}\r
-\r
-/* End mini posts */\r
-\r
-\r
-\r
-\r
-.posts { list-style-type: none; padding: 0 0 0.75em 0; display:inline;}\r
-.posts li { background-color: #fff; border: 1px dotted #800000; border-width: 1px 0; margin: 5px; padding: 8px;}\r
-.posts ul { background-color: #fff; margin: 5px 0; padding: 5px 0;}\r
-\r
-\r
-.pagination{\r
- color: #666666;\r
- display: block; \r
- font: normal 80% arial, sans-serif;\r
- padding: 5px 5px 5px 8px; \r
- text-decoration: none;\r
-}\r
-\r
-\r
-.pagination a:link { \r
- text-decoration: none;\r
- color: #00f;\r
-}\r
- \r
-.a_posts { \r
- display:block;\r
- font: bold 100% arial, sans-serif;\r
- padding: 5px; \r
- text-decoration: none;\r
- \r
-}\r
-.a_posts:link { \r
- text-decoration: none;\r
- color: #00f;\r
-}\r
- \r
-.a_posts:visited {\r
- text-decoration: none;\r
- color: #639;\r
-}\r
- \r
-.a_posts:hover { \r
- text-decoration: underline;\r
- background: #eeeeee;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 8px 8px ;\r
- \r
-}\r
-.a_posts:active { \r
- text-decoration: underline; \r
-}\r
-\r
-\r
-.post_notes {\r
- margin-left: 5px;\r
- color: #666666;\r
- display: block; \r
- font: normal 90% Verdana, arial, sans-serif;\r
- padding: 5px; \r
- \r
-}\r
-\r
-.post_tags {\r
- display: block ;\r
- font: bold 100% arial, sans-serif;\r
- text-decoration: none;\r
- padding: 5px;\r
- padding-left:0px;\r
- margin-top:1px;\r
- line-height:1.5;\r
-}\r
-\r
-\r
-.a_post_tags:link { \r
- text-decoration: none;\r
- color: #9999FF;\r
- padding: 5px;\r
-}\r
- \r
-.a_post_tags:visited {\r
- text-decoration: none;\r
- color: #639;\r
-}\r
- \r
-.a_post_tags:hover { \r
- text-decoration: underline;\r
- background: #FFEAEA;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 8px 8px ;\r
-}\r
-.a_post_tags:active { \r
- text-decoration: underline; \r
-}\r
-\r
-\r
-\r
-.post-cal-2 {\r
- text-align: center;\r
- float:left; \r
- font-family: Arial, Helvetica, sans-serif;\r
- border:1px outset #bbb;\r
- padding: 0 ;\r
-}\r
-.post-month-2 {\r
- font-size: .6em;\r
- margin:0; \r
- padding:0 2px;\r
- /*padding-bottom:4px;*/\r
- /*background:#fed url(images/cal-triangle.png) center bottom repeat-x;\r
- */\r
- \r
- display: block;\r
- background: #eeeeee;\r
- }\r
- \r
-.post-date-2 { \r
- font-size:0.7em;\r
- margin:0; \r
- padding:0 2px;\r
- background:#ffffff; \r
- display: block;\r
- font-weight: bold;\r
- \r
-}\r
-\r
-.post-dateyear-2 { \r
- font-size:.6em;\r
- margin:0; \r
- padding:0 2px;\r
- background:#eeeeee; \r
- display: block;\r
- \r
-}\r
-\r
-\r
-.post-dateicon-2 { \r
- font-size:.6em;\r
- margin:0; \r
- padding:3px 2px;\r
- background:#ffffff; \r
- display: block;\r
- \r
-}\r
-\r
-\r
-#menu_post {\r
- position: absolute;\r
- width: 30px;\r
- margin:2px 0px 0px 0px;\r
- padding:0px;\r
- \r
-\r
-}\r
-\r
-\r
-#content_post {\r
- margin-left: 35px;\r
- background-color:#fff;\r
-} \r
-\r
-\r
-\r
-.favico_span{\r
-cursor: pointer ;\r
-\r
-}\r
-\r
-.favico_span:hover{\r
-\r
-}\r
-\r
-.blob_comment_box_div{\r
- background-color:#FFFFCC;\r
- padding:1px 0px 1px 3px; \r
- border:4px solid #FFFF9D;\r
- width:93px;\r
- margin-left:29px;\r
- -moz-box-sizing:border-box;\r
- -moz-border-radius:8px 8px 8px 8px ;\r
-}\r
-\r
-\r
-.blob_comment_box_div img{\r
- margin-right: 3px;\r
- padding: 3px;\r
- border: 1px dotted #FFFFCC;\r
- \r
-}\r
-\r
-.blob_comment_box_div img:hover{\r
- background-color:#ffffff;\r
- border: 1px solid #800000;\r
- \r
-}\r
-\r
-\r
-\r
-.colorBar { font-size: 132%; padding: 0px 1em; cursor:pointer; border: 1px solid #ffffff;}\r
-.colorBar:hover{border: 1px solid #0000FF;}\r
-\r
-.a_posts_link_color_protocol_container {\r
- font: normal 100% arial, sans-serif;\r
- color: #8B2500;\r
- padding: 5px; \r
-}\r
-\r
-\r
-\r
-\r
-\r
-\r
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\r
-\r
-\r
-#inspd-searchbar-container{\r
-/* */\r
-}\r
-\r
-#inspd-searchbar-textbox {\r
- min-width: 40px;\r
- width: 80px;\r
- min-height: 24px;\r
- margin-right: 0px;\r
- margin-left: 1px;\r
-}\r
-\r
-\r
-#inspd-searchbar-dropdown {\r
- list-style-image: url("chrome://inspd/skin/searchtb/inspd-searchbar-dropdown-default-icon.png");\r
- margin: 0px;\r
- min-width: 40px;\r
- width: 40px;\r
-}\r
-\r
-#inspd-searchbar-resizer {\r
- min-height: 24px; \r
- min-width: 11px;\r
- margin-left: 2px;\r
- margin-right: 0px;\r
- border: none;\r
- background-image: url("chrome://inspd/skin/searchtb/inspd-searchbar-splitter.png");\r
- background-color: transparent;\r
-}\r
-\r
-#inspd-searchbar-go {\r
- list-style-image: url('chrome://inspd/skin/searchtb/inspd-searchbar-go-1413.png'); \r
- cursor: pointer;\r
- margin: 0px;\r
- padding-left: 2px;\r
- padding-right: 2px;\r
-}\r
-\r
-#inspd-button1-home{\r
- list-style-image: url('chrome://inspd/skin/searchtb/inspd-button1-home.png');\r
-}\r
-\r
-#inspd-button2-posttoinsipid{\r
- list-style-image: url('chrome://inspd/skin/searchtb/inspd-button2-posttoinsipid.png');\r
-}\r
-\r
-#inspd-button3-mytagcloud{\r
- list-style-image: url('chrome://inspd/skin/searchtb/inspd-button3-mytagcloud.png');\r
-}\r
-\r
-#inspd-button4-mystars{\r
- list-style-image: url('chrome://inspd/skin/searchtb/inspd-button4-mystars.png');\r
-}\r
-\r
-\r
-\r
+++ /dev/null
-The pictures used in the icons are originally created by:\r
-mjames at gmail dot com.\r
-licensed under Creative Commons Attribution 2.5 License.\r
-http://creativecommons.org/licenses/by/2.5/\r
-\r
-They were downloaded from: \r
-http://www.famfamfam.com/lab/icons/silk/\r
+++ /dev/null
-pref("extensions.inspd.defurl", "");\r
-pref("extensions.inspd.showgo", "1");\r
-pref("extensions.inspd.delintegrate", "0");\r
-pref("extensions.inspd.delintegratecommontags", "0");\r
-pref("extensions.inspd.defsearchselection", "allitems");\r
-pref("extensions.inspd.searchstyle", "json");\r
-pref("extensions.inspd.lastsearchq", "");\r
-pref("extensions.inspd.searchbar.autocomp", "1");\r
-pref("extensions.inspd.defcount", "15");\r
-pref("extensions.inspd.altpost", "0");\r
-pref("extensions.inspd.cloud.minfont", "16");\r
-pref("extensions.inspd.cloud.maxfont", "50");\r
-pref("extensions.inspd.cloud.mincolor", "8B2500");\r
-pref("extensions.inspd.cloud.maxcolor", "0000AC");\r
-pref("extensions.inspd.cloud.sortby", "alphabetic");\r
-pref("extensions.inspd.cloud.sorttype", "asc");\r
-pref("extensions.inspd.cloud.showcounts", "1");\r
-pref("extensions.inspd.cloud.mintag", "1");\r
-pref("extensions.inspd.cloud.showadd", "1");\r
-pref("extensions.inspd.bookmarks.showfavicon", "0");\r
-pref("extensions.inspd.stars.list", "");\r
-\r
+++ /dev/null
-<?xml version="1.0"?>\r
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\r
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">\r
- <Description about="urn:mozilla:install-manifest">\r
- <em:id>inspd@danny</em:id>\r
- <em:version>0.0.2.9</em:version>\r
- <!-- Firefox --> \r
- <em:targetApplication>\r
- <Description>\r
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>\r
- <em:minVersion>1.5</em:minVersion>\r
- <em:maxVersion>15.0</em:maxVersion>\r
- </Description>\r
- </em:targetApplication>\r
- \r
- <!-- Flock -->\r
- <em:targetApplication>\r
- <Description>\r
- <em:id>{a463f10c-3994-11da-9945-000d60ca027b}</em:id>\r
- <em:minVersion>0.5</em:minVersion>\r
- <em:maxVersion>15.0</em:maxVersion>\r
- </Description>\r
- </em:targetApplication>\r
- \r
- \r
- \r
- <em:name>Insipid Firefox/Flock Extension</em:name>\r
- <em:description>Access your Insipid bookmark manager.</em:description>\r
- <em:creator>Danny Miles</em:creator>\r
- <em:contributor>Luke Reeves</em:contributor>\r
- <em:iconURL>chrome://inspd/skin/icon1-3232.png</em:iconURL>\r
- <em:homepageURL>https://neuro-tech.net/insipid/</em:homepageURL>\r
- <em:updateURL>https://neuro-tech.net/insipid/inspd_update.xml</em:updateURL>\r
- \r
- </Description> \r
-</RDF>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<r:RDF xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#" \r
- xmlns="http://www.mozilla.org/2004/em-rdf#">\r
- <!-- Insipid Firefox/Flock Extension -->\r
- <r:Description about="urn:mozilla:extension:inspd@danny">\r
- <updates>\r
- <r:Seq>\r
- <r:li>\r
- <r:Description>\r
- <version>0.0.2.9</version>\r
-\r
- <!-- Firefox -->\r
- <targetApplication>\r
- <r:Description>\r
- <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>\r
- <minVersion>1.5</minVersion>\r
- <maxVersion>15.0</maxVersion>\r
- <updateLink>https://neuro-tech.net/insipid/insipid_firefox_flock_extension_0.0.2.9.xpi</updateLink>\r
-\r
- </r:Description>\r
- </targetApplication>\r
- <!-- Flock -->\r
- <targetApplication>\r
- <r:Description>\r
- <id>{a463f10c-3994-11da-9945-000d60ca027b}</id>\r
- <minVersion>0.5</minVersion>\r
- <maxVersion>15.0</maxVersion>\r
-\r
- <updateLink>https://neuro-tech.net/insipid/insipid_firefox_flock_extension_0.0.2.9.xpi</updateLink>\r
- </r:Description>\r
- </targetApplication>\r
- </r:Description>\r
- </r:li>\r
- </r:Seq>\r
- </updates>\r
- <version>0.0.2.9</version>\r
-\r
- <updateLink>https://neuro-tech.net/insipid/insipid_firefox_flock_extension_0.0.2.9.xpi</updateLink>\r
- </r:Description>\r
-</r:RDF>\r
+++ /dev/null
-<!--\r
- Copyright (C) 2008 Luke Reeves\r
-\r
- This program is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation; either version 2 of the License, or\r
- (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
- USA\r
-\r
- This is a heavily modified version of insipid createted by Luke Reeves.\r
- This release was done by https://github.com/jumpin-banana/insipid\r
--->\r
-\r
-<html>\r
-<head>\r
- <title>Insipid Help</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
- <link rel="stylesheet" href="insipid.css" type="text/css" title="Standard">\r
-</head>\r
-\r
-<body>\r
-\r
-<br><div class="bodyTitle" align="center">Insipid Help</div>\r
-<br />\r
-<!-- /bookmark list title -->\r
-\r
-<!-- bookmark list -->\r
-<table class="bookmarklist">\r
-<tr><td>\r
-\r
-<p><div class="bodyTitle">Adding Bookmarks</div><br>\r
-<div class="bodytext">Ensure that you are logged into the system (the login button is located at the top right of the window) and click the "add" link from the toolbar, this will bring you to the add form.<br> <br>\r
-Enter in the URL of the site you wish to add, the title you want the URL to be displayed under, a brief description of the link (if you want, this isnt necessary) and the tags - separated by spaces - that you want this bookmark to be classified under, leave this blank if you are unsure what you want to classify the bookmark as, you can always update and change this later. If you want this link to be viewable by anyone who visits your site, leave the "Public" checkbox checked. If you want this bookmark only viewable by you, uncheck the box<br><br>\r
-Click the "Add" button at the bottom of the form, and this bookmark will be added to your list\r
-</div></p>\r
-\r
-<p><div class="bodyTitle">Using Tags</div><br>\r
-<div class="bodytext">Tags are the way you organize and sort your bookmarks in Insipid, they are essentially keywords used to group similar links together. Tags can be any single word that you choose and you can use as many tags as you want for each link. Each time you add a link with a new tag it will automatically be added to the Tag List table on the left hand side of the page.\r
-</div></p>\r
-<p>When adding or editing a tag, Insipid supplies suggestions of tags to use based on the tags you have. When a suggestion is offered, you may navigate with [tab], [left arrow], or [right arrow] keys. Pressing [spacebar] on the highlighted tag makes the selection. Pressing [esc] makes Insipid stop making suggestions for the tag you are entering.</p>\r
-\r
-<p><div class="bodyTitle">Using Bookmarklets</div><br>\r
-<div class="bodytext">A bookmarklet is essentially a shortcut to adding a new bookmark and a great tool for quickly building up your links. To start usinga bookmarklet follow these steps:\r
-<ol>\r
-<li>Login to Insipid</li>\r
-<li>Click on "Bookmarklet", this will bring you to a page with a single link "Post this page"</li>\r
-<li>Right click on this link, and click "bookmark this link" in Moz/Firefox or "Add to Favourites" in IE (shame on you for using IE!).</li>\r
-<li>Thats it!</li>\r
-</ol>\r
-Now whenever you are on a page that you want to add to Insipid, simply select this bookmark and you will automagically be taken to Insipid's add bookmark page, the URL and Title already filled in for you. Add your description and tags, decide whether to make this a private link, click add and you are done. After you click add you will be taken back to the page you just bookmarked.\r
-</div></p>\r
-\r
-<p><div class="bodyTitle">RSS Feeds</div><br>\r
-<div class="bodytext">To subscribe to a specific users list of bookmarks, add the XML page to whichever feed reader you are using. To find out more about <a href="http://www.whatisrss.com/">RSS click here</a>\r
-</div></p>\r
-\r
-</td></tr>\r
-</table>\r
-<!-- /bookmarklist -->\r
-\r
-</body></html>\r
+++ /dev/null
-# add +ExecCGI if this option is not set
-Options +FollowSymlinks -Indexes
-
-# add the following line if you want to lauch inspid without insipid.cgi
-#DirectoryIndex index.cgi insipid.cgi
-
-# add the following line if the addhandler is not set
-#AddHandler cgi-script .cgi .pl
-
-RewriteEngine On
-RewriteBase /yourwebdirectory
-RewriteRule ^bookmarks/(.*) insipid.cgi?tag=$1 [QSA]
-RewriteRule ^bookmarks insipid.cgi [QSA]
-RewriteRule ^feeds/bookmarks/(.*) insipid.cgi?op=rss&tag=$1 [QSA]
-RewriteRule ^feeds/bookmarks insipid.cgi?op=rss [QSA]
-RewriteRule ^snapshot/(.*) insipid.cgi?op=viewsnapshot&md5=$1 [QSA]
-
-RewriteRule ^feeds/json/tags/(.*) insipid.cgi?op=json_tags&tag=$1 [QSA]
-RewriteRule ^feeds/json/tags insipid.cgi?op=json_tags [QSA]
-
-RewriteRule ^feeds/json/posts/(.*) insipid.cgi?op=json_posts&tag=$1 [QSA]
-RewriteRule ^feeds/json/posts insipid.cgi?op=json_posts [QSA]
-
+++ /dev/null
-# This is the database configuration for Insipid.
-dbname = insipid_luke
-dbuser = luke
-dbpass = dbpass
-dbhost = 127.0.0.1
-
-# If you'd like the Insipid database tables to use a prefix, uncomment
-# this line.
-#dbprefix = insipid_
-
-# The base URI to your installation.
-pagepath = /Luke
-
-# If your webserver is not running on port 80 and it doesn't properly set
-# the SERVER_PORT variable, set it here.
-#server_port = 8080
-
-# The login name and password for using the Insipid interface.
-username = luke
-userpass = yourpassword
-
-# use phantomjs to create screenshots for a bookmark
-usePhantomjs = 0;
-phantomPath = "./path/to/phantomjs/bin/phantomjs"
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# Copyright (C) 2012 Johannes Keßler
-# https://github.com/jumpin-banana/insipid
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-use warnings;
-use strict;
-
-# This stub checks for libraries and what not and then calls the main program.
-
-if(!-e "insipid-config.cgi") {
- # TODO: Better error message here.
- show_error("Configuration file missing", "The \"insipid-config.cgi\"" .
- " file could not be found.");
-}
-
-
-eval {
- push(@INC, "lib");
- require Insipid::Main;
- Insipid::Main::main();
-};
-
-if($@) {
- my $errstr = $@;
- if($errstr =~ /Can\'t locate (.*) in/) {
- show_error("Couldn't find the module \"$1\".", "You may want to " .
- "<a href=\"http://search.cpan.org/\">search CPAN</a> " .
- "for the module or check the " .
- "<a href=\"https://neuro-tech.net/insipid/\">" .
- "Insipid</a> homepage for more information.",
- $errstr);
- } elsif (
- ($errstr =~ /Couldn\'t acquire lock on id/) ||
- ($errstr =~ /doesn\'t exist/) ||
- ($errstr =~ /relation \".*\" does not exist/) ) {
-
- print STDERR "Creating database\n";
-
- # This means that a database connection was established but the
- # tables were not found.
- undef($@);
- eval {
- push(@INC, "lib");
- require Insipid::DBInstall;
- Insipid::DBInstall::install();
- };
-
- if($@) {
- $errstr = $@;
- show_error("Database error", "There was a problem " .
- "creating the database tables required by Insipid:",
- $errstr);
- }
- } else {
- print "Content-Type: text/plain\r\n\r\nError: $@\r\n";
- }
-}
-
-sub show_error {
- my ($subject, $body, $error) = (@_);
- print "Content-Type: text/html\r\n\r\n";
- print "<html><head><title>Insipid Error</title></head>";
- print "<body>";
- print "<h2>$subject</h2>";
- print "<p>$body</p>";
-
- if(defined($error)) {
- print '<pre>' . $error . '</pre>';
- }
-
- print '</body></html>';
- exit;
-}
+++ /dev/null
-/**
- * Copyright (C) 2008 Luke Reeves
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-* {
- font-family:Arial, Helvetica, sans-serif;
-}
-
-#leftside {
- float:left;
- padding-right: 20px;
- padding-left: 20px;
- padding-top: 20px;
-}
-
-.bodyContent {
- margin-right: 15px;
- margin-top: 10px;
-}
-
-.title {
- padding-left:20px;
- padding-top:10px;
- color: blue;
- font-size:medium;
- font-weight:bold;
- background-color: #CCCCCC;
-}
-
-.tagsummarytable {
- border-color:#000000;
- border-style:solid;
- -moz-box-sizing: border-box;
- -moz-border-radius:8px;
- border-width: medium;
- font-size: small;
- margin-bottom: 15px;
-}
-
-.tagsummarytable th {
- background-color: #000;
- color: #fff;
-}
-.tagsummarytable td {
- padding: 1px 3px 0 1px;
-}
-
-.tagtabletext {
- font-family:Arial, Helvetica, sans-serif;
- text-decoration: none;
- color: #000000;
-}
-
-.bodytext{
- font-family:Arial, Helvetica, sans-serif;
- color: black;
-}
-
-/* Used for "Most Recent Bookmarks" */
-.bodyTitle{
- color: black;
- font-weight: bold;
-}
-
-.inline_title{
- font-family:Arial, Helvetica, sans-serif;
- color:#FFFFFF;
- background:#000000;
-}
-
-.search {
- padding-left: 10px;
- text-align: left;
- background-color: #CCCCCC;
-}
-
-.toolbar {
- text-align: right;
- padding-right: 10px;
- background-color: #CCCCCC;
- font-size: small;
-}
-h2 {
- font-size: medium;
- padding-top: 10px;
-}
-
-h3 {
- font-size: medium;
- text-align: center;
- padding-top: 10px;
-}
-
-a.tools {
- font-family:Arial, Helvetica, sans-serif;
- color: black;
- font-weight: bold;
- line-height:2;
-}
-
-a.tools:visited {
- color: black;
-}
-
-a.tools:hover {
- font-family:Arial, Helvetica, sans-serif;
- color: black;
- font-weight: bold;
- background:white;
- text-decoration: none;
- line-height:2;
-}
-
-
-.formtext {
- font-family:Arial, Helvetica, sans-serif;
- text-decoration: none;
-}
-
-
-A {
- font-family:Arial, Helvetica, sans-serif;
- text-decoration: none;
-}
-
-A:hover {
- font-family:Arial, Helvetica, sans-serif;
- text-decoration: underline
-}
-
-A:visited {
- font-family:Arial, Helvetica, sans-serif;
- text-decoration: none;
- color:blue;
-}
-
-.error {
- font-family:Arial, Helvetica, sans-serif;
- margin-top: 40px;
- margin-bottom: 10px;
- color: red;
-}
-
-.bookmarkOperations {
- font-family: Arial, Helvetica, sans-serif;
- font-size: small;
- margin-left: 20px;
- color: #777777;
-}
-
-li{ color:#8888ff; }
-.bookmarklistitem{
- padding-bottom:8px;
-}
-
-.bookmarklist{
- font-size: medium;
- margin-left: 20px;
- border-width: medium;
- border-color:#CCCCCC;
- border-style:dotted;
- padding-right:10px;
-}
-
-A.bookmarkTag:link { color: #8888ff; }
-A.bookmarkTag:visited { color: #8888ff; }
-A.bookmarkTag:hover { color: #8888ff; }
-
-A.bookmarkOp:link { color: #800000; }
-A.bookmarkOp:visited { color: #800000; }
-A.bookmarkOp:hover { color: #800000; }
-
-#suggestlist {
- display: none;
- padding-bottom: 0.5em;
- width: 500px;
- height: 1em;
-}
-
-#suggestlist ul {
- border: 1px solid;
- border-top-color: #EEE;
- border-left-color: #EEE;
- border-right-color: #AAA;
- border-bottom-color: #AAA;
- background: #EEE;
- margin: 0;
- padding: 0;
- list-style: none;
- width: 100%;
- height: 100%;
- overflow: hidden;
-}
-
-#suggestlist li {
- float: left;
- padding: 0.2em 0.3em;
- font-size: 12px;
- color: black;
-}
-
-#suggestlist li.sel {
- background: black;
- color: white;
-}
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Bookmarks;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK $icount $duplicates);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Schemas;
-use Insipid::Sessions;
-use Insipid::Tags;
-use Insipid::Util;
-use DBI qw/:sql_types/;;
-use Date::Format;
-use Date::Parse;
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Digest::MD5 qw(md5 md5_hex);
-
-require Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-add_bookmark
-export_bookmarks
-get_bookmark_id_by_url
-$icount
-$duplicates
-);
-
-sub get_bookmark_id_by_url {
- my ($url) = (@_);
- my $sql = "select $tbl_bookmarks.id from $tbl_bookmarks
- where ($tbl_bookmarks.url = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($url);
-
- my @r = $sth->fetchrow_array;
- return $r[0];
-}
-
-sub add_bookmark {
- my ($url, $title, $description, $access_level, $epoch, $tags) = (@_);
- my ($sql, $sth);
-
- check_access();
-
- my $md5 = md5_hex($url);
-
- # Check for duplicate
- $sql = "select title from $tbl_bookmarks where (md5 = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($md5);
-
- if($sth->rows ne 0) {
- $duplicates++;
- return;
- }
-
- $sql = "INSERT INTO $tbl_bookmarks
- (url, md5, title, description, access_level, date)
- VALUES (?, ?, ?, ?, ?, ?)";
-
- if($epoch eq 0) { $epoch = time; }
- $sth = $dbh->prepare($sql);
-
- $sth->execute($url, $md5, $title, $description, $access_level, $epoch)
- or die $DBI::errstr;
-
- $icount++;
-
- set_tags(get_bookmark_id_by_url($url), $tags);
-}
-
-sub export_bookmarks {
- my ($writer) = (@_);
-
- my ($sql, $sth, $last_id);
-
- $writer->startTag("posts");
-
- $sql = "select
- $tbl_bookmarks.id, $tbl_bookmarks.title,
- $tbl_bookmarks.date, $tbl_bookmarks.access_level,
- $tbl_bookmarks.url, $tbl_tags.name
- from $tbl_bookmarks
- left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id = $tbl_bookmark_tags.bookmark_id)
- left join $tbl_tags on
- ($tbl_bookmark_tags.tag_id = $tbl_tags.id)";
-
- $sth = $dbh->prepare($sql);
- $sth->execute();
-
- my ($url, $title);
- my $tags = "";
-
- my %last;
- $last_id = -1;
- my $current = 0;
- my $max = $sth->rows;
-
- # There HAS to be a better way to do this horrible looping for tags.
- while(my $hr = $sth->fetchrow_hashref) {
- $current++;
-
- # For the first bookmark
- if($last_id eq -1) {
- $last_id = $hr->{'id'};
- $last{title} = $hr->{'title'};
- $last{url} = $hr->{'url'};
- $last{tags} = "";
- $last{timestamp} = $hr->{'date'};
- $last{access_level} = $hr->{'access_level'};
- }
-
- #if(($hr->{'id'} ne $last_id) || ($current eq $max)) {
- if($hr->{'id'} ne $last_id) {
- # the id changed, so show the last mark.
- #my $url = sanitize_html($last{'url'});
- my $url = $last{'url'};
- my $title = $last{'title'};
- #my $title = sanitize_html($last{'title'});
- #$title =~ s/"/"/gi;
- if(defined($last{tags})) {
- if($last{tags} eq "") {
- $last{tags} = "system:unfiled";
- }
- } else {
- $last{tags} = "system:unfiled";
- }
-
- if($last{url} ne "") {
- my $tstr = time2str("%Y-%m-%dT%TZ", $last{timestamp}, "GMT");
- $writer->emptyTag('post',
- 'access_level' => $last{access_level},
- 'href' => $url,
- 'description' => $title,
- 'tag' => $last{tags},
- 'time' => $tstr);
- }
-
- # Swap the new one in.
- $last_id = $hr->{'id'};
- $last{title} = $hr->{'title'};
- $last{url} = $hr->{'url'};
- $last{tags} = $hr->{'name'};
- $last{timestamp} = $hr->{'date'};
- $last{access_level} = $hr->{'access_level'};
- } else {
- # Add tag to the current bookmark
- if($hr->{'name'}) {
- $last{tags} = "$last{tags} $hr->{'name'}";
- }
- }
- }
-
- if($last{'url'}) {
- #$url = sanitize_html($last{'url'});
- #$title = sanitize_html($last{'title'});
- #$title =~ s/"/"/gi;
-
- $url = $last{'url'};
- $title = $last{'title'};
-
- if(defined($last{tags})) {
- if($last{tags} eq "") {
- $last{tags} = "system:unfiled";
- }
- } else {
- $last{tags} = "system:unfiled";
- }
-
- if($last{url} ne "") {
- my $tstr = time2str("%Y-%m-%dT%TZ", $last{timestamp}, "GMT");
- $writer->emptyTag('post',
- 'access_level' => $last{access_level},
- 'href' => $url,
- 'description' => $title,
- 'tag' => $last{tags},
- 'time' => $tstr);
- }
- }
-
- $writer->endTag("posts");
-}
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-package Insipid::Config;\r
-\r
-use strict;\r
-use warnings;\r
-\r
-use CGI qw/:standard/;\r
-\r
-use vars qw(@ISA @EXPORT $pagepath $site_url $tag_url $feed_url $full_url \r
- $tbl_authentication $tbl_bookmarks $tbl_tags $tbl_options\r
- $tbl_bookmark_tags $tbl_pagecache $tbl_pagecache_references\r
- @errors);\r
-@ISA = qw(Exporter);\r
-@EXPORT = qw(getconfig $pagepath $site_url $tag_url $feed_url \r
- $tbl_authentication $tbl_bookmarks $tbl_tags\r
- $tbl_options $tbl_bookmark_tags $tbl_pagecache\r
- $tbl_pagecache_references $full_url @errors);\r
-\r
-my $config_file;\r
-my %config;\r
-\r
-if(-e "insipid-config.cgi") { $config_file = "insipid-config.cgi"; }\r
-if(-e "../insipid-config.cgi") { $config_file = "../insipid-config.cgi"; }\r
-\r
-# Read basic database and user configuration\r
-open (CFG, $config_file);\r
-while(my $line = <CFG>) {\r
- if($line =~ /^[^#]/) {\r
- $line =~ /(.*?)\s*=\s*(.*?)\s/;\r
- if(defined($1)) {\r
- if(defined($2)) {\r
- $config{$1} = $2;\r
- } else {\r
- $config{$1} = "";\r
- }\r
- }\r
- }\r
-}\r
-close(CFG);\r
-\r
-sub getconfig {\r
- my ($key) = (@_);\r
- return $config{$key};\r
-}\r
-\r
-my $prefix = $ENV{'HTTPS'} ? 'https://' : 'http://';\r
-my $port = '';\r
-if(defined($ENV{'SERVER_PORT'})) {\r
- if($ENV{'SERVER_PORT'} ne '80') {\r
- $port = ':' . $ENV{'SERVER_PORT'};\r
- }\r
-}\r
-\r
-# Override the port from the configuration file if available\r
-if(defined(getconfig('server_port'))) {\r
- if(getconfig('server_port') ne '') {\r
- $port = ':' . getconfig('server_port');\r
- }\r
-}\r
-\r
-$site_url = $prefix . virtual_host() . $port . getconfig('pagepath');\r
-\r
-my $dbprefix;\r
-if(defined(getconfig('dbprefix'))) {\r
- $dbprefix = getconfig('dbprefix');\r
-} else {\r
- $dbprefix = '';\r
-}\r
-\r
-# Table names.\r
-$tbl_authentication = $dbprefix . 'authentication';\r
-$tbl_bookmarks = $dbprefix . 'bookmarks';\r
-$tbl_tags = $dbprefix . 'tags';\r
-$tbl_bookmark_tags = $dbprefix . 'bookmark_tags';\r
-$tbl_options = $dbprefix . 'options';\r
-$tbl_pagecache = $dbprefix . 'pagecache';\r
-$tbl_pagecache_references = $dbprefix . 'pagecache_references';\r
-\r
-\r
-\r
-1;\r
-\r
-__END__\r
-\r
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::DBInstall;
-
-use strict;
-use warnings;
-
-use Insipid::Config;
-use Insipid::Schemas;
-
-use DBI qw/:sql_types/;;
-use vars qw($version);
-
-use Exporter ();
-our (@ISA, @EXPORT);
-
-@ISA = qw(Exporter);
-@EXPORT = qw(install);
-
-sub install {
- my ($sth, $dbname, $dbuser, $dbpass, $dbhost, $dbtype, $dsn, $dbh, @creates);
-
- $dbname = getconfig('dbname');
- $dbuser = getconfig('dbuser');
- $dbpass = getconfig('dbpass');
- $dbhost = getconfig('dbhost');
-
- $dbtype = 'mysql';
-
- $dsn = "DBI:$dbtype:dbname=$dbname;host=$dbhost";
- $dbh = DBI->connect($dsn, $dbuser, $dbpass, { 'RaiseError' => 0}) or die $DBI::errstr;
-
- print "Content-Type: text/html\r\n\r\n";
- print "<html><head><title>Insipid Installation</title></head><body>";
-
- print "<p>Creating tables...";
-
- @creates = split(/\;/, $createMySQL);
-
- foreach(@creates) {
- my $sql = $_;
- if(length($sql) > 2) {
- $sth = $dbh->prepare($sql);
- $sth->execute() or print "<br />Error executing \"$sql\" - $DBI::errstr<br />";
- }
- }
- print " done!</p>";
-
- print "<p>Insipid's database has been installed. You can reload this " .
- "page to start using Insipid.</p>";
-
- print "</body></html>";
-
-}
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Database;
-
-use strict;
-use warnings;
-
-use Insipid::Config;
-use Insipid::Schemas;
-
-use DBI qw/:sql_types/;;
-use vars qw($version);
-
-use Exporter ();
-our (@ISA, @EXPORT);
-
-@ISA = qw(Exporter);
-@EXPORT = qw($dbname $dbuser $dbpass $dsn $dbh $dbtype get_option
- install $version $tag_url $feed_url $full_url $snapshot_url
- export_options $dbprefix);
-
-our ($dsn, $dbh, $dbname, $dbuser, $dbpass, $dbhost, $snapshot_url,
- $dbtype, $tag_url, $feed_url, $full_url, $dbprefix);
-
-$dbname = getconfig('dbname');
-$dbuser = getconfig('dbuser');
-$dbpass = getconfig('dbpass');
-$dbhost = getconfig('dbhost');
-
-$dbtype = 'mysql';
-
-$dsn = "DBI:$dbtype:dbname=$dbname;host=$dbhost";
-$dbh = DBI->connect($dsn, $dbuser, $dbpass, { 'RaiseError' => 1, 'PrintError' => 1}) or die $DBI::errstr;
-
-my %options;
-
-sub export_options {
- my ($writer) = (@_);
- my ($sth);
-
- $writer->startTag('options');
- $sth = $dbh->prepare("select name, value from $tbl_options");
- $sth->execute();
- while(my $row = $sth->fetchrow_hashref) {
- if($row->{name} ne 'version') {
- $writer->emptyTag('option',
- 'name' => $row->{name},
- 'value' => $row->{value});
- }
- }
-
- $writer->endTag('options');
-}
-
-# this function is special for every version.
-# there is no generic function for upgrades
-# so changes to the DB needs to be saved here too
-# in the next version change this
-sub dbupgrade {
-
-
- my $sql = "ALTER TABLE `$tbl_options` ADD COLUMN `pos` int(10) NOT NULL AFTER `value`;";
- my $sth = $dbh->prepare($sql);
- $sth->execute;
-
- $sql = "UPDATE $tbl_options SET pos = ? where (name = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute(3, 'feed_name');
- $sth->execute(1, 'site_name');
- $sth->execute(20, 'proxy_host');
- $sth->execute(21, 'proxy_port');
- $sth->execute(2, 'public_searches');
- $sth->execute(90, 'use_rewrite');
- $sth->execute(9999, 'version');
-
-
- $sql = "INSERT INTO `$tbl_options` ( `name`, `value`, `description`, `pos`)
- VALUES ( 'feed_num', '10', 'How many feed entries per default (0 = all)', '4')";
- $sth = $dbh->prepare($sql);
- $sth->execute;
-
- $sql = "ALTER TABLE `$tbl_bookmarks`
- ADD COLUMN `linkcheck_status` int(1) NOT NULL AFTER `access_level`,
- ADD COLUMN `linkcheck_date` int(10) NOT NULL AFTER `linkcheck_status`;";
- $sth = $dbh->prepare($sql);
- $sth->execute;
-
- $sql = "update $tbl_options set value = ? where (name = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($version, 'version');
-
- return;
-}
-
-sub get_option {
- my ($name) = (@_);
-
- if(keys (%options) == 0) {
- reload_options();
- }
-
- # Determine if we need to upgrade the database
- if($version ne $options{'version'}) {
- print STDERR "Upgrading schema from $options{'version'} to $version.\n";
- dbupgrade();
- reload_options();
- }
-
- return $options{$name};
-}
-
-sub reload_options {
- my $sql = "select name, value from $tbl_options";
- my $sth = $dbh->prepare($sql);
- $sth->execute() or die $DBI::errstr;
-
- while(my $hr = $sth->fetchrow_hashref) {
- $options{$hr->{'name'}} = $hr->{'value'};
- }
-}
-
-# This configures the URLs in the application to support mod_rewrite or
-# a webserver sans mod_rewrite.
-if(get_option('use_rewrite') eq 'yes') {
- $tag_url = $site_url . '/bookmarks/';
- $feed_url = $site_url . '/feeds/bookmarks';
- $full_url = $site_url . '/bookmarks';
- $snapshot_url = $site_url . '/snapshot/';
-} else {
- $tag_url = 'insipid.cgi?tag=';
- $feed_url = $site_url . '/insipid.cgi?op=rss&tag=';
- $full_url = $site_url . '/insipid.cgi';
- $snapshot_url = 'insipid.cgi?op=viewsnapshot&md5=';
-}
-
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::JSON;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Sessions;
-use Date::Format;
-use Date::Parse;
-
-require Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-send_json_tags
-send_json_posts
-);
-
-my $query = '';
-my $last_page = 0;
-
-
-
-sub send_json_tags {
- my ($sql, $sth);
-
- # Building up JSON structure before parsing the data:
- my ($json_prefix,$json_suffix);
- # limiting url_param('callback') to a reasonable length (100):
- if((defined(url_param('callback'))) && (length(url_param('callback')) < 100)){
- $json_prefix = ''.url_param('callback').'({';
- $json_suffix = '})';
- } elsif(url_param('raw') eq 1) {
- $json_prefix = '{';
- $json_suffix = '}';
- } else {
- $json_prefix = 'if(typeof(Insipid) == \'undefined\') Insipid = {}; Insipid.tags = {';
- $json_suffix = '}';
- }
- #limiting tags count, only if url_param('count') is a valid integer:
- my $limit ;
- if (url_param('count') =~ /^[+-]?\d+$/) {
- $limit = ' limit '.url_param('count') ;
- }
-
-
-
- # If the user has already chosen a tag, get the intersection list
- if((url_param('tag')) && (logged_in() eq 1)) {
- $sql = "select $tbl_tags.name,count(*) from $tbl_bookmarks
- inner join $tbl_bookmark_tags as bt1 on
- ($tbl_bookmarks.id = bt1.bookmark_id)
- inner join $tbl_tags on
- ($tbl_tags.id = bt1.tag_id)
- inner join $tbl_bookmark_tags as bt2 on
- ($tbl_bookmarks.id = bt2.bookmark_id)
- inner join $tbl_tags as t2 on
- (t2.id = bt2.tag_id and t2.name = ?)
- where ($tbl_tags.name != ?)
- group by $tbl_tags.name $limit";
- $sth = $dbh->prepare($sql);
- $sth->execute(url_param('tag'), url_param('tag'));
- print $json_prefix ;
- if($sth->rows ne 0) {
- my $icount = 1 ;
- while(my @r = $sth->fetchrow_array()) {
- json_show_tag($icount, $sth->rows, $r[0], $r[1]);
- $icount++ ;
- }
- }
- print $json_suffix ;
- return ;
- } else {
-
- # Access_spec contains a where clause to count only public bookmarks
- # if the user is not logged in
- my $access_where = "";
- if(logged_in() eq 0) {
- $access_where = " where ($tbl_bookmarks.access_level = 1) ";
- }
-
- my $order_clause;
- $order_clause = "order by $tbl_tags.name";
-
- $sql = "select $tbl_tags.name, count(*)
- from $tbl_bookmarks
- inner join $tbl_bookmark_tags on
- ($tbl_bookmarks.id = $tbl_bookmark_tags.bookmark_id)
- inner join $tbl_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- $access_where
- group by $tbl_tags.name
- $order_clause
- $limit";
-
- $sth = $dbh->prepare($sql);
- $sth->execute;
- print $json_prefix;
- if($sth->rows ne 0) {
- my $icount = 1;
- while(my @r = $sth->fetchrow_array()) {
- json_show_tag($icount, $sth->rows, $r[0], $r[1]);
- $icount++;
- }
- }
- print $json_suffix;
- return;
- }
-}
-
-sub json_show_tag {
- my($icount, $rowscount, $tag, $tagcount) = (@_);
- $tag =~ s/\"/\\"/g ;
- my $json_txt = '';
- $json_txt = $json_txt.'"'.$tag.'":'.$tagcount;
- if ($icount ne $rowscount){
- $json_txt = $json_txt.',';
- }
- print $json_txt ;
-}
-
-sub send_json_posts {
-
- # Building up JSON structure before parsing the data:
- my ($json_prefix,$json_suffix);
- # limiting url_param('callback') to a reasonable length:
- if((defined(url_param('callback'))) && (length(url_param('callback')) < 100)){
- $json_prefix = ''.url_param('callback').'([';
- $json_suffix = '])';
- } elsif(url_param('raw') eq 1) {
- $json_prefix = '[';
- $json_suffix = ']';
- } else {
- $json_prefix = 'if(typeof(Insipid) == \'undefined\') Insipid = {}; Insipid.posts = [';
- $json_suffix = ']';
- }
- #limiting posts count to url_param('count') , setting hard limit to 100 and default limit to 50 :
- my $limit ;
- if ((url_param('count') =~ /^[+-]?\d+$/) && (url_param('count') < 101)) {
- $limit = url_param('count') ;
- } else {
- $limit = 50 ;
- }
-
- my ($subquery, $sql, $sth, @parms, @wheres, @hr);
-
- # this first query will be used to select from a set, like when a user
- # drills in on a specific tag or to get a smaller view of the entire
- # dataset (for paging purposes).
-
- $sql = "select $tbl_bookmarks.id from $tbl_bookmarks";
-
- # Limit to tags
- if(defined(url_param('tag'))) {
- # Join the tag tables only when necessary
-
- if(url_param('tag') =~ / /) {
- my @tags = split(/ /, url_param('tag'));
- my $icount = 1;
-
- foreach(@tags) {
- push(@parms, $_);
- $sql = "$sql inner join $tbl_bookmark_tags
- as bt$icount on
- ($tbl_bookmarks.id =
- bt$icount.bookmark_id)
- inner join $tbl_tags as t$icount on
- (t$icount.id = bt$icount.tag_id
- and t$icount.name = ?) ";
- $icount++;
- }
- } else {
- $sql = "$sql
- left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id =
- $tbl_bookmark_tags.bookmark_id)
- inner join $tbl_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- where ($tbl_tags.name = ?)";
- push(@parms, url_param('tag'));
- }
-
- }
-
- # Search
- # ?q=
- $query = url_param('q');
- if($query ne "") {
- if((get_option("public_searches") eq "yes") || (logged_in() eq 1)) {
- my $sparm = $query;
- if(length($sparm) > 2) {
- $sql = "$sql where ($tbl_bookmarks.title like ?)";
- $sparm =~ s/\%//;
- $sparm = "\%$sparm\%";
- push(@parms, $sparm);
- }
- }
- }
-
- # order
- $sql = "$sql order by $tbl_bookmarks.date desc";
-
- # paging functionality
- $sql = "$sql limit $limit";
-
-
- if(url_param('page')) {
- my $offset = ((url_param('page') - 1) * $limit);
- $sql = "$sql offset $offset";
- }
-
- $sth = $dbh->prepare($sql);
- $sth->execute(@parms);
-
- $subquery = "";
- if($sth->rows > 0) {
- if($sth->rows ne $limit) { $last_page = 1; }
-
- $subquery = " $tbl_bookmarks.id in (";
-
- while(@hr = $sth->fetchrow_array) {
- $subquery = $subquery . "$hr[0],";
- }
- chop($subquery); # Strip off the last delimiter
-
- $subquery = $subquery . ")";
- } else {
- # no bookmarks found:
- ###################
- print $json_prefix ;
- print $json_suffix ;
- ###################
- return;
- }
-
- @parms = ();
- @wheres = ();
-
- $sql = "select
- $tbl_bookmarks.id,
- $tbl_bookmarks.title,
- $tbl_bookmarks.description,
- $tbl_bookmarks.access_level,
- $tbl_bookmarks.url,
- $tbl_tags.name,
- $tbl_bookmarks.date,
- $tbl_pagecache.date as cache_date,
- $tbl_bookmarks.md5
- from $tbl_bookmarks
- left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id = $tbl_bookmark_tags.bookmark_id)
- left join $tbl_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- left join $tbl_pagecache on
- ($tbl_bookmarks.md5 = $tbl_pagecache.md5)";
-
- # Don't show private marks for non-logged in users
- if(logged_in() eq 0) {
- push(@wheres, "$tbl_bookmarks.access_level");
- push(@parms, "1");
- }
-
- my $max = @wheres;
- if($max ne 0) {
- $sql = "$sql where (";
- my $count = 1;
-
- foreach (@wheres) {
- $sql = "$sql $_ = ?";
- if($count < $max) {
- $sql = "$sql and ";
- }
- $count++;
- }
-
- $sql = "$sql )";
- if($subquery ne "") { $sql = "$sql and $subquery"; }
- } else {
- if($subquery ne "") { $sql = "$sql where $subquery "; }
- }
-
- # append sort order.
- $sql = "$sql order by $tbl_bookmarks.date desc";
-
- $sth = $dbh->prepare($sql);
- $sth->execute(@parms);
-
- my %last;
- $last{id} = -1;
-
-
- ###################
- print $json_prefix ;
- ###################
-
- while(@hr = $sth->fetchrow_array) {
- if($last{id} eq -1) {
- $last{id} = $hr[0];
- $last{title} = $hr[1];
- $last{description} = $hr[2];
- $last{access_level} = $hr[3];
- $last{url} = $hr[4];
- $last{tags} = "";
- $last{timestamp} = $hr[6];
- }
-
- if($hr[0] ne $last{id}) {
- # the id changed, so show the last mark.
- json_show_post(0,$last{id}, $last{title}, $last{description}, $last{access_level}, $last{url}, $last{tags}, $last{timestamp});
-
- # Swap the new one in.
- $last{id} = $hr[0];
- $last{title} = $hr[1];
- $last{description} = $hr[2];
- $last{access_level} = $hr[3];
- $last{url} = $hr[4];
- $last{tags} = $hr[5];
- $last{timestamp} = $hr[6];
- } else {
- # Add tag to the current bookmark
- if(defined($hr[5])) {
- $last{tags} = "$last{tags} $hr[5]";
- }
- }
- }
-
- if($last{id} ne -1) {
- json_show_post(1,$last{id}, $last{title}, $last{description}, $last{access_level}, $last{url}, $last{tags}, $last{timestamp});
- }
-
- ###################
- print $json_suffix ;
- ###################
-}
-
-
-sub json_show_post {
- my($last_mark, $id, $title, $description, $access_level, $url,
- $tags, $timestamp) = (@_);
- $title =~ s/\"/\\"/g ;
- $description =~ s/\"/\\"/g ;
- $tags =~ s/\"/\\"/g ;
- my $json_txt = '{';
-
- if($access_level eq 0) {
- $json_txt = $json_txt.'"u":"'.$site_url.'/insipid.cgi?go='.$id.'",';
- $json_txt = $json_txt.'"d":"'.$title.'",';
- } else {
- $json_txt = $json_txt.'"u":"'.$url.'",';
- $json_txt = $json_txt.'"d":"'.$title.'",';
- }
-
- if($description){
- $json_txt = $json_txt.'"n":"'.$description.'",';
- }
-
- my $timestr = '';
- if(logged_in() eq 1) {
- $timestr = time2str('%Y-%m-%d %T EST', $timestamp, 'EST');
- } else {
- $timestr = time2str('%Y-%m-%d', $timestamp, 'EST');
- }
-
- $json_txt = $json_txt.'"dt":"'.$timestr.'"';
-
- if($tags) {
- $json_txt = $json_txt.',"t":[';
- my $cur;
- my @tags = split(/\ /, $tags);
- my $icount = 1 ;
- foreach my $tag (@tags) {
- if($tag){
- $json_txt = $json_txt.'"'.$tag.'"';
- if ($icount ne @tags){
- $json_txt = $json_txt.',';
- }
- }
- $icount++ ;
- }
- $json_txt = $json_txt.']';
- }
-
- $json_txt = $json_txt.'}';
-
- if($last_mark ne 1){
- $json_txt = $json_txt.',';
- }
-
- print $json_txt ;
-}
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-package Insipid::LinkExtractor;\r
-\r
-use strict;\r
-use warnings;\r
-use HTML::Parser;\r
-use HTML::Entities ();\r
-use URI::URL;\r
-use URI::WithBase;\r
-use Digest::MD5 qw(md5 md5_hex);\r
-use Insipid::Config;\r
-use Insipid::Database;\r
-use Insipid::Snapshots;\r
-\r
-use vars qw(@ISA);\r
-@ISA = qw(HTML::Parser);\r
-\r
-my $url = '';\r
-\r
-sub new {\r
- my $pack = shift;\r
- $url = shift;\r
- my $self = $pack->SUPER::new;\r
- $self;\r
-}\r
-\r
-sub declaration {\r
- my $self = shift;\r
- my ($decl) = @_;\r
-\r
- 1;\r
-}\r
-\r
-sub start {\r
- my $self = shift;\r
- my ($tag, $attr, $attrseq, $origtext) = @_;\r
-\r
- #print "Found tag $tag<br />";\r
- if($tag eq 'a') {\r
- my $href = $attr->{'href'};\r
- if(defined($href)) {\r
- if($href =~ /(\.gif|\.jpg|\.png)/i) {\r
- grab_image($url, $href);\r
- }\r
- }\r
- }\r
-\r
- 1;\r
-}\r
-\r
-sub grab_image {\r
- my ($base_url, $t) = (@_);\r
- my ($sql, $sth);\r
- \r
- my $u1 = URI::WithBase->new($t, $base_url);\r
- my $target_url = $u1->abs;\r
- \r
- print "Fetching $target_url... ";\r
-\r
- my $target_md5 = md5_hex($target_url);\r
-\r
- # Check if this already exists.\r
- $sql = "select count(*) from $tbl_pagecache where (md5 = ?)";\r
- $sth = $dbh->prepare($sql);\r
- $sth->execute($target_md5);\r
- my @r = $sth->fetchrow_array();\r
-\r
- if($r[0] ne 0) {\r
- print " Already exists. <br />";\r
- return;\r
- }\r
-\r
- my $rv = Insipid::Snapshots::fetch_url($target_url, $base_url);\r
-\r
- if($rv eq 0) {\r
- $sql = "insert into $tbl_pagecache_references(\r
- md5_parent, md5_child) values(?, ?)";\r
- $sth = $dbh->prepare($sql);\r
- $sth->execute(md5_hex($base_url), $target_md5);\r
- \r
- print "OK.<br />";\r
- }\r
- \r
- 1;\r
-}\r
-\r
-sub end {\r
- my $self = shift;\r
- my ($tag) = @_;\r
-\r
- 1;\r
-}\r
-\r
-sub text {\r
- my $self = shift;\r
- my ($text) = @_;\r
-\r
- 1;\r
-}\r
-\r
-sub comment {\r
- my $self = shift;\r
- my ($comment) = @_;\r
-\r
- 1;\r
-}\r
- \r
-1;\r
-\r
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Main;
-
-use warnings;
-use strict;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-require Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(main);
-
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Bookmarks;
-use Insipid::RSS;
-use Insipid::JSON;
-use Insipid::Sessions;
-use Insipid::Snapshots;
-use Insipid::Tags;
-use Insipid::Util;
-use Insipid::Stats;
-use Insipid::Screenshots;
-
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use URI::Escape;
-use IO::File;
-use XML::Parser;
-use XML::Writer;
-use Date::Format;
-use Date::Parse;
-use DBI qw/:sql_types/;
-use Digest::MD5 qw(md5 md5_hex);
-use MIME::Base64;
-use LWP::UserAgent;
-use HTTP::Request;
-use HTTP::Response;
-use Data::Validate::URI qw(is_uri);
-
-my $NL = "<br />\n";
-my @valid;
-my $icount = 0;
-my %options;
-my $tspec = "";
-my $query = "";
-my $last_page = 0;
-my $site_title;
-
-if (!defined($ENV{SERVER_NAME})) {
- $NL = "\n";
-}
-
-sub main {
-
- my $username = getconfig('username');
- my $userpass = getconfig('userpass');
- my $usePhantomjs = getconfig('usePhantomjs');
- my $phantomjsPath = getconfig('phantomPath');
-
- my $redirect = '';
- my $et = '';
-
- # Valid options:
- @valid = (
- 'feed_name', 'site_name', 'public_searches', 'use_rewrite',
- 'proxy_host', 'proxy_port'
- );
-
- # Get the basic options
- $site_title = get_option('site_name');
- if ($site_title eq '') {
- $site_title = 'Insipid Bookmarks';
- }
-
- # Initialize variables that can be posted and in the URL.
- if (defined(url_param('q'))) {
- $query = url_param('q');
- }
-
- if (defined(param('q'))) {
- $query = param('q');
- }
-
- # Check to see if a username and password have been posted
- if (defined(param('password')) && defined(param('username'))) {
- if ( (param('password') eq $userpass)
- && (param('username') eq $username)) {
- my $rv = login();
- print $rv;
- } else {
- push(@errors, "Invalid username or password.");
- }
- }
-
- # Operations for non-HTML content
-
- if (defined(url_param('op'))) {
- if (url_param('op') eq 'export') {
-
- check_access();
-
- my $sn = 'n';
- if (defined(param('snapshots'))) {
- $sn = 'y';
- }
- do_export($sn);
- }
-
- if (defined(param('op'))) {
- if (logged_in() eq 1) {
- if (param('op') eq 'logout') {
- my $rv = logout();
- print $rv;
- }
- }
- }
-
- # RSS
- if (url_param('op') eq 'rss') {
- print "Content-Type: text/xml\r\n\r\n";
- send_rss();
- exit;
- }
-
- # JSON
- # JSON Show tags:
- if (url_param('op') eq 'json_tags') {
- print "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n";
- send_json_tags();
- exit;
- }
-
- # JSON Show bookmarks:
- if (url_param('op') eq 'json_posts') {
- print "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n";
- send_json_posts();
- exit;
- }
-
- # Cache
- if (url_param('op') eq 'viewsnapshot') {
- check_access();
- if (param('md5')) {
- show_snapshot(param('md5'));
- }
- }
- }
-
- # Allow redirections to a bookmark if the user's logged in.
- # This allows private bookmarks to not send a referer.
- if (logged_in() eq 1) {
- if (param('go')) {
- my $bid = param('go');
- my $sql = "select url from $tbl_bookmarks
- where ($tbl_bookmarks.id = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($bid);
- my $hr = $sth->fetchrow_hashref;
- if (defined($hr->{'url'})) {
- print "Cache-Control: private, must-revalidate\n";
- print "Content-Type: text/html; charset=UTF-8\n\n";
- print
- "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$hr->{'url'}\">\n";
- exit;
- } else {
- push(@errors, "Bookmark does not exist.");
- }
- }
- }
-
- # Add description to the HTML title tag.
- if (url_param('tag')) {
- $tspec = "/" . url_param('tag');
- $tspec =~ s/ /\+/g;
- my $tt = url_param('tag');
- $tt =~ s/ / \+ /g;
- $et = sprintf(" - %s", $tt);
- }
- if ($query ne "") {
- $et = sprintf(" - search results for \"%s\"", $query);
- }
-
- if (logged_in() eq 1) {
- print "Cache-Control: private, must-revalidate\n";
- }
-
- print "Content-Type: text/html; charset=UTF-8\n\n";
-
- print <<DOC;
-<html>
- <head>
- <title>$site_title$et</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="alternate" type="application/rss+xml" title="RSS" href="$feed_url$tspec" />
- <link rel="stylesheet" href="$site_url/insipid.css" type="text/css" title="Standard" />
- <script type="text/javascript" src="$site_url/lib/js/jquery.js"></script>
- </head>
- <body marginheight="0" marginwidth="0">
-DOC
-
- ###### Operations that don't touch the screen
- if (defined(param('op')) && defined(param('id'))) {
- if (param('op') eq 'delete_bookmark') {
- my $id = param('id');
- delete_bookmark($id);
- }
- }
-
- # If the user just saved a bookmark, redirect them now.
- if ($redirect ne "") {
- print "<script language=\"JavaScript\">document.location = \"$redirect\";</script>";
- print "</body></html>";
- exit;
- }
-
- show_toolbar();
- show_tags();
-
- print '<table class="bodyContent" border="0"><tr><td>';
-
- if (defined(url_param('op'))) {
- if (url_param('op') eq 'export') {
- if (!defined(param('target'))) {
- print "<br /><br /><form method=\"post\" class=\"formText\">";
- print "<input type=\"checkbox\" name=\"snapshots\" />Include Snapshots<br />";
- print "<input type=\"submit\" value=\"Export\" /></form>";
- }
- }
-
- if (url_param('op') eq 'import') {
- check_access();
- if (param('fileupload')) {
- do_import();
- } else {
- print <<IFORM;
- <p>This allows you to import either
- <a href="http://www.neuro-tech.net/insipid/">Insipid</a> or
- <a href="http://del.icio.us/">del.icio.us</a> backups. For del.icio.us, you
- must first use their API to export your bookmarks to an XML file. To do this,
- access the URL "http://username:password\@del.icio.us/api/posts/all?"
- (using your username and password). You can then upload that XML file here.
- </p>
- <br />
- <form class="formtext" enctype="multipart/form-data" action="$site_url/insipid.cgi?op=import" method="post">
- Import from:<br />
- <input type="file" name="fileupload" size="30"><br />
- <input type="hidden" name="op" value="import" />
- <input type="submit" value="Import" />
- </form>
-IFORM
- }
- }
- }
-
- if (defined(param('op'))) {
- if (param('op') eq 'login') {
- login_form();
- }
-
- if ((param('op') eq 'add_bookmark') || (param('op') eq 'edit_bookmark')) {
- check_access();
- #check to see if the url is bookmarked, then indicate that this is an edit.
- my (
- $id, $url, $title,
- $description, $button, $tags,
- $extra_params, $access_level, $access_box
- ) = (-1, "", "", "", "", "", "", 0, "");
-
- $access_level = 0;
-
- if (defined(param('save'))) {
- ($url, $title, $description, $tags) = (
- param('url'), param('title'),
- param('description'), param('tags')
- );
-
- if(!$url || !$title) {
- print "URL or Title can not be empty";
- exit;
- }
-
- if(!is_uri($url)) {
- print "This is not a valid URL";
- exit;
- }
-
- if (defined(param('access_level'))) {
- if (param('access_level') eq 'on') {
- $access_level = 1;
- } else {
- $access_level = 0;
- }
- }
-
- if (param('id')) {
- update_bookmark(param('id'), $url, $title, $description, $access_level, $tags);
- } else {
- add_bookmark($url, $title, $description, $access_level, 0, $tags);
- }
- if (param('snapshot')) {
- if (param('snapshot') eq 'on') {
- $id = get_bookmark_id(param('url'));
- do_snapshot($id);
- }
- }
-
- if (param('screenshot')) {
- if (param('screenshot') eq 'on') {
- $id = get_bookmark_id(param('url'));
- my $do = do_screenshot($id);
- }
- }
-
- if (param('redirect')) {
- if (param('redirect') eq 'on') {
- if (@errors eq 0) {
- $redirect = $url;
- }
- }
- }
- } else {
- # Show the form, populating from the database if it's an existing entry.
- my $utext = "URL:";
- my $snapshot_params = "";
- $id = "-1";
-
- if (defined(param('id'))) {$id = param('id');}
- if (defined(url_param('id'))) {$id = url_param('id');}
-
- if ($id eq "-1") {
- if (defined(param('url'))) {
- $id = get_bookmark_id(param('url'));
- }
- }
-
- if ($id ne -1) {
- ($url, $title, $description, $access_level) =
- get_bookmark($id);
- $tags = get_tags($url);
- $button = "Save";
- $utext = "<span style=\"color:red\">URL (already bookmarked):</span>";
- $extra_params = "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
- } else {
-
- # There has to be a nicer way to do this.
- if (param('url')) {$url = param('url');}
- if (param('title')) {$title = param('title');}
- if (param('description')) {
- $description = param('description');
- }
- $access_level = 1;
- $button = "Add";
- $snapshot_params = "<span class=\"formtext\">Snapshot:</span><input type=\"checkbox\" name=\"snapshot\" />\n";
- }
-
- my $style = "style=\"width:500px\"";
- my $redir = "off";
- my $redir_box = "";
-
- if (param('redirect')) {
- if (param('redirect') eq 'on') {$redir = 'on';}
- if (param('redirect') eq 'true') {$redir = 'on';}
- }
-
- if ($access_level eq 0) {$access_box = "";}
- else {$access_box = "checked=\"true\" ";}
-
- if ($redir eq 'on') {$redir_box = "checked=\"true\"";}
-
- print <<FORM;
- <script type="text/javascript" src="lib/js/tagsSuggest.js"></script>
- <br />
- <form method="post">
- <span class="formtext">$utext</span><br />
- <input name="url" $style value="$url" /><br />
-
- <span class="formtext">Title:</span><br />
- <input name="title" $style value="$title" /><br />
-
- <span class="formtext">Description:</span><br />
- <input name="description" $style value="$description" /><br />
-
- <span class="formtext">Tags:</span><br />
- <input name="tags" $style value="$tags" /><br />
-
- <div id="suggestlist"><ul></ul></div>
-
- $snapshot_params
-
- <span class="formtext">Public:</span>
- <input type="checkbox" name="access_level" $access_box />
-
- <span class="formtext">Return:</span>
- <input type="checkbox" name="redirect" $redir_box />
-FORM
- if($usePhantomjs) {
- print "<span class='formtext'>Screenshot:</span>";
- print "<input type='checkbox' name='screenshot' value='on' />";
- }
-
- print <<FORM;
- <input type="hidden" name="save" value="true" />
- <input type="hidden" name="op" value="add_bookmark" />
-
- $extra_params
- <input type="submit" value="$button" />
- </form>
-FORM
- }
- }
- elsif(param('op') eq 'screenshot' && $usePhantomjs) {
- my $id;
-
- if (defined(param('id'))) {$id = param('id');}
- if (defined(url_param('id'))) {$id = url_param('id');}
-
- if ($id eq "-1") {
- if (defined(param('url'))) {
- $id = get_bookmark_id(param('url'));
- }
- }
- my ($url, $title, $description, $access_level, $md5) = get_bookmark($id);
- my $screnshotNameFile = "./screenshots/".$md5.".png";
-
- if (defined(param('create_screenshot')) && param('create_screenshot') eq '1') {
-
- print '<p>Creating screenshot... Please wait...</p>';
- my $do = do_screenshot($id);
- if($do == 0) {
- print '<p style="color: green;">Success !</p>';
- if(-e $screnshotNameFile) {
- print "<p>Screenshot available: <a href='$screnshotNameFile'>see it here.</a><p>";
- }
- }
- else {
- print "<p>Screenshot creation failed.<p>";
- }
- }
- else {
- if(-e $screnshotNameFile) {
- print "<p>Screenshot available: <a href='$screnshotNameFile'>see it here.</a> Re-Create to refresh.<p>";
- }
-
- print <<FORM;
- <p>$title : $url</p>
- <form method="post">
- <input type="hidden" name="op" value="screenshot" />
-
- <span class="formtext">Create screenshot:</span>
- <input type="checkbox" name="create_screenshot" value="1" />
- <input type="submit" value="Create" />
- </form>
-FORM
- }
- }
- }
-
- # Late redirects. TODO: Get rid of this.
- if ($redirect ne "") {
- print
- "<script language=\"JavaScript\">document.location = \"$redirect\";</script>";
- print "</body></html>";
- exit;
- }
-
- if (defined(param('op'))) {
- if (logged_in() eq 1) {
- # used in snapshots
- if (param('op') eq 'fetchrelated') {
- if (defined(param('id'))) {
- fetch_related(param('id'));
- }
- }
-
- if (param('op') eq 'snapshots') {
- show_snapshots();
- print "</body></html>";
- exit;
- }
-
- if (param('op') eq 'snapshot') {
- if (defined(param('id'))) {
- do_snapshot(param('id'));
- print "</body></html>";
- exit;
- }
- }
-
- if (param('op') eq 'bookmarklets') {
- print <<DESC;
-<p>This bookmarklet provides a fast way to add your browser's
-current page to this Insipid installation. Either drag the
-following link to your bookmarks toolbar or right-click on it
-and choose "Bookmark This Link..." to create a bookmarklet.
-Then when you're on a page you'd like to save, click on your
-new "Add to Insipid" button and you'll be brought to a page
-that allows you to fill out the tags for the bookmark and save
-it. Once you've clicked Save you'll be brought back to the
-page.</p>
-DESC
- my $ad = <<BLET;
- javascript:location.href='$site_url/insipid.cgi?op=add_bookmark&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&redirect=true'
-BLET
- print "<ul><li><a href=\"$ad\">Add to Insipid</a></li></ul>";
- print "</td></tr></table><br /></body></html>";
- exit;
- }
-
- # Configuration and management pages
- if (param('op') eq 'tags') {
- tag_operations();
- print "</td></tr></table><br /></body></html>";
- exit;
- }
-
- # show the options
- if (param('op') eq 'options') {
- show_options();
- print "</td></tr></table><br /></body></html>";
- exit;
- }
-
- # management
- if (param('op') eq 'stats') {
- show_stats();
- print "</td></tr></table><br /></body></html>";
- exit;
- }
-
- # screenshot overview
- if (param('op') eq 'screenshots' && $usePhantomjs) {
- show_screenshots();
- print "</td></tr></table><br /></body></html>";
- exit;
- }
- }
- }
-
- foreach (@errors) {
- print "<div class=\"error\">$_</div>";
- }
-
- show_bookmarks();
-
- print "</td></tr></table><br /></body></html>";
-} # main
-
-################################################################
-
-sub do_screenshot {
- my ($bookmarkID) = (@_);
-
- my $phantomjsPath = getconfig('phantomPath');
-
- my ($url, $title, $description, $access_level, $md5) = get_bookmark($bookmarkID);
- my $screnshotNameFile = "./screenshots/".$md5.".png";
-
- #my $output = `$phantomjsPath ./lib/screen.js $url $screnshotNameFile`;
- my $output = `$phantomjsPath --proxy=10.0.1.11:80 ./lib/screen.js $url $screnshotNameFile`;
- if($? == 0) {
- return 0;
- }
- else {
- if ($? == -1) {
- return "failed to execute: $!\n";
- }
- elsif ($? & 127) {
- return printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
- }
- else {
- return printf "child exited with value %d\n", $? >> 8;
- }
- }
-}
-
-sub show_options {
-
- # Save options if they were posted.
- print "<br /><br />";
- if (param('save')) {
- my $sql = "update $tbl_options set value=?
- where (name = ?)";
- my $sth = $dbh->prepare($sql);
-
- my %save;
- foreach my $p (@valid) {
- if (param($p)) {
- $save{$p} = param($p);
- }
- }
-
- foreach my $k (keys %save) {
- $sth->execute($save{$k}, $k);
- }
-
- # The proxy_host can be empty, so check for that.
- if (!defined($save{'proxy_host'})) {
- $sth->execute('', 'proxy_host');
- }
-
- print "<div class=\"error\">Your options have been saved.</div>";
- }
-
- # Now show em
- my $sql = "SELECT name, description, value
- FROM $tbl_options
- ORDER BY `pos`";
- my $sth = $dbh->prepare($sql);
- $sth->execute();
-
- print "<form method=\"post\">";
- print "<table id=\"options\" cellpadding=5 cellspacing=5>";
- while (my $hr = $sth->fetchrow_hashref) {
- print "<td>$hr->{'description'}</td>";
- if ($hr->{'name'} eq 'version') {
- print "<td>$hr->{'value'}</td>";
- } else {
- print "<td><input name=\"$hr->{'name'}\" value=\"$hr->{'value'}\" /></td>";
- }
- print "</tr>";
- }
-
- print "<input type=hidden name=op value=options>";
- print "<input type=hidden name=save value=yes>";
- print "<tr><td></td><td><input type='submit' value='Save'></td></tr>";
- print "</table></form>";
-}
-
-sub show_pageLinks {
- my $older = 2;
- my $newer = 2;
- my $returnstr;
- my $currentPage;
-
- if (defined(url_param('page'))) {
- $currentPage = url_param('page')||'';
- $older = $currentPage + 1;
- $newer = $currentPage - 1;
- }
- else {
- $currentPage = 1;
- $older = $currentPage + 1;
- $newer = $currentPage - 1;
- }
-
- $returnstr = " | ";
- if($older >= 2 && $currentPage > 1) {
- $returnstr .= "<a href=\"?page=$newer\">« newer</a>";
- }
- if ($last_page eq 0) {
- $returnstr .= " <a href=\"?page=$older\">older »</a>";
- }
-
- print $returnstr;
-}
-
-sub do_import {
- my $old_fh = select(OUTPUT_HANDLE);
- my $cbuffer = "";
- my $pcount = 0;
- my $icount = 0;
- $| = 1;
- select($old_fh);
-
- my ($omd5, $ourl, $otype, $olength, $odate, $sql, $oadd, $omod, $otags);
- my $ispec = '';
-
- $ispec = " ignore ";
-
- $sql = "insert $ispec into pagecache_references
- (md5_parent, md5_child) values(?,?)";
- my $insert_reference = $dbh->prepare($sql);
-
- $sql = "insert $ispec into pagecache
- (md5,url,content_type,
- content_length,content,date)
- values(?,?,?,?,?,?)";
- my $insert_snapshot = $dbh->prepare($sql);
-
- $sql = 'update options set value = ? where (name = ?)';
- my $update_option = $dbh->prepare($sql);
-
- my $parser = new XML::Parser();
- $parser->setHandlers(
- Start => sub {
- my %attr;
- my $expat = shift;
- my $element = shift;
-
- while (@_) {
- my $att = shift;
- my $val = shift;
- $attr{$att} = $val;
- }
-
- # netscape stuff
- if ($element eq "A") {
- $ourl = $attr{'HREF'};
- $oadd = $attr{'ADD_DATE'};
- $omod = $attr{'LAST_MODIFIED'};
- $otags = $attr{'TAGS'};
- $cbuffer = '';
- }
-
- # A pagecache object
- if ($element eq "object") {
- $omd5 = $attr{'md5'};
- $ourl = $attr{'url'};
- $otype = $attr{'type'};
- $olength = $attr{'length'};
- $odate = $attr{'date'};
- }
-
- # A pagecache relationship
- if ($element eq "relationship") {
- my $parent = $attr{parent};
- my $child = $attr{child};
- $insert_reference->execute($parent, $child);
- }
-
- # A bookmark
- if ($element eq "post") {
- my $url = $attr{href};
- my $title = $attr{description};
- my $tagvalue = $attr{tag};
- my $datevalue = $attr{time};
- my $access_level;
- if (defined($attr{access_level})) {
- $access_level = $attr{access_level};
- } else {
- $access_level = 1;
- }
-
- my $epoch = str2time($datevalue);
-
- if ($tagvalue eq "system:unfiled") {
- $tagvalue = "";
- }
-
- add_bookmark($url, $title, "", $access_level, $epoch, $tagvalue, 1);
- $icount++;
- }
-
- # Option
- if ($element eq 'option') {
- $update_option->execute($attr{value}, $attr{name});
- }
- },
- Char => sub {
- my $expat = shift;
- my $chars = shift;
- $cbuffer = $cbuffer . $chars;
- 1;
- },
- End => sub {
- my $expat = shift;
- my $element = shift;
-
- #
- # netscape stuff
- #
- if ($element eq 'A') {
- add_bookmark(
- $ourl, # $url,
- $cbuffer, # $title,
- "",
- '1', # $access_level,
- $omod, # $epoch,
- $otags, # $tagvalue
- );
- $cbuffer = '';
- }
- if ($element eq 'TITLE' || $element eq 'H1' || $element eq 'DD') {
- $cbuffer = '';
- }
-
- if ($element eq 'object') {
-
- $insert_snapshot->bind_param(1, $omd5);
- $insert_snapshot->bind_param(2, $ourl);
- $insert_snapshot->bind_param(3, $otype);
- $insert_snapshot->bind_param(4, $olength);
-
- $insert_snapshot->bind_param(5, decode_base64($cbuffer));
-
- $insert_snapshot->bind_param(6, $odate);
- $insert_snapshot->execute;
-
- if (!defined($DBI::errstr)) {$pcount++;}
-
- $cbuffer = "";
- }
- }
- );
-
- my $xml = "";
-
- # BEGIN {
- # *CORE::GLOBAL::die = sub {
- # print "Some errors were detected. ";
- # };
- # }
-
- if (defined($ENV{SERVER_NAME})) {
- my $fh = upload('fileupload');
- while (<$fh>) {
- $xml .= $_;
- }
-
- $parser->parse($xml);
- } else {
- if (!defined($ARGV[0])) {
- print "Please specify the filename to import.\n\n";
- exit;
- }
-
- my $fn = $ARGV[0];
- $parser->parsefile($fn);
- }
-
- print "Import finished - $icount bookmarks and $pcount "
- . "snapshot objects imported.$NL";
-}
-
-sub do_export {
- my ($snapshots, $islocal) = (@_);
- my $writer;
-
- if (!defined($islocal)) {
- print "Content-Type: text/xml;charset=UTF-8\r\n";
- print "Content-Disposition: attachment; filename=bookmarks.xml\r\n\r\n";
- }
-
- $writer = new XML::Writer();
-
- $writer->xmlDecl('UTF-8');
- $writer->startTag('insipid');
-
- export_bookmarks($writer);
- export_snapshots($writer);
- export_options($writer);
-
- $writer->endTag('insipid');
- $writer->end();
- exit;
-}
-
-sub login_form {
- print <<FORM;
-<br />
-<form method="post" action="$site_url/insipid.cgi">
-<span class="formtext">Username:</span><br />
-<input style="width:250px" name="username" /><br />
-<span class="formtext">Password:</span><br />
-<input style="width:250px" name="password" type="password" /><br />
-<input type="submit" value="Login" />
-</form>
-<br />
-FORM
-}
-
-sub show_toolbar {
- my $rdata = "";
- if (defined(url_param('tag'))) {
- $rdata = url_param('tag');
- $rdata =~ s/ /\+/g;
- }
-
- # Toolbar
- print '<center>';
- print '<table border="0" width="100%" cellspacing="0" cellpadding="3"><tr>';
- print '<td valign="top" bgcolor="#CCCCCC">';
-
- # Title
- print '<div class="title"><a href="';
- if (get_option('use_rewrite') eq 'yes') {
- print $site_url . '/bookmarks';
- } else {
- print 'insipid.cgi';
- }
- print '">' . $site_title . '</a></div>';
-
- if ((get_option("public_searches") eq "yes") || (logged_in() eq 1)) {
- print "<div class=\"search\">";
- print "<form action=\"$site_url/bookmarks\" method=\"post\">";
- print "<input type=\"text\" name=\"q\"> <input type=\"submit\" value=\"search\">";
- print "</form>";
- print "</div>";
- } else {
- print " ";
- }
-
- print "</td><td valign=\"top\" bgcolor=\"#CCCCCC\" align=\"right\">";
- print "<div class=\"toolbar\">";
-
- if (logged_in() eq 1) {
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=options\">options</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=stats\">stats</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=tags\">tags</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=import\">import</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=export\">export</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=snapshots\">snapshots</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=screenshots\">screenshots</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=logout\">logout</a><br />";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=add_bookmark\">add</a> | ";
- print "<a class=\"tools\" href=\"$site_url/insipid.cgi?op=bookmarklets\">bookmarklets</a> | ";
- }
-
- my $rf;
- if (get_option('use_rewrite') eq 'yes') {
- $rf = $feed_url . '/' . $rdata;
- } else {
- $rf = $feed_url . $rdata;
- }
-
- print "<a class=\"tools\" href=\"$rf\">RSS feed</a>";
-
- if (logged_in() ne 1) {
- print " | <a class=\"tools\" href=\"$site_url/insipid.cgi?op=login\">login</a>";
- }
-
- print " <br /> <a class=\"tools\" href=\"javascript:void window.open('$site_url/help.html','width=300,height=500');\">help</a> ";
- print " | <a class='tools' href='http://www.neuro-tech.net/insipid/'>old-source</a>";
- print " | <a class='tools' href='https://github.com/jumpin-banana/insipid'>current-source</a>";
-
- print "</div></tr></table></center>";
-}
-
-sub delete_bookmark {
- my ($id) = (@_);
- my ($sql, $sth) = ("", "", "");
-
- check_access();
-
- # delete screenshot
- my ($url, $title, $description, $access_level, $md5) = get_bookmark($id);
- if(-e './screenshots/'.$md5.".png") {
- unlink('./screenshots/'.$md5.".png");
- }
-
- $md5 = '';
-
- # Check for cached version to delete.
- $sql = "select $tbl_pagecache.md5 from $tbl_pagecache
- inner join $tbl_bookmarks on
- ($tbl_pagecache.md5 = $tbl_bookmarks.md5)
- where ($tbl_bookmarks.id = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($id);
- while (my @r = $sth->fetchrow_array) {
- $md5 = $r[0];
- }
-
- # Drop the tags for the bookmark
- $sql = "delete from $tbl_bookmark_tags where (bookmark_id = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($id);
-
- # Drop the bookmark.
- $sql = "delete from $tbl_bookmarks where (id = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($id);
-
- # Delete the cached page.
- if ($md5 ne "") {delete_snapshot($md5);}
-}
-
-sub show_bookmarks {
- my ($subquery, $sql, $sth, @parms, @wheres, @hr);
-
- # this first query will be used to select from a set, like when a user
- # drills in on a specific tag or to get a smaller view of the entire
- # dataset (for paging purposes).
-
- $sql = "select $tbl_bookmarks.id from $tbl_bookmarks";
-
- # Limit to tags
- if (defined(url_param('tag'))) {
-
- # Join the tag tables only when necessary
-
- if(url_param('tag') eq "empty") {
-
- # allow this action only for logged in users
- check_access();
-
- $sql = $sql." left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id =
- $tbl_bookmark_tags.bookmark_id)
- WHERE $tbl_bookmark_tags.bookmark_id IS NULL";
- }
- elsif (url_param('tag') =~ / /) {
- my @tags = split(/ /, url_param('tag'));
- my $icount = 1;
-
- foreach (@tags) {
- push(@parms, $_);
- $sql = "$sql inner join $tbl_bookmark_tags
- as bt$icount on
- ($tbl_bookmarks.id =
- bt$icount.bookmark_id)
- inner join $tbl_tags as t$icount on
- (t$icount.id = bt$icount.tag_id
- and t$icount.name = ?) ";
- $icount++;
- }
- } else {
- $sql = "$sql
- left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id =
- $tbl_bookmark_tags.bookmark_id)
- inner join $tbl_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- where ($tbl_tags.name = ?)";
- push(@parms, url_param('tag'));
- }
-
- }
-
- # search by domain
- if(defined(url_param('bydomain'))) {
- my $sparm = url_param('bydomain');
- $sql = "$sql where ($tbl_bookmarks.url like ?)";
- $sparm =~ s/\%//;
- $sparm = "\%$sparm\%";
- push(@parms, $sparm);
- }
-
-
- # Search
- if ($query ne "") {
- if ( (get_option("public_searches") eq "yes")
- || (logged_in() eq 1)) {
- my $sparm = $query;
- if (length($sparm) > 2) {
- $sql = "$sql where ($tbl_bookmarks.title like ?)";
- $sparm =~ s/\%//;
- $sparm = "\%$sparm\%";
- push(@parms, $sparm);
- }
- }
- }
-
- # order
- $sql = "$sql order by $tbl_bookmarks.date desc";
-
- # paging functionality
- $sql = "$sql limit 50";
-
- if (defined(url_param('page'))) {
- my $offset = ((url_param('page') - 1) * 50);
- $sql = "$sql offset $offset";
- }
-
- $sth = $dbh->prepare($sql);
- $sth->execute(@parms);
-
- $subquery = "";
- if ($sth->rows > 0) {
- if ($sth->rows ne 50) {$last_page = 1;}
-
- $subquery = " $tbl_bookmarks.id in (";
-
- while (@hr = $sth->fetchrow_array) {
- $subquery = $subquery . "$hr[0],";
- }
- chop($subquery); # Strip off the last delimiter
-
- $subquery = $subquery . ")";
- } else {
- print "<p>No bookmarks found.</p>";
- return;
- }
-
- @parms = ();
- @wheres = ();
-
- $sql = "select
- $tbl_bookmarks.id,
- $tbl_bookmarks.title,
- $tbl_bookmarks.description,
- $tbl_bookmarks.access_level,
- $tbl_bookmarks.url,
- $tbl_tags.name,
- $tbl_bookmarks.date,
- $tbl_pagecache.date as cache_date,
- $tbl_bookmarks.md5
- from $tbl_bookmarks
- left join $tbl_bookmark_tags on
- ($tbl_bookmarks.id = $tbl_bookmark_tags.bookmark_id)
- left join $tbl_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- left join $tbl_pagecache on
- ($tbl_bookmarks.md5 = $tbl_pagecache.md5)";
-
- # Don't show private marks for non-logged in users
- if (logged_in() eq 0) {
- push(@wheres, "$tbl_bookmarks.access_level");
- push(@parms, "1");
- }
-
- my $max = @wheres;
- if ($max ne 0) {
- $sql = "$sql where (";
- my $count = 1;
-
- foreach (@wheres) {
- $sql = "$sql $_ = ?";
- if ($count < $max) {
- $sql = "$sql and ";
- }
- $count++;
- }
-
- $sql = "$sql )";
- if ($subquery ne "") {$sql = "$sql and $subquery";}
- } else {
- if ($subquery ne "") {$sql = "$sql where $subquery ";}
- }
-
- # append sort order.
- $sql = "$sql order by $tbl_bookmarks.date desc";
-
- $sth = $dbh->prepare($sql);
- $sth->execute(@parms);
-
- my %last;
- $last{id} = -1;
-
- print '<ul><br />';
-
- my $title = '';
- if (defined(url_param('tag'))) {
- my $temp = url_param('tag');
- if ($temp =~ / /) {
- my $count = 0;
- foreach (split(/ /, $temp)) {
- if ($count++ ne 0) {$title = "$title +";}
- $title =
- "$title <a class=\"bodyTitle\" href=\"$tag_url$_\">$_</a>";
- }
- } else {
- $title = "<a class=\"bodyTitle\" href=\"$tag_url$temp\">$temp</a>";
- }
- } else {
- $title = 'Most Recent Bookmarks';
- }
-
- if ($query ne '') {
- $title = sprintf("Search results for \"%s\"", $query);
- }
-
- print "<span class=\"bodyTitle\">$title</span>";
- show_pageLinks();
- print '<br /><br />';
-
- print "<table class=\"bookmarklist\">";
- print '<tr><td>';
- print "<ul type=\"circle\">\n";
- while (@hr = $sth->fetchrow_array) {
- if ($last{id} eq -1) {
- $last{id} = $hr[0];
- $last{title} = $hr[1];
- $last{description} = $hr[2];
- $last{access_level} = $hr[3];
- $last{url} = $hr[4];
- $last{tags} = "";
- $last{timestamp} = $hr[6];
- $last{cachetime} = $hr[7];
- $last{md5} = $hr[8];
- }
-
- if ($hr[0] ne $last{id}) {
-
- # the id changed, so show the last mark.
- show_bookmark(
- $last{id}, $last{title}, $last{description},
- $last{access_level}, $last{url}, $last{tags},
- $last{timestamp}, $last{cachetime}, $last{md5}
- );
-
- # Swap the new one in.
- $last{id} = $hr[0];
- $last{title} = $hr[1];
- $last{description} = $hr[2];
- $last{access_level} = $hr[3];
- $last{url} = $hr[4];
- $last{tags} = $hr[5];
- $last{timestamp} = $hr[6];
- $last{cachetime} = $hr[7];
- $last{md5} = $hr[8];
- } else {
-
- # Add tag to the current bookmark
- if (defined($hr[5])) {
- $last{tags} = "$last{tags} $hr[5]";
- }
- }
- }
-
- if ($last{id} ne -1) {
- show_bookmark(
- $last{id}, $last{title}, $last{description},
- $last{access_level}, $last{url}, $last{tags},
- $last{timestamp}, $last{cachetime}, $last{md5}
- );
- }
-
- print "</ul></td></tr></table>";
-}
-
-sub show_bookmark {
- my (
- $id, $title, $description,
- $access_level, $url, $tags,
- $timestamp, $cachetime, $md5
- ) = (@_);
-
- my $usePhantomjs = getconfig('usePhantomjs');
-
- print "<div class=\"bookmarklistitem\">";
- print "<li>";
- if ($access_level eq 0) {
- print "<a href=\"$site_url/insipid.cgi?go=$id\">";
- print "<i>";
- print "$title";
- print "</i>";
- } else {
- print "<a href=\"$url\">";
- print $title;
- }
-
- if (logged_in() eq 1) {
- if (defined($cachetime)) {
- print "</a> - <a href=\"$snapshot_url$md5\">view snapshot";
- }
- }
-
- print "</a><br /><div class=\"bookmarkOperations\">";
-
- my $timestr = "";
- if (logged_in() eq 1) {
- $timestr = time2str("%Y-%m-%d %T EST", $timestamp, "EST");
- } else {
- $timestr = time2str("%Y-%m-%d", $timestamp, "EST");
- }
-
- print "posted on $timestr ";
-
- if (defined($tags)) {
- print "to ";
- my $cur;
-
- foreach $cur (split(/\ /, $tags)) {
- print '<a class="bookmarkTag" href="';
- print $tag_url . $cur . '">' . $cur . '</a> ';
- }
- }
-
- if (logged_in() eq 1) {
- my $ex = "";
-
- if (url_param('tag')) {$ex = "$ex&tag=" . url_param('tag');}
- if (url_param('page')) {$ex = "$ex&page=" . url_param('page');}
- if ($query ne "") {$ex = "$ex&q=" . $query;}
-
- print "<span class=\"bodytext\"> — ";
- print "(<a class=\"bookmarkOp\" href=\"$site_url/insipid.cgi?op=delete_bookmark&id=$id$ex\">delete</a>, ";
- print "<a class=\"bookmarkOp\" href=\"$site_url/insipid.cgi?op=edit_bookmark&id=$id$ex\">edit</a>";
- if (!defined($cachetime)) {
- print ", <a class=\"bookmarkOp\" href=\"$site_url/insipid.cgi?op=snapshot&id=$id$ex\">snapshot</a>";
- }
- if($usePhantomjs) {
- print ", <a class=\"bookmarkOp\" href=\"$site_url/insipid.cgi?op=screenshot&id=$id$ex\">screenshot</a>";
- }
- print ")<div class=\"bookmarkDescription\">$description</div></span></div></li>\n";
- }
-
- print "</div>\n";
-}
-
-# Gets the ID for a bookmark if it already exists in the DB. Otherwise, -1.
-sub get_bookmark_id {
- my ($url) = (@_);
-
- # Lookup the URL id first.
- my $sql = "select $tbl_bookmarks.id from
- $tbl_bookmarks where ($tbl_bookmarks.md5 = ?)";
- my $sth = $dbh->prepare($sql);
-
- $sth->execute(md5_hex($url));
-
- if ($sth->rows ne 0) {
- my @r = $sth->fetchrow_array;
- return $r[0];
- }
-
- return -1;
-}
-
-sub get_bookmark {
- my ($id) = (@_);
-
- my $sql = "select
- $tbl_bookmarks.title,
- $tbl_bookmarks.description,
- $tbl_bookmarks.url,
- $tbl_bookmarks.access_level,
- $tbl_bookmarks.md5
- from $tbl_bookmarks
- where ($tbl_bookmarks.id = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($id);
- my @r = $sth->fetchrow_array;
- return ($r[2], $r[0], $r[1], $r[3], $r[4]);
-}
-
-sub update_bookmark {
- my ($id, $url, $title, $description, $access_level, $tags) = (@_);
-
- check_access();
-
- my $sql = "update $tbl_bookmarks
- set url = ?, md5 = ?, title = ?, description = ?,
- access_level = ?,
- linkcheck_status = 1,
- linkcheck_status = ''
- where (id = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($url, md5_hex("$url"), $title, $description, $access_level,$id);
-
- set_tags($id, $tags);
-}
-
-1;
-__END__
+++ /dev/null
-package Insipid::Parser;\r
-\r
-use HTML::Parser;\r
-use HTML::Entities ();\r
-use URI::URL;\r
-use Digest::MD5 qw(md5 md5_hex);\r
-use Insipid::Config;\r
-use Insipid::Database;\r
-\r
-use vars qw(@ISA);\r
-@ISA = qw(HTML::Parser);\r
-\r
-sub setSnapshotMap {\r
- my($self, $ssMap) = (@_);\r
- $self->{SSMAP} = $ssMap;\r
-}\r
-\r
-sub new {\r
- my $pack = shift;\r
- my $self = $pack->SUPER::new;\r
- @{$self}{qw(__base __grabit)} = @_;\r
- $self;\r
-}\r
-\r
-sub declaration {\r
- my $self = shift;\r
- my ($decl) = @_;\r
-}\r
-\r
-sub start {\r
- my $self = shift;\r
- my ($tag, $attr, $attrseq, $origtext) = @_;\r
-\r
- if(!defined($self->{__grabit})) {\r
- print("<$tag");\r
- }\r
-\r
- for (keys %$attr) {\r
- my $val = $attr->{$_};\r
- if(($_ eq "/") && ($val = "/")) { next; }\r
-\r
- if(!defined($self->{__grabit})) { \r
- print(" $_=\""); \r
- }\r
-\r
- if( "$tag $_" =~ /^(link href|img src)$/i) {\r
- $val = url($val)->abs($self->{__base},1);\r
-\r
- if(!defined($self->{__grabit})) {\r
- if($val =~ /(\.gif|\.jpg|\.png|\.css)$/i) {\r
- my $md5 = md5_hex("$val");\r
- $val = $snapshot_url . $md5;\r
- }\r
- } else {\r
- # JPG, GIF, PNG and CSS\r
- if($val =~ /(\.gif|\.jpg|\.png|\.css)$/i) {\r
- join_urls($self->{__base}, $val);\r
- $val = $self->{__grabit}($val, $1);\r
- }\r
- }\r
- }\r
-\r
- if(!defined($self->{__grabit})) {\r
- # Check against our snapshot map\r
- if(($tag =~ /^a/i) && ($_ =~ /^href/i)) {\r
- my $sst = $self->{SSMAP};\r
-\r
- if(defined($sst->{$val})) {\r
- print $snapshot_url . $sst->{$val};\r
- print('"');\r
- } else {\r
- print("$val\"");\r
- }\r
- } else {\r
- print("$val\"");\r
- }\r
- }\r
- }\r
-\r
- if(!defined($self->{__grabit})) { print(">"); }\r
-}\r
-\r
-sub end {\r
- my $self = shift;\r
- my ($tag) = @_;\r
-\r
- if(!defined($self->{__grabit})) { print("</$tag>"); }\r
-}\r
-\r
-sub text {\r
- my $self = shift;\r
- my ($text) = @_;\r
-\r
- if(!defined($self->{__grabit})) { print("$text"); }\r
-}\r
-\r
-sub comment {\r
- my $self = shift;\r
- my ($comment) = @_;\r
-\r
- if(!defined($self->{__grabit})) { print("<!-- $comment -->"); }\r
-}\r
-\r
-sub join_urls {\r
- my($parent, $child) = (@_);\r
- my $sql = "insert into $tbl_pagecache_references(md5_parent, md5_child) values(?, ?)";\r
- my $sth = $dbh->prepare($sql);\r
- $sth->execute(md5_hex($parent), md5_hex($child));\r
- if($sth->err) {\r
- # ignore errors for now\r
- }\r
-}\r
-\r
-1;\r
-__END__\r
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-package Insipid::RSS;\r
-\r
-use warnings;\r
-use strict;\r
-\r
-use CGI qw/:standard/;\r
-use CGI::Carp qw(fatalsToBrowser);\r
-\r
-use Insipid::Config;\r
-use Insipid::Database;\r
-use Insipid::Sessions;\r
-use Insipid::Util;\r
-\r
-use vars qw(@ISA @EXPORT $dbh);\r
-require Exporter;\r
-\r
-@ISA = qw(Exporter);\r
-@EXPORT = qw(send_rss);\r
-\r
-sub send_rss {\r
- my @parms;\r
- my $ew = "";\r
- my $joins = "";\r
- my $title = get_option("feed_name");\r
- my $limit = get_option("feed_num");\r
-\r
- if(url_param('tag')) {\r
- if(url_param('tag') =~ / /) {\r
- my @tags = split(/ /, url_param('tag'));\r
- my $rcount = 1;\r
-\r
- foreach(@tags) {\r
- push(@parms, $_);\r
- $joins = "$joins inner join $tbl_bookmark_tags\r
- as bt$rcount on\r
- ($tbl_bookmarks.id = bt$rcount.bookmark_id)\r
- inner join $tbl_tags as t$rcount on\r
- (t$rcount.id = bt$rcount.tag_id and t$rcount.name = ?) ";\r
- $rcount++;\r
- }\r
- } else {\r
-\r
- push(@parms, url_param('tag'));\r
- $joins = "\r
- inner join $tbl_bookmark_tags on\r
- ($tbl_bookmarks.id =\r
- $tbl_bookmark_tags.bookmark_id)\r
- inner join $tbl_tags on\r
- ($tbl_bookmark_tags.tag_id = $tbl_tags.id)";\r
- $ew = "and ($tbl_tags.name = ?)";\r
- }\r
- }\r
-\r
- my $access_where = "where (access_level = 1)";\r
- if(logged_in() eq 1) {\r
- $access_where = "";\r
- }\r
-\r
- my $sql = "\r
- select $tbl_bookmarks.id, $tbl_bookmarks.title, $tbl_bookmarks.url\r
- from $tbl_bookmarks $joins $access_where $ew\r
- order by $tbl_bookmarks.date desc limit $limit";\r
-\r
- my $sth = $dbh->prepare($sql);\r
- $sth->execute(@parms);\r
-\r
- print <<RDFHEADER;\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rss version="2.0"\r
- xmlns:dc="http://purl.org/dc/elements/1.1/"\r
- xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"\r
- xmlns:admin="http://webns.net/mvcb/"\r
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\r
- xmlns:content="http://purl.org/rss/1.0/modules/content/">\r
-\r
-<channel>\r
- <title>$title</title>\r
- <link>$full_url</link>\r
- <description>Personal collection</description>\r
- <dc:language>en-us</dc:language>\r
- <dc:creator>Insipid</dc:creator>\r
-RDFHEADER\r
-\r
- while(my @hr = $sth->fetchrow_array) {\r
- my $url = sanitize_html($hr[2]);\r
- my $title = sanitize_html($hr[1]);\r
- print <<ITEM;\r
-<item>\r
- <title>$title</title>\r
- <link>$url</link>\r
- <guid isPermaLink="false">$hr[0]_$full_url</guid>\r
- <content:encoded><![CDATA[<a href="$url">$hr[1]</a>]]></content:encoded>\r
-</item>\r
-ITEM\r
- }\r
-\r
- print "</channel></rss>\n\n";\r
-}\r
-\r
-1;\r
-__END__\r
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Schemas;
-
-use strict;
-use warnings;
-use Insipid::Config;
-
-use vars qw(
-@ISA
-@EXPORT
-$createMySQL
-);
-
-use Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-$version
-$createMySQL
-);
-
-# Insipid will check the database version number on each initialization of
-# the options table (every hit essentially) and upgrade the tables if there's
-# any mismatch.
-our $version = "1.1";
-
-our $createMySQL = <<CMYSQL;
-CREATE TABLE IF NOT EXISTS $tbl_authentication (
- session_id CHAR(32) NOT NULL UNIQUE,
- create_time INT,
- PRIMARY KEY(session_id)
-);
-
-CREATE TABLE IF NOT EXISTS $tbl_bookmarks (
- id INT AUTO_INCREMENT NOT NULL,
- url TEXT NOT NULL DEFAULT '',
- md5 CHAR(32) NOT NULL DEFAULT '' UNIQUE,
- date INT NOT NULL DEFAULT 0,
- title VARCHAR(255) NOT NULL DEFAULT '',
- description TEXT NOT NULL DEFAULT '',
- access_level INT NOT NULL DEFAULT 0,
- PRIMARY KEY(id)
-);
-
-
-CREATE TABLE IF NOT EXISTS $tbl_tags (
- id INT AUTO_INCREMENT NOT NULL,
- name VARCHAR(255) NOT NULL DEFAULT '' UNIQUE,
- PRIMARY KEY(id)
-);
-
-CREATE TABLE IF NOT EXISTS $tbl_bookmark_tags (
- bookmark_id INT NOT NULL,
- tag_id INT NOT NULL,
- PRIMARY KEY(bookmark_id, tag_id),
- INDEX(bookmark_id),
- INDEX(tag_id)
-);
-
-
-CREATE TABLE IF NOT EXISTS $tbl_options (
- name VARCHAR(255) NOT NULL UNIQUE,
- description TEXT NOT NULL DEFAULT '',
- value TEXT NOT NULL DEFAULT '',
- pos INT(10) NO NULL,
- PRIMARY KEY(name)
-);
-
-CREATE TABLE IF NOT EXISTS $tbl_pagecache (
- md5 CHAR(32) NOT NULL DEFAULT '',
- url TEXT NOT NULL DEFAULT '',
- content_type VARCHAR(50),
- content_length INT NOT NULL DEFAULT 0,
- content LONGBLOB,
- date INT NOT NULL DEFAULT 0,
- PRIMARY KEY(md5)
-);
-
-CREATE TABLE IF NOT EXISTS $tbl_pagecache_references (
- md5_parent CHAR(32) NOT NULL DEFAULT '',
- md5_child CHAR(32) NOT NULL DEFAULT '',
- PRIMARY KEY(md5_parent, md5_child)
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'feed_name',
- 'The title of your feed (e.g. My Bookmarks)',
- 'Bookmarks',
- 3
-);
-INSERT IGNORE INTO $tbl_options VALUES(
- 'feed_num',
- 'How many feed entries per default (0 = all)',
- '10',
- 4
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'site_name',
- 'The title of the main page (e.g. My Bookmarks)',
- 'My Bookmarks',
- 1
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'public_searches',
- 'Allow public searches - when set to yes, any visitor can search your bookmarks.',
- 'no',
- 2
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'proxy_host',
- 'The proxy server (if any) to use when making page snapshots.',
- '',
- 20
-);
-INSERT IGNORE INTO $tbl_options VALUES(
- 'proxy_port',
- 'Your proxy port number.',
- '3128',
- 21
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'version',
- 'Internal Insipid version number',
- '$version',
- 9999
-);
-
-INSERT IGNORE INTO $tbl_options VALUES(
- 'use_rewrite',
- 'Use mod_rewrite - disable this if you do not want .htaccess-controlled URLs, or if your Apache does not have the rewrite module installed.',
- 'no',
- 90
-);
-CMYSQL
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2012 jumpin.banana
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Screenshots;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Sessions;
-use Insipid::Util;
-require Exporter;
-
-use URI;
-use URI::Escape;
-use POSIX qw/strftime/;
-use File::Basename;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-show_screenshots
-);
-
-sub show_screenshots {
-
- if(defined(param('delete')) && defined(param('hash'))) {
- my $_md5 = param('hash');
- if($_md5 ne '') {
- unlink("./screenshots/$_md5.png");
- print "<p style='color: green'>Screenshot deleted.</p>";
- }
- }
-
- my @files = <./screenshots/*.png>;
- if(@files) {
- print '<table>';
- print '<tr><th>Screenshot</th><th>Date</th><th>Bookmark</th><th>Options</th></tr>';
- foreach my $file (@files) {
- # some file informations
- my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
- $mtime, $ctime, $blksize, $blocks) = stat($file);
-
- my $md5Hash = basename($file, ".png");
-
- # get the bookmark
- my $sql = "select $tbl_bookmarks.url, $tbl_bookmarks.id from $tbl_bookmarks
- where ($tbl_bookmarks.md5 = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($md5Hash);
- my @r = $sth->fetchrow_array;
-
- my $bookmark = $r[0];
- my $bookmarkID = $r[1];
-
- print '<tr>';
- print "<td><a href='".$file ."'>Screenshotfile</a></td>";
- print "<td>".scalar localtime($mtime)."</td>";
- print "<td><a href='$bookmark'>$bookmark</a></td>\n";
- print "<td><a href='$site_url/insipid.cgi?op=screenshots&delete=1&hash=$md5Hash'>delete</a>, <a href='$site_url/insipid.cgi?op=screenshot&id=$bookmarkID'>refresh</a></td>\n";
- print '</tr>';
- }
- print '</table>';
- }
- else {
- print "<p>No screenshots available yet.</p>";
- }
-}
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-package Insipid::Sessions;\r
-\r
-use warnings;\r
-use strict;\r
-\r
-use CGI qw/:standard/;\r
-use CGI::Carp qw(fatalsToBrowser);\r
-use Digest::MD5;\r
-\r
-use Insipid::Config;\r
-use Insipid::Database;\r
-\r
-use vars qw(@ISA @EXPORT $dbh);\r
-require Exporter;\r
-\r
-@ISA = qw(Exporter);\r
-\r
-@EXPORT = qw(\r
-logged_in\r
-login\r
-logout\r
-);\r
-\r
-# Create/find the session\r
-my $uname = getconfig('username');\r
-my $pagepath = getconfig('pagepath');\r
-my $ctag = "INSIPID2_$uname";\r
-my $sid = cookie($ctag) || undef;\r
-my $logged_in = 0;\r
-my $options;\r
-\r
-if(defined($sid)) {\r
- my $sql = "select create_time from $tbl_authentication \r
- where (session_id = ?)";\r
- my $sth = $dbh->prepare($sql);\r
- $sth->execute($sid);\r
-\r
- if($sth->rows ne 0) {\r
- $logged_in = 1;\r
- } else {\r
- print "Set-Cookie: $ctag=; path=$pagepath; expires=Fri, 03-Sep-2020 20:20:13 GMT\n";\r
- }\r
-}\r
-\r
-# Depending on our context we can consider the user logged in. If they're\r
-# running one of the programs in the "tools" and using a terminal then \r
-# we'll authorize them.\r
-if(!defined($ENV{'SERVER_NAME'})) {\r
- $logged_in = 1;\r
-}\r
-\r
-sub logged_in {\r
- return $logged_in;\r
-}\r
-\r
-# Creates the session and returns the cookie header for a newly-logged in user.\r
-sub login {\r
- my $sid = generate_id();\r
-\r
- my $sql = "insert into $tbl_authentication\r
- (session_id, create_time) values(?, ?)";\r
- my $sth = $dbh->prepare($sql);\r
- $sth->execute($sid, time());\r
-\r
- $logged_in = 1;\r
- \r
- return "Set-Cookie: $ctag=$sid; path=$pagepath; expires=Fri, 03-Sep-2020 20:20:13 GMT\n";\r
-}\r
-\r
-# Logs out and returns the cookie header\r
-sub logout {\r
- if(defined($sid)) {\r
- my $sql = "delete from $tbl_authentication \r
- where (session_id = ?)";\r
- my $sth = $dbh->prepare($sql);\r
- $sth->execute($sid);\r
-\r
- $logged_in = 0;\r
- \r
- return "Set-Cookie: $ctag=; path=$pagepath; expires=Fri, " . \r
- "03-Sep-2020 20:20:13 GMT\n";\r
- }\r
-}\r
-\r
-sub generate_id {\r
- my @valid = ('A'..'Z','a'..'z','0'..'9');\r
- my $i;\r
- my $rv = "";\r
- \r
- for($i = 0; $i < 32; $i++) {\r
- $rv = $rv . $valid[rand @valid];\r
- }\r
- \r
- return $rv;\r
-}\r
-\r
-\r
-\r
-1;\r
-__END__\r
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Snapshots;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Util;
-use Insipid::LinkExtractor;
-use Insipid::Parser;
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Date::Format;
-use Date::Parse;
-use Date::Parse;
-use Digest::MD5 qw(md5 md5_hex);
-use DBI qw/:sql_types/;;
-use LWP::UserAgent;
-use HTTP::Request;
-use MIME::Base64;
-use XML::Writer;
-
-require Exporter;
-
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-show_snapshots
-do_snapshot
-delete_snapshot
-export_snapshots
-show_snapshot
-fetch_related
-parsepage
-fetch_url
-);
-
-my $ua = LWP::UserAgent->new(timeout=>30);
-if(get_option('proxy_host') ne '') {
- my $proxy_host = get_option('proxy_host');
- my $proxy_port = get_option('proxy_port');
- $ua->proxy(['http', 'ftp'], "http://$proxy_host:$proxy_port/");
-}
-
-
-my $referer = "";
-
-sub export_snapshots {
- my ($writer) = (@_);
- my ($sql, $sth, @rs);
-
- # Export the objects
- $writer->startTag('objects');
- $sql = "select md5, url, content_type, content_length, date, content
- from $tbl_pagecache";
- $sth = $dbh->prepare($sql);
- $sth->execute();
-
- while(@rs = $sth->fetchrow_array()) {
- $writer->startTag('object',
- 'md5' => $rs[0],
- 'url' => $rs[1],
- 'type' => $rs[2],
- 'length' => $rs[3],
- 'date' => $rs[4]
- );
- $writer->characters(encode_base64($rs[5]));
- $writer->endTag("object");
- }
- $writer->endTag('objects');
-
- # Export the relationships
- $writer->startTag('relationships');
-
- $sql = "select md5_parent, md5_child from $tbl_pagecache_references";
- $sth = $dbh->prepare($sql);
- $sth->execute();
-
- while(@rs = $sth->fetchrow_array()) {
- $writer->startTag("relationship",
- "parent" => $rs[0],
- "child" => $rs[1]);
- $writer->endTag("relationship");
- }
-
- $writer->endTag("relationships");
-
-}
-
-# TODO: Make the insert_snapshot callable by this and the import method.
-sub fetch_url {
- my ($url, $roverride) = (@_);
-
- # TODO: No.
- if(defined($roverride)) { $referer = $roverride; }
- my $md5 = md5_hex($url);
-
- my $req = HTTP::Request->new(GET => $url) or die "Can't fetch page: $!\n";
-
- if($referer ne '') { $req->header( referer => $referer ); }
-
- my $res = $ua->request($req);
-
- if($res->is_success) {
- my $content = $res->content;
-
- # Shove the unparsed page into the cache.
- my $sql = "insert into $tbl_pagecache(md5, url, content_type,
- content_length, content, date)
- values ( ? , ? , ? , ? , ? , ? )";
-
- my $sth = $dbh->prepare($sql);
- my $ct = $res->header('Content-Type');
- if(length($ct) > 50) { $ct = substr($ct, 0, 50); }
-
- $sth->bind_param(1, $md5);
- $sth->bind_param(2, $url);
- $sth->bind_param(3, $ct);
- $sth->bind_param(4, length($content));
-
- $sth->bind_param(5, $content);
-
- $sth->bind_param(6, time());
- $sth->execute;
-
- if($sth->err) {
- # print $sth->errstr;
- # print "<br />";
- return 1;
- } else {
- if($ct =~ /text\/html/i) {
- print '<br />Parsing page... ';
- parsepage($url, $content, $ct);
- print 'done.';
- }
-
- return 0;
- }
- } else {
- my $err = $res->status_line;
- print "$err<br />";
-
- return 1;
- }
-}
-
-sub show_snapshot {
- my ($md5) = (@_);
- my ($sql, $sth, @row);
- my %internalLinks = ();
-
- $sql = "select content_type,content,url,date,content_length
- from $tbl_pagecache where (md5 = ?)";
-
- $sth = $dbh->prepare($sql);
- $sth->execute($md5);
-
- @row = $sth->fetchrow_array;
-
- if(!@row) {
- print 'Content-Type: text/plain\r\n\r\n';
- print "Can't find cached item \"$md5\"";
- return;
- }
-
-
- # Check for IMS request.
- my $ims = http('If-Modified-Since');
- if($ims) {
-
- my $t = str2time($ims);
-
- if($row[3] <= $t) {
- # Return a 304 not modified.
- print 'Status: 304 Not Modified\r\n';
- return;
- }
- }
-
- my $dt = ims_time($row[3]);
- print "Last-Modified: $dt\r\n";
- print "Content-Type: $row[0]\r\n";
-
- if($row[0] =~ /text\/html/i) {
- # Now we get a list of URLs that can be redirected to our
- # local snapshot cache. We'll use that to build a hash of
- # URL->MD5 values and match outputted links against that.
- my ($resql, $resth, @rerow);
- $resql = "select $tbl_pagecache_references.md5_child,
- $tbl_pagecache.url
- from $tbl_pagecache_references
- inner join $tbl_pagecache on
- ($tbl_pagecache_references.md5_child =
- $tbl_pagecache.md5)
- where (md5_parent = ?)";
- $resth = $dbh->prepare($resql);
- $resth->execute($md5);
-
- while(@rerow = $resth->fetchrow_array()) {
- $internalLinks{$rerow[1]} = $rerow[0];
- }
-
- print "\r\n";
- my $p = Insipid::Parser->new($row[2], undef);
- $p->setSnapshotMap(\%internalLinks);
-
- if($row[0] =~ /utf/i) {
- $p->utf8_mode(1);
- }
- $p->parse($row[1]);
- } else {
- print "Content-Length: $row[4]\r\n";
- print "\r\n";
- print $row[1];
- }
-
- exit;
-}
-
-sub show_details {
- my ($md5) = @_;
- my ($sth, $sql);
-
- $sql = "select $tbl_bookmarks.title from $tbl_bookmarks
- where ($tbl_bookmarks.md5 = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($md5);
- my @row = $sth->fetchrow_array();
-
- print '<h3>Cache Details for "';
- print escapeHTML($row[0]);
- print '"</h3>';
- print '<br /><center><table cellpadding="5"><tr><th>View</th><th>URL</th><th>';
- print 'Type</th><th>Size</th><th>Ref Count</th></tr>';
-
- $sql = "select $tbl_pagecache.md5, $tbl_pagecache.url,
- $tbl_pagecache.content_type,
- $tbl_pagecache.content_length,
- pg2.md5_parent, count(*)
- from $tbl_pagecache_references
- inner join $tbl_pagecache on
- ($tbl_pagecache_references.md5_child =
- $tbl_pagecache.md5)
- left join $tbl_pagecache_references as pg2 on
- (pg2.md5_child = $tbl_pagecache.md5)
- where ($tbl_pagecache_references.md5_parent = ?)
- group by $tbl_pagecache.md5, $tbl_pagecache.url,
- $tbl_pagecache.content_type, pg2.md5_parent,
- $tbl_pagecache.content_length, pg2.md5_child
- order by $tbl_pagecache.url";
-
- $sth = $dbh->prepare($sql);
- $sth->execute($md5);
-
- while(my @rs = $sth->fetchrow_array()) {
- print '<tr><td>';
- my $ss = "$snapshot_url$rs[0]";
-
- print "<a href=\"$rs[1]\">live</a>/<a href=\"$ss\">snapshot</a>";
- print '</td><td>';
- print $rs[1];
- print '</td><td>';
- print $rs[2];
- print '</td><td>';
- print $rs[3];
- print '</td><td>';
- print $rs[5];
- print '</td></tr>';
- }
-
- print '</table></center>';
-}
-
-#
-# Show a nice menu of the users snapshots.
-#
-sub show_snapshots {
-
- # If a snapshot was asked to be deleted
- if(defined(param('delete'))) {
- delete_snapshot(param('delete'));
- }
-
- if(defined(param('md5'))) {
- show_details(param('md5'));
- return;
- }
-
- my $tcount = 0;
- my $tsize = 0;
-
- my $sql = "select $tbl_pagecache.md5, $tbl_bookmarks.title,
- $tbl_pagecache.date,
- $tbl_pagecache.content_length +
- coalesce(sum(p2.content_length), 0),
- count(*) - 1, $tbl_bookmarks.access_level
- from $tbl_pagecache
- inner join $tbl_bookmarks on
- ($tbl_bookmarks.md5 = $tbl_pagecache.md5)
- left join $tbl_pagecache_references on
- ($tbl_pagecache.md5 = $tbl_pagecache_references.md5_parent)
- left join $tbl_pagecache as p2 on
- (p2.md5 = $tbl_pagecache_references.md5_child)
- group by
- $tbl_bookmarks.access_level,
- $tbl_pagecache.md5, $tbl_bookmarks.title,
- $tbl_pagecache.date, $tbl_pagecache.content_length
- order by $tbl_pagecache.date desc";
- my $sth = $dbh->prepare($sql);
- $sth->execute;
-
- print '<br /><center><table cellpadding=\"5\"><tr><th>Page</th><th>';
- print 'Date</th><th>Size</th><th>Objects</th><th>Functions</th></tr>';
-
- my $count = 0;
-
- while(my @r = $sth->fetchrow_array) {
-
- $count++;
-
- my $color;
- if(($count % 2) eq 1) {
- $color = ' bgcolor="#EEEEEE" ';
- } else {
- $color = '';
- }
-
- print "<tr $color>";
- print '<td>';
-
- print "<a href=\"$snapshot_url$r[0]\">";
- if($r[5] eq 0) { print '<i>'; }
- print $r[1];
- if($r[5] eq 0) { print '</i>'; }
- print '</a></td>';
- my $timestr = time2str('%Y-%m-%d', $r[2], 'EST');
- my $count = $r[4] + 1; $tcount += $count;
- $tsize += $r[3];
- print "<td align=\"center\">$timestr</td>";
- print "<td align=\"center\">$r[3]</td>";
-
- my $link = "$site_url/insipid.cgi?op=snapshots&md5=$r[0]";
-
- if($count ne 1) {
- print "<td align=\"center\"><a href=\"$link\">$count</a></td>";
- } else {
- print "<td align=\"center\">$count</td>";
- }
-
- print '<td>';
- print "<a href=\"insipid.cgi?op=snapshots&delete=$r[0]\">delete</a>,";
- print " <a href=\"insipid.cgi?op=fetchrelated&id=$r[0]\">";
- print "fetch linked objects</a></td>";
- print '</tr>';
- }
-
- print '<tr><td><b>Total</b></td><td> </td>';
- print "<td align=\"center\"><b>$tsize</b></td>";
- print "<td align=\"center\"><b>$tcount</b></td><td> </td></tr>";
-
- print "</table></center>";
-}
-
-# This fetches all linked-to objects (specifically images for now)
-# for a cached page.
-sub fetch_related {
- my ($md5) = (@_);
-
- my $sql = "select content, url
- from $tbl_pagecache where (md5 = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($md5);
-
- my @r = $sth->fetchrow_array();
-
- my $p = Insipid::LinkExtractor->new($r[1]);
- $p->parse($r[0]);
-
-}
-
-# Deletes a snapshot and all orphan cache children, taking into
-# account the fact that items can be shared across cached pages.
-#
-# This is horribly expensive, and someday I'll replace it with
-# a much nicer function.
-sub delete_snapshot {
- my ($md5) = (@_);
-
- # The snapshot
- my $sql = "delete from $tbl_pagecache where (md5 = ?)";
- my $delstatement = $dbh->prepare($sql);
- $delstatement->execute($md5);
-
- # References
- $sql = "delete from $tbl_pagecache_references where (md5_parent = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($md5);
-
- # Orpans - blow away any md5s in the pagecache table that aren't
- # referenced as a child in the references table. First, get a list
- # of valid MD5s.
- $sql = "select distinct md5_child from $tbl_pagecache_references";
- $sth = $dbh->prepare($sql);
- $sth->execute();
-
- my $subquery = '';
- while(my @r = $sth->fetchrow_array) {
- if($subquery ne '') { $subquery = $subquery . ','; }
- $subquery = "$subquery '$r[0]'";
- }
-
- $sql = "select distinct md5_parent from $tbl_pagecache_references";
- $sth = $dbh->prepare($sql);
- $sth->execute();
- while(my @r = $sth->fetchrow_array) {
- if($subquery ne '') { $subquery = $subquery . ','; }
- $subquery = "$subquery '$r[0]'";
- }
-
- if($subquery eq '') {
- $sql = "delete from $tbl_pagecache;";
- } else {
- $sql = "delete from $tbl_pagecache where md5 not in ($subquery)";
- }
-
- $sth = $dbh->prepare($sql);
- $sth->execute();
-}
-
-sub do_snapshot {
- # Save the page.
- print '<br /><br />';
-
- my ($bookmark_id) = (@_);
- my $sql = "select url,md5,title from $tbl_bookmarks where (id = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($bookmark_id);
- my @row = $sth->fetchrow_array;
-
- if(@row) {
- print "<p>Fetching \"<b>$row[2]</b>\"...</p>\n";
- $referer = $row[0];
- fetch_url(@row);
- } else {
- die "Couldn't find the row for id $bookmark_id!";
- }
-}
-
-sub parsepage {
- my ($url, $content, $content_type) = (@_);
-
- my $p = Insipid::Parser->new($url, \&fetch_url);
- if($content_type =~ /utf/i) {
- $p->utf8_mode(1);
- }
-
- $p->parse($content);
-}
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2012 jumpin.banana
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Stats;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Sessions;
-use Insipid::Util;
-require Exporter;
-
-use URI;
-use URI::Escape;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-show_stats
-);
-
-sub show_stats {
- &groupByDomain;
-}
-
-sub groupByDomain {
- my $url = shift;
-
- my ($sql, $sth, @row);
- my %domainGroup = ();
- my @invalidDomains;
-
- if($url) {
-
- }
-
- # keep order otherwise the while will not work
- $sql = "SELECT `id`, `url`,
- `linkcheck_status`,
- `linkcheck_date`
- FROM `$tbl_bookmarks` ORDER BY `url`";
- $sth = $dbh->prepare($sql);
- $sth->execute;
-
- if($sth->rows ne 0) {
- print "<h3> Invalid URLs after last linkcheck</h3>";
- print "<p>Please keep in mind, that SSL URLs can not be checked at this time !</p>";
- print "<ul>";
- while(@row = $sth->fetchrow_array()) {
- my $uri = URI->new($row[1]);
-
- if($row[2] eq 0) {
- print "<li><a href='$site_url/insipid.cgi?op=edit_bookmark&id=$row[0]'>".$row[1]."</a> (<a href='$site_url/insipid.cgi?op=delete_bookmark&id=$row[0]'>delete</a>)</li>";
- }
-
- if($domainGroup{$uri->host}) {
- $domainGroup{$uri->host}++;
- } else {
- $domainGroup{$uri->host} = 1;
- }
- }
- print "</ul>";
-
- if(%domainGroup) {
-
- print "<h3>Bookmarks grouped by domain</h3>";
- print "<table cellpadding='2' cellspacing='0'>";
- print "<tr><th>Domain</th><th>Count</th></tr>";
- #for(sort keys %domains) {
- foreach (reverse sort { $domainGroup{$a} <=> $domainGroup{$b} } keys %domainGroup ) {
-
- print "<tr><td><a href='$site_url/insipid.cgi?bydomain=".uri_escape($_)."'>$_</a></td><td>$domainGroup{$_}</td></tr>";
- }
- print "</table>";
- }
- }
-}
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Tags;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-use CGI qw/:standard/;
-use CGI::Carp qw(fatalsToBrowser);
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Sessions;
-use Insipid::Util;
-require Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-show_tags
-get_tags
-get_tags_list
-set_tags
-tag_operations
-);
-
-sub tag_operations {
-
- check_access();
-
- my ($sql,$sth,$sql1, $sth1, $sql2,$sth2);
-
- if(param('save') && param('newName')) {
- print '<p>Reanming...</p>';
-
- my $newTag = param('newName');
- my $oldTagName = param('rename');
- my $oldTagId = get_tag_id_by_name($oldTagName);
-
- # is the new name already a tag ?
- # if check then check is the new tagId
- my $check = get_tag_id_by_name($newTag);
- if($check && ($check != $oldTagId)) {
- $sql = "SELECT bookmark_id, tag_id
- FROM `$tbl_bookmark_tags`
- WHERE tag_id = ?";
- $sth = $dbh->prepare($sql);
- $sth->execute($oldTagId);
- while(my ($bid, $tid) = $sth->fetchrow_array) {
- $sql1 = "DELETE FROM `$tbl_bookmark_tags`
- WHERE bookmark_id = ?
- AND tag_id = ?";
- $sth1 = $dbh->prepare($sql1);
- $sth1->execute($bid,$tid);
-
- $sql2 = "INSERT IGNORE INTO `$tbl_bookmark_tags`
- SET bookmark_id = ?,
- tag_id = ?";
- $sth2 = $dbh->prepare($sql2);
- $sth2->execute($bid,$check);
- }
-
- # remove the old one
- $sql = "DELETE FROM `$tbl_tags` WHERE id = ?";
- $sth = $dbh->prepare($sql);
- $sth->execute($oldTagId);
- }
- else {
- # just rename the tag
- $sql = "UPDATE $tbl_tags SET name = ? WHERE id = ?";
- $sth = $dbh->prepare($sql);
- $sth->execute($newTag,$oldTagId);
- }
-
- print '<span style="color: green;">Done !</span>';
- }
- elsif(param("doDelete") && param("deleteTag") && param("moveTo")) {
- print '<p>Delete...</p>';
-
- # this moves the selected tag and its bookmarks to the new one
- # the tag is still availbale in the DB
-
- my($delTagName,$moveToTagName) = (param('deleteTag'), param('moveTo'));
-
- if($delTagName && $moveToTagName && ($delTagName ne $moveToTagName)) {
- # get the ones with the old tag
- my $oldTagId = get_tag_id_by_name($delTagName);
- my $moveToTagId = get_tag_id_by_name($moveToTagName);
- if($oldTagId && $moveToTagId) {
- $sql = "UPDATE IGNORE `$tbl_bookmark_tags`
- SET `tag_id` = ?
- WHERE `tag_id` = ?";
- $sth = $dbh->prepare($sql);
- $sth->execute($moveToTagId,$oldTagId);
- }
- }
-
- print '<span style="color: green;">Done !</span>';
- }
-
- print '<h2>Rename Tag</h2>';
- print '<form method="post" action="">';
- print '<select name="rename">';
- show_tags(1);
- print '</select>';
- print '<input type="text" name="newName" value="" />';
- print '<input type="submit" value="Rename" />';
- print '<input type=hidden name="op" value="tags">';
- print '<input type=hidden name="save" value="yes">';
- print '</form>';
-
- print '<h2>Delete Tag</h2>';
- print '<form method="post" action="">';
- print "Delete Tag";
- print '<select name="deleteTag">';
- show_tags(1);
- print '</select><br />';
- print "and move to:";
- print '<select name="moveTo">';
- show_tags(1);
- print '</select>';
- print '<input type=hidden name="op" value="tags">';
- print '<input type=hidden name="doDelete" value="yes">';
- print '<input type="submit" value="Delete and move" />';
- print '</form>';
-
- print '<h2>Show bookmarks without a tag</h2>';
- print '<p><a href="'.$site_url.'/insipid.cgi?tag=empty">Show me the bookmarks</a></p>';
-}
-
-# Display the tag list. Takes one parameter for the mode - 0 is for the
-# sidebar, 1 is for a SELECT box. TODO: Cache the actual result set so
-# that when there's more than one tag list on a page we only hit the database
-# once.
-sub show_tags {
- my ($mode) = shift;
- if(!defined($mode)) { $mode = 0; }
-
- my ($sql, $sth, $tagstring);
- if($mode eq 0) { print "<div id=\"leftside\">"; }
-
- my $tag = url_param('tag');
-
- #if()) {
- # find the tags which have been used with this tags too
- $tagstring = $tag||'';
- chomp($tagstring);
- $tagstring =~ s/ /','/g;
-
- # get the bookmarks first which have those tags
- $sql = "SELECT bm.id FROM $tbl_bookmarks as bm
- INNER JOIN $tbl_bookmark_tags AS bt ON bm.id = bt.bookmark_id
- INNER JOIN $tbl_tags AS t ON t.id = bt.tag_id
- WHERE 1";
- $sql .= " AND t.name IN ('$tagstring')" if $tag;
-
- $sql .= " AND (bm.access_level = 1) " if(logged_in() eq 0);
-
- $sth = $dbh->prepare($sql);
- $sth->execute;
-
- if($sth->rows ne 0) {
- my @bids;
- while(my($id) = $sth->fetchrow_array()) {
- push(@bids,$id);
- }
-
- if(@bids) {
- # there are results
- # get the tags for the tag list
- my $bids = join(',',@bids);
-
- $sql = "SELECT t.name, count(*) FROM $tbl_bookmarks AS bm
- INNER JOIN $tbl_bookmark_tags AS bt
- ON (bm.id = bt.bookmark_id)
- INNER JOIN $tbl_tags AS t
- ON (t.id = bt.tag_id)
- WHERE 1";
-
- $sql .= " AND bm.id IN ($bids) AND t.name NOT IN ('$tagstring')" if $tag;
- $sql .= " AND (bm.access_level = 1) " if(logged_in() eq 0);
-
- $sql .= " GROUP BY t.name
- ORDER BY t.name";
- #print $sql;
- $sth = $dbh->prepare($sql);
- $sth->execute;
- if($sth->rows ne 0) {
-
- if($mode eq 0) {
- print '<div id="taglist" style="">';
- print '<table cellpadding="0" cellspacing="0" ';
- print 'class="tagsummarytable"><tbody>';
- print '<tr><th colspan="2">Tags</th></tr>';
- }
-
-
- while(my @rs = $sth->fetchrow_array()) {
- my $link = $tag_url.$rs[0];
-
- if($mode eq 0) {
- print "<tr><td class=\"tagtabletext\">($rs[1])</td>";
- print "<td class=\"tagtabletext\"><a href=\"$link\">$rs[0]</a></td></tr>\n";
- } else {
- print "<option name=\"$rs[0]\">$rs[0]</option>";
- }
- }
-
- if($mode eq 0) {
- print "</tbody></table></div>";
- print "</div>";
- }
-
- return;
- }
- }
- }
- #}
-
-
-
-}
-
-# Get a string representing a URLs tags
-sub get_tags {
- my ($url) = (@_);
- my @tags = get_tags_list($url);
-
- my $rv = "";
- foreach (@tags) {
- $rv = "$rv $_";
- }
-
- # Trim leading whitespace
- $rv =~ s/^\s+//;
- return $rv;
-}
-
-# Get a list of the tags for a given URL id
-sub get_tags_list {
- my ($url) = (@_);
- my $sql = "select $tbl_tags.name from $tbl_tags
- inner join $tbl_bookmark_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- inner join $tbl_bookmarks on
- ($tbl_bookmark_tags.bookmark_id = $tbl_bookmarks.id)
- where ($tbl_bookmarks.url = ?)";
-
- my $sth = $dbh->prepare($sql);
- $sth->execute($url);
-
- my @tags;
- while(my @r = $sth->fetchrow_array) {
- push(@tags, $r[0]);
- }
-
- return @tags;
-}
-
-# Sets tags for a bookmark. Takes a bookmark ID and a string
-# representing the tags as parameters.
-sub set_tags {
- my ($bookmark_id, $tag_string) = (@_);
-
- check_access();
-
- my @tags = split(" ", $tag_string);
-
- # Clear old tags first.
- my $sql = "delete from $tbl_bookmark_tags where (bookmark_id = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($bookmark_id);
-
- foreach my $cur (@tags) {
- # check if this tag exists in tags table
- my $sql = "select count(id) from $tbl_tags where (name = ?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($cur);
- my @rv = $sth->fetchrow_array;
- my $tagcount = $rv[0];
-
- # or create a new tag
- if ($tagcount < 1) {
- my $sql = "insert into $tbl_tags (name) values(?)";
- my $sth = $dbh->prepare($sql);
- $sth->execute($cur);
- }
-
- # and fetch the tag ID
- $sql = "select id from $tbl_tags where (name = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($cur);
- my $tid = $sth->fetchrow_array;
-
- $sql = "insert into $tbl_bookmark_tags(bookmark_id, tag_id)
- values( ? , ? )";
- $sth = $dbh->prepare($sql);
- $sth->execute($bookmark_id, $tid);
- }
-}
-
-# check if given word is an existing tag
-# if so return the tag id
-sub get_tag_id_by_name {
- my ($tag) = (@_);
-
- my($tagId, $sql, $sth, @result);
-
- if($tag) {
- $sql = "select id from `$tbl_tags` where (name = ?)";
- $sth = $dbh->prepare($sql);
- $sth->execute($tag);
- @result = $sth->fetchrow_array();
- $tagId = $result[0];
- }
-
- return $tagId;
-}
-
-1;
-__END__
+++ /dev/null
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Luke Reeves
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-package Insipid::Util;
-
-use strict;
-use warnings;
-
-use vars qw(@ISA @EXPORT @EXPORT_OK);
-
-use Insipid::Sessions;
-use Insipid::Config;
-
-require Exporter;
-
-@ISA = qw(Exporter);
-
-@EXPORT = qw(
-ims_time
-sanitize_html
-check_access
-);
-
-@EXPORT_OK = qw();
-
-my @DoW = qw(Sun Mon Tue Wed Thu Fri Sat);
-my @MoY = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
-
-# TODO: If content is already sent, add the error to @errors instead of dying
-sub check_access {
- if(logged_in() ne 1) {
- #print "Content-Type: text/plain\r\n\r\n";
- print "You have to be logged in to perform that operation.";
- exit;
- }
-}
-
-sub sanitize_html {
- my ($orig) = (@_);
-
- $orig =~ s/</</gi;
- $orig =~ s/>/>/gi;
-
- $orig =~ s/&/&/gi;
- $orig =~ s/&/&/gi;
-
- return $orig;
-}
-
-
-# From http::date
-sub ims_time {
- my ($time) = (@_);
- my ($sec, $min, $hour, $mday, $mon, $year, $wday) = gmtime($time);
- return sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",
- $DoW[$wday],
- $mday, $MoY[$mon], $year+1900,
- $hour, $min, $sec);
-}
-
-1;
-__END__
+++ /dev/null
-/*!
- * jQuery JavaScript Library v1.5.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Mar 31 15:28:23 2011 -0400
- */
-(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test("Â ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bM[1]||q[2]!=bM[2]||(q[3]||(q[1]==="http:"?80:443))!=(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c):c()},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!ch.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);
\ No newline at end of file
+++ /dev/null
-
-// detect tag insertion and provide suggestions
-$(document).ready(function()
-{
- var f = $('form input[name=tags]');
- var ls = $('#suggestlist');
-
- var stopSuggesting = false;
- //var isFocussed = true;
- //var defaultTab = false; // set true to allow tabbing to the next element
-
- f.keyup(function(e)
- {
- var ulist = f.val().split(' ');
-
- var k = e.keyCode || e.which;
- switch (k)
- {
- // tab to navigate suggestions
- // The first suggestion is already selected. Tabbing
- // selects the next suggestion, until the end of the
- // list is reached, from which the selection loops to
- // the start of the list.
- case 9:
- // implemented at document level
- break;
-
- // esc halts suggestions for this tag
- case 27:
- hide(ls);
- stopSuggesting = true;
- break;
-
- // Spacebar to make a selection or add a new tag.
- // If there is a selection, pressing spacebar will add
- // the selection to the field. Keep typing the preferred
- // tag name if none of the suggestions are valid. The
- // suggestions list will disappear - pressing spacebar
- // at this point allows for adding the next tag.
- case 32:
- if (ls.css('display') != 'none' && ls.find('li.sel').index() >= 0) {
- ulist.pop(); ulist.pop();
-
- var v = ulist.join(' ');
- if (ulist.length) {
- v += ' ';
- }
- f.val(v + ls.find('li.sel').text() + ' ');
- hide(ls);
- //defaultTab = true;
- }
- else {
- hide(ls);
- stopSuggesting = false;
- }
- break;
-
- // left arrow makes previous selection
- case 37:
- next(ls, 'backward');
- break;
-
- // right arrow makes next selection
- case 39:
- next(ls, 'forward');
- break;
-
- // initiate suggestions
- default:
- var w = ulist.pop();
-
- if (w.length > 1 && stopSuggesting == false) {
- $.ajax({
- url: 'lib/tagsSuggest.cgi?' + w,
- dataType: 'html',
- success: function(o) {
- if (o.length > 0) {
- ls.slideDown('fast');
- ls.find('ul').html(o);
- }
- else {
- hide(ls);
- }
- }
- });
- //defaultTab = false;
- }
- else {
- hide(ls);
- }
- break;
- } //switch
- });
-}).keydown(function(e)
-{
- var k = e.keyCode || e.which;
- var ls = $('#suggestlist');
- var defaultTab = ls.css('display') == 'none';
- var isFocussed = e.target.tagName.toLowerCase() == 'input' && e.target.name == 'tags';
-
- if (k == 9 && isFocussed && !defaultTab) {
- e.preventDefault();
- next(ls);
- }
-});
-
-// Allows for directional navigation of suggestion list.
-// With forward direction, tabbing selects the right-next
-// suggestion. When the end of the list is reached, the
-// selection jumps to the start of the list.
-//
-// @param ls:obj - the suggest list
-// @param dir:string - "forward" | "backward"
-function next(ls, dir)
-{
- var n;
- var i = ls.find('li.sel').index();
- var c = ls.find('li.sel');
- c.removeClass('sel');
-
- switch (dir)
- {
- case 'backward':
- i--;
- n = c.prev('li');
- break;
-
- case 'forward':
- default:
- if (i < 0) {
- i = 0;
- }
- else {
- i++;
- }
- n = c.next('li');
- break;
- }
-
- // jump to the start
- if (i >= ls.find('li').size() || i == 0) {
- ls.find('li:first-child').addClass('sel');
- }
- // jump to the end
- else if (i < 0) {
- ls.find('li:last-child').addClass('sel');
- }
- // select the next suggestion
- else {
- n.addClass('sel');
- }
-}
-
-// Hides the suggest list.
-// @param ls:obj - the suggest list
-function hide(ls)
-{
- ls.find('ul').empty();
- ls.hide();
-}
-
+++ /dev/null
-/*
- * this file is iused by phantomjs (http://phantomjs.org/) to load the given bookmark and save the output to a file
- *
- * Copyright (C) 2012 jumpin.banana
- *
- */
-var page = require('webpage').create(), system = require('system'), address, output;
-page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11';
-
-if (system.args.length < 2) {
- console.log('Usage: screen.js URL Outputfilename');
- phantom.exit(1);
-}
-else {
- address = system.args[1];
- output = system.args[2];
-
- page.open(address, function (status) {
- if (status !== 'success') {
- //console.log('Unable to access network');
- phantom.exit(1);
- } else {
- window.setTimeout(function () {
- //console.log('rendering');
-
- page.render(output);
-
- phantom.exit(0);
- }, 50);
- }
- });
-}
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use CGI;
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Sessions;
-
-my $cgi = new CGI();
-print $cgi->header(-type => "text/html", -charset => "utf-8");
-
-# Retrieve all related tags as the user adds a tag. This is to reduce
-# the mental guess-work for the type of user who loathes creating
-# redundant tags. Invoke this subroutine via js in a text input event.
-#
-# @param $in:string - First letters of the tag to match.
-# @return $out:string - HTML-formatted list of tags.
-my ($in) = shift;
-
-if ($in =~ /^[0-9a-z:_]+/i) {
- my ($sql, $sth);
-
- # The user has typed in the first two letters, look for a match.
- # Order suggestions by popularity.
- $sql = "select $tbl_tags.name, count(*) from `$tbl_tags`
- inner join $tbl_bookmark_tags on
- ($tbl_tags.id = $tbl_bookmark_tags.tag_id)
- where ($tbl_tags.name LIKE ".$dbh->quote($in.'%').")
- group by $tbl_tags.name
- order by count(*) desc";
- $sth = $dbh->prepare($sql);
- $sth->execute();
-
- # external wrappers div.suggestlist>ul> ... /ul/div
- if($sth->rows ne 0) {
- my $out = "";
- #$out .= "Content-Type: text/html; charset=UTF-8\n\n";
- while(my @r = $sth->fetchrow_array()) {
- $out .= "<li>$r[0]</li>";
- }
- print $out;
- }
-}
+++ /dev/null
-*
-!.gitignore
+++ /dev/null
-Those pl scripts are command line tools.
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-use strict;\r
-\r
-if(defined($ENV{SERVER_NAME})) {\r
- print "Content-Type: text/plain\r\n\r\nThis is a command-line tool.\n";\r
- exit;\r
-}\r
-\r
-push(@INC, "../lib");\r
-\r
-eval {\r
- require Insipid::Config;\r
- require Insipid::Main;\r
- \r
- $Insipid::Config::logged_in = 1;\r
- $Insipid::Config::logged_in = 1;\r
-\r
- Insipid::Main::do_export('y', 'y');\r
-};\r
-\r
-if($@) {\r
- print "$@\n";\r
-}\r
-\r
+++ /dev/null
-#!/usr/bin/perl\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-use strict;\r
-\r
-if(defined($ENV{SERVER_NAME})) {\r
- print "Content-Type: text/plain\r\n\r\nThis is a command-line tool.\n";\r
- exit;\r
-}\r
-\r
-push(@INC, "../lib");\r
-\r
-eval {\r
- require Insipid::Config;\r
- require Insipid::Main;\r
- \r
- $Insipid::Config::logged_in = 1;\r
- $Insipid::Config::logged_in = 1;\r
- \r
- Insipid::Main::do_import();\r
-};\r
-\r
-if($@) {\r
- print "$@\n";\r
-}\r
-\r
+++ /dev/null
-#!/usr/bin/perl -w
-#
-# Copyright (C) 2012 jumpin.banana
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-#
-
-
-#
-# check exiting bookmark entries if they are available
-# ssl entries will not be checked...
-# if they return a non 200 HTTP Status code they will be marked and visible
-# in the stats overview
-#
-
-use warnings;
-use strict;
-use Getopt::Long;
-use DBI;
-use LWP::UserAgent;
-
-BEGIN {
- binmode STDOUT, ':encoding(UTF-8)';
- binmode STDERR, ':encoding(UTF-8)';
-}
-
-use lib "../lib";
-use Insipid::Config;
-use Insipid::Database;
-use Insipid::Bookmarks;
-
-$|=1;
-
-my $opt_help;
-my $opt_link = "all";
-my $opt_proxy;
-
-# if no arguments passed
-&usage if @ARGV < 1;
-
-GetOptions(
- "help|h" => \$opt_help,
- "link=s" => \$opt_link,
- "proxy=s" => \$opt_proxy
-) or die(&usage);
-
-&usage if $opt_help;
-
-
-#
-# main
-#
-my $query = "SELECT `id`, `url` FROM `$tbl_bookmarks`";
-$query .= " WHERE `linkcheck_status` = 1" if($opt_link eq "active");
-$query .= " WHERE `linkcheck_status` = 0" if($opt_link eq "inactive");
-
-my $sth = $dbh->prepare($query);
-$sth->execute;
-if($sth->rows ne 0) {
- my $ua = LWP::UserAgent->new;
- $ua->timeout(5);
- $ua->show_progress(1);
- $ua->agent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11");
-
- $ua->proxy(['http', 'ftp'], $opt_proxy) if $opt_proxy;
-
- $ua->ssl_opts('verify_hostname' => 0);
- $ua->protocols_allowed(undef); # all are allowed
-
- $query = "UPDATE `$tbl_bookmarks`
- SET `linkcheck_status` = ?,
- `linkcheck_date` = ?
- WHERE `id` = ?";
- my $sthupdate = $dbh->prepare($query);
-
- while (my $hr = $sth->fetchrow_hashref) {
- print $hr->{url}." ";
-
- # ssl not working correctly so avoid those bookmarks
- next if $hr->{url} =~ m/https:/g;
-
- #my $response = $ua->head($hr->{url});
- my $response = $ua->get($hr->{url});
- my $status = 0;
-
- if ($response->is_success) {
- print "Ok !\n";
- $status = 1;
- }
- else {
- print $response->status_line."\n";
- }
-
- $sthupdate->execute($status,time(),$hr->{id});
-
- }
-}
-
-
-#
-# functions
-#
-
-sub usage {
- print <<EOT
-Usage: linkcheck.pl [OPTION]
-Check the bookmark entries from insipid. Check if the URL returns a 200 Status
-code. If so set the checkDate and result. Non 200 checks will be marked. Those
-can be checked seperately
-
- -h, --help display this help message
- --link= all = check all links
- active = check only those which are not marked as inactive
- inactive = check inactive only
- --proxy= proxy address if needed
-
-EOT
-;
- exit(1);
-}
-
-exit(0);
+++ /dev/null
-#!/usr/bin/perl -T\r
-#\r
-# Copyright (C) 2008 Luke Reeves\r
-#\r
-# Modified by: Manuel de la Torre <mdltorre(a)gmail(dot)com>\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\r
-# USA\r
-#\r
-\r
-use warnings;\r
-use strict;\r
-\r
-use XML::Writer;\r
-use Date::Format;\r
-use IO::File;\r
-\r
-if(defined($ENV{SERVER_NAME})) {\r
- print "Content-Type: text/plain\r\n\r\nThis is a command-line tool.\n";\r
- exit;\r
-}\r
-\r
-if($#ARGV eq -1) {\r
- print "Usage: ./mozilla.pl <bookmarks filename>\n\n";\r
- exit;\r
-}\r
-\r
-my $output = new IO::File(">insipid.xml");\r
-my $writer = new XML::Writer(OUTPUT => $output, DATA_MODE => 1, DATA_INDENT => 4);\r
-my $count = 0;\r
-my $currentLine;\r
-my $currentTag;\r
-\r
-$writer->xmlDecl('UTF-8');\r
-$writer->startTag('insipid');\r
-$writer->startTag('posts');\r
-\r
-open(FH, $ARGV[0]);\r
-\r
-while( defined($currentLine = <FH>) ) {\r
-\r
- \r
- if ($currentLine =~ /<H3.*\">(.*?)</) {\r
- if(defined($1)) {\r
- $currentTag = $1;\r
- }\r
- }\r
- \r
- if ($currentLine =~ /\/DL/) {\r
- $currentTag = '';\r
- }\r
- \r
- if ($currentLine =~ /<A\sHREF=\"(.*?)\".*?\".*?>(.*?)<\/A>/) {\r
- \r
- if(defined($1) && defined($2)) {\r
- $writer->emptyTag('post',\r
- 'access_level' => '0',\r
- 'href' => $1,\r
- 'description' => $2,\r
- 'tag' => $currentTag,\r
- 'time' => time2str("%Y-%m-%dT%TZ", time(), 'GMT')\r
- );\r
- }\r
- \r
- }\r
-}\r
-\r
-$writer->endTag('posts');\r
-$writer->endTag('insipid');\r
-$writer->end();\r
-\r
-\r