recentpopularlog in

kme : slideshow   25

TripTracker slideshow - Home
The bookmarklet:
javascript:s=document.createElement('script');s.src='http://slideshow.triptracker.net/slide-bookmark.js';s.type='text/javascript';void(document.getElementsByTagName('head')[0].appendChild(s));

And the JS source:
/*
* (c) Copyright 2006, Klika, all rights reserved.
*
* This code is the property of Klika d.o.o. The code
* may not be included in, invoked from, or otherwise
* used in any software, service, device, or process
* which is sold, exchanged for profit, or for which
* a license, subscription, or royalty fee is charged.
*
* Permission is granted to use this code for personal,
* educational, research, or commercial purposes, provided
* this notice is included, and provided this code is not
* used as described in the above paragraph.
*
* This code may not be modified without express
* permission of Klika. You may not delete, disable, or in
* any manner alter distinctive brand features rendered
* by the code. The use of this code in derivative work is
* permitted, provided that the code and this notice are
* included in full, and provided that the code is used in
* accordance with these terms.
*
* Email: info at triptracker.net
* Web: http://slideshow.triptracker.net
*/
var MESSAGES = {
"format.date": "MM/dd/yyyy",
"format.time": "h:mm a",

"photoviewer.toolbar.first": "Go to Start (Home)",
"photoviewer.toolbar.prev": "Previous Photo (Left arrow)",
"photoviewer.toolbar.slideShow": "Start/Pause Slide Show (Space)",
"photoviewer.toolbar.next": "Next Photo (Right arrow)",
"photoviewer.toolbar.last": "Go to End (End)",
"photoviewer.toolbar.email": "Email Photo",
"photoviewer.toolbar.permalink": "Link to Photo",
"photoviewer.toolbar.close": "Close (Esc)",
"photoviewer.email.subject.photo": "Photo",

"gallery.nophotos": "No photos",
"gallery.thumbs.start": "Start",
"gallery.thumbs.end": "End",
"gallery.toolbar.first": "First Photo",
"gallery.toolbar.prev": "Previous Photo",
"gallery.toolbar.view": "View Photo",
"gallery.toolbar.next": "Next Photo",
"gallery.toolbar.last": "Last Photo",
"gallery.view.full": "Maximize Window",
"gallery.view.photo": "Show Photo Only",
"gallery.view.text": "Show Description Only",
"gallery.view.close": "Close Window"
};

var agent=navigator.userAgent.toLowerCase();var IE=(agent.indexOf("msie")!=-1&&agent.indexOf("opera")==-1);var IE7=(agent.indexOf("msie 7")!=-1);var IE8=(agent.indexOf("msie 8")!=-1);var OPERA=(agent.indexOf("opera")!=-1);var SAFARI=(agent.indexOf("safari")!=-1);var FIREFOX=(agent.indexOf("gecko")!=-1);var STRICT_MODE=(document.compatMode=="CSS1Compat");var _DOMAIN=undefined;var GALLERY_W=650;var GALLERY_H=530;if(USE_GOOGLE_MAPS==undefined){var USE_GOOGLE_MAPS=true;}
var USE_OLD_MAPS=!USE_GOOGLE_MAPS;var TESTING=false;var log=getLogger();if(document.location.href.indexOf("#jslog")!=-1)
log.enable();function Logger(){this.enable=loggerEnable;this.clear=loggerClear;this.log=loggerLog;this.debug=loggerDebug;this.info=loggerInfo;this.error=loggerError;var console=undefined;try{console=document.createElement("textarea");console.style.display="none";console.style.position="absolute";console.style.right="2px";console.style.bottom="2px";console.style.width="23em";console.style.height="40em";console.style.fontFamily="monospace";console.style.fontSize="9px";console.style.color="#000000";setOpacity(console,0.7);console.border="1px solid #808080";console.ondblclick=clearLogger;}catch(e){}
this.console=console;this.enabled=false;this.logTimeStart=getTimeMillis();}
function getLogger(){var log=undefined;var win=window;while(log==undefined){try{log=win.document.log;}catch(e){break;}
if(win==win.parent)
break;win=win.parent;}
if(log==undefined){log=new Logger();document.log=log;}
return log;}
function clearLogger(){getLogger().clear();}
function loggerEnable(){if(this.enabled||this.console==undefined)
return;if(window.document.body!=undefined){window.document.body.appendChild(this.console);this.console.style.display="";this.enabled=true;}}
function loggerDebug(msg){this.log("DEBUG",msg);}
function loggerInfo(msg){this.log("INFO",msg);}
function loggerError(msg,e){this.log("ERROR",msg,e);}
function loggerLog(level,msg,e){if(!this.enabled||this.console==undefined)
return;var millis=(getTimeMillis()-this.logTimeStart)+"";while(millis.length<6)
millis+=" ";var m=millis+" ";if(msg!=undefined)
m+=msg+" ";if(e!=undefined)
m+=e.name+": "+e.message;this.console.value+=m+"n";}
function loggerClear(){if(!this.enabled||this.console==undefined)
return;this.console.value="";}
function getTimeMillis(){var t=new Date();return Date.UTC(t.getFullYear(),t.getMonth(),t.getDay(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());}
function getEvent(event){return(event!=undefined?event:window.event);}
function preventDefault(event){if(event.stopEvent)
event.stopEvent();if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}}
function getEventTarget(event){if(event==undefined)
return undefined;if(event.srcElement!=undefined)
return event.srcElement;else
return event.target;}
function getMousePosition(event){event=getEvent(event);var scrollLeft=window.pageXOffset;if(scrollLeft==undefined||scrollLeft===0)
scrollLeft=window.document.documentElement.scrollLeft;if(scrollLeft==undefined||scrollLeft===0)
scrollLeft=window.document.body.scrollLeft;var scrollTop=window.pageYOffset;if(scrollTop==undefined||scrollTop===0)
scrollTop=window.document.documentElement.scrollTop;if(scrollTop==undefined||scrollTop===0)
scrollTop=window.document.body.scrollTop;var x=event.clientX+scrollLeft;var y=event.clientY+scrollTop;return{x:x,y:y};}
function getResponse(url,async,getXML,callback,data){var req=undefined;try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){req=new XMLHttpRequest();}}
if(req==undefined){log.error("Failed to initialize XML/HTTP");return undefined;}
req.open("GET",url,async);if(!async){req.send(undefined);if(req.readyState!=4){log.error("Request failed: "+req.readyState);return undefined;}
if(!getXML)
return req.responseText;else
return req.responseXML;}else{pollResponse(req,callback,data);req.send(undefined);return undefined;}}
function pollResponse(req,callback,data){if(req.readyState!=4)
window.setTimeout(function(){pollResponse(req,callback,data);},100);else
callback(req,data);}
function getDOMLocation(node){var x=node.offsetLeft;var y=node.offsetTop;while(node.offsetParent){x=x+node.offsetParent.offsetLeft;y=y+node.offsetParent.offsetTop;if(node==document.getElementsByTagName('body')[0]){break;}else{node=node.offsetParent;}}
return{x:x,y:y};}
function getElementsByTagName(node,tag){if(node==undefined)
return undefined;if(IE){return node.getElementsByTagName(tag);}
if(tag.indexOf(":")!=-1){tag=tag.split(":")[1];}
return node.getElementsByTagNameNS("*",tag);}
function getFirstElementsValue(node,tag){if(node==undefined)
return undefined;var nodes=getElementsByTagName(node,tag);if(nodes.length===0)
return undefined;else
return getElementValue(nodes[0]);}
function findDOMElement(id){var el=undefined;var win=window;while(el==undefined){try{el=win.document.getElementById(id);}catch(e){break;}
if(win===win.parent){break;}
win=win.parent;}
return el;}
function getElementValue(node){var i;var val="";for(i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeValue!==null)
val+=node.childNodes[i].nodeValue;}
return val;}
function trim(str){if(str==undefined)
return undefined;return str.replace(/^s*([sS]*S+)s*$|^s*$/,'$1');}
function trimToLen(str,len){if(str==undefined){return undefined;}
if(str.length>len){str=str.substring(0,len)+"...";}
return str;}
function getRootWindow(){var win=window;while(win!=undefined){try{if(win===win.parent){break;}else if(win.parent!=undefined&&win.parent.document.location.href.indexOf("/selenium-server/")!=-1){break;}
win=win.parent;}catch(e){win.permissionDenied=true;break;}}
return win;}
function getURLParams(){var i,params=[];var url=window.location.search;if(url==undefined||url.length===0)
return undefined;url=url.substring(1);var namevals=url.replace(/+/g," ").split("&");for(i=0;i<namevals.length;i++){var name,val;var pos=namevals[i].indexOf("=");if(pos!=-1){name=namevals[i].substring(0,pos);try
{val=decodeURIComponent(namevals[i].substring(pos+1));}
catch(e)
{val=unescape(namevals[i].substring(pos+1));}}else{name=namevals[i];val=undefined;}
params[name]=val;}
return params;}
function joinLists(list1,list2){var i;var size=0;var result=[];if(list1!=undefined&&list1.length>0){for(i=0;i<list1.length;i++)
result[i]=list1[i];size=list1.length;}
if(list2!=undefined&&list2.length>0){for(i=0;i<list2.length;i++)
result[i+size]=list2[i];}
return result;}
function setCookie(name,value,expire){var expiry=(expire==undefined)?"":("; expires="+expire.toGMTString());document.cookie=name+"="+value+expiry;}
function getCookie(name){if(document.cookie==undefined||document.cookie.length===0)
return undefined;var search=name+"=";var index=document.cookie.indexOf(search);if(index!=-1){index+=search.length;var end=document.cookie.indexOf(";",index);if(end==-1)
end=document.cookie.length;return unescape(document.cookie.substring(index,end));}}
function removeCookie(name){var today=new Date();var expires=new Date();expires.setTime(today.getTime()-1);setCookie(name,"",expires);}
function getMessage(id){if(MESSAGES[id]==undefined){return"("+id+")";}else{return MESSAGES[id];}}
function localizeNodeAttribs(node){var i;if(node==undefined)
return;if(node.alt!=undefined&&node.alt.indexOf("#")===0){node.alt=getMessage(node.alt.substring(1));}
if(node.title!=undefined&&node.title.indexOf("#")===0){node.title=getMessage(node.title.substring(1));}
if(node.childNodes!=undefined){for(i=0;i<node.childNodes.length;i++){localizeNodeAttribs(node.… [more]
slideshow  javascript  bookmarklet  essential  webannoyances  lightbox 
october 2011 by kme

Copy this bookmark:





to read