x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
HeaderControls.js - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\tmp4677415525\Leona\Scripts\Widgets\HeaderControls\HeaderControls.js
旋转
特效
属性
历史版本
// // iWeb - HeaderControls.js // Copyright (c) 2007 Apple Inc. All rights reserved. // function HeaderControls(instanceID) {if(instanceID!=null) {Widget.apply(this,arguments);NotificationCenter.addObserver(this,HeaderControls.prototype.p_prevPage,"PreviousPage",this.p_mediaGridID());NotificationCenter.addObserver(this,HeaderControls.prototype.p_nextPage,"NextPage",this.p_mediaGridID());NotificationCenter.addObserver(this,HeaderControls.prototype.p_setPage,"SetPage",this.p_mediaGridID());this.mRange=new IWPageRange(0,5);this.p_updateRange();}} HeaderControls.prototype=new Widget();HeaderControls.prototype.constructor=HeaderControls;HeaderControls.prototype.widgetIdentifier="com-apple-iweb-widget-headercontrols";HeaderControls.prototype.onload=function() {var defaults={showBackToIndex:true,showAddPhoto:true,showSubscribe:true,showSlideshow:true,mediaIndex:false,entriesPerPage:99,entryCount:0};this.initializeDefaultPreferences(defaults);this.setPage(0);this.updateFromPreferences();if(this.preferences&&this.preferences.postNotification) {this.preferences.postNotification("BLWidgetIsSafeToDrawNotification",1);}} HeaderControls.prototype.onunload=function() {} HeaderControls.prototype.startup=function() {this.p_updateCanvasControls();this.p_updateBackToIndex();this.p_updatePaginationControls();this.p_updateAddPhoto();this.p_updateSubscribe();this.p_updateSlideshow();if(this.p_mediaIndex()) {this.getElementById("media_index_only").show();} else {this.getElementById("album_only").show();}} HeaderControls.prototype.changedPreferenceForKey=function(key) {if(key=="entriesPerPage"||key=="entryCount"||key=="x-currentPage") {this.p_updateRange();this.p_updatePaginationControls();} else if(key=="showBackToIndex") {this.p_updateBackToIndex();} else if(key=="showAddPhoto") {this.p_updateAddPhoto();} else if(key=="showSubscribe") {this.p_updateSubscribe();} else if(key=="showSlideshow") {this.p_updateSlideshow();} else if(key=="canvas controls") {this.p_updateCanvasControls();} else if(this.runningInApp) {if(key=="x-nextPage") {this.nextPage();} else if(key=="x-previousPage") {this.prevPage();} else if(key=="x-setPage") {this.setPage(this.p_setPagePreference());}}} HeaderControls.prototype.updateFromPreferences=function() {this.startup();} HeaderControls.prototype.prevPage=function() {NotificationCenter.postNotification(new IWNotification("PreviousPage",this.p_mediaGridID(),null));} HeaderControls.prototype.nextPage=function() {NotificationCenter.postNotification(new IWNotification("NextPage",this.p_mediaGridID(),null));} HeaderControls.prototype.setPage=function(pageIndex) {NotificationCenter.postNotification(new IWNotification("SetPage",this.p_mediaGridID(),{pageIndex:pageIndex}));} HeaderControls.prototype.playSlideshow=function() {if(this.mPlaySlideshowFunction) {this.mPlaySlideshowFunction();}} HeaderControls.prototype.setPlaySlideshowFunction=function(playSlideshow) {this.mPlaySlideshowFunction=playSlideshow;} HeaderControls.prototype.p_canNavigateToPrev=function() {return(this.p_currentPage()>0);} HeaderControls.prototype.p_prevPage=function(notification) {if(this.p_canNavigateToPrev()) {this.setPage(this.p_currentPage()-1);}} HeaderControls.prototype.p_canNavigateToNext=function() {return(this.p_currentPage()
";controls+=imgMarkup(leftArrowSrc,'','','');controls+=" ";} else {var leftArrowSrc=canvasControlURLs['canvas_arrow-left-D'];controls+=imgMarkup(leftArrowSrc,'','','')+" ";} for(var i=this.mRange.min();i
"+(i+1)+" ";} else {controls+="
"+(i+1)+"
";}} if(this.p_canNavigateToNext()) {var rightArrowSrc=canvasControlURLs['canvas_arrow-right'];controls+="
";controls+=imgMarkup(rightArrowSrc,'','','');controls+="
";} else {var rightArrowSrc=canvasControlURLs['canvas_arrow-right-D'];controls+=imgMarkup(rightArrowSrc,'','','');}} var template=new Template(controls);var myControls=template.evaluate({WIDGET_ID:this.instanceID});this.getElementById("pagination_controls").update(myControls);widgetDiv.select('.paginated_only').invoke(this.p_isPaginated()?'show':'hide');widgetDiv.select('.non_paginated_only').invoke(this.p_isPaginated()?'hide':'show');if(this.runningInApp) {this.setPreferenceForKey(controls,"x-paginationSpanContents");} else {NotificationCenter.postNotification(new IWNotification("paginationSpanContents",this.p_mediaGridID(),{controls:controls}));}} HeaderControls.prototype.p_setAnchorsUnderElementToHREF=function(element,href) {var links=element.getElementsByTagName("a");for(var i=0;i
this.p_entriesPerPage());} HeaderControls.prototype.p_pageCount=function() {return Math.ceil(this.p_entryCount()/this.p_entriesPerPage());} HeaderControls.prototype.p_updateRange=function() {var pageCount=this.p_pageCount();var currentPage=this.p_currentPage();if(currentPage>=pageCount) {currentPage=pageCount-1;this.setPreferenceForKey(currentPage,"x-currentPage");} if(pageCount<=5||this.mRange.length()<3||this.mRange.max()>pageCount) {this.mRange.setMax(Math.min(5,pageCount));} if(currentPage
=this.mRange.max()) {this.mRange.shift(currentPage-this.mRange.max()+1);}}
HeaderControls.js
网页地址
文件地址
上一页
2/3
下一页
下载
( 9 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.