From 1aa1c4eb503fa7aeadbcf954c3c56ff916532c2e Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 19 Aug 2009 23:34:03 +0200 Subject: [PATCH] * Insipid Firefox/Flock extension - Initial import --- ff_ext/inspd@danny/chrome.manifest | 8 + .../chrome/inspd/content/inc/globals.js | 774 ++++++++++++++++++ .../chrome/inspd/content/inc/md5.js | 245 ++++++ .../chrome/inspd/content/inc/vars.js | 8 + .../chrome/inspd/content/inspdoverlay.js | 336 ++++++++ .../chrome/inspd/content/inspdoverlay.xul | 179 ++++ .../inspd/content/v2/altpost/altpost.css | 41 + .../inspd/content/v2/altpost/altpost1.js | 63 ++ .../content/v2/altpost/altpost2_popup.js | 373 +++++++++ .../content/v2/altpost/altpost_trigger.js | 265 ++++++ .../altpost/images/inspd_altpost_arrow1.png | Bin 0 -> 176 bytes .../altpost/images/inspd_altpost_arrow2.png | Bin 0 -> 220 bytes .../inspd/content/v2/altpost/qpost.html | 116 +++ .../chrome/inspd/content/v2/altpost/qpost.js | 49 ++ .../inspd/content/v2/json/allitems.html | 35 + .../chrome/inspd/content/v2/json/home.html | 37 + .../chrome/inspd/content/v2/json/home.js | 190 +++++ .../inspd/content/v2/json/images/cancel.png | Bin 0 -> 518 bytes .../content/v2/json/images/icons_credits.txt | 7 + .../v2/json/images/inspd_color_swatch.png | Bin 0 -> 160 bytes .../json/images/inspd_delicious_history.png | Bin 0 -> 466 bytes .../content/v2/json/images/inspd_edit.png | Bin 0 -> 411 bytes .../content/v2/json/images/inspd_edit2.png | Bin 0 -> 630 bytes .../v2/json/images/inspd_icon1_1616.png | Bin 0 -> 196 bytes .../v2/json/images/inspd_icon2_home.png | Bin 0 -> 767 bytes .../images/inspd_icon3_mytagcloud_1616.png | Bin 0 -> 428 bytes .../inspd_icon3_mytagcloud_html_icon_1616.png | Bin 0 -> 749 bytes .../images/inspd_icon5_mybookmarks_1616.png | Bin 0 -> 495 bytes .../inspd_icon6_allitems_html_icon_1616.png | Bin 0 -> 891 bytes .../images/inspd_icon6_allitems_icon_1616.png | Bin 0 -> 463 bytes .../inspd_icon7_posttoinsipid_icon_1616.png | Bin 0 -> 464 bytes .../images/inspd_icon8_mystars_icon_1616.png | Bin 0 -> 592 bytes .../content/v2/json/images/inspd_links.png | Bin 0 -> 378 bytes .../content/v2/json/images/inspd_links2.png | Bin 0 -> 414 bytes .../content/v2/json/images/inspd_similar.png | Bin 0 -> 384 bytes .../v2/json/images/inspd_star_gold.png | Bin 0 -> 770 bytes .../content/v2/json/images/inspd_star_off.png | Bin 0 -> 619 bytes .../content/v2/json/images/inspd_star_on.png | Bin 0 -> 823 bytes .../inspd/content/v2/json/inspd_json_lib.js | 730 +++++++++++++++++ .../inspd/content/v2/json/mybookmarks.html | 37 + .../chrome/inspd/content/v2/json/mystars.html | 31 + .../chrome/inspd/content/v2/json/mystars.js | 38 + .../chrome/inspd/content/v2/json/mytags.html | 42 + .../chrome/inspd/content/v2/json/mytags.js | 233 ++++++ .../chrome/inspd/content/v2/json/style.css | 532 ++++++++++++ .../chrome/inspd/skin/classic/icon1-3232.png | Bin 0 -> 222 bytes .../chrome/inspd/skin/classic/inspd.css | 59 ++ .../skin/classic/searchtb/icons_credits.txt | 7 + .../classic/searchtb/inspd-button1-home.png | Bin 0 -> 862 bytes .../searchtb/inspd-button2-posttoinsipid.png | Bin 0 -> 823 bytes .../searchtb/inspd-button3-mytagcloud.png | Bin 0 -> 823 bytes .../searchtb/inspd-button4-mystars.png | Bin 0 -> 853 bytes .../inspd-searchbar-dropdown-allitems.png | Bin 0 -> 973 bytes .../inspd-searchbar-dropdown-default-icon.png | Bin 0 -> 579 bytes .../inspd-searchbar-dropdown-mybookmarks.png | Bin 0 -> 829 bytes .../inspd-searchbar-dropdown-mytags.png | Bin 0 -> 916 bytes .../searchtb/inspd-searchbar-go-1413.png | Bin 0 -> 386 bytes .../searchtb/inspd-searchbar-splitter.png | Bin 0 -> 334 bytes .../classic/searchtb/inspd_icon_post1.png | Bin 0 -> 674 bytes .../inspd@danny/defaults/preferences/inspd.js | 22 + ff_ext/inspd@danny/install.rdf | 36 + ff_ext/utils/inspd_update.xml | 40 + 62 files changed, 4533 insertions(+) create mode 100644 ff_ext/inspd@danny/chrome.manifest create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/inc/globals.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/inc/md5.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/inc/vars.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/inspdoverlay.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/inspdoverlay.xul create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/altpost.css create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/altpost1.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/altpost2_popup.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/altpost_trigger.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/images/inspd_altpost_arrow1.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/images/inspd_altpost_arrow2.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/qpost.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/altpost/qpost.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/allitems.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/home.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/home.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/cancel.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/icons_credits.txt create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_color_swatch.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_delicious_history.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_edit.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_edit2.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon1_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon2_home.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon3_mytagcloud_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon3_mytagcloud_html_icon_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon5_mybookmarks_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon6_allitems_html_icon_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon6_allitems_icon_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon7_posttoinsipid_icon_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_icon8_mystars_icon_1616.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_links.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_links2.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_similar.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_star_gold.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_star_off.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/images/inspd_star_on.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/inspd_json_lib.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/mybookmarks.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/mystars.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/mystars.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/mytags.html create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/mytags.js create mode 100644 ff_ext/inspd@danny/chrome/inspd/content/v2/json/style.css create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/icon1-3232.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/inspd.css create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/icons_credits.txt create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-button1-home.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-button2-posttoinsipid.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-button3-mytagcloud.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-button4-mystars.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-dropdown-allitems.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-dropdown-default-icon.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-dropdown-mybookmarks.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-dropdown-mytags.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-go-1413.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd-searchbar-splitter.png create mode 100644 ff_ext/inspd@danny/chrome/inspd/skin/classic/searchtb/inspd_icon_post1.png create mode 100644 ff_ext/inspd@danny/defaults/preferences/inspd.js create mode 100644 ff_ext/inspd@danny/install.rdf create mode 100644 ff_ext/utils/inspd_update.xml diff --git a/ff_ext/inspd@danny/chrome.manifest b/ff_ext/inspd@danny/chrome.manifest new file mode 100644 index 0000000..1ec8b50 --- /dev/null +++ b/ff_ext/inspd@danny/chrome.manifest @@ -0,0 +1,8 @@ +content inspd chrome/inspd/content/ +content inspd chrome/inspd/content/ contentaccessible=yes + +overlay chrome://browser/content/browser.xul chrome://inspd/content/inspdoverlay.xul + +skin inspd classic/1.0 chrome/inspd/skin/classic/ +style chrome://browser/content/browser.xul chrome://inspd/skin/inspd.css +style chrome://global/content/customizeToolbar.xul chrome://inspd/skin/inspd.css \ No newline at end of file diff --git a/ff_ext/inspd@danny/chrome/inspd/content/inc/globals.js b/ff_ext/inspd@danny/chrome/inspd/content/inc/globals.js new file mode 100644 index 0000000..3aa1462 --- /dev/null +++ b/ff_ext/inspd@danny/chrome/inspd/content/inc/globals.js @@ -0,0 +1,774 @@ +function $id(elid,doc){if(!doc){doc=document;} return doc.getElementById(elid); } +if(typeof(Insipid) == 'undefined') var Insipid = {}; +var Inspd_gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); +var prefs_getBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); +var prefs_getservice = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); +var $prefs = { + + set : function(pref_name, pref_value) { + var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); + str.data = $utils.trim(pref_value); + prefs_getBranch.setComplexValue('extensions.inspd.'+pref_name, Components.interfaces.nsISupportsString, str); + }, + + set2 : function(pref_name, pref_value) { + var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); + str.data = $utils.trim(pref_value); + prefs_getBranch.setComplexValue(pref_name, Components.interfaces.nsISupportsString, str); + }, + + + + get : function(pref_name){ + try{ + return prefs_getBranch.getComplexValue('extensions.inspd.'+pref_name,Components.interfaces.nsISupportsString).data; + } + catch(e){ return false;} + }, + + remove : function(pref_name){ + try{prefs_getBranch.clearUserPref('extensions.inspd.'+pref_name) + }catch(e){} + }, + + remove_all : function(pref_name){ + try{prefs_getBranch.deleteBranch('extensions.inspd.'+pref_name,'') + }catch(e){} + }, + + + branch : function(pref_name){ + var serialBranch = prefs_getservice.getBranch('extensions.inspd.'+pref_name+'.'); + return serialBranch.getChildList("",{}); + } +} + + +var $ajax = { + + get : function(url,func){ + var http_request = new XMLHttpRequest(); + http_request.onreadystatechange = function() { func(http_request); }; + http_request.open('GET', url, true); + http_request.setRequestHeader("Connection", "close"); + http_request.setRequestHeader("Keep-Alive", ""); + http_request.send(null); + } + +} + + +var $effects = { + + toggleFade: function(elid) { + if ($id(elid).style.display == 'none'){ + this.fadeIn(elid); + }else{ + this.fadeOut(elid); + } + }, + + toggleShow: function(elid) { + if ($id(elid).style.display == 'none'){ + $id(elid).style.display = 'block'; + } + else{ + $id(elid).style.display = 'none'; + } + }, + + + + fadeOut : function(elid) { + var opacs = ["0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"]; + opacs.reverse(); + for (var i = 0; i < 11; i++) { + setTimeout('$id(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40); + } + setTimeout('$id(\''+elid+'\').style.display = "none";', i * 40); + }, + + + fadeIn : function(elid) { + var opacs = [".1",".2",".3",".4",".5",".6",".7",".8",".9","1"]; + $id(elid).style.opacity = '0'; + $id(elid).style.display = 'block'; + for (var i = 0; i < 10; i++) { + setTimeout('$id(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40); + } + + }, + + hide : function(elid,delay){ + setTimeout('$effects.fadeOut(\''+elid+'\');',parseInt(delay)*1000) + }, + + initializedrag : function(e,main_id,drag_id){ + var crossobj=$id(main_id) ; + var firedobj= e.target ; + var topelement= "body" ; + while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!=drag_id){ + firedobj=firedobj.parentNode ; + } + + if (firedobj.id==drag_id){ + var offsetx= e.clientX ; + var offsety= e.clientY ; + + var tempx=parseInt(crossobj.style.left) ; + var tempy=parseInt(crossobj.style.top) ; + + dragapproved=true ; + document.onmousemove=(function(e){ + if (dragapproved){ + crossobj.style.left=tempx+e.clientX-offsetx+"px" + crossobj.style.top=tempy+e.clientY-offsety+"px" + return false + } + return false; + }) + } + + }, + + pos2Anchor : function(obj,e,commentbox) { + + + var tempX = 0; + var tempY = 0; + var offset = 5; + + obj = $id(obj); + + tempX = e.pageX; + tempY = e.pageY; + if (tempX < 0){tempX = 0} + if (tempY < 0){tempY = 0} + + + + obj.style.top = (tempY + offset) + 'px'; + if (commentbox == true){ + obj.style.left = ((tempX + offset)+0) + 'px'; + } + else { + obj.style.left = ((tempX + offset)-155) + 'px'; + } + + + }, + + show : function(obj,show) { + + $id(obj).style.display = show ? 'block' : 'none'; + //obj.style.visibility = show ? 'visible' : 'hidden'; + }, + + + getAnchorPos: function(anchorname) { + // This function will return an Object with x and y properties + var useWindow=false; + var coordinates=new Object(); + var x=0,y=0; + var use_gebi=false, use_css=false, use_layers=false; + if (document.getElementById) { use_gebi=true; } + else if (document.all) { use_css=true; } + else if (document.layers) { use_layers=true; } + if (use_gebi && document.all) { + x=this.AnchorPosition_getPageOffsetLeft(document.all[anchorname]); + y=this.AnchorPosition_getPageOffsetTop(document.all[anchorname]); + } + else if (use_gebi) { + var o=document.getElementById(anchorname); + x=this.AnchorPosition_getPageOffsetLeft(o); + y=this.AnchorPosition_getPageOffsetTop(o); + } + else if (use_css) { + x=this.AnchorPosition_getPageOffsetLeft(document.all[anchorname]); + y=this.AnchorPosition_getPageOffsetTop(document.all[anchorname]); + } + else if (use_layers) { + var found=0; + for (var i=0; i'; + $id('nav').style.display= 'none'; + return headertxt ; + } + }, + + remove_all : function(){ + if (confirm('Are you sure you want to delete all your stars?')){ + $prefs.set('stars.list',''); + document.location.href = Inspd_JSON_HOME_PAGE ; + } + else { + return false; + } + return false; + } + + + + + + + +} + +var $conditions = { + + page_with_qs_tags : function() { + if ($utils.qs('tag') && $utils.qs('tag').split('+').length < 2){ + return true ; + } + else { + return false ; + } + }, + gate : function(){ + if (!document.location.href.match(Inspd_JSON_BOOKMARKS_PAGE) && $utils.qs('tag')){ + document.location.href = Inspd_JSON_BOOKMARKS_PAGE+'?tag='+$utils.qs('tag')+'' ; + } + + else if (!document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) && $utils.qs('q')){ + document.location.href = Inspd_JSON_ALLITEMS_PAGE+'?q='+$utils.qs('q')+'' ; + } + else if (document.location.href.match(Inspd_JSON_HOME_PAGE) && $utils.qs('tag')){ + document.location.href = Inspd_JSON_BOOKMARKS_PAGE+'?tag='+$utils.qs('tag')+'' ; + } + else if (document.location.href.match(Inspd_JSON_HOME_PAGE) && $utils.qs('q')){ + document.location.href = Inspd_JSON_ALLITEMS_PAGE+'?q='+$utils.qs('q')+'' ; + } + else if (document.location.href.match(Inspd_JSON_ALLITEMS_PAGE) && $utils.qs('q') == ''){ + document.location.href = Inspd_JSON_HOME_PAGE ; + } + else if (document.location.href.match(Inspd_JSON_BOOKMARKS_PAGE) && $utils.qs('tag') == ''){ + document.location.href = Inspd_JSON_HOME_PAGE ; + } + }, + + getProtocol : function(url,protocol_name){ + if(url.split(':')[0] == protocol_name){ + return true ; + } + else{ + return false; + } + + + } + + + + +} + + +var $delpage = { + + draw_postToInsipid : function(doc){ + var posts = this.getNodes("//div[@class='data']//h4", doc,doc); + for (var i = 0, k = posts.snapshotLength ; i < k ; i++) { + var row = posts.snapshotItem(i) ; + var url , title , tags, user ; + var extended = ''; + var metaNode = null; + var tagsNode = null ; + var original_save_link_href = row.getElementsByTagName('a')[1].getAttribute('href'); + original_save_link_href = original_save_link_href.replace(/^\/save;_y(.*)\?/,$prefs.get('defurl')+'?op=add_bookmark&'); + original_save_link_href = original_save_link_href.replace(/jump=(.*)original_user=/,'copy_user='); + original_save_link_href = original_save_link_href.replace(/%20/g,'+'); + var new_save_link_href = original_save_link_href ; + row.innerHTML += ' SAVE TO INSIPID'; + } + + }, + + getNodes: function(what, where, doc) { + return doc.evaluate(what, where, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + } + +} + +var $alt_Post = { + + trigger : function(doc){ + //$utils.appendFavIcon('chrome://inspd/content/v2/json/images/inspd_icon7_posttoinsipid_icon_1616.ico',doc); + $utils.appendcssfile(''+Inspd_BASE_ALTPOST_URL+'altpost.css',doc); + $utils.appendjsHTML(''+$alt_Post.write_jsoptions()+'',doc); + + var title_tmp = doc.evaluate("//div[@class='title']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML ; + doc.evaluate("//div[@class='title']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML = 'Post to '+title_tmp+'.  With tag autocompletion.'; + + doc.evaluate("//div[@class='search']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML = ''; + + doc.forms[0].getElementsByTagName('input')[1].setAttribute('value',(''+(''+doc.forms[0].getElementsByTagName('input')[1].value+'').replace(//g,'>')); + + if (doc.evaluate("//span[@class='formtext']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML.match('already bookmarked')){ + //'this is an edit' + var linkdelete = ''+$prefs.get('defurl')+'?op=delete_bookmark&id=\'+document.forms[0].id.value+\''; + doc.forms[0].innerHTML += '   » delete this bookmark'; + } + else{ + doc.evaluate("//span[@class='formtext']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML ='URL (new bookmark):'; + + } + + doc.forms[0].innerHTML +='
'+ + '
'+ + '
    '+ + '
  • '+ + '
  • '+ + '
  • '+ + '
  • '+ + '
  • '+ + '
  • '+ + '
'+ + ''; + + $utils.appendjs('chrome://inspd/content/inc/vars.js',doc) + $utils.appendjs('chrome://inspd/content/inc/md5.js',doc) + $alt_Post.setInitialUI(doc); + //$utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) + + }, + + write_jsoptions : function(){ + + var jstxt = 'window.focus();var tagRec = [];var tagPop = [];var tagPop2 = []; var tagPop3 = []; var tagFor = [];var copyuser = "" ; var copytags = [];'; + + $utils.get_deliciousUser() ? jstxt +='var Inspd_delicious_username=\''+$utils.get_deliciousUser()+'\';' : jstxt+=''; + return jstxt ; + }, + + setInitialUI : function(doc){ + var url = doc.getElementsByTagName('input')[0].getAttribute('value') ; + 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.)') ){ + doc.evaluate("//span[@class='poptags_msg']",doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).innerHTML += 'getting popular tags for this url from del.icio.us ....'; + + $utils.appendjsHTML('Inspd_delintegrate_commontags = 1;',doc); + $alt_Post.GetPopTagsFromDeliciousChooser(doc,''+$prefs.get('delintegratecommontags')+''); + + + } + else{ + $utils.appendjsHTML('Inspd_delintegrate_commontags = 0;',doc); + $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ; + } + }, + + + + GetPopTagsFromDeliciousPersonal : function(doc){ + //var urlDeliciousPersonal = 'http://del.icio.us/'+$utils.get_deliciousUser()+'?v=4&noui&jump=close&url='+doc.getElementsByTagName('input')[0].getAttribute('value')+''; + var urlDeliciousPersonal = 'http://feeds.delicious.com/v2/json/tags/'+$utils.get_deliciousUser() ; + + + + var http_requestDeliciousPersonal = new XMLHttpRequest(); + http_requestDeliciousPersonal.onreadystatechange = function() { + if (http_requestDeliciousPersonal.readyState == 4) { + try{ + if (http_requestDeliciousPersonal.status == 200) { + //if(http_requestDeliciousPersonal.responseText.match('tagPop = \\[.*\\]') != 'tagPop = []'){ + //$utils.appendjsHTML('Inspd_delintegrate_commontags_found = 1;'+(''+http_requestDeliciousPersonal.responseText.match('var tagPop = \\[.*\\]')+'').toLowerCase()+';tagPop = tagpop;',doc) ; + var tags_txt = http_requestDeliciousPersonal.responseText ; + tags_txt = tags_txt.replace(/\{|\}|\:[0-9]{1}|\:[0-9]{2}|\:[0-9]{3}|\:[0-9]{4}/g,''); + $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 1; tagPop = ['+tags_txt.toLowerCase()+'];',doc) ; + //} + //else{ + //$utils.appendjsHTML('Inspd_delintegrate_commontags_found = 2;',doc); + //} + $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ; + } + else { + //alert(e); + $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc); + $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ; + } + } + catch(e){ + //alert(e); + $utils.appendjsHTML('Inspd_delintegrate_commontags_found = 3;',doc); + $utils.appendjs(''+Inspd_BASE_ALTPOST_URL+'altpost_trigger.js',doc) ; + } + } + }; + //http_requestDeliciousPersonal.overrideMimeType('text/xml'); + http_requestDeliciousPersonal.open('GET', urlDeliciousPersonal, true); + http_requestDeliciousPersonal.setRequestHeader("Connection", "close"); + http_requestDeliciousPersonal.setRequestHeader("Keep-Alive", ""); + http_requestDeliciousPersonal.send(null); + }, + + GetPopTagsFromDeliciousFetchURL : function(doc){ + //$utils.inc('chrome://inspd/content/inc/md5.js'); + var urlDeliciousURL = 'http://delicious.com/url/'+hex_md5(''+doc.getElementsByTagName('input')[0].getAttribute('value')+'')+'?settagview=cloud'; + + var http_requestDeliciousURL = new XMLHttpRequest(); + http_requestDeliciousURL.onreadystatechange = function() { + if (http_requestDeliciousURL.readyState == 4) { + try{ + if (http_requestDeliciousURL.status == 200) { + //var alphacloud_txt = (''+http_requestDeliciousURL.responseText.match(/
[\s\S]+/)+'').replace(/