⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slide.js

📁 tarena电子月刊第一期,包括java开发、面试相关信息
💻 JS
📖 第 1 页 / 共 4 页
字号:
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*([\s\S]*\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);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.childNodes[i]);}}}function padNumber(n,pad){n=n+"";while(n.length<pad){n="0"+n;}return n;}function isArray(obj){if(obj instanceof Array)return true;elsereturn false;}function simpleDateFormatter(date,pattern){var d=pattern;d=d.replace(/yyyy/g,date.getFullYear());d=d.replace(/yy/g,padNumber(date.getFullYear()%100,2));d=d.replace(/MM/g,padNumber(date.getMonth()+1,2));d=d.replace(/M/g,date.getMonth()+1);d=d.replace(/dd/g,padNumber(date.getDate(),2));d=d.replace(/d/g,date.getDate());d=d.replace(/HH/g,padNumber(date.getHours(),2));d=d.replace(/H/g,date.getHours());d=d.replace(/hh/g,padNumber(date.getHours()%12,2));d=d.replace(/h/g,date.getHours()%12);d=d.replace(/mm/g,padNumber(date.getMinutes(),2));d=d.replace(/m/g,date.getMinutes());d=d.replace(/ss/g,padNumber(date.getSeconds(),2));d=d.replace(/s/g,date.getSeconds());var am=(date.getHours()<12?"AM":"PM");d=d.replace(/a/g,am);return d;}function formatDateTime(date){if(date==undefined)return undefined;return formatDate(date)+" "+formatTime(date);}function formatDate(date){var datePattern=getMessage("format.date");return simpleDateFormatter(date,datePattern);}function formatTime(date){var timePattern=getMessage("format.time");return simpleDateFormatter(date,timePattern);}function parseISOTime(strTime){if(strTime==undefined)return undefined;var isoRE=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d{3})?([Z+-])?(\d\d)?:?(\d\d)?$/;if(!isoRE.test(strTime)){return undefined;}else{return new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5,RegExp.$6);}}function setOpacity(elt,opacity){if(IE){elt.style.filter="alpha(opacity="+parseInt(opacity*100)+")";}elt.style.KhtmlOpacity=opacity;elt.style.opacity=opacity;}function validCoordinates(lat,lon){if(Math.abs(lat)>90||Math.abs(lon)>180){return false;}if(lat===0.0&&lon===0.0){return false;}return true;}function isHosted(){var host=document.location.host;if(host==undefined)host="";return((host.indexOf("triptracker.net")==-1||host.indexOf("slideshow.triptracker.net")!=-1)&&host.indexOf("rtvslo.si")==-1&&host!="localhost"&&!checkDomain());}function checkDomain(){try{if(_DOMAIN==undefined)return false;var protocol=document.location.protocol;if(protocol==undefined)protocol="http:";var host=document.location.host;if(host==undefined)host="";host=host.toLowerCase();if(protocol.toLowerCase().indexOf("file")===0){return true;}var pos=host.lastIndexOf(":");if(pos!=-1){host=host.substring(0,pos);}if(host.indexOf("www.")===0){host=host.substring(4);}if(host===""||host=="localhost"||host=="127.0.0.1")return true;var domain=_DOMAIN.toLowerCase();pos=domain.indexOf("://");if(pos!=-1){domain=domain.substring(pos+3);}pos=domain.indexOf("/");if(pos!=-1){domain=domain.substring(0,pos);}if(domain.indexOf("www.")===0){domain=domain.substring(4);}if(host==domain){return true;}else if(new RegExp(domain).test(host)){return true;}return false;}catch(e){return true;}}function getWindowSize(win){var availW=win.innerWidth;if(availW==undefined||availW===0||isNaN(availW))availW=win.document.documentElement.clientWidth;if(availW==undefined||availW===0||isNaN(availW))availW=win.document.body.clientWidth;var availH=win.innerHeight;if(availH==undefined||availH===0||isNaN(availH))availH=win.document.documentElement.clientHeight;if(availH==undefined||availH===0||isNaN(availH))availH=win.document.body.clientHeight;return{w:availW,h:availH};}function getDocumentSize(win){var winSize=getWindowSize(win);var scrollPos=getScrollPos(win);var w=winSize.w+scrollPos.left;var h=winSize.h+scrollPos.top;w=Math.max(w,win.document.body.offsetWidth);h=Math.max(h,win.document.body.offsetHeight);w=Math.max(w,win.document.body.scrollWidth);h=Math.max(h,win.document.body.scrollHeight);return{w:w,h:h};}function getScrollPos(win){var scrollTop=win.pageYOffset;if(scrollTop==undefined||scrollTop===0)scrollTop=win.document.documentElement.scrollTop;if(scrollTop==undefined||scrollTop===0)scrollTop=win.document.body.scrollTop;var scrollLeft=win.pageXOffset;if(scrollLeft==undefined||scrollLeft===0)scrollLeft=win.document.documentElement.scrollLeft;if(scrollLeft==undefined||scrollLeft===0)scrollLeft=win.document.body.scrollLeft;return{top:scrollTop,left:scrollLeft};}var CLEAR_EVENTS=["onclick","ondblclick","onkeydown","onkeypress","onmousedown","onmouseup","onmousemove","onmouseover","onmouseout","onmousewheeldown","oncontextmenu"];function clearEvents(){var i,j;var count=0;if(document.all==undefined)return;for(i=0;i<document.all.length;i++){for(j=0;j<CLEAR_EVENTS.length;j++){var event=document.all[i][CLEAR_EVENTS[j]];if(event!=undefined){document.all[i][CLEAR_EVENTS[j]]=null;count++;}}}}if(window.attachEvent)window.attachEvent("onunload",clearEvents);function getGallery(){var gallery=undefined;var win=window;while(gallery==undefined){try{gallery=win.document.gallery;}catch(e){break;}var tmpWin=win;win=win.parent;if(tmpWin===win){break;}}return gallery;}function getMap(){if(this.map!=undefined)return this.map;try{if(document.map!=undefined)return document.map;}catch(e){}try{if(window.parent.document.map!=undefined)return window.parent.document.map;}catch(e){}return undefined;}function viewerCloseCallback(photoIndex){var i,j,n=0;var gallery=getGallery();for(i=0;i<gallery.sets.length;i++){for(j=0;j<gallery.sets[i].photos.length;j++){var p=gallery.sets[i].photos[j];if(p==undefined||p.orig==undefined||p.orig.src==undefined)continue;if(n==photoIndex){gallery.setIndex=i;gallery.photoIndex=j;gallery.renderPhotos();gallery.win.focus();return;}n++;}}}var VIEWER_INDEX=0;var SLIDE_DURATION=4000;var SLIDE_OFFSET=50;var SLIDE_PHOTOS=true;var FADE_BORDER=false;var FADE_STEPS=10;var MOVE_STEP=1;var PRELOAD_TIMEOUT=60000;var BORDER_WIDTH=5;var FONT_SIZE=10;var LINE_HEIGHT="0.7em";var OFFSET_LEFT=0;var OFFSET_TOP=0;var REST_URL="/rest/";var P_IMG_ROOT="img/photoviewer";var TOOLBAR_IMG="toolbar.png";var TOOLBAR_IMG_RUNNING="toolbar2.png";var TOOLBAR_IMG_BACK="toolbar-back";var TOOLBAR_IMG_MASK="toolbar-mask.png";var TOOLBAR_IMG_LOADING="loading-anim.gif";var TOOLBAR_W=440;var TOOLBAR_H=75;var TOOLBAR_IMG_W=420;var TOOLBAR_IMG_H=44;var TOOLBAR_LINK="http://slideshow.triptracker.net";var TOOLBAR_OPACITY=0.7;var TOOLBAR_FONT_COLOR="#c0c0c0";var TOOLBAR_FONT_STYLE="tahoma, verdana, arial, helvetica, sans-serif";var BYLINE_FONT_COLOR=TOOLBAR_FONT_COLOR;var BYLINE_FONT_STYLE=TOOLBAR_FONT_STYLE;var BYLINE_POSITION_RIGHT=5;var BYLINE_POSITION_BOTTOM=5;var VIEWER_ID_PREFIX="PhotoViewer";var VIEWER_ID_BACK=VIEWER_ID_PREFIX+"Back";var VIEWER_ID_TOOLBAR=VIEWER_ID_PREFIX+"Toolbar";var VIEWER_ID_TOOLBAR_MAP=VIEWER_ID_PREFIX+"ToolbarMap";var VIEWER_ID_TOOLBAR_IMG=VIEWER_ID_PREFIX+"ToolbarImg";var VIEWER_ID_LOADING=VIEWER_ID_PREFIX+"Loading";var VIEWER_ID_TIME=VIEWER_ID_PREFIX+"Time";var VIEWER_ID_TITLE=VIEWER_ID_PREFIX+"Title";var VIEWER_ID_BYLINE=VIEWER_ID_PREFIX+"Byline";var VIEWER_ID_PHOTO=VIEWER_ID_PREFIX+"Photo";var VIEWER_ID_CTXMENU=VIEWER_ID_PREFIX+"CtxMenu";var TITLE_MAX_LENGTH=140;var TOOLBAR_IMG_LOADING_LEFT=273;var TOOLBAR_IMG_LOADING_TOP=24;function PhotoViewer(win,handleKeys){this.setImageRoot=setImageRoot;this.add=addPhoto;this.show=showPhoto;this.close=closePhoto;this.randomize=randomize;this.isShown=isPhotoShown;this.setBackground=setPhotoBackground;this.setShowToolbar=setShowToolbar;this.setToolbarImage=setToolbarImage;this.setShowCallback=setShowCallback;this.setCloseCallback=setCloseCallback;this.setEndCallback=setEndCallback;this.setLoading=setPhotoLoading;this.addBackShade=addBackShade;this.addToolbar=addToolbar;this.addCaptions=addCaptions;this.addByLine=addByLine;this.addBylineCaption=addBylineCaption;this.next=nextPhoto;this.prev=prevPhoto;this.first=firstPhoto;this.last=lastPhoto;this.slideShow=slideShow;this.slideShowStop=slideShowStop;this.startSlideShow=startSlideShow;this.handleKey=viewerHandleKey;this.checkStartFragmentIdentifier=checkStartFragmentIdentifier;this.checkStopFragmentIdentifier=checkStopFragmentIdentifier;this.setStartFragmentIdentifier=setStartFragmentIdentifier;this.setStopFragmentIdentifier=setStopFragmentIdentifier;this.email=emailPhoto;this.favorite=favoritePhoto;this.permalink=linkPhoto;this.setBackgroundColor=setBackgroundColor;this.setBorderWidth=setBorderWidth;this.setSlideDuration=setSlideDuration;this.disablePanning=disablePanning;this.enablePanning=enablePanning;this.disableFading=disableFading;this.enableFading=enableFading;this.disableShade=disableShade;this.enableShade=enableShade;this.setShadeColor=setShadeColor;this.setShadeOpacity=setShadeOpacity;this.setFontSize=setFontSize;this.setFont=setFont;this.enableAutoPlay=enableAutoPlay;this.disableAutoPlay=disableAutoPlay;this.enableEmailLink=enableEmailLink;this.disableEmailLink=disableEmailLink;this.enablePhotoLink=enablePhotoLink;this.disablePhotoLink=disablePhotoLink;this.setOnClickEvent=setOnClickEvent;this.setOnRightclickEvent=setOnRightclickEvent;this.enableLoop=enableLoop;this.disableLoop=disableLoop;this.enableToolbarAnimator=enableToolbarAnimator;this.disableToolbarAnimator=disableToolbarAnimator;this.enableToolbar=enableToolbar;this.disableToolbar=disableToolbar;this.setControlsImageMap=setControlsImageMap;this.setOverrideToolbarStyles=setOverrideToolbarStyles;this.setNoPadding=setNoPadding;this.hideOverlappingElements=hideOverlappingElements;this.showOverlappingElements=showOverlappingElements;this.addContextMenu=addContextMenu;this.id=VIEWER_ID_PREFIX+VIEWER_INDEX;VIEWER_INDEX++;this.photos=[];this.index=0;this.win=(win!=undefined?win:window);this.shown=false;this.showToolbar=true;this.backgroundColor="#000000";this.shadeColor="#000000";this.shadeOpacity=0.7;this.borderColor="#000000";this.shadeColor="#000000";this.shadeOpacity=0.7;this.borderWidth=BORDER_WIDTH;this.backgroundShade=true;this.fadePhotos=true;this.autoPlay=false;this.enableEmailLink=true;this.enablePhotoLink=true;this.slideDuration=SLIDE_DURATION;this.panPhotos=SLIDE_PHOTOS;this.fontSize=FONT_SIZE;this.font=undefined;if((handleKeys==undefined||handleKeys)&&!VIEWER_KEY_EVENT_ADDED){if(this.win.addEventListener){this.win.addEventListener("keydown",viewerHandleKey,false);}else{this.win.document.attachEvent("onkeydown",viewerHandleKey);}VIEWER_KEY_EVENT_ADDED=true;}this.win.document.viewer=this;if(OPERA)this.disableFading();}var VIEWER_KEY_EVENT_ADDED=false;function PhotoImg(id,src,w,h,time,title,byline){this.id=id;this.src=src;this.w=parseInt(w,10);this.h=parseInt(h,10);this.time=time;this.title=title;this.byline=byline;}function getViewer(){var viewer=undefined;var win=window;while(viewer==undefined){try{viewer=win.document.viewer;}catch(e){break;}if(win===win.parent){break;}win=win.parent;}return viewer;}function setImageRoot(root){P_IMG_ROOT=root;}function addPhoto(photo,title,time,byline){var type=typeof photo;if(typeof photo=="string"){photo=new PhotoImg(undefined,photo,undefined,undefined,time,title,byline);}this.photos.push(photo);}function randomize(){var o=this.photos;for(var j,x,i=o.length;i;j=parseInt(Math.random((new Date()).getSeconds())*i,10),x=o[--i],o[i]=o[j],o[j]=x);}function setPhotoBackground(color,border,doShade){if(color!=undefined)this.backgroundColor=color;if(border!=undefined)this.borderColor=border;if(doShade!=undefined)this.backgroundShade=doShade;}function setPhotoLoading(isLoading){this.isLoading=isLoading;var elt=this.win.document.getElementById(VIEWER_ID_LOADING);if(elt==undefined)return;elt.style.display=isLoading?"":"none";}function setBackgroundColor(color){this.backgroundColor=color;this.borderColor=color;}function setBorderWidth(width){this.borderWidth=width;}function setSlideDuration(duration){this.slideDuration=duration;}function disableShade(){this.backgroundShade=false;}function enableShade(){this.backgroundShade=true;}function setShadeColor(color){this.shadeColor=color;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -