Archives | Contacts | Privacy Policy
26 January 2009
Nerd 2.0

Bookmark sidebar with icons

I never thought that I sometimes do not find in the abundance of Firefox Extensions that's right.

The plan was simply my Firefox something "clean" and to leave any valuable bookmarks on a call by Sidebar icon on the left. Ready to plug-nil return!

After some recherche then I've at last found a way to realize my project.

So describes Evan Rowals in his blog how to use the " All-In-One Sidebar "extension and the" Custom Buttons ² "extension, such can build a Lesezeichenbar.

Since his example code for the ADD button but can be called nicthmehr, I've tinkered own solution with the help of Custom Buttons Forum.

var button = this;

function create button (button, name, img, code, Icode)
{
var nowButton = button;
var = nowButtonNum custombuttons.getNumber (nowButton.id);
var values ​​= getButtonParameters (name, img, code, Icode);

var toolbar = nowButton.parentNode;

var = newNum custombuttons.min_button_number ();
var = NewButton custombuttons.createButton (newNum, values);
var = newButton2 custombuttons.createButton (newNum, values);
var = newButtonId newButton.id;

/ / Palette äîáàâëÿåì â
custombuttons.addToPalette (newButton2);

/ / Â toolbar
var = aBefore nowButton.nextSibling;
custombuttons.insertToToolbar (toolbar, NewButton, aBefore);

/ / Èñïðàâëÿåì currentSet äëÿ toolbar
var ar = toolbar.getAttribute ('currentset') split (',').;
var Z = 1;
for (var j = 0; j
if (ar [j] == nowButton.id) {
z = j +1;
break;
}
}
ar.splice (z, 0, newButtonId);
/ / Èçáàâëÿåìñÿ îò ãëþêà ñ ñàìîïðîèçâîëüíûì ðàçìíîæåíèåì êíîïîê
var newset = ";
var temp = {};
for (var i = 0; i
if (! (ar [i] in temp)) {
temp [ar [i]] = true;
newset + = ar [i];
if (i +1
}
}
toolbar.setAttribute ('currentset', Newset);
document.persist (toolbar.id, 'currentset');

/ / Anee ýòî custom-toolbar, òî èñïðàâëÿåì àòðèáóòû â toolbarset ...
var custom index = toolbar.getAttribute ('custom index');
if (custom index> 0) {
var attrName = 'toolbar' + custom index;
var toolbarset = document.getElementById ('custom toolbars');
var = oldset toolbarSet.getAttribute (attrName);
Newset oldSet.substring = (0, oldSet.indexOf (':') +1) + newset;
toolbarSet.setAttribute (attrName, Newset);
document.persist ('custom toolbars', attrName);
}
/ / Èñïðàâëåíèÿ äëÿ AIOS
if (document.getElementById ('aiostbx-belowtabs-toolbox'))
persistCurrentSets ();
custombuttons.saveButtonsToProfile ();
}
getButtonParameters function (name, img, code, Icode) {
var ar = new Array;
ar.push (name);
ar.push (img);
ar.push (code);
ar.push (Icode);
return {
'Name': ar [0] | | ",
'Image': ar [1] | | ",
'Code': ar [2] | | ",
'Init code': ar [3] | | "
};
}

this.create_image = function (img)
{
this.CB = window.custombuttons;
var img = AURL;
kIOContractID var = "@ mozilla.org / network / io-service; 1";
var = kIOIID Components. interfaces. nsIIOService;
var = IOSVC Components. classes [kIOContractID]. getService (kIOIID);
var chan = IOSVC. NewChannel (AURL, null, null);
var listener = new this.CB.imageLoadListener (chan);
chan. notificationCallbacks = listener;
listener.callBackFunction = this.setImageURL;
chan. asyncOpen (listener, null);
}
this.setImageURL = function (img)
{
var name = content.document.title;
var code = "";
Icode var = "var link =" "+ content.document.location.href +" "; nvar label =" "+ name +" "; nthis.quot = function (evt) {nif (evt.shiftKey) {nthis.showPopup ( this); Nreturn, n} nn NSwitch (evt.button) {nn case 0: n loadURI (link); n break; nn case 2: n = gBrowser.selectedTab gBrowser.addTab (link); Nbreak, nn} n} nthis.showPopup = function (node) {n var popup = document.getElementById ('custom buttons-context popup'); n var x = node.boxObject.x; n var y = node.boxObject.y + node.boxObject.height; n document.popupNode = node; popup.showPopup n (node, x, y, 'popup', null, null);} nn n this.setAttribute ('onclick', 'this.quot (event);'); n this.setAttribute ('context', "), n = this.tooltipText label,";

create button (button, name, img, code, Icode);

}
this.bkmrk = function (evt) {

var favicon = document.getElementById ("page-proxy-favicon") src.;
if (! document.getElementById ("page-proxy-favicon") src.) {
favicon = prompt ('This site has no favicon n If you would like to Specify one, please do so: nnnn For files use "file :/ / /" and the locationnnOr use a URL instead', 'file :/ / / ',' Specify a favicon ');
if ((favicon.match ('file :/ / /.')) | | (favicon.match ('http://'))) {
this.create_image (favicon);
return;
}
if (favicon == null) {
return;
}
else {
favicon = "chrome :/ / custom buttons / skin / button.png";
this.create_image (favicon);
}
}
else {
this.create_image (favicon);
}
}

this.setAttribute ("homepage", "http://custombuttons.phpbbnow.com/viewtopic.php?t=167");

By clicking the star as now created a button, the saved page in the current tab open at a left-click and right-click in a new one. Shift + right-click opens the Custom button menu for editing.

Lots of fun ;)

Similar Posts:
Unzip with PHP
Firefox: Icon Sidebar (Update)
Shortened text, HTML open?
New Blogging System
Archive for Wordpress! Without links?

One comment


[...] Firefox: Icon Sidebar (Update) BODY SNATCHER 16.06.2009 No comment Print The everyday surfers, Collected Works More on the topic: bookmarks sidebar with icons [...]


Comment on