K-Meleon

KMeleonWiki > Resources > MacroLibrary > Image Browsing Toolbar

Submitted by: Johnny Sim-Bravenboer



Notes:

A toolbar to make image browsing just a little easier.


The Zoom macros and the Open Image Links macro are already part of K-Meleon 0.9


To complete the toolbar, rename and convert this picture to imagebrowsing.bmp and place it in the folder of the skin in use:


internal://fe0492b45a6ba0842f8d18b50ef324f5.jpeg


If you do not wish to use the imagebrowsing.bmp toolbar picture, just leave out the references to the picture in the toolbar macro.


References:






Zoom In & Zoom Out Images?


In Macros:


Sync{

&EngineSync?;
setcheck("macros(SN0)",getpref(INT,$so)==0? true:false);
setcheck("macros(SN1)",getpref(INT,$so)==1? true:false);
setcheck("macros(SN2)",getpref(INT,$so)==2? true:false);
setcheck("macros(SearchLock?)",getpref(BOOL,$sl));
....

pluginmsg(toolbars,"CheckButton?","Image Browsing Bar,macros(toggle_autoresize),".(getpref(BOOL,"browser.enable_automatic_image_resizing")? 1:0));

}


# Image Browsing Macros

hide_visited_links{
    $macro="hide-visited-links"; &JSEnable;
}
hide-visited-links{
    open("javascript:(function(){var newSS, styles=':visited {display: none}'; if(document.createStyleSheet) { document.createStyleSheet("javascript:'"+styles+"'"); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.documentElement.childNodes0?.appendChild(newSS); } })();");
}


increment_link{
    $macro="increment-link"; &JSEnable;
}
increment-link{
    open("javascript:(function(){ var e,s; IB=1; function isDigit(c) { return ("0" <= c && c <= "9") } L = location.href; LL = L.length; for (e=LL-1; e>=0; e) if (isDigit(L.charAt(e))) { for(s=e-1; s>=0; s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e<0) return; oldNum = L.substring(s,e+1); newNum = "" + (parseInt(oldNum,10) + IB); while (newNum.length < oldNum.length) newNum = "0" + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();");
}


decrement_link{
    $macro="decrement-link"; &JSEnable;
}
decrement-link{
    open("javascript:(function(){ var e,s; IB=-1; function isDigit(c) { return ("0" <= c && c <= "9") } L = location.href; LL = L.length; for (e=LL-1; e>=0; e) if (isDigit(L.charAt(e))) { for(s=e-1; s>=0; s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e<0) return; oldNum = L.substring(s,e+1); newNum = "" + (parseInt(oldNum,10) + IB); while (newNum.length < oldNum.length) newNum = "0" + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();");
}


go_refferer{
    $macro="go-refferer"; &JSEnable;
}
go-refferer{
    open("javascript:if(!document.referrer) alert("No referrer!"); else document.location = document.referrer; void 0");
}

# Enable Automatic Image Resize

toggle_autoresize{    
   menu = "Enable Auto Image Resizing"
   togglepref(BOOL, "browser.enable_automatic_image_resizing");
   &Sync;
   getpref(BOOL, "browser.enable_automatic_image_resizing") == true ? $warn = "enabled" :$warn = "disabled";
   alert("        Auto Image Resize has been ".$warn."! \n\n Refresh the page for the setting to take effect.");
}

# List Image Links

list_images_links{
menu=&List Images As Links
open("javascript:{var images='';for (var idx=0;idx<document.images.length;idx++)images+='<a href=\'+document.imagesidx?.src+\'>'+document.imagesidx?.src+'</a>
\';images='<html><body>'+images+'</body></html>\';document.write(images);document.close();}"); } # Open all links in a page OpenAllLinks?{ getpref(BOOL, $popups) == "true" ? &PB2 : &AllLinks?; } PB2{ &PBToggle; &AllLinks?; &PBToggle; } AllLinks?{ $macro = "OpenAll?"; &JSEnable; } OpenAll?{ open("javascript:(function(){var n_to_open,dl,dll,i; function linkIsSafe(u) { if (u.substr(0,7)'mailto:') return false; if (u.substr(0,11)'javascript:') return false; return true; } n_to_open = 0; dl = document.links; dll = dl.length; for(i = 0; i < dll; i) { if (linkIsSafe(dli.href)) n_to_open; } if (!n_to_open) alert ('no links'); else { if (confirm('Open ' + n_to_open + ' links in new windows?')) for (i = 0; i < dll; ++i) if (linkIsSafe(dli.href)) window.open(dli.href); } })();"); }


In Toolbars:

# Image Browsing Toolbar

%ifplugin macros

Image Browsing Bar(66,10){

    Zoom In {
    macros(ZoomInImages?)
    Zoom In Images
    imagebrowsing.bmp0?
    }

    Zoom Out {
    macros(ZoomOutImages?)
    Zoom Out Images    
    imagebrowsing.bmp1?
    }

    Open Links {
    macros(open_image_links)
    Open Linked Images
    imagebrowsing.bmp2?
    }

    Hide Visited {
    macros(hide_visited_links)
    Hide Visited Links
    imagebrowsing.bmp3?
    }

    ++ Link {
    macros(increment_link)
    Increment Last Number Of Link
    imagebrowsing.bmp4?
    }

    -- Link {
    macros(decrement_link)
    Decrement Last Number Of Link
    imagebrowsing.bmp5?
    }   

    List Links {
    macros(list_images_links)
    Create an Image Link List
    imagebrowsing.bmp6?
    }

    All Links {
    macros(OpenAllLinks?, Open All Links)
    Open All Links
    imagebrowsing.bmp7?
    }

    Go Refferer {
    macros(go_refferer)
    Go to Refferer
    imagebrowsing.bmp8?
    }

    BugMeNot {
    macros(BugMeNot, Bypass Registration (BugMeNot))
    Bypass Site Registration
    imagebrowsing.bmp9?
    }

    Auto Resize {
    macros(toggle_autoresize)
    En- or Disable Auto Image Resize
    imagebrowsing.bmp10?
    }

}

%endif


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.