Initial import.
3
WebContent/META-INF/MANIFEST.MF
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
||||
47
WebContent/META-INF/context.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- The contents of this file will be loaded for each web application -->
|
||||
<Context>
|
||||
|
||||
<!-- Default set of monitored resources -->
|
||||
<WatchedResource>WEB-INF/web.xml</WatchedResource>
|
||||
|
||||
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
|
||||
<!--
|
||||
<Manager pathname="" />
|
||||
-->
|
||||
|
||||
<!-- Uncomment this to enable Comet connection tacking (provides events
|
||||
on session expiration as well as webapp lifecycle) -->
|
||||
<!--
|
||||
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
|
||||
-->
|
||||
|
||||
<Resource
|
||||
name="jdbc/mysql"
|
||||
auth="Container"
|
||||
type="javax.sql.DataSource"
|
||||
username="main"
|
||||
password="ZL5CU5qzbx4MzEnA"
|
||||
driverClassName="com.mysql.jdbc.Driver"
|
||||
url="jdbc:mysql://koc.se:3306/main"
|
||||
maxActive="8"
|
||||
maxIdle="4"
|
||||
validationQuery="SELECT 1"
|
||||
testOnBorrow="true" />
|
||||
</Context>
|
||||
BIN
WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar
Normal file
BIN
WebContent/WEB-INF/lib/commons-io-1.4.jar
Normal file
BIN
WebContent/WEB-INF/lib/mail.jar
Normal file
BIN
WebContent/WEB-INF/lib/mysql-connector-java-5.1.15-bin.jar
Normal file
99
WebContent/WEB-INF/web_sample.xml
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
|
||||
<display-name>Zallery</display-name>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>gallery</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Zallery</servlet-name>
|
||||
<servlet-class>zall.Zallery</servlet-class>
|
||||
<init-param>
|
||||
<param-name>WEBSITE_NAME</param-name>
|
||||
<param-value>Gallery</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>WEBSITE_URL</param-name>
|
||||
<param-value>http://example.com/Zallery/</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>SMTP_HOST</param-name>
|
||||
<param-value>127.0.0.1</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>THEME</param-name>
|
||||
<param-value></param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>DATA_PATH</param-name>
|
||||
<param-value>C:\\data</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>FB_APPID</param-name>
|
||||
<param-value>123456789</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>FB_APPSEC</param-name>
|
||||
<param-value>123456789abcdefklmnopqrst</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Zallery</servlet-name>
|
||||
<url-pattern>/gallery</url-pattern>
|
||||
<url-pattern>/media</url-pattern>
|
||||
<url-pattern>/slideshow</url-pattern>
|
||||
<url-pattern>/login</url-pattern>
|
||||
<url-pattern>/logout</url-pattern>
|
||||
<url-pattern>/upload</url-pattern>
|
||||
<url-pattern>/profile</url-pattern>
|
||||
<url-pattern>/users</url-pattern>
|
||||
<url-pattern>/register</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Content</servlet-name>
|
||||
<servlet-class>zall.ZalleryContent</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Content</servlet-name>
|
||||
<url-pattern>/content</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Ajax</servlet-name>
|
||||
<servlet-class>zall.ZalleryAjax</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Ajax</servlet-name>
|
||||
<url-pattern>/ajax</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Upload</servlet-name>
|
||||
<servlet-class>zall.UploadServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>TEMP_PATH</param-name>
|
||||
<param-value>C:\\temp</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>ALLOWED_EXTENSIONS</param-name>
|
||||
<param-value>png,jpg,jpeg,gif,tif,bmp,avi,wmv,mov,mp4,mpeg,flv,m4v,divx,xvid</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Upload</servlet-name>
|
||||
<url-pattern>/uploadserv</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>transcoder</servlet-name>
|
||||
<servlet-class>zall.ZalleryTranscoder</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>gallery</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
95
WebContent/css/2c-l-fixed.css
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
LAYOUT: One-Column (Left) Fixed
|
||||
DESCRIPTION: Two-column 950px fixed layout with one sidebar left of content
|
||||
*/
|
||||
|
||||
body {
|
||||
min-width:940px;
|
||||
}
|
||||
#header {
|
||||
position:relative;
|
||||
}
|
||||
#branding {
|
||||
width:940px;
|
||||
margin:0 auto;
|
||||
}
|
||||
#access {
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
}
|
||||
.menu {
|
||||
width:940px;
|
||||
margin:0 auto;
|
||||
}
|
||||
#main {
|
||||
width:940px;
|
||||
margin:0 auto;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
}
|
||||
#container {
|
||||
width:940px;
|
||||
float:right;
|
||||
margin: 0 0 0 -310px;
|
||||
}
|
||||
#content {
|
||||
width:620px;
|
||||
overflow:hidden;
|
||||
margin: 0 0 0 320px;
|
||||
}
|
||||
.hentry {
|
||||
width:620px;
|
||||
}
|
||||
.main-aside {
|
||||
width:300px;
|
||||
float:left;
|
||||
position:relative;
|
||||
}
|
||||
#primary {
|
||||
float:left;
|
||||
}
|
||||
#secondary {
|
||||
clear:left;
|
||||
}
|
||||
#footer {
|
||||
clear:both;
|
||||
}
|
||||
#subsidiary {
|
||||
width:940px;
|
||||
margin:0 auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
#subsidiary .aside {
|
||||
width:300px;
|
||||
float:left;
|
||||
margin:0 20px 0 0;
|
||||
}
|
||||
#subsidiary #third {
|
||||
margin:0;
|
||||
}
|
||||
#siteinfo {
|
||||
clear:both;
|
||||
width:940px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
/* =Page Templates
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
Full Width Template
|
||||
*/
|
||||
|
||||
.page-template-template-page-fullwidth-php #container {
|
||||
margin:0;
|
||||
width:940px;
|
||||
}
|
||||
|
||||
.page-template-template-page-fullwidth-php #content {
|
||||
margin: 0 0 0 10px;
|
||||
width:940px;
|
||||
}
|
||||
|
||||
.page-template-template-page-fullwidth-php #comments {
|
||||
width:540px;
|
||||
}
|
||||
81
WebContent/css/images.css
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
Default styles for Images
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
.entry-content .wp-post-image {
|
||||
border: 1px solid #ccc;
|
||||
float:right;
|
||||
margin: 0 0 20px 18px;
|
||||
padding: 5px;
|
||||
}
|
||||
.entry-content img {
|
||||
height:auto;
|
||||
margin: 0 0 18px 0;
|
||||
max-width:100%;
|
||||
}
|
||||
.alignleft,
|
||||
img.alignleft {
|
||||
float: left;
|
||||
margin-right:20px;
|
||||
}
|
||||
.alignright,
|
||||
img.alignright {
|
||||
display: block;
|
||||
float: right;
|
||||
margin-left:20px;
|
||||
}
|
||||
.aligncenter,
|
||||
img.aligncenter {
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.wp-caption {
|
||||
border:1px solid #ccc;
|
||||
text-align: center;
|
||||
margin-bottom:18px;
|
||||
padding:9px 5px 0;
|
||||
}
|
||||
.wp-caption img {
|
||||
border: 1px solid #ccc;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.wp-caption p.wp-caption-text {
|
||||
margin: 0;
|
||||
padding:18px 5px;
|
||||
}
|
||||
.gallery-icon {
|
||||
border: 1px solid #ccc;
|
||||
margin: 0 5px;
|
||||
padding-top: 6px;
|
||||
}
|
||||
.gallery img {
|
||||
margin:0;
|
||||
}
|
||||
.gallery-caption {
|
||||
padding:6px 6px 0;
|
||||
}
|
||||
.wp-smiley { /* Prevent the smileys from breaking line-height */
|
||||
max-height:12px;
|
||||
margin:0 !important;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Adapt the following for use in your Child Themes when using
|
||||
different font-sizes and line-heights
|
||||
|
||||
.entry-content img,
|
||||
.wp-caption {
|
||||
margin-bottom:--px;
|
||||
}
|
||||
.wp-smiley {
|
||||
max-height:--px;
|
||||
}
|
||||
|
||||
All other styles can be overridden--or ignored!--in Child Theme stylesheets
|
||||
|
||||
*/
|
||||
64
WebContent/css/reset.css
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* --------------------------------------------------------------
|
||||
|
||||
Reset default browser CSS.
|
||||
|
||||
Based on work by Eric Meyer:
|
||||
http://meyerweb.com/eric/tools/css/reset/index.html
|
||||
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* v1.0 | 20080212 */
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
background: transparent;
|
||||
}
|
||||
body {
|
||||
background:#fff;
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* remember to highlight inserts somehow! */
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
a img { border: none; }
|
||||
1166
WebContent/css/style.css
Normal file
99
WebContent/css/zallery.css
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
.progressbar, .progressbarYellow, .progressbarGreen, .progressbarRed, .progressbarBlue{
|
||||
background: transparent url(../img/bar-grey.gif) repeat-x scroll 0%;
|
||||
border: 1px solid black;
|
||||
color: white;
|
||||
height: 16px;
|
||||
margin: 5pt;
|
||||
padding: 0pt;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
width; 150px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.progressbar b, .progressbarYellow b, .progressbarGreen b, .progressbarRed b, .progressbarBlue b{
|
||||
float: left;
|
||||
height: 16px;
|
||||
margin: 0pt;
|
||||
padding: 0pt;
|
||||
font-size: 11px;
|
||||
}
|
||||
.progressbar b, .progressbarGreen b{
|
||||
background: transparent url(../img/bar-green.gif) repeat-x scroll 0%;
|
||||
}
|
||||
.progressbarYellow b{
|
||||
background: transparent url(../img/bar-yellow.gif) repeat-x scroll 0%;
|
||||
}
|
||||
.progressbarRed b{
|
||||
background: transparent url(../img/bar-red.gif) repeat-x scroll 0%;
|
||||
}
|
||||
.progressbarBlue b{
|
||||
background: transparent url(../img/bar-blue.gif) repeat-x scroll 0%;
|
||||
}
|
||||
|
||||
|
||||
input:focus{
|
||||
border: 1px solid #7D6D06;
|
||||
}
|
||||
|
||||
.slideshow-link{
|
||||
background: url("../img/icons/slideshow.png") no-repeat left center
|
||||
}
|
||||
|
||||
#footer{
|
||||
padding: 25px 0;
|
||||
}
|
||||
|
||||
.fb_edge_comment_widget {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Forms **/
|
||||
/* style.css:34 */
|
||||
input[type="submit"], input[type="button"], button {
|
||||
padding: 3px 18px 6px 18px;
|
||||
-moz-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
-webkit-border-radius: 0px;
|
||||
}
|
||||
|
||||
/** Gallery **/
|
||||
/* style.css:141 */
|
||||
#header {
|
||||
padding: 10px 0;
|
||||
}
|
||||
/* style.css:374 */
|
||||
.msie #content, .single #content, .home #content, .page #content {
|
||||
padding-top: 0px;
|
||||
}
|
||||
/* style.css:516 */
|
||||
form {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
/** Upload **/
|
||||
/* style.css:674 */
|
||||
/*#comments {
|
||||
padding: 0px 0 0 0;
|
||||
}*/
|
||||
/* style.css:374 */
|
||||
/*.msie #content, .single #content, .home #content, .page #content {
|
||||
padding-top: 0px;
|
||||
}*/
|
||||
|
||||
.entry-title {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
|
||||
#edit-row{
|
||||
margin: 0 0 0.8em 0;
|
||||
}
|
||||
#edit-row form{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modmedia_edit{
|
||||
display: none;
|
||||
}
|
||||
21
WebContent/footer.jsp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
|
||||
|
||||
<div class="push"></div>
|
||||
</div><!-- #wrapper -->
|
||||
|
||||
<div class="footer">
|
||||
<div id="footer">
|
||||
<div id="siteinfo">
|
||||
Powered by
|
||||
Java2EE And Tomcat. Zallery Gallery created by Ziver Koc.
|
||||
<br>Built on the
|
||||
<a href="http://upthemes.com/themes/gallery/" title="Gallery Wordpress Theme" rel="designer">Gallery WordPress Theme</a>
|
||||
by
|
||||
<a href="http://upthemes.com">UpThemes</a>.
|
||||
</div><!-- #siteinfo -->
|
||||
</div><!-- #footer -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
66
WebContent/gallery.jsp
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="zall.bean.*" %>
|
||||
<%@ page import="java.sql.Timestamp" %>
|
||||
<%
|
||||
User user = (User)session.getAttribute("user");
|
||||
Folder folder = (Folder)request.getAttribute("folder");
|
||||
%>
|
||||
|
||||
<DIV id="main">
|
||||
<DIV id="container">
|
||||
<DIV id="content">
|
||||
<TABLE id="edit-row" width="100%" border="0"><TR>
|
||||
<TD>
|
||||
<%if( folder.getParent() != null ){ %>
|
||||
<button type="button" onClick="window.location='gallery?folder=<%=folder.getParent().getId()%>'"><img src="img/arrow_undo.png" style="width: 10px; padding-right: 5px;">...Back</button>
|
||||
<%} %>
|
||||
</TD><TD>
|
||||
<%if( user.canEdit( folder ) && folder.getParent() != null ){ %>
|
||||
<form action="gallery?folder=<%=folder.getParent().getId() %>" method="post" align="right">
|
||||
<input type="hidden" name="id" value="<%=folder.getId() %>">
|
||||
<button type="submit" name="action" value="rmdir" onClick="return confirm ('Are you sure you want to delete this folder?')"><img src="img/delete.png" style="width: 10px; padding-right: 5px;">Delete</button>
|
||||
</form>
|
||||
<%} %>
|
||||
</TD>
|
||||
</TR></TABLE>
|
||||
<% // Folders
|
||||
for( Folder subfolder : ((List<Folder>)request.getAttribute("subfolders")) ){ %>
|
||||
<DIV class="entry-content">
|
||||
<DIV class="entry-content">
|
||||
<%if( subfolder.getDate().after(new Timestamp(System.currentTimeMillis()-10*24*60*60*1000) )){ %><SPAN class="new"></SPAN><%} %>
|
||||
<A href="gallery?folder=<%=subfolder.getId()%>"><SPAN class="slide-title" style="opacity: 0; "><%=subfolder.getName()%></SPAN>
|
||||
<IMG class="thumbnail" src="img/folder.png" width="125" height="125" alt="<%=subfolder.getName()%>"><SPAN class="cover-up"></SPAN></A>
|
||||
</DIV>
|
||||
</DIV><!-- .post -->
|
||||
<% } %>
|
||||
|
||||
|
||||
<% // Media
|
||||
for( Media media : (List<Media>)request.getAttribute("media") ){
|
||||
if( media instanceof Image ){ %>
|
||||
<DIV class="entry-content">
|
||||
<% } else if( media instanceof Video ){ %>
|
||||
<DIV class="video">
|
||||
<% } %>
|
||||
|
||||
<DIV class="entry-content">
|
||||
<%if( media.getDate().after(new Timestamp(System.currentTimeMillis()-10*24*60*60*1000)) ){ %><SPAN class="new"></SPAN><%} %>
|
||||
<A href="media?type=<%=media.getType() %>&id=<%=media.getId()%>"><SPAN class="slide-title" style="opacity: 0; "><%=media.getTitle()%></SPAN>
|
||||
<IMG class="thumbnail" src="content?type=<%=media.getType() %>&id=<%=media.getId()%>&size=small" width="125" height="125" alt="<%=media.getTitle()%>"><SPAN class="cover-up"></SPAN></A>
|
||||
</DIV>
|
||||
</DIV><!-- .post -->
|
||||
<% } %>
|
||||
|
||||
<!--
|
||||
<DIV id="nav-below" class="navigation">
|
||||
<DIV class="nav-previous">
|
||||
<A href="#"><SPAN class="meta-nav">«</SPAN> Older posts</A>
|
||||
</DIV>
|
||||
<DIV class="nav-next">
|
||||
<a href="#" >Newer posts <span class="meta-nav">»</span></a>
|
||||
</DIV>
|
||||
</DIV>
|
||||
-->
|
||||
</DIV><!-- #content -->
|
||||
</DIV><!-- #container -->
|
||||
</DIV><!-- #main -->
|
||||
181
WebContent/header.jsp
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page import="zall.bean.*" %>
|
||||
<%@ page import="zall.*, zall.util.msg.UserMessage, zall.util.msg.UserMessage.*" %>
|
||||
<%
|
||||
String page_url = (String)request.getAttribute("page");
|
||||
if( page_url == null ) page_url = "";
|
||||
User user = (User)session.getAttribute("user");
|
||||
UserMessage message = UserMessage.getUserMessage(session);
|
||||
%>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head profile="http://gmpg.org/xfn/11">
|
||||
<title><%=Zallery.getWebsiteName() %></title>
|
||||
|
||||
<!-- GLOBAL -->
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/zallery.css" />
|
||||
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="js/gallery.js"></script>
|
||||
<script type="text/javascript" src="js/colortip-1.0-jquery.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="js/colortip-1.0-jquery.css">
|
||||
|
||||
<% if( page_url.startsWith("media") ){ %>
|
||||
<!-- IMAGE -->
|
||||
<script type="text/javascript" src="js/fancyzoom/js-global/FancyZoom.js"></script>
|
||||
<script type="text/javascript" src="js/fancyzoom/js-global/FancyZoomHTML.js"></script>
|
||||
<script type="text/javascript" src="http://static.flowplayer.org/js/flowplayer-3.2.6.min.js"></script>
|
||||
<% } %>
|
||||
|
||||
<% if( page_url.startsWith("slideshow") ){ %>
|
||||
<!-- SLIDESHOW -->
|
||||
<script type="text/javascript" src="js/galleria/galleria-1.2.2.min.js"></script>
|
||||
<% } %>
|
||||
|
||||
<% if( page_url.startsWith("upload") ){ %>
|
||||
<!-- UPLOAD -->
|
||||
<script type="text/javascript" src="uploadserv?js"></script>
|
||||
<% } %>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
/* Adding a colortip to any tag with a title attribute: */
|
||||
jQuery("a").colorTip({
|
||||
color: 'black',
|
||||
timeout: 0
|
||||
});
|
||||
});
|
||||
|
||||
jQuery.validator.addMethod( "firstLastName", function(value, element) {
|
||||
var check = false;
|
||||
var re = new RegExp("^[^0-9_]+ [^0-9_]+$");
|
||||
return re.test(value);
|
||||
}, "Please enter your first and last name" );
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Google Analythics
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-310804-2']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<% if( page_url.startsWith("upload") || page_url.startsWith("users") || page_url.startsWith("profile") || page_url.startsWith("login") || page_url.startsWith("register") ){ %>
|
||||
<body class="page">
|
||||
<% }else if( page_url.startsWith("gallery") || page_url.startsWith("Zallery") ){ %>
|
||||
<body class="wordpress home blog not-singular">
|
||||
<% }else if( page_url.startsWith("media") ){ %>
|
||||
<body class="single" onload="setupZoom()">
|
||||
<% }else{ %>
|
||||
<body class="single">
|
||||
<% } %>
|
||||
|
||||
<div id="fb-root"></div>
|
||||
<script>
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : '110543555676926',
|
||||
status : true,
|
||||
cookie : true,
|
||||
xfbml : true,
|
||||
oauth : true,
|
||||
});
|
||||
};
|
||||
(function(d) {
|
||||
var js, id = 'facebook-jssdk';
|
||||
if (d.getElementById(id)) {
|
||||
return;
|
||||
}
|
||||
js = d.createElement('script');
|
||||
js.id = id;
|
||||
js.async = true;
|
||||
js.src = "//connect.facebook.net/en_US/all.js";
|
||||
d.getElementsByTagName('head')[0].appendChild(js);
|
||||
}(document));
|
||||
</script>
|
||||
|
||||
<div id="wrapper" class="hfeed">
|
||||
<div id="header">
|
||||
<div id="branding">
|
||||
<div id="blog-title">
|
||||
<span>
|
||||
<a href="gallery" title="<%=Zallery.getWebsiteName() %>" rel="home">
|
||||
<img src="img/logo.png" alt="<%=Zallery.getWebsiteName() %>" />
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div><!-- #branding -->
|
||||
|
||||
<div id="access">
|
||||
<div id="page-menu" class="menu">
|
||||
<ul id="page-nav" class="sf-menu">
|
||||
<li class="menu-item menu-item-type-post_type"><a href="status.jsp">Status</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="category-menu" class="menu">
|
||||
<ul id="category-nav" class="sf-menu">
|
||||
<li class="home"><a href="gallery">Home</a></li>
|
||||
<li class="cat-item"><a href="gallery" title="Main gallery">Gallery</a></li>
|
||||
<li class="cat-item"><a href="upload" title="Upload files to your album">Upload</a></li>
|
||||
<li class="cat-item"><a href="users" title="List of all users">Users</a></li>
|
||||
<li class="cat-item"><a href="profile" title="Your profile page">Profile</a></li>
|
||||
<% if( user != null ){ %>
|
||||
<li class="cat-item"><a href="page_geni.jsp" title="Family tree">Geni</a></li>
|
||||
<li class="cat-item"><a href="page_chat.jsp" title="Video chat with other users">Chat</a></li>
|
||||
|
||||
<li class="blog-description"><A id="FB_logout" href="logout" onClick="FB.logout(); return true;">Logout <%=user.getName() %></A></li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #access -->
|
||||
|
||||
<!-- User Messages -->
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(".message").click(function(){
|
||||
jQuery(this).animate({
|
||||
opacity: 0
|
||||
}, 300).animate({
|
||||
height: 0,
|
||||
border: 0
|
||||
}, 300, function(){
|
||||
jQuery(this).css("display","none");
|
||||
});
|
||||
});
|
||||
/*setTimeout(function(){
|
||||
jQuery(".message").animate({
|
||||
opacity: 0
|
||||
}, 300).animate({
|
||||
height: 0,
|
||||
border: 0
|
||||
}, 300, function(){
|
||||
jQuery(this).css("display","none");
|
||||
});
|
||||
}, 10000);*/
|
||||
});
|
||||
</script>
|
||||
<div class="menu">
|
||||
<% while( message.next() ){
|
||||
if( message.getType() == MessageType.WARNING ){%>
|
||||
<div class="message" style="border: 2px solid #E6E600; padding: 0px; margin: 5px; background: #FFFF99 none repeat scroll 0%; font-size: 11px; color: black; border-radius: 7px;">
|
||||
<center><b><%=message.getMessage() %></b></center>
|
||||
</div>
|
||||
<%} else if( message.getType() == MessageType.ERROR ){ %>
|
||||
<div class="message" style="border: 2px solid #FF0000; padding: 0px; margin: 5px; background: #FFDDCC none repeat scroll 0%; font-size: 11px; color: black; border-radius: 7px;">
|
||||
<center><b><%=message.getMessage() %></b></center>
|
||||
</div>
|
||||
<%} else if( message.getType() == MessageType.INFO ){ %>
|
||||
<div class="message" style="border: 2px solid #039C00; padding: 0px; margin: 5px; background: #9BFB66 none repeat scroll 0%; font-size: 11px; color: black; border-radius: 7px;">
|
||||
<center><b><%=message.getMessage() %></b></center>
|
||||
</div>
|
||||
<% }
|
||||
}%>
|
||||
</div>
|
||||
</div><!-- #header-->
|
||||
2
WebContent/img/.picasa.ini
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[download.png]
|
||||
rotate=rotate(2)
|
||||
BIN
WebContent/img/arrow_undo.png
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
WebContent/img/bar-blue.gif
Normal file
|
After Width: | Height: | Size: 163 B |
BIN
WebContent/img/bar-green.gif
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
WebContent/img/bar-grey.gif
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
WebContent/img/bar-red.gif
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
WebContent/img/bar-yellow.gif
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
WebContent/img/body-background.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
WebContent/img/btn-bg.jpg
Normal file
|
After Width: | Height: | Size: 376 B |
BIN
WebContent/img/default-user.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/img/delete.png
Normal file
|
After Width: | Height: | Size: 8 KiB |
BIN
WebContent/img/disk-black.png
Normal file
|
After Width: | Height: | Size: 434 B |
BIN
WebContent/img/download.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
WebContent/img/error.png
Normal file
|
After Width: | Height: | Size: 696 B |
BIN
WebContent/img/folder.png
Normal file
|
After Width: | Height: | Size: 270 KiB |
BIN
WebContent/img/full-image-default.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
WebContent/img/ico-comment.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
WebContent/img/ico-home-trans.png
Normal file
|
After Width: | Height: | Size: 662 B |
BIN
WebContent/img/ico-new-trans.png
Normal file
|
After Width: | Height: | Size: 1,004 B |
BIN
WebContent/img/ico-person.png
Normal file
|
After Width: | Height: | Size: 159 B |
BIN
WebContent/img/ico-reply.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
WebContent/img/ico-rss-trans.png
Normal file
|
After Width: | Height: | Size: 274 B |
BIN
WebContent/img/ico-video-trans.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
WebContent/img/icons/email.png
Normal file
|
After Width: | Height: | Size: 504 B |
BIN
WebContent/img/icons/facebook.png
Normal file
|
After Width: | Height: | Size: 485 B |
BIN
WebContent/img/icons/feed.png
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
WebContent/img/icons/flickr.png
Normal file
|
After Width: | Height: | Size: 467 B |
BIN
WebContent/img/icons/globe.png
Normal file
|
After Width: | Height: | Size: 584 B |
BIN
WebContent/img/icons/person.png
Normal file
|
After Width: | Height: | Size: 744 B |
BIN
WebContent/img/icons/slideshow.png
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
WebContent/img/icons/slideshow2.png
Normal file
|
After Width: | Height: | Size: 529 B |
BIN
WebContent/img/icons/vimeo.png
Normal file
|
After Width: | Height: | Size: 613 B |
BIN
WebContent/img/icons/youtube.png
Normal file
|
After Width: | Height: | Size: 471 B |
BIN
WebContent/img/light-source-trans.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
WebContent/img/loading.gif
Normal file
|
After Width: | Height: | Size: 771 B |
BIN
WebContent/img/logo.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
WebContent/img/menu-bg-trans.png
Normal file
|
After Width: | Height: | Size: 677 B |
BIN
WebContent/img/mixcss-logo-small-trans.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
WebContent/img/mixcss-logo-trans.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
WebContent/img/pencil.png
Normal file
|
After Width: | Height: | Size: 450 B |
BIN
WebContent/img/processing.gif
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
WebContent/img/rating_half.png
Normal file
|
After Width: | Height: | Size: 648 B |
BIN
WebContent/img/rating_off.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
WebContent/img/rating_on.png
Normal file
|
After Width: | Height: | Size: 670 B |
BIN
WebContent/img/rating_over.png
Normal file
|
After Width: | Height: | Size: 676 B |
BIN
WebContent/img/side-fade-trans.png
Normal file
|
After Width: | Height: | Size: 307 B |
BIN
WebContent/img/thumbnail-default.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
WebContent/img/upload.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
99
WebContent/js/colortip-1.0-jquery.css
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
.colorTip{
|
||||
/* This class is assigned to the color tip span by jQuery */
|
||||
|
||||
display:none;
|
||||
position:absolute;
|
||||
left:50%;
|
||||
top:-30px;
|
||||
padding:6px;
|
||||
|
||||
background-color:white;
|
||||
font-family:Arial,Helvetica,sans-serif;
|
||||
font-size:11px;
|
||||
font-style:normal;
|
||||
line-height:1;
|
||||
text-decoration:none;
|
||||
text-align:center;
|
||||
text-shadow:0 0 1px white;
|
||||
white-space:nowrap;
|
||||
|
||||
-moz-border-radius:4px;
|
||||
-webkit-border-radius:4px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
.pointyTip,.pointyTipShadow{
|
||||
/* Setting a thick transparent border on a 0x0 div to create a triangle */
|
||||
border:6px solid transparent;
|
||||
bottom:-12px;
|
||||
height:0;
|
||||
left:50%;
|
||||
margin-left:-6px;
|
||||
position:absolute;
|
||||
width:0;
|
||||
}
|
||||
|
||||
.pointyTipShadow{
|
||||
/* The shadow tip is 1px larger, so it acts as a border to the tip */
|
||||
border-width:7px;
|
||||
bottom:-14px;
|
||||
margin-left:-7px;
|
||||
}
|
||||
|
||||
.colorTipContainer{
|
||||
position:relative;
|
||||
text-decoration:none !important;
|
||||
}
|
||||
|
||||
|
||||
/* 6 Available Color Themes */
|
||||
|
||||
.white .pointyTip{ border-top-color:white;}
|
||||
.white .pointyTipShadow{ border-top-color:#ddd;}
|
||||
.white .colorTip{
|
||||
background-color:white;
|
||||
border:1px solid #DDDDDD;
|
||||
color:#555555;
|
||||
}
|
||||
|
||||
.yellow .pointyTip{ border-top-color:#f9f2ba;}
|
||||
.yellow .pointyTipShadow{ border-top-color:#e9d315;}
|
||||
.yellow .colorTip{
|
||||
background-color:#f9f2ba;
|
||||
border:1px solid #e9d315;
|
||||
color:#5b5316;
|
||||
}
|
||||
|
||||
.blue .pointyTip{ border-top-color:#d9f1fb;}
|
||||
.blue .pointyTipShadow{ border-top-color:#7fcdee;}
|
||||
.blue .colorTip{
|
||||
background-color:#d9f1fb;
|
||||
border:1px solid #7fcdee;
|
||||
color:#1b475a;
|
||||
}
|
||||
|
||||
.green .pointyTip{ border-top-color:#f2fdf1;}
|
||||
.green .pointyTipShadow{ border-top-color:#b6e184;}
|
||||
.green .colorTip{
|
||||
background-color:#f2fdf1;
|
||||
border:1px solid #b6e184;
|
||||
color:#558221;
|
||||
}
|
||||
|
||||
.red .pointyTip{ border-top-color:#bb3b1d;}
|
||||
.red .pointyTipShadow{ border-top-color:#8f2a0f;}
|
||||
.red .colorTip{
|
||||
background-color:#bb3b1d;
|
||||
border:1px solid #8f2a0f;
|
||||
color:#fcfcfc;
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
.black .pointyTip{ border-top-color:#333;}
|
||||
.black .pointyTipShadow{ border-top-color:#111;}
|
||||
.black .colorTip{
|
||||
background-color:#333;
|
||||
border:1px solid #111;
|
||||
color:#fcfcfc;
|
||||
text-shadow:none;
|
||||
}
|
||||
142
WebContent/js/colortip-1.0-jquery.js
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
(function($){
|
||||
$.fn.colorTip = function(settings){
|
||||
|
||||
var defaultSettings = {
|
||||
color : 'yellow',
|
||||
timeout : 500
|
||||
}
|
||||
|
||||
var supportedColors = ['red','green','blue','white','yellow','black'];
|
||||
|
||||
/* Combining the default settings object with the supplied one */
|
||||
settings = $.extend(defaultSettings,settings);
|
||||
|
||||
/*
|
||||
* Looping through all the elements and returning them afterwards.
|
||||
* This will add chainability to the plugin.
|
||||
*/
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var elem = $(this);
|
||||
|
||||
// If the title attribute is empty, continue with the next element
|
||||
if(!elem.attr('title')) return true;
|
||||
|
||||
// Creating new eventScheduler and Tip objects for this element.
|
||||
// (See the class definition at the bottom).
|
||||
|
||||
var scheduleEvent = new eventScheduler();
|
||||
var tip = new Tip(elem.attr('title'));
|
||||
|
||||
// Adding the tooltip markup to the element and
|
||||
// applying a special class:
|
||||
|
||||
elem.append(tip.generate()).addClass('colorTipContainer');
|
||||
|
||||
// Checking to see whether a supported color has been
|
||||
// set as a classname on the element.
|
||||
|
||||
var hasClass = false;
|
||||
for(var i=0;i<supportedColors.length;i++)
|
||||
{
|
||||
if(elem.hasClass(supportedColors[i])){
|
||||
hasClass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If it has been set, it will override the default color
|
||||
|
||||
if(!hasClass){
|
||||
elem.addClass(settings.color);
|
||||
}
|
||||
|
||||
// On mouseenter, show the tip, on mouseleave set the
|
||||
// tip to be hidden in half a second.
|
||||
|
||||
elem.hover(function(){
|
||||
|
||||
tip.show();
|
||||
|
||||
// If the user moves away and hovers over the tip again,
|
||||
// clear the previously set event:
|
||||
|
||||
scheduleEvent.clear();
|
||||
|
||||
},function(){
|
||||
|
||||
// Schedule event actualy sets a timeout (as you can
|
||||
// see from the class definition below).
|
||||
|
||||
scheduleEvent.set(function(){
|
||||
tip.hide();
|
||||
},settings.timeout);
|
||||
|
||||
});
|
||||
|
||||
// Removing the title attribute, so the regular OS titles are
|
||||
// not shown along with the tooltips.
|
||||
|
||||
elem.removeAttr('title');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/ Event Scheduler Class Definition
|
||||
*/
|
||||
|
||||
function eventScheduler(){}
|
||||
|
||||
eventScheduler.prototype = {
|
||||
set : function (func,timeout){
|
||||
|
||||
// The set method takes a function and a time period (ms) as
|
||||
// parameters, and sets a timeout
|
||||
|
||||
this.timer = setTimeout(func,timeout);
|
||||
},
|
||||
clear: function(){
|
||||
|
||||
// The clear method clears the timeout
|
||||
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/ Tip Class Definition
|
||||
*/
|
||||
|
||||
function Tip(txt){
|
||||
this.content = txt;
|
||||
this.shown = false;
|
||||
}
|
||||
|
||||
Tip.prototype = {
|
||||
generate: function(){
|
||||
|
||||
// The generate method returns either a previously generated element
|
||||
// stored in the tip variable, or generates it and saves it in tip for
|
||||
// later use, after which returns it.
|
||||
|
||||
return this.tip || (this.tip = $('<span class="colorTip">'+this.content+
|
||||
'<span class="pointyTipShadow"></span><span class="pointyTip"></span></span>'));
|
||||
},
|
||||
show: function(){
|
||||
if(this.shown) return;
|
||||
|
||||
// Center the tip and start a fadeIn animation
|
||||
this.tip.css('margin-left',-this.tip.outerWidth()/2).fadeIn('fast');
|
||||
this.shown = true;
|
||||
},
|
||||
hide: function(){
|
||||
this.tip.fadeOut();
|
||||
this.shown = false;
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
BIN
WebContent/js/fancyzoom/images-global/zoom/closebox.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/spacer.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-caption-fill.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-caption-l.png
Normal file
|
After Width: | Height: | Size: 310 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-caption-r.png
Normal file
|
After Width: | Height: | Size: 290 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow1.png
Normal file
|
After Width: | Height: | Size: 310 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow2.png
Normal file
|
After Width: | Height: | Size: 164 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow3.png
Normal file
|
After Width: | Height: | Size: 368 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow4.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow5.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow6.png
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow7.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-shadow8.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-1.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-10.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-11.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-12.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-2.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-3.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-4.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-5.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-6.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-7.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-8.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WebContent/js/fancyzoom/images-global/zoom/zoom-spin-9.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
761
WebContent/js/fancyzoom/js-global/FancyZoom.js
Normal file
|
|
@ -0,0 +1,761 @@
|
|||
// FancyZoom.js - v1.1 - http://www.fancyzoom.com
|
||||
//
|
||||
// Copyright (c) 2008 Cabel Sasser / Panic Inc
|
||||
// All rights reserved.
|
||||
//
|
||||
// Requires: FancyZoomHTML.js
|
||||
// Instructions: Include JS files in page, call setupZoom() in onLoad. That's it!
|
||||
// Any <a href> links to images will be updated to zoom inline.
|
||||
// Add rel="nozoom" to your <a href> to disable zooming for an image.
|
||||
//
|
||||
// Redistribution and use of this effect in source form, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * USE OF SOURCE ON COMMERCIAL (FOR-PROFIT) WEBSITE REQUIRES ONE-TIME LICENSE FEE PER DOMAIN.
|
||||
// Reasonably priced! Visit www.fancyzoom.com for licensing instructions. Thanks!
|
||||
//
|
||||
// * Non-commercial (personal) website use is permitted without license/payment!
|
||||
//
|
||||
// * Redistribution of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution of source code and derived works cannot be sold without specific
|
||||
// written prior permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
var includeCaption = true; // Turn on the "caption" feature, and write out the caption HTML
|
||||
var zoomTime = 5; // Milliseconds between frames of zoom animation
|
||||
var zoomSteps = 15; // Number of zoom animation frames
|
||||
var includeFade = 1; // Set to 1 to fade the image in / out as it zooms
|
||||
var minBorder = 90; // Amount of padding between large, scaled down images, and the window edges
|
||||
var shadowSettings = '0px 5px 25px rgba(0, 0, 0, '; // Blur, radius, color of shadow for compatible browsers
|
||||
|
||||
var zoomImagesURI = 'js/fancyzoom/images-global/zoom/'; // Location of the zoom and shadow images
|
||||
|
||||
// Init. Do not add anything below this line, unless it's something awesome.
|
||||
|
||||
var myWidth = 0, myHeight = 0, myScroll = 0; myScrollWidth = 0; myScrollHeight = 0;
|
||||
var zoomOpen = false, preloadFrame = 1, preloadActive = false, preloadTime = 0, imgPreload = new Image();
|
||||
var preloadAnimTimer = 0;
|
||||
|
||||
var zoomActive = new Array(); var zoomTimer = new Array();
|
||||
var zoomOrigW = new Array(); var zoomOrigH = new Array();
|
||||
var zoomOrigX = new Array(); var zoomOrigY = new Array();
|
||||
|
||||
var zoomID = "ZoomBox";
|
||||
var theID = "ZoomImage";
|
||||
var zoomCaption = "ZoomCaption";
|
||||
var zoomCaptionDiv = "ZoomCapDiv";
|
||||
|
||||
if (navigator.userAgent.indexOf("MSIE") != -1) {
|
||||
var browserIsIE = true;
|
||||
}
|
||||
|
||||
// Zoom: Setup The Page! Called in your <body>'s onLoad handler.
|
||||
|
||||
function setupZoom() {
|
||||
prepZooms();
|
||||
insertZoomHTML();
|
||||
zoomdiv = document.getElementById(zoomID);
|
||||
zoomimg = document.getElementById(theID);
|
||||
}
|
||||
|
||||
// Zoom: Inject Javascript functions into hrefs pointing to images, one by one!
|
||||
// Skip any href that contains a rel="nozoom" tag.
|
||||
// This is done at page load time via an onLoad() handler.
|
||||
|
||||
function prepZooms() {
|
||||
if (! document.getElementsByTagName) {
|
||||
return;
|
||||
}
|
||||
var links = document.getElementsByTagName("a");
|
||||
for (i = 0; i < links.length; i++) {
|
||||
if (links[i].getAttribute("href")) {
|
||||
if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi) != -1 || links[i].getAttribute("rel") == "zoom") {
|
||||
if (links[i].getAttribute("rel") != "nozoom") {
|
||||
links[i].onclick = function (event) { return zoomClick(this, event); };
|
||||
links[i].onmouseover = function () { zoomPreload(this); };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Zoom: Load an image into an image object. When done loading, function sets preloadActive to false,
|
||||
// so other bits know that they can proceed with the zoom.
|
||||
// Preloaded image is stored in imgPreload and swapped out in the zoom function.
|
||||
|
||||
function zoomPreload(from) {
|
||||
|
||||
var theimage = from.getAttribute("href");
|
||||
|
||||
// Only preload if we have to, i.e. the image isn't this image already
|
||||
|
||||
if (imgPreload.src.indexOf(from.getAttribute("href").substr(from.getAttribute("href").lastIndexOf("/"))) == -1) {
|
||||
preloadActive = true;
|
||||
imgPreload = new Image();
|
||||
|
||||
// Set a function to fire when the preload is complete, setting flags along the way.
|
||||
|
||||
imgPreload.onload = function() {
|
||||
preloadActive = false;
|
||||
}
|
||||
|
||||
// Load it!
|
||||
imgPreload.src = theimage;
|
||||
}
|
||||
}
|
||||
|
||||
// Zoom: Start the preloading animation cycle.
|
||||
|
||||
function preloadAnimStart() {
|
||||
preloadTime = new Date();
|
||||
document.getElementById("ZoomSpin").style.left = (myWidth / 2) + 'px';
|
||||
document.getElementById("ZoomSpin").style.top = ((myHeight / 2) + myScroll) + 'px';
|
||||
document.getElementById("ZoomSpin").style.visibility = "visible";
|
||||
preloadFrame = 1;
|
||||
document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';
|
||||
preloadAnimTimer = setInterval("preloadAnim()", 100);
|
||||
}
|
||||
|
||||
// Zoom: Display and ANIMATE the jibber-jabber widget. Once preloadActive is false, bail and zoom it up!
|
||||
|
||||
function preloadAnim(from) {
|
||||
if (preloadActive != false) {
|
||||
document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';
|
||||
preloadFrame++;
|
||||
if (preloadFrame > 12) preloadFrame = 1;
|
||||
} else {
|
||||
document.getElementById("ZoomSpin").style.visibility = "hidden";
|
||||
clearInterval(preloadAnimTimer);
|
||||
preloadAnimTimer = 0;
|
||||
zoomIn(preloadFrom);
|
||||
}
|
||||
}
|
||||
|
||||
// ZOOM CLICK: We got a click! Should we do the zoom? Or wait for the preload to complete?
|
||||
// todo?: Double check that imgPreload src = clicked src
|
||||
|
||||
function zoomClick(from, evt) {
|
||||
|
||||
var shift = getShift(evt);
|
||||
|
||||
// Check for Command / Alt key. If pressed, pass them through -- don't zoom!
|
||||
if (! evt && window.event && (window.event.metaKey || window.event.altKey)) {
|
||||
return true;
|
||||
} else if (evt && (evt.metaKey|| evt.altKey)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get browser dimensions
|
||||
getSize();
|
||||
|
||||
// If preloading still, wait, and display the spinner.
|
||||
if (preloadActive == true) {
|
||||
// But only display the spinner if it's not already being displayed!
|
||||
if (preloadAnimTimer == 0) {
|
||||
preloadFrom = from;
|
||||
preloadAnimStart();
|
||||
}
|
||||
} else {
|
||||
// Otherwise, we're loaded: do the zoom!
|
||||
zoomIn(from, shift);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
// Zoom: Move an element in to endH endW, using zoomHost as a starting point.
|
||||
// "from" is an object reference to the href that spawned the zoom.
|
||||
|
||||
function zoomIn(from, shift) {
|
||||
|
||||
zoomimg.src = from.getAttribute("href");
|
||||
|
||||
// Determine the zoom settings from where we came from, the element in the <a>.
|
||||
// If there's no element in the <a>, or we can't get the width, make stuff up
|
||||
|
||||
if (from.childNodes[0].width) {
|
||||
startW = from.childNodes[0].width;
|
||||
startH = from.childNodes[0].height;
|
||||
startPos = findElementPos(from.childNodes[0]);
|
||||
} else {
|
||||
startW = 50;
|
||||
startH = 12;
|
||||
startPos = findElementPos(from);
|
||||
}
|
||||
|
||||
hostX = startPos[0];
|
||||
hostY = startPos[1];
|
||||
|
||||
// Make up for a scrolled containing div.
|
||||
// TODO: This HAS to move into findElementPos.
|
||||
|
||||
if (document.getElementById('scroller')) {
|
||||
hostX = hostX - document.getElementById('scroller').scrollLeft;
|
||||
}
|
||||
|
||||
// Determine the target zoom settings from the preloaded image object
|
||||
|
||||
endW = imgPreload.width;
|
||||
endH = imgPreload.height;
|
||||
|
||||
// Start! But only if we're not zooming already!
|
||||
|
||||
if (zoomActive[theID] != true) {
|
||||
|
||||
// Clear everything out just in case something is already open
|
||||
|
||||
if (document.getElementById("ShadowBox")) {
|
||||
document.getElementById("ShadowBox").style.visibility = "hidden";
|
||||
} else if (! browserIsIE) {
|
||||
|
||||
// Wipe timer if shadow is fading in still
|
||||
if (fadeActive["ZoomImage"]) {
|
||||
clearInterval(fadeTimer["ZoomImage"]);
|
||||
fadeActive["ZoomImage"] = false;
|
||||
fadeTimer["ZoomImage"] = false;
|
||||
}
|
||||
|
||||
document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';
|
||||
}
|
||||
|
||||
document.getElementById("ZoomClose").style.visibility = "hidden";
|
||||
|
||||
// Setup the CAPTION, if existing. Hide it first, set the text.
|
||||
|
||||
if (includeCaption) {
|
||||
document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
|
||||
if (from.getAttribute('title') && includeCaption) {
|
||||
// Yes, there's a caption, set it up
|
||||
document.getElementById(zoomCaption).innerHTML = from.getAttribute('title');
|
||||
} else {
|
||||
document.getElementById(zoomCaption).innerHTML = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Store original position in an array for future zoomOut.
|
||||
|
||||
zoomOrigW[theID] = startW;
|
||||
zoomOrigH[theID] = startH;
|
||||
zoomOrigX[theID] = hostX;
|
||||
zoomOrigY[theID] = hostY;
|
||||
|
||||
// Now set the starting dimensions
|
||||
|
||||
zoomimg.style.width = startW + 'px';
|
||||
zoomimg.style.height = startH + 'px';
|
||||
zoomdiv.style.left = hostX + 'px';
|
||||
zoomdiv.style.top = hostY + 'px';
|
||||
|
||||
// Show the zooming image container, make it invisible
|
||||
|
||||
if (includeFade == 1) {
|
||||
setOpacity(0, zoomID);
|
||||
}
|
||||
zoomdiv.style.visibility = "visible";
|
||||
|
||||
// If it's too big to fit in the window, shrink the width and height to fit (with ratio).
|
||||
|
||||
sizeRatio = endW / endH;
|
||||
if (endW > myWidth - minBorder) {
|
||||
endW = myWidth - minBorder;
|
||||
endH = endW / sizeRatio;
|
||||
}
|
||||
if (endH > myHeight - minBorder) {
|
||||
endH = myHeight - minBorder;
|
||||
endW = endH * sizeRatio;
|
||||
}
|
||||
|
||||
zoomChangeX = ((myWidth / 2) - (endW / 2) - hostX);
|
||||
zoomChangeY = (((myHeight / 2) - (endH / 2) - hostY) + myScroll);
|
||||
zoomChangeW = (endW - startW);
|
||||
zoomChangeH = (endH - startH);
|
||||
|
||||
// Shift key?
|
||||
|
||||
if (shift) {
|
||||
tempSteps = zoomSteps * 7;
|
||||
} else {
|
||||
tempSteps = zoomSteps;
|
||||
}
|
||||
|
||||
// Setup Zoom
|
||||
|
||||
zoomCurrent = 0;
|
||||
|
||||
// Setup Fade with Zoom, If Requested
|
||||
|
||||
if (includeFade == 1) {
|
||||
fadeCurrent = 0;
|
||||
fadeAmount = (0 - 100) / tempSteps;
|
||||
} else {
|
||||
fadeAmount = 0;
|
||||
}
|
||||
|
||||
// Do It!
|
||||
|
||||
zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')", zoomTime);
|
||||
zoomActive[theID] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Zoom it back out.
|
||||
|
||||
function zoomOut(from, evt) {
|
||||
|
||||
// Get shift key status.
|
||||
// IE events don't seem to get passed through the function, so grab it from the window.
|
||||
|
||||
if (getShift(evt)) {
|
||||
tempSteps = zoomSteps * 7;
|
||||
} else {
|
||||
tempSteps = zoomSteps;
|
||||
}
|
||||
|
||||
// Check to see if something is happening/open
|
||||
|
||||
if (zoomActive[theID] != true) {
|
||||
|
||||
// First, get rid of the shadow if necessary.
|
||||
|
||||
if (document.getElementById("ShadowBox")) {
|
||||
document.getElementById("ShadowBox").style.visibility = "hidden";
|
||||
} else if (! browserIsIE) {
|
||||
|
||||
// Wipe timer if shadow is fading in still
|
||||
if (fadeActive["ZoomImage"]) {
|
||||
clearInterval(fadeTimer["ZoomImage"]);
|
||||
fadeActive["ZoomImage"] = false;
|
||||
fadeTimer["ZoomImage"] = false;
|
||||
}
|
||||
|
||||
document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';
|
||||
}
|
||||
|
||||
// ..and the close box...
|
||||
|
||||
document.getElementById("ZoomClose").style.visibility = "hidden";
|
||||
|
||||
// ...and the caption if necessary!
|
||||
|
||||
if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
|
||||
// fadeElementSetup(zoomCaptionDiv, 100, 0, 5, 1);
|
||||
document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
|
||||
}
|
||||
|
||||
// Now, figure out where we came from, to get back there
|
||||
|
||||
startX = parseInt(zoomdiv.style.left);
|
||||
startY = parseInt(zoomdiv.style.top);
|
||||
startW = zoomimg.width;
|
||||
startH = zoomimg.height;
|
||||
zoomChangeX = zoomOrigX[theID] - startX;
|
||||
zoomChangeY = zoomOrigY[theID] - startY;
|
||||
zoomChangeW = zoomOrigW[theID] - startW;
|
||||
zoomChangeH = zoomOrigH[theID] - startH;
|
||||
|
||||
// Setup Zoom
|
||||
|
||||
zoomCurrent = 0;
|
||||
|
||||
// Setup Fade with Zoom, If Requested
|
||||
|
||||
if (includeFade == 1) {
|
||||
fadeCurrent = 0;
|
||||
fadeAmount = (100 - 0) / tempSteps;
|
||||
} else {
|
||||
fadeAmount = 0;
|
||||
}
|
||||
|
||||
// Do It!
|
||||
|
||||
zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+startX+", "+zoomChangeX+", "+startY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDone(zoomID, theID)')", zoomTime);
|
||||
zoomActive[theID] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Finished Zooming In
|
||||
|
||||
function zoomDoneIn(zoomdiv, theID) {
|
||||
|
||||
// Note that it's open
|
||||
|
||||
zoomOpen = true;
|
||||
zoomdiv = document.getElementById(zoomdiv);
|
||||
|
||||
// Position the table shadow behind the zoomed in image, and display it
|
||||
|
||||
if (document.getElementById("ShadowBox")) {
|
||||
|
||||
setOpacity(0, "ShadowBox");
|
||||
shadowdiv = document.getElementById("ShadowBox");
|
||||
|
||||
shadowLeft = parseInt(zoomdiv.style.left) - 13;
|
||||
shadowTop = parseInt(zoomdiv.style.top) - 8;
|
||||
shadowWidth = zoomdiv.offsetWidth + 26;
|
||||
shadowHeight = zoomdiv.offsetHeight + 26;
|
||||
|
||||
shadowdiv.style.width = shadowWidth + 'px';
|
||||
shadowdiv.style.height = shadowHeight + 'px';
|
||||
shadowdiv.style.left = shadowLeft + 'px';
|
||||
shadowdiv.style.top = shadowTop + 'px';
|
||||
|
||||
document.getElementById("ShadowBox").style.visibility = "visible";
|
||||
fadeElementSetup("ShadowBox", 0, 100, 5);
|
||||
|
||||
} else if (! browserIsIE) {
|
||||
// Or, do a fade of the modern shadow
|
||||
fadeElementSetup("ZoomImage", 0, .8, 5, 0, "shadow");
|
||||
}
|
||||
|
||||
// Position and display the CAPTION, if existing
|
||||
|
||||
if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
|
||||
// setOpacity(0, zoomCaptionDiv);
|
||||
zoomcapd = document.getElementById(zoomCaptionDiv);
|
||||
zoomcapd.style.top = parseInt(zoomdiv.style.top) + (zoomdiv.offsetHeight + 15) + 'px';
|
||||
zoomcapd.style.left = (myWidth / 2) - (zoomcapd.offsetWidth / 2) + 'px';
|
||||
zoomcapd.style.visibility = "visible";
|
||||
// fadeElementSetup(zoomCaptionDiv, 0, 100, 5);
|
||||
}
|
||||
|
||||
// Display Close Box (fade it if it's not IE)
|
||||
|
||||
if (!browserIsIE) setOpacity(0, "ZoomClose");
|
||||
document.getElementById("ZoomClose").style.visibility = "visible";
|
||||
if (!browserIsIE) fadeElementSetup("ZoomClose", 0, 100, 5);
|
||||
|
||||
// Get keypresses
|
||||
document.onkeypress = getKey;
|
||||
|
||||
}
|
||||
|
||||
// Finished Zooming Out
|
||||
|
||||
function zoomDone(zoomdiv, theID) {
|
||||
|
||||
// No longer open
|
||||
|
||||
zoomOpen = false;
|
||||
|
||||
// Clear stuff out, clean up
|
||||
|
||||
zoomOrigH[theID] = "";
|
||||
zoomOrigW[theID] = "";
|
||||
document.getElementById(zoomdiv).style.visibility = "hidden";
|
||||
zoomActive[theID] == false;
|
||||
|
||||
// Stop getting keypresses
|
||||
|
||||
document.onkeypress = null;
|
||||
|
||||
}
|
||||
|
||||
// Actually zoom the element
|
||||
|
||||
function zoomElement(zoomdiv, theID, zoomCurrent, zoomStartW, zoomChangeW, zoomStartH, zoomChangeH, zoomStartX, zoomChangeX, zoomStartY, zoomChangeY, zoomSteps, includeFade, fadeAmount, execWhenDone) {
|
||||
|
||||
// console.log("Zooming Step #"+zoomCurrent+ " of "+zoomSteps+" (zoom " + zoomStartW + "/" + zoomChangeW + ") (zoom " + zoomStartH + "/" + zoomChangeH + ") (zoom " + zoomStartX + "/" + zoomChangeX + ") (zoom " + zoomStartY + "/" + zoomChangeY + ") Fade: "+fadeAmount);
|
||||
|
||||
// Test if we're done, or if we continue
|
||||
|
||||
if (zoomCurrent == (zoomSteps + 1)) {
|
||||
zoomActive[theID] = false;
|
||||
clearInterval(zoomTimer[theID]);
|
||||
|
||||
if (execWhenDone != "") {
|
||||
eval(execWhenDone);
|
||||
}
|
||||
} else {
|
||||
|
||||
// Do the Fade!
|
||||
|
||||
if (includeFade == 1) {
|
||||
if (fadeAmount < 0) {
|
||||
setOpacity(Math.abs(zoomCurrent * fadeAmount), zoomdiv);
|
||||
} else {
|
||||
setOpacity(100 - (zoomCurrent * fadeAmount), zoomdiv);
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate this step's difference, and move it!
|
||||
|
||||
moveW = cubicInOut(zoomCurrent, zoomStartW, zoomChangeW, zoomSteps);
|
||||
moveH = cubicInOut(zoomCurrent, zoomStartH, zoomChangeH, zoomSteps);
|
||||
moveX = cubicInOut(zoomCurrent, zoomStartX, zoomChangeX, zoomSteps);
|
||||
moveY = cubicInOut(zoomCurrent, zoomStartY, zoomChangeY, zoomSteps);
|
||||
|
||||
document.getElementById(zoomdiv).style.left = moveX + 'px';
|
||||
document.getElementById(zoomdiv).style.top = moveY + 'px';
|
||||
zoomimg.style.width = moveW + 'px';
|
||||
zoomimg.style.height = moveH + 'px';
|
||||
|
||||
zoomCurrent++;
|
||||
|
||||
clearInterval(zoomTimer[theID]);
|
||||
zoomTimer[theID] = setInterval("zoomElement('"+zoomdiv+"', '"+theID+"', "+zoomCurrent+", "+zoomStartW+", "+zoomChangeW+", "+zoomStartH+", "+zoomChangeH+", "+zoomStartX+", "+zoomChangeX+", "+zoomStartY+", "+zoomChangeY+", "+zoomSteps+", "+includeFade+", "+fadeAmount+", '"+execWhenDone+"')", zoomTime);
|
||||
}
|
||||
}
|
||||
|
||||
// Zoom Utility: Get Key Press when image is open, and act accordingly
|
||||
|
||||
function getKey(evt) {
|
||||
if (! evt) {
|
||||
theKey = event.keyCode;
|
||||
} else {
|
||||
theKey = evt.keyCode;
|
||||
}
|
||||
|
||||
if (theKey == 27) { // ESC
|
||||
zoomOut(this, evt);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//
|
||||
// FADE Functions
|
||||
//
|
||||
|
||||
function fadeOut(elem) {
|
||||
if (elem.id) {
|
||||
fadeElementSetup(elem.id, 100, 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
function fadeIn(elem) {
|
||||
if (elem.id) {
|
||||
fadeElementSetup(elem.id, 0, 100, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// Fade: Initialize the fade function
|
||||
|
||||
var fadeActive = new Array();
|
||||
var fadeQueue = new Array();
|
||||
var fadeTimer = new Array();
|
||||
var fadeClose = new Array();
|
||||
var fadeMode = new Array();
|
||||
|
||||
function fadeElementSetup(theID, fdStart, fdEnd, fdSteps, fdClose, fdMode) {
|
||||
|
||||
// alert("Fading: "+theID+" Steps: "+fdSteps+" Mode: "+fdMode);
|
||||
|
||||
if (fadeActive[theID] == true) {
|
||||
// Already animating, queue up this command
|
||||
fadeQueue[theID] = new Array(theID, fdStart, fdEnd, fdSteps);
|
||||
} else {
|
||||
fadeSteps = fdSteps;
|
||||
fadeCurrent = 0;
|
||||
fadeAmount = (fdStart - fdEnd) / fadeSteps;
|
||||
fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
|
||||
fadeActive[theID] = true;
|
||||
fadeMode[theID] = fdMode;
|
||||
|
||||
if (fdClose == 1) {
|
||||
fadeClose[theID] = true;
|
||||
} else {
|
||||
fadeClose[theID] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fade: Do the fade. This function will call itself, modifying the parameters, so
|
||||
// many instances can run concurrently. Can fade using opacity, or fade using a box-shadow.
|
||||
|
||||
function fadeElement(theID, fadeCurrent, fadeAmount, fadeSteps) {
|
||||
|
||||
if (fadeCurrent == fadeSteps) {
|
||||
|
||||
// We're done, so clear.
|
||||
|
||||
clearInterval(fadeTimer[theID]);
|
||||
fadeActive[theID] = false;
|
||||
fadeTimer[theID] = false;
|
||||
|
||||
// Should we close it once the fade is complete?
|
||||
|
||||
if (fadeClose[theID] == true) {
|
||||
document.getElementById(theID).style.visibility = "hidden";
|
||||
}
|
||||
|
||||
// Hang on.. did a command queue while we were working? If so, make it happen now
|
||||
|
||||
if (fadeQueue[theID] && fadeQueue[theID] != false) {
|
||||
fadeElementSetup(fadeQueue[theID][0], fadeQueue[theID][1], fadeQueue[theID][2], fadeQueue[theID][3]);
|
||||
fadeQueue[theID] = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
fadeCurrent++;
|
||||
|
||||
// Now actually do the fade adjustment.
|
||||
|
||||
if (fadeMode[theID] == "shadow") {
|
||||
|
||||
// Do a special fade on the webkit-box-shadow of the object
|
||||
|
||||
if (fadeAmount < 0) {
|
||||
document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (Math.abs(fadeCurrent * fadeAmount)) + ')';
|
||||
} else {
|
||||
document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (100 - (fadeCurrent * fadeAmount)) + ')';
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Set the opacity depending on if we're adding or subtracting (pos or neg)
|
||||
|
||||
if (fadeAmount < 0) {
|
||||
setOpacity(Math.abs(fadeCurrent * fadeAmount), theID);
|
||||
} else {
|
||||
setOpacity(100 - (fadeCurrent * fadeAmount), theID);
|
||||
}
|
||||
}
|
||||
|
||||
// Keep going, and send myself the updated variables
|
||||
clearInterval(fadeTimer[theID]);
|
||||
fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//
|
||||
// UTILITY functions
|
||||
//
|
||||
|
||||
// Utility: Set the opacity, compatible with a number of browsers. Value from 0 to 100.
|
||||
|
||||
function setOpacity(opacity, theID) {
|
||||
|
||||
var object = document.getElementById(theID).style;
|
||||
|
||||
// If it's 100, set it to 99 for Firefox.
|
||||
|
||||
if (navigator.userAgent.indexOf("Firefox") != -1) {
|
||||
if (opacity == 100) { opacity = 99.9999; } // This is majorly awkward
|
||||
}
|
||||
|
||||
// Multi-browser opacity setting
|
||||
|
||||
object.filter = "alpha(opacity=" + opacity + ")"; // IE/Win
|
||||
object.opacity = (opacity / 100); // Safari 1.2, Firefox+Mozilla
|
||||
|
||||
}
|
||||
|
||||
// Utility: Math functions for animation calucations - From http://www.robertpenner.com/easing/
|
||||
//
|
||||
// t = time, b = begin, c = change, d = duration
|
||||
// time = current frame, begin is fixed, change is basically finish - begin, duration is fixed (frames),
|
||||
|
||||
function linear(t, b, c, d)
|
||||
{
|
||||
return c*t/d + b;
|
||||
}
|
||||
|
||||
function sineInOut(t, b, c, d)
|
||||
{
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
}
|
||||
|
||||
function cubicIn(t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
}
|
||||
|
||||
function cubicOut(t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
}
|
||||
|
||||
function cubicInOut(t, b, c, d)
|
||||
{
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
}
|
||||
|
||||
function bounceOut(t, b, c, d)
|
||||
{
|
||||
if ((t/=d) < (1/2.75)){
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)){
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)){
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Utility: Get the size of the window, and set myWidth and myHeight
|
||||
// Credit to quirksmode.org
|
||||
|
||||
function getSize() {
|
||||
|
||||
// Window Size
|
||||
|
||||
if (self.innerHeight) { // Everyone but IE
|
||||
myWidth = window.innerWidth;
|
||||
myHeight = window.innerHeight;
|
||||
myScroll = window.pageYOffset;
|
||||
} else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
|
||||
myWidth = document.documentElement.clientWidth;
|
||||
myHeight = document.documentElement.clientHeight;
|
||||
myScroll = document.documentElement.scrollTop;
|
||||
} else if (document.body) { // Other IE, such as IE7
|
||||
myWidth = document.body.clientWidth;
|
||||
myHeight = document.body.clientHeight;
|
||||
myScroll = document.body.scrollTop;
|
||||
}
|
||||
|
||||
// Page size w/offscreen areas
|
||||
|
||||
if (window.innerHeight && window.scrollMaxY) {
|
||||
myScrollWidth = document.body.scrollWidth;
|
||||
myScrollHeight = window.innerHeight + window.scrollMaxY;
|
||||
} else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
|
||||
myScrollWidth = document.body.scrollWidth;
|
||||
myScrollHeight = document.body.scrollHeight;
|
||||
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
|
||||
myScrollWidth = document.body.offsetWidth;
|
||||
myScrollHeight = document.body.offsetHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Utility: Get Shift Key Status
|
||||
// IE events don't seem to get passed through the function, so grab it from the window.
|
||||
|
||||
function getShift(evt) {
|
||||
var shift = false;
|
||||
if (! evt && window.event) {
|
||||
shift = window.event.shiftKey;
|
||||
} else if (evt) {
|
||||
shift = evt.shiftKey;
|
||||
if (shift) evt.stopPropagation(); // Prevents Firefox from doing shifty things
|
||||
}
|
||||
return shift;
|
||||
}
|
||||
|
||||
// Utility: Find the Y position of an element on a page. Return Y and X as an array
|
||||
|
||||
function findElementPos(elemFind)
|
||||
{
|
||||
var elemX = 0;
|
||||
var elemY = 0;
|
||||
do {
|
||||
elemX += elemFind.offsetLeft;
|
||||
elemY += elemFind.offsetTop;
|
||||
} while ( elemFind = elemFind.offsetParent )
|
||||
|
||||
return Array(elemX, elemY);
|
||||
}
|
||||
318
WebContent/js/fancyzoom/js-global/FancyZoomHTML.js
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
// FancyZoomHTML.js - v1.0
|
||||
// Used to draw necessary HTML elements for FancyZoom
|
||||
//
|
||||
// Copyright (c) 2008 Cabel Sasser / Panic Inc
|
||||
// All rights reserved.
|
||||
|
||||
function insertZoomHTML() {
|
||||
|
||||
// All of this junk creates the three <div>'s used to hold the closebox, image, and zoom shadow.
|
||||
|
||||
var inBody = document.getElementsByTagName("body").item(0);
|
||||
|
||||
// WAIT SPINNER
|
||||
|
||||
var inSpinbox = document.createElement("div");
|
||||
inSpinbox.setAttribute('id', 'ZoomSpin');
|
||||
inSpinbox.style.position = 'absolute';
|
||||
inSpinbox.style.left = '10px';
|
||||
inSpinbox.style.top = '10px';
|
||||
inSpinbox.style.visibility = 'hidden';
|
||||
inSpinbox.style.zIndex = '525';
|
||||
inBody.insertBefore(inSpinbox, inBody.firstChild);
|
||||
|
||||
var inSpinImage = document.createElement("img");
|
||||
inSpinImage.setAttribute('id', 'SpinImage');
|
||||
inSpinImage.setAttribute('src', zoomImagesURI+'zoom-spin-1.png');
|
||||
inSpinbox.appendChild(inSpinImage);
|
||||
|
||||
// ZOOM IMAGE
|
||||
//
|
||||
// <div id="ZoomBox">
|
||||
// <a href="javascript:zoomOut();"><img src="/images/spacer.gif" id="ZoomImage" border="0"></a> <!-- THE IMAGE -->
|
||||
// <div id="ZoomClose">
|
||||
// <a href="javascript:zoomOut();"><img src="/images/closebox.png" width="30" height="30" border="0"></a>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
var inZoombox = document.createElement("div");
|
||||
inZoombox.setAttribute('id', 'ZoomBox');
|
||||
|
||||
inZoombox.style.position = 'absolute';
|
||||
inZoombox.style.left = '10px';
|
||||
inZoombox.style.top = '10px';
|
||||
inZoombox.style.visibility = 'hidden';
|
||||
inZoombox.style.zIndex = '499';
|
||||
|
||||
inBody.insertBefore(inZoombox, inSpinbox.nextSibling);
|
||||
|
||||
var inImage1 = document.createElement("img");
|
||||
inImage1.onclick = function (event) { zoomOut(this, event); return false; };
|
||||
inImage1.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inImage1.setAttribute('id','ZoomImage');
|
||||
inImage1.setAttribute('border', '0');
|
||||
// inImage1.setAttribute('onMouseOver', 'zoomMouseOver();')
|
||||
// inImage1.setAttribute('onMouseOut', 'zoomMouseOut();')
|
||||
|
||||
// This must be set first, so we can later test it using webkitBoxShadow.
|
||||
inImage1.setAttribute('style', '-webkit-box-shadow: '+shadowSettings+'0.0)');
|
||||
inImage1.style.display = 'block';
|
||||
inImage1.style.width = '10px';
|
||||
inImage1.style.height = '10px';
|
||||
inImage1.style.cursor = 'pointer'; // -webkit-zoom-out?
|
||||
inZoombox.appendChild(inImage1);
|
||||
|
||||
var inClosebox = document.createElement("div");
|
||||
inClosebox.setAttribute('id', 'ZoomClose');
|
||||
inClosebox.style.position = 'absolute';
|
||||
|
||||
// In MSIE, we need to put the close box inside the image.
|
||||
// It's 2008 and I'm having to do a browser detect? Sigh.
|
||||
if (browserIsIE) {
|
||||
inClosebox.style.left = '-1px';
|
||||
inClosebox.style.top = '0px';
|
||||
} else {
|
||||
inClosebox.style.left = '-15px';
|
||||
inClosebox.style.top = '-15px';
|
||||
}
|
||||
|
||||
inClosebox.style.visibility = 'hidden';
|
||||
inZoombox.appendChild(inClosebox);
|
||||
|
||||
var inImage2 = document.createElement("img");
|
||||
inImage2.onclick = function (event) { zoomOut(this, event); return false; };
|
||||
inImage2.setAttribute('src',zoomImagesURI+'closebox.png');
|
||||
inImage2.setAttribute('width','30');
|
||||
inImage2.setAttribute('height','30');
|
||||
inImage2.setAttribute('border','0');
|
||||
inImage2.style.cursor = 'pointer';
|
||||
inClosebox.appendChild(inImage2);
|
||||
|
||||
// SHADOW
|
||||
// Only draw the table-based shadow if the programatic webkitBoxShadow fails!
|
||||
// Also, don't draw it if we're IE -- it wouldn't look quite right anyway.
|
||||
|
||||
if (! document.getElementById('ZoomImage').style.webkitBoxShadow && ! browserIsIE) {
|
||||
|
||||
// SHADOW BASE
|
||||
|
||||
var inFixedBox = document.createElement("div");
|
||||
inFixedBox.setAttribute('id', 'ShadowBox');
|
||||
inFixedBox.style.position = 'absolute';
|
||||
inFixedBox.style.left = '50px';
|
||||
inFixedBox.style.top = '50px';
|
||||
inFixedBox.style.width = '100px';
|
||||
inFixedBox.style.height = '100px';
|
||||
inFixedBox.style.visibility = 'hidden';
|
||||
inFixedBox.style.zIndex = '498';
|
||||
inBody.insertBefore(inFixedBox, inZoombox.nextSibling);
|
||||
|
||||
// SHADOW
|
||||
// Now, the shadow table. Skip if not compatible, or irrevelant with -box-shadow.
|
||||
|
||||
// <div id="ShadowBox"><table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"> X
|
||||
// <tr height="25">
|
||||
// <td width="27"><img src="/images/zoom-shadow1.png" width="27" height="25"></td>
|
||||
// <td background="/images/zoom-shadow2.png"> </td>
|
||||
// <td width="27"><img src="/images/zoom-shadow3.png" width="27" height="25"></td>
|
||||
// </tr>
|
||||
|
||||
var inShadowTable = document.createElement("table");
|
||||
inShadowTable.setAttribute('border', '0');
|
||||
inShadowTable.setAttribute('width', '100%');
|
||||
inShadowTable.setAttribute('height', '100%');
|
||||
inShadowTable.setAttribute('cellpadding', '0');
|
||||
inShadowTable.setAttribute('cellspacing', '0');
|
||||
inFixedBox.appendChild(inShadowTable);
|
||||
|
||||
var inShadowTbody = document.createElement("tbody"); // Needed for IE (for HTML4).
|
||||
inShadowTable.appendChild(inShadowTbody);
|
||||
|
||||
var inRow1 = document.createElement("tr");
|
||||
inRow1.style.height = '25px';
|
||||
inShadowTbody.appendChild(inRow1);
|
||||
|
||||
var inCol1 = document.createElement("td");
|
||||
inCol1.style.width = '27px';
|
||||
inRow1.appendChild(inCol1);
|
||||
var inShadowImg1 = document.createElement("img");
|
||||
inShadowImg1.setAttribute('src', zoomImagesURI+'zoom-shadow1.png');
|
||||
inShadowImg1.setAttribute('width', '27');
|
||||
inShadowImg1.setAttribute('height', '25');
|
||||
inShadowImg1.style.display = 'block';
|
||||
inCol1.appendChild(inShadowImg1);
|
||||
|
||||
var inCol2 = document.createElement("td");
|
||||
inCol2.setAttribute('background', zoomImagesURI+'zoom-shadow2.png');
|
||||
inRow1.appendChild(inCol2);
|
||||
// inCol2.innerHTML = '<img src=';
|
||||
var inSpacer1 = document.createElement("img");
|
||||
inSpacer1.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inSpacer1.setAttribute('height', '1');
|
||||
inSpacer1.setAttribute('width', '1');
|
||||
inSpacer1.style.display = 'block';
|
||||
inCol2.appendChild(inSpacer1);
|
||||
|
||||
var inCol3 = document.createElement("td");
|
||||
inCol3.style.width = '27px';
|
||||
inRow1.appendChild(inCol3);
|
||||
var inShadowImg3 = document.createElement("img");
|
||||
inShadowImg3.setAttribute('src', zoomImagesURI+'zoom-shadow3.png');
|
||||
inShadowImg3.setAttribute('width', '27');
|
||||
inShadowImg3.setAttribute('height', '25');
|
||||
inShadowImg3.style.display = 'block';
|
||||
inCol3.appendChild(inShadowImg3);
|
||||
|
||||
// <tr>
|
||||
// <td background="/images/zoom-shadow4.png"> </td>
|
||||
// <td bgcolor="#ffffff"> </td>
|
||||
// <td background="/images/zoom-shadow5.png"> </td>
|
||||
// </tr>
|
||||
|
||||
inRow2 = document.createElement("tr");
|
||||
inShadowTbody.appendChild(inRow2);
|
||||
|
||||
var inCol4 = document.createElement("td");
|
||||
inCol4.setAttribute('background', zoomImagesURI+'zoom-shadow4.png');
|
||||
inRow2.appendChild(inCol4);
|
||||
// inCol4.innerHTML = ' ';
|
||||
var inSpacer2 = document.createElement("img");
|
||||
inSpacer2.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inSpacer2.setAttribute('height', '1');
|
||||
inSpacer2.setAttribute('width', '1');
|
||||
inSpacer2.style.display = 'block';
|
||||
inCol4.appendChild(inSpacer2);
|
||||
|
||||
var inCol5 = document.createElement("td");
|
||||
inCol5.setAttribute('bgcolor', '#ffffff');
|
||||
inRow2.appendChild(inCol5);
|
||||
// inCol5.innerHTML = ' ';
|
||||
var inSpacer3 = document.createElement("img");
|
||||
inSpacer3.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inSpacer3.setAttribute('height', '1');
|
||||
inSpacer3.setAttribute('width', '1');
|
||||
inSpacer3.style.display = 'block';
|
||||
inCol5.appendChild(inSpacer3);
|
||||
|
||||
var inCol6 = document.createElement("td");
|
||||
inCol6.setAttribute('background', zoomImagesURI+'zoom-shadow5.png');
|
||||
inRow2.appendChild(inCol6);
|
||||
// inCol6.innerHTML = ' ';
|
||||
var inSpacer4 = document.createElement("img");
|
||||
inSpacer4.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inSpacer4.setAttribute('height', '1');
|
||||
inSpacer4.setAttribute('width', '1');
|
||||
inSpacer4.style.display = 'block';
|
||||
inCol6.appendChild(inSpacer4);
|
||||
|
||||
// <tr height="26">
|
||||
// <td width="27"><img src="/images/zoom-shadow6.png" width="27" height="26"</td>
|
||||
// <td background="/images/zoom-shadow7.png"> </td>
|
||||
// <td width="27"><img src="/images/zoom-shadow8.png" width="27" height="26"></td>
|
||||
// </tr>
|
||||
// </table>
|
||||
|
||||
var inRow3 = document.createElement("tr");
|
||||
inRow3.style.height = '26px';
|
||||
inShadowTbody.appendChild(inRow3);
|
||||
|
||||
var inCol7 = document.createElement("td");
|
||||
inCol7.style.width = '27px';
|
||||
inRow3.appendChild(inCol7);
|
||||
var inShadowImg7 = document.createElement("img");
|
||||
inShadowImg7.setAttribute('src', zoomImagesURI+'zoom-shadow6.png');
|
||||
inShadowImg7.setAttribute('width', '27');
|
||||
inShadowImg7.setAttribute('height', '26');
|
||||
inShadowImg7.style.display = 'block';
|
||||
inCol7.appendChild(inShadowImg7);
|
||||
|
||||
var inCol8 = document.createElement("td");
|
||||
inCol8.setAttribute('background', zoomImagesURI+'zoom-shadow7.png');
|
||||
inRow3.appendChild(inCol8);
|
||||
// inCol8.innerHTML = ' ';
|
||||
var inSpacer5 = document.createElement("img");
|
||||
inSpacer5.setAttribute('src',zoomImagesURI+'spacer.gif');
|
||||
inSpacer5.setAttribute('height', '1');
|
||||
inSpacer5.setAttribute('width', '1');
|
||||
inSpacer5.style.display = 'block';
|
||||
inCol8.appendChild(inSpacer5);
|
||||
|
||||
var inCol9 = document.createElement("td");
|
||||
inCol9.style.width = '27px';
|
||||
inRow3.appendChild(inCol9);
|
||||
var inShadowImg9 = document.createElement("img");
|
||||
inShadowImg9.setAttribute('src', zoomImagesURI+'zoom-shadow8.png');
|
||||
inShadowImg9.setAttribute('width', '27');
|
||||
inShadowImg9.setAttribute('height', '26');
|
||||
inShadowImg9.style.display = 'block';
|
||||
inCol9.appendChild(inShadowImg9);
|
||||
}
|
||||
|
||||
if (includeCaption) {
|
||||
|
||||
// CAPTION
|
||||
//
|
||||
// <div id="ZoomCapDiv" style="margin-left: 13px; margin-right: 13px;">
|
||||
// <table border="1" cellpadding="0" cellspacing="0">
|
||||
// <tr height="26">
|
||||
// <td><img src="zoom-caption-l.png" width="13" height="26"></td>
|
||||
// <td rowspan="3" background="zoom-caption-fill.png"><div id="ZoomCaption"></div></td>
|
||||
// <td><img src="zoom-caption-r.png" width="13" height="26"></td>
|
||||
// </tr>
|
||||
// </table>
|
||||
// </div>
|
||||
|
||||
var inCapDiv = document.createElement("div");
|
||||
inCapDiv.setAttribute('id', 'ZoomCapDiv');
|
||||
inCapDiv.style.position = 'absolute';
|
||||
inCapDiv.style.visibility = 'hidden';
|
||||
inCapDiv.style.marginLeft = 'auto';
|
||||
inCapDiv.style.marginRight = 'auto';
|
||||
inCapDiv.style.zIndex = '501';
|
||||
|
||||
inBody.insertBefore(inCapDiv, inZoombox.nextSibling);
|
||||
|
||||
var inCapTable = document.createElement("table");
|
||||
inCapTable.setAttribute('border', '0');
|
||||
inCapTable.setAttribute('cellPadding', '0'); // Wow. These honestly need to
|
||||
inCapTable.setAttribute('cellSpacing', '0'); // be intercapped to work in IE. WTF?
|
||||
inCapDiv.appendChild(inCapTable);
|
||||
|
||||
var inTbody = document.createElement("tbody"); // Needed for IE (for HTML4).
|
||||
inCapTable.appendChild(inTbody);
|
||||
|
||||
var inCapRow1 = document.createElement("tr");
|
||||
inTbody.appendChild(inCapRow1);
|
||||
|
||||
var inCapCol1 = document.createElement("td");
|
||||
inCapCol1.setAttribute('align', 'right');
|
||||
inCapRow1.appendChild(inCapCol1);
|
||||
var inCapImg1 = document.createElement("img");
|
||||
inCapImg1.setAttribute('src', zoomImagesURI+'zoom-caption-l.png');
|
||||
inCapImg1.setAttribute('width', '13');
|
||||
inCapImg1.setAttribute('height', '26');
|
||||
inCapImg1.style.display = 'block';
|
||||
inCapCol1.appendChild(inCapImg1);
|
||||
|
||||
var inCapCol2 = document.createElement("td");
|
||||
inCapCol2.setAttribute('background', zoomImagesURI+'zoom-caption-fill.png');
|
||||
inCapCol2.setAttribute('id', 'ZoomCaption');
|
||||
inCapCol2.setAttribute('valign', 'middle');
|
||||
inCapCol2.style.fontSize = '14px';
|
||||
inCapCol2.style.fontFamily = 'Helvetica';
|
||||
inCapCol2.style.fontWeight = 'bold';
|
||||
inCapCol2.style.color = '#ffffff';
|
||||
inCapCol2.style.textShadow = '0px 2px 4px #000000';
|
||||
inCapCol2.style.whiteSpace = 'nowrap';
|
||||
inCapRow1.appendChild(inCapCol2);
|
||||
|
||||
var inCapCol3 = document.createElement("td");
|
||||
inCapRow1.appendChild(inCapCol3);
|
||||
var inCapImg2 = document.createElement("img");
|
||||
inCapImg2.setAttribute('src', zoomImagesURI+'zoom-caption-r.png');
|
||||
inCapImg2.setAttribute('width', '13');
|
||||
inCapImg2.setAttribute('height', '26');
|
||||
inCapImg2.style.display = 'block';
|
||||
inCapCol3.appendChild(inCapImg2);
|
||||
}
|
||||
}
|
||||
4096
WebContent/js/galleria/galleria-1.2.2.js
Normal file
83
WebContent/js/galleria/galleria-1.2.2.min.js
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
Galleria v 1.2.2 2010-02-23
|
||||
http://galleria.aino.se
|
||||
|
||||
Copyright (c) 2011, Aino
|
||||
Licensed under the MIT license.
|
||||
*/
|
||||
(function(e){var s=this,t=s.document,I=e(t),E=false,x=navigator.userAgent.toLowerCase(),J=s.location.hash.replace(/#\//,""),y=function(){return j.TOUCH?"touchstart":"click"},u=function(){var a=3,b=t.createElement("div"),c=b.getElementsByTagName("i");do b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]--\>";while(c[0]);return a>4?a:void 0}(),z=function(){return{html:t.documentElement,body:t.body,head:t.getElementsByTagName("head")[0],title:t.title}},K=function(){var a=[];e.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "),
|
||||
function(b,c){a.push(c);/_/.test(c)&&a.push(c.replace(/_/g,""))});return a}(),L=function(a){var b;if(typeof a!=="object")return a;e.each(a,function(c,d){if(/^[a-z]+_/.test(c)){b="";e.each(c.split("_"),function(i,k){b+=i>0?k.substr(0,1).toUpperCase()+k.substr(1):k});a[b]=d;delete a[c]}});return a},F=function(a){if(e.inArray(a,K)>-1)return j[a.toUpperCase()];return a},B={trunk:{},add:function(a,b,c,d){d=d||false;this.clear(a);if(d){var i=b;b=function(){i();B.add(a,b,c)}}this.trunk[a]=s.setTimeout(b,
|
||||
c)},clear:function(a){var b=function(d){s.clearTimeout(this.trunk[d]);delete this.trunk[d]},c;if(a&&a in this.trunk)b.call(B,a);else if(typeof a==="undefined")for(c in this.trunk)this.trunk.hasOwnProperty(c)&&b.call(B,c)}},C=[],g=function(){return{array:function(a){return Array.prototype.slice.call(a)},create:function(a,b){b=b||"div";var c=t.createElement(b);c.className=a;return c},forceStyles:function(a,b){a=e(a);a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style");a.css(b)},revertStyles:function(){e.each(g.array(arguments),
|
||||
function(a,b){b=e(b).removeAttr("style");b.data("styles")&&b.attr("style",b.data("styles")).data("styles",null)})},moveOut:function(a){g.forceStyles(a,{position:"absolute",left:-1E4})},moveIn:function(){g.revertStyles.apply(g,g.array(arguments))},hide:function(a,b,c){a=e(a);a.data("opacity")||a.data("opacity",a.css("opacity"));var d={opacity:0};b?a.stop().animate(d,b,c):a.css(d)},show:function(a,b,c){a=e(a);var d=parseFloat(a.data("opacity"))||1,i={opacity:d};d===1&&a.data("opacity",null);b?a.stop().animate(i,
|
||||
b,c):a.css(i)},addTimer:function(){B.add.apply(B,g.array(arguments));return this},clearTimer:function(){B.clear.apply(B,g.array(arguments));return this},wait:function(a){a=e.extend({until:function(){return false},success:function(){},error:function(){j.raise("Could not complete wait function.")},timeout:3E3},a);var b=g.timestamp(),c,d,i=function(){d=g.timestamp();c=d-b;if(a.until(c)){a.success();return false}if(d>=b+a.timeout){a.error();return false}s.setTimeout(i,2)};s.setTimeout(i,2)},toggleQuality:function(a,
|
||||
b){if(!(u!==7||u!==8||!a)){if(typeof b==="undefined")b=a.style.msInterpolationMode==="nearest-neighbor";a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor"}},insertStyleTag:function(a){var b=t.createElement("style");z().head.appendChild(b);if(b.styleSheet)b.styleSheet.cssText=a;else{a=t.createTextNode(a);b.appendChild(a)}},loadScript:function(a,b){var c=false,d=e("<script>").attr({src:a,async:true}).get(0);d.onload=d.onreadystatechange=function(){if(!c&&(!this.readyState||this.readyState===
|
||||
"loaded"||this.readyState==="complete")){c=true;d.onload=d.onreadystatechange=null;typeof b==="function"&&b.call(this,this)}};z().head.appendChild(d)},parseValue:function(a){if(typeof a==="number")return a;else if(typeof a==="string")return(a=a.match(/\-?\d/g))&&a.constructor===Array?parseInt(a.join(""),10):0;else return 0},timestamp:function(){return(new Date).getTime()},loadCSS:function(a,b,c){var d,i=false,k;e("link[rel=stylesheet]").each(function(){if(RegExp(a).test(this.href)){d=this;return false}});
|
||||
if(typeof b==="function"){c=b;b=void 0}c=c||function(){};if(d){c.call(d,d);return d}k=t.styleSheets.length;if(E)a+="?"+g.timestamp();if(e("#"+b).length){e("#"+b).attr("href",a);k--;i=true}else{d=e("<link>").attr({rel:"stylesheet",href:a,id:b}).get(0);s.setTimeout(function(){var l=e('link[rel="stylesheet"], style');l.length?l.get(0).parentNode.insertBefore(d,l[0]):z().head.appendChild(d);if(u)d.attachEvent("onreadystatechange",function(){if(d.readyState==="complete")i=true});else i=true},10)}typeof c===
|
||||
"function"&&g.wait({until:function(){return i&&t.styleSheets.length>k},success:function(){g.addTimer("css",function(){c.call(d,d)},100)},error:function(){j.raise("Theme CSS could not load")},timeout:1E3});return d}}}(),G={fade:function(a,b){e(a.next).css("opacity",0).show().animate({opacity:1},a.speed,b);a.prev&&e(a.prev).css("opacity",1).show().animate({opacity:0},a.speed)},flash:function(a,b){e(a.next).css("opacity",0);a.prev?e(a.prev).animate({opacity:0},a.speed/2,function(){e(a.next).animate({opacity:1},
|
||||
a.speed,b)}):e(a.next).animate({opacity:1},a.speed,b)},pulse:function(a,b){a.prev&&e(a.prev).hide();e(a.next).css("opacity",0).animate({opacity:1},a.speed,b)},slide:function(a,b){var c=e(a.next).parent(),d=this.$("images"),i=this._stageWidth,k=this.getOptions("easing");c.css({left:i*(a.rewind?-1:1)});d.animate({left:i*(a.rewind?1:-1)},{duration:a.speed,queue:false,easing:k,complete:function(){d.css("left",0);c.css("left",0);b()}})},fadeslide:function(a,b){var c=0,d=this.getOptions("easing"),i=this.getStageWidth();
|
||||
if(a.prev){c=g.parseValue(e(a.prev).css("left"));e(a.prev).css({opacity:1,left:c}).animate({opacity:0,left:c+i*(a.rewind?1:-1)},{duration:a.speed,queue:false,easing:d})}c=g.parseValue(e(a.next).css("left"));e(a.next).css({left:c+i*(a.rewind?-1:1),opacity:0}).animate({opacity:1,left:c},{duration:a.speed,complete:b,queue:false,easing:d})}},j=function(){var a=this;this._theme=void 0;this._options={};this._playing=false;this._playtime=5E3;this._active=null;this._queue={length:0};this._data=[];this._dom=
|
||||
{};this._thumbnails=[];this._initialized=false;this._stageHeight=this._stageWidth=0;this._target=void 0;this._id=Math.random();e.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description info-author thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(f,h){a._dom[h]=g.create("galleria-"+h)});e.each("current total".split(" "),function(f,h){a._dom[h]=g.create("galleria-"+h,"span")});
|
||||
var b=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:false,press:function(f){var h=f.keyCode||f.which;h in b.map&&typeof b.map[h]==="function"&&b.map[h].call(a,f)},attach:function(f){var h,n;for(h in f)if(f.hasOwnProperty(h)){n=h.toUpperCase();if(n in b.keys)b.map[b.keys[n]]=f[h]}if(!b.bound){b.bound=true;I.bind("keydown",b.press)}},detach:function(){b.bound=false;I.unbind("keydown",b.press)}},c=this._controls={0:void 0,1:void 0,active:0,
|
||||
swap:function(){c.active=c.active?0:1},getActive:function(){return c[c.active]},getNext:function(){return c[1-c.active]}},d=this._carousel={next:a.$("thumb-nav-right"),prev:a.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var f=0,h=0,n=[0];e.each(a._thumbnails,function(o,p){if(p.ready){f+=p.outerWidth||e(p.container).outerWidth(true);n[o+1]=f;h=Math.max(h,p.outerHeight||e(p.container).outerHeight(true))}});a.$("thumbnails").css({width:f,height:h});d.max=f;d.hooks=n;d.width=
|
||||
a.$("thumbnails-list").width();d.setClasses();a.$("thumbnails-container").toggleClass("galleria-carousel",f>d.width)},bindControls:function(){var f;d.next.bind(y(),function(h){h.preventDefault();if(a._options.carouselSteps==="auto")for(f=d.current;f<d.hooks.length;f++){if(d.hooks[f]-d.hooks[d.current]>d.width){d.set(f-2);break}}else d.set(d.current+a._options.carouselSteps)});d.prev.bind(y(),function(h){h.preventDefault();if(a._options.carouselSteps==="auto")for(f=d.current;f>=0;f--)if(d.hooks[d.current]-
|
||||
d.hooks[f]>d.width){d.set(f+2);break}else{if(f===0){d.set(0);break}}else d.set(d.current-a._options.carouselSteps)})},set:function(f){for(f=Math.max(f,0);d.hooks[f-1]+d.width>=d.max&&f>=0;)f--;d.current=f;d.animate()},getLast:function(f){return(f||d.current)-1},follow:function(f){if(f===0||f===d.hooks.length-2)d.set(f);else{for(var h=d.current;d.hooks[h]-d.hooks[d.current]<d.width&&h<=d.hooks.length;)h++;if(f-1<d.current)d.set(f-1);else f+2>h&&d.set(f-h+d.current+2)}},setClasses:function(){d.prev.toggleClass("disabled",
|
||||
!d.current);d.next.toggleClass("disabled",d.hooks[d.current]+d.width>=d.max)},animate:function(){d.setClasses();var f=d.hooks[d.current]*-1;isNaN(f)||a.$("thumbnails").animate({left:f},{duration:a._options.carouselSpeed,easing:a._options.easing,queue:false})}},i=this._tooltip={initialized:false,open:false,init:function(){i.initialized=true;g.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}");
|
||||
a.$("tooltip").css("opacity",0.8);g.hide(a.get("tooltip"))},move:function(f){var h=a.getMousePosition(f).x;f=a.getMousePosition(f).y;var n=a.$("tooltip");h=h;var o=f,p=n.outerHeight(true)+1,q=n.outerWidth(true),r=p+15;q=a.$("container").width()-q-2;p=a.$("container").height()-p-2;if(!isNaN(h)&&!isNaN(o)){h+=10;o-=30;h=Math.max(0,Math.min(q,h));o=Math.max(0,Math.min(p,o));if(f<r)o=r;n.css({left:h,top:o})}},bind:function(f,h){i.initialized||i.init();var n=function(o,p){i.define(o,p);e(o).hover(function(){g.clearTimer("switch_tooltip");
|
||||
a.$("container").unbind("mousemove",i.move).bind("mousemove",i.move).trigger("mousemove");i.show(o);j.utils.addTimer("tooltip",function(){a.$("tooltip").stop().show();g.show(a.get("tooltip"),400);i.open=true},i.open?0:500)},function(){a.$("container").unbind("mousemove",i.move);g.clearTimer("tooltip");a.$("tooltip").stop();g.hide(a.get("tooltip"),200,function(){a.$("tooltip").hide();g.addTimer("switch_tooltip",function(){i.open=false},1E3)})})};typeof h==="string"?n(f in a._dom?a.get(f):f,h):e.each(f,
|
||||
function(o,p){n(a.get(o),p)})},show:function(f){f=e(f in a._dom?a.get(f):f);var h=f.data("tt"),n=function(o){s.setTimeout(function(p){return function(){i.move(p)}}(o),10);f.unbind("mouseup",n)};if(h=typeof h==="function"?h():h){a.$("tooltip").html(h.replace(/\s/," "));f.bind("mouseup",n)}},define:function(f,h){if(typeof h!=="function"){var n=h;h=function(){return n}}f=e(f in a._dom?a.get(f):f).data("tt",h);i.show(f)}},k=this._fullscreen={scrolled:0,active:false,enter:function(f){k.active=true;
|
||||
g.hide(a.getActiveImage());a.$("container").addClass("fullscreen");k.scrolled=e(s).scrollTop();g.forceStyles(a.get("container"),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1E4});var h={height:"100%",overflow:"hidden",margin:0,padding:0};g.forceStyles(z().html,h);g.forceStyles(z().body,h);a.attachKeyboard({escape:a.exitFullscreen,right:a.next,left:a.prev});a.rescale(function(){g.addTimer("fullscreen_enter",function(){g.show(a.getActiveImage());typeof f==="function"&&f.call(a)},
|
||||
100);a.trigger(j.FULLSCREEN_ENTER)});e(s).resize(function(){k.scale()})},scale:function(){a.rescale()},exit:function(f){k.active=false;g.hide(a.getActiveImage());a.$("container").removeClass("fullscreen");g.revertStyles(a.get("container"),z().html,z().body);s.scrollTo(0,k.scrolled);a.detachKeyboard();a.rescale(function(){g.addTimer("fullscreen_exit",function(){g.show(a.getActiveImage());typeof f==="function"&&f.call(a)},50);a.trigger(j.FULLSCREEN_EXIT)});e(s).unbind("resize",k.scale)}},l=this._idle=
|
||||
{trunk:[],bound:false,add:function(f,h){if(f){l.bound||l.addEvent();f=e(f);var n={},o;for(o in h)if(h.hasOwnProperty(o))n[o]=f.css(o);f.data("idle",{from:n,to:h,complete:true,busy:false});l.addTimer();l.trunk.push(f)}},remove:function(f){f=jQuery(f);e.each(l.trunk,function(h,n){if(n.length&&!n.not(f).length){a._idle.show(f);a._idle.trunk.splice(h,1)}});if(!l.trunk.length){l.removeEvent();g.clearTimer("idle")}},addEvent:function(){l.bound=true;a.$("container").bind("mousemove click",l.showAll)},removeEvent:function(){l.bound=
|
||||
false;a.$("container").unbind("mousemove click",l.showAll)},addTimer:function(){g.addTimer("idle",function(){a._idle.hide()},a._options.idleTime)},hide:function(){a.trigger(j.IDLE_ENTER);e.each(l.trunk,function(f,h){var n=h.data("idle");if(n){h.data("idle").complete=false;h.stop().animate(n.to,{duration:a._options.idleSpeed,queue:false,easing:"swing"})}})},showAll:function(){g.clearTimer("idle");e.each(a._idle.trunk,function(f,h){a._idle.show(h)})},show:function(f){var h=f.data("idle");if(!h.busy&&
|
||||
!h.complete){h.busy=true;a.trigger(j.IDLE_EXIT);g.clearTimer("idle");f.stop().animate(h.from,{duration:a._options.idleSpeed/2,queue:false,easing:"swing",complete:function(){e(this).data("idle").busy=false;e(this).data("idle").complete=true}})}l.addTimer()}},m=this._lightbox={width:0,height:0,initialized:false,active:null,image:null,elems:{},init:function(){a.trigger(j.LIGHTBOX_OPEN);if(!m.initialized){m.initialized=true;var f={},h=a._options,n="";h={overlay:"position:fixed;display:none;opacity:"+
|
||||
h.overlayOpacity+";filter:alpha(opacity="+h.overlayOpacity*100+");top:0;left:0;width:100%;height:100%;background:"+h.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:"position:absolute;background:#000;width:100%;height:100%;",content:"position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:"position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",
|
||||
close:"position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:"position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:"position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:"position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;line-height:40px;text-align:center;color:#000",
|
||||
next:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;line-height:40px;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"};var o={};if(u===8){h.nextholder+="background:#000;filter:alpha(opacity=0);";h.prevholder+="background:#000;filter:alpha(opacity=0);"}e.each(h,function(p,q){n+=".galleria-lightbox-"+p+"{"+q+"}"});g.insertStyleTag(n);e.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),
|
||||
function(p,q){a.addElement("lightbox-"+q);f[q]=m.elems[q]=a.get("lightbox-"+q)});m.image=new j.Picture;e.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(p,q){var r=[];e.each(q.split(" "),function(w,v){r.push("lightbox-"+v)});o["lightbox-"+p]=r});a.append(o);e(f.image).append(m.image.container);e(z().body).append(f.overlay,f.box);(function(p){return p.hover(function(){e(this).css("color","#bbb")},function(){e(this).css("color",
|
||||
"#444")})})(e(f.close).bind(y(),m.hide).html("×"));e.each(["Prev","Next"],function(p,q){var r=e(f[q.toLowerCase()]).html(/v/.test(q)?"‹ ":" ›"),w=e(f[q.toLowerCase()+"holder"]);w.bind(y(),function(){m["show"+q]()});u<8?r.show():w.hover(function(){r.show()},function(){r.stop().fadeOut(200)})});e(f.overlay).bind(y(),m.hide)}},rescale:function(f){var h=Math.min(e(s).width()-40,m.width),n=Math.min(e(s).height()-60,m.height);n=Math.min(h/m.width,n/m.height);h=m.width*n+40;n=
|
||||
m.height*n+60;h={width:h,height:n,marginTop:Math.ceil(n/2)*-1,marginLeft:Math.ceil(h/2)*-1};f?e(m.elems.box).css(h):e(m.elems.box).animate(h,a._options.lightboxTransitionSpeed,a._options.easing,function(){var o=m.image,p=a._options.lightboxFadeSpeed;a.trigger({type:j.LIGHTBOX_IMAGE,imageTarget:o.image});o.show();g.show(o.image,p);g.show(m.elems.info,p)})},hide:function(){m.image.image=null;e(s).unbind("resize",m.rescale);e(m.elems.box).hide();g.hide(m.elems.info);g.hide(m.elems.overlay,200,function(){e(this).hide().css("opacity",
|
||||
a._options.overlayOpacity);a.trigger(j.LIGHTBOX_CLOSE)})},showNext:function(){m.show(a.getNext(m.active))},showPrev:function(){m.show(a.getPrev(m.active))},show:function(f){m.active=f=typeof f==="number"?f:a.getIndex();m.initialized||m.init();e(s).unbind("resize",m.rescale);var h=a.getData(f),n=a.getDataLength();g.hide(m.elems.info);m.image.load(h.image,function(o){m.width=o.original.width;m.height=o.original.height;e(o.image).css({width:"100.5%",height:"100.5%",top:0,zIndex:99998,opacity:0});m.elems.title.innerHTML=
|
||||
h.title;m.elems.counter.innerHTML=f+1+" / "+n;e(s).resize(m.rescale);m.rescale()});e(m.elems.overlay).show();e(m.elems.box).show()}};return this};j.prototype={constructor:j,init:function(a,b){var c=this;b=L(b);C.push(this);this._original={target:a,options:b,data:null};if(this._target=this._dom.target=a.nodeName?a:e(a).get(0)){this._options={autoplay:false,carousel:true,carouselFollow:true,carouselSpeed:400,carouselSteps:"auto",clicknext:false,dataConfig:function(){return{}},dataSelector:"img",dataSource:this._target,
|
||||
debug:void 0,easing:"galleria",extend:function(){},height:"auto",idleTime:3E3,idleSpeed:200,imageCrop:false,imageMargin:0,imagePan:false,imagePanSmoothness:12,imagePosition:"50%",keepSource:false,lightboxFadeSpeed:200,lightboxTransition_speed:500,linkSourceTmages:true,maxScaleRatio:void 0,minScaleRatio:void 0,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:true,popupLinks:false,preload:2,queue:true,show:0,showInfo:true,showCounter:true,showImagenav:true,thumbCrop:true,thumbEventType:y(),
|
||||
thumbFit:true,thumbMargin:0,thumbQuality:"auto",thumbnails:true,transition:"fade",transitionInitial:void 0,transitionSpeed:400,width:"auto"};if(b&&b.debug===true)E=true;e(this._target).children().hide();typeof j.theme==="object"?this._init():g.wait({until:function(){return typeof j.theme==="object"},success:function(){c._init.call(c)},error:function(){j.raise("No theme found.",true)},timeout:5E3})}else j.raise("Target not found.")},_init:function(){var a=this;if(this._initialized){j.raise("Init failed: Gallery instance already initialized.");
|
||||
return this}this._initialized=true;if(!j.theme){j.raise("Init failed: No theme found.");return this}e.extend(true,this._options,j.theme.defaults,this._original.options);this.bind(j.DATA,function(){this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var b=this.$("container"),c={width:0,height:0},d=g.create("galleria-image");g.wait({until:function(){e.each(["width","height"],function(k,l){c[l]=a._options[l]&&typeof a._options[l]==="number"?a._options[l]:Math.max(g.parseValue(b.css(l)),
|
||||
g.parseValue(a.$("target").css(l)),b[l](),a.$("target")[l]())});var i=function(){return true};if(a._options.thumbnails){a.$("thumbnails").append(d);i=function(){return!!e(d).height()}}return i()&&c.width&&c.height>10},success:function(){e(d).remove();b.width(c.width);b.height(c.height);j.WEBKIT?s.setTimeout(function(){a._run()},1):a._run()},error:function(){j.raise("Width & Height not found.",true)},timeout:2E3})});this.bind(j.READY,function(b){return function(){g.show(this.get("counter"));this._options.carousel&&
|
||||
this._carousel.bindControls();if(this._options.autoplay){this.pause();if(typeof this._options.autoplay==="number")this._playtime=this._options.autoplay;this.trigger(j.PLAY);this._playing=true}if(b)typeof this._options.show==="number"&&this.show(this._options.show);else{b=true;if(this._options.clicknext){e.each(this._data,function(c,d){delete d.link});this.$("stage").css({cursor:"pointer"}).bind(y(),function(){a.next()})}j.History&&j.History.change(function(c){c=parseInt(c.value.replace(/\//,""),10);
|
||||
isNaN(c)?s.history.go(-1):a.show(c,void 0,true)});j.theme.init.call(this,this._options);this._options.extend.call(this,this._options);/^[0-9]{1,4}$/.test(J)&&j.History?this.show(J,void 0,true):this.show(this._options.show)}}}(false));this.append({"info-text":["info-title","info-description","info-author"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list",
|
||||
"thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});g.hide(this.$("counter").append(this.get("current")," / ",this.get("total")));this.setCounter("–");g.hide(a.get("tooltip"));e.each(Array(2),function(b){var c=new j.Picture;e(c.container).css({position:"absolute",top:0,left:0});a.$("images").append(c.container);a._controls[b]=c});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});this.$("thumbnails, thumbnails-list").css({overflow:"hidden",
|
||||
position:"relative"});this.$("image-nav-right, image-nav-left").bind(y(),function(b){a._options.clicknext&&b.stopPropagation();a._options.pause_on_interaction&&a.pause();b=/right/.test(this.className)?"next":"prev";a[b]()});e.each(["info","counter","image-nav"],function(b,c){a._options["show"+c.substr(0,1).toUpperCase()+c.substr(1).replace(/-/,"")]===false&&g.moveOut(a.get(c.toLowerCase()))});this.load();if(!this._options.keep_source&&!u)this._target.innerHTML="";this.$("target").append(this.get("container"));
|
||||
this._options.carousel&&this.bind(j.THUMBNAIL,function(){this.updateCarousel()});return this},_createThumbnails:function(){var a,b,c,d,i,k=this,l=this._options,m=function(){var q=k.$("thumbnails").find(".active");if(!q.length)return false;return q.find("img").attr("src")}(),f=typeof l.thumbnails==="string"?l.thumbnails.toLowerCase():null,h=function(q){return t.defaultView&&t.defaultView.getComputedStyle?t.defaultView.getComputedStyle(c.container,null)[q]:i.css(q)},n=function(q,r,w){return function(){e(w).append(q);
|
||||
k.trigger({type:j.THUMBNAIL,thumbTarget:q,index:r})}},o=function(q){l.pauseOnInteraction&&k.pause();var r=e(q.currentTarget).data("index");k.getIndex()!==r&&k.show(r);q.preventDefault()},p=function(q){q.scale({width:q.data.width,height:q.data.height,crop:l.thumbCrop,margin:l.thumbMargin,complete:function(r){var w=["left","top"],v,A;e.each(["Width","Height"],function(D,H){v=H.toLowerCase();if((l.thumbCrop!==true||l.thumbCrop===v)&&l.thumbFit){A={};A[v]=r[v];e(r.container).css(A);A={};A[w[D]]=0;e(r.image).css(A)}r["outer"+
|
||||
H]=e(r.container)["outer"+H](true)});g.toggleQuality(r.image,l.thumbQuality===true||l.thumbQuality==="auto"&&r.original.width<r.width*3);k.trigger({type:j.THUMBNAIL,thumbTarget:r.image,index:r.data.order})}})};this._thumbnails=[];this.$("thumbnails").empty();for(a=0;this._data[a];a++){d=this._data[a];if(l.thumbnails===true){c=new j.Picture(a);b=d.thumb||d.image;this.$("thumbnails").append(c.container);i=e(c.container);c.data={width:g.parseValue(h("width")),height:g.parseValue(h("height")),order:a};
|
||||
l.thumbFit&&l.thumbCrop!==true?i.css({width:0,height:0}):i.css({width:c.data.width,height:c.data.height});c.load(b,p);l.preload==="all"&&c.add(d.image)}else if(f==="empty"||f==="numbers"){c={container:g.create("galleria-image"),image:g.create("img","span"),ready:true};f==="numbers"&&e(c.image).text(a+1);this.$("thumbnails").append(c.container);s.setTimeout(n(c.image,a,c.container),50+a*20)}else c={container:null,image:null};e(c.container).add(l.keepSource&&l.linkSourceImages?d.original:null).data("index",
|
||||
a).bind(l.thumbEventType,o);m===b&&e(c.container).addClass("active");this._thumbnails.push(c)}},_run:function(){var a=this;a._createThumbnails();g.wait({until:function(){j.OPERA&&a.$("stage").css("display","inline-block");a._stageWidth=a.$("stage").width();a._stageHeight=a.$("stage").height();return a._stageWidth&&a._stageHeight>50},success:function(){a.trigger(j.READY)},error:function(){j.raise("Stage measures not found",true)}})},load:function(a,b,c){var d=this;this._data=[];this._thumbnails=[];
|
||||
this.$("thumbnails").empty();if(typeof b==="function"){c=b;b=null}a=a||this._options.dataSource;b=b||this._options.dataSelector;c=c||this._options.dataConfig;if(a.constructor===Array){if(this.validate(a)){this._data=a;this._parseData().trigger(j.DATA)}else j.raise("Load failed: JSON Array not valid.");return this}e(a).find(b).each(function(i,k){k=e(k);var l={},m=k.parent().attr("href");if(/\.(png|gif|jpg|jpeg)(\?.*)?$/i.test(m))l.image=m;else if(m)l.link=m;d._data.push(e.extend({title:k.attr("title"),
|
||||
thumb:k.attr("src"),image:k.attr("src"),description:k.attr("alt"),link:k.attr("longdesc"),original:k.get(0)},l,c(k)))});this.getDataLength()?this.trigger(j.DATA):j.raise("Load failed: no data found.");return this},_parseData:function(){var a=this;e.each(this._data,function(b,c){if("thumb"in c===false)a._data[b].thumb=c.image});return this},splice:function(){Array.prototype.splice.apply(this._data,g.array(arguments));return this._parseData()._createThumbnails()},push:function(){Array.prototype.push.apply(this._data,
|
||||
g.array(arguments));return this._parseData()._createThumbnails()},_getActive:function(){return this._controls.getActive()},validate:function(){return true},bind:function(a,b){a=F(a);this.$("container").bind(a,this.proxy(b));return this},unbind:function(a){a=F(a);this.$("container").unbind(a);return this},trigger:function(a){a=typeof a==="object"?e.extend(a,{scope:this}):{type:F(a),scope:this};this.$("container").trigger(a);return this},addIdleState:function(){this._idle.add.apply(this._idle,g.array(arguments));
|
||||
return this},removeIdleState:function(){this._idle.remove.apply(this._idle,g.array(arguments));return this},enterIdleMode:function(){this._idle.hide();return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(){this._fullscreen.enter.apply(this,g.array(arguments));return this},exitFullscreen:function(){this._fullscreen.exit.apply(this,g.array(arguments));return this},toggleFullscreen:function(){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,g.array(arguments));
|
||||
return this},bindTooltip:function(){this._tooltip.bind.apply(this._tooltip,g.array(arguments));return this},defineTooltip:function(){this._tooltip.define.apply(this._tooltip,g.array(arguments));return this},refreshTooltip:function(){this._tooltip.show.apply(this._tooltip,g.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,g.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,g.array(arguments));return this},
|
||||
getActiveImage:function(){return this._getActive().image||void 0},getActiveThumb:function(){return this._thumbnails[this._active].image||void 0},getMousePosition:function(a){return{x:a.pageX-this.$("container").offset().left,y:a.pageY-this.$("container").offset().top}},addPan:function(a){if(this._options.imageCrop!==false){a=e(a||this.getActiveImage());var b=this,c=a.width()/2,d=a.height()/2,i=parseInt(a.css("left"),10),k=parseInt(a.css("top"),10),l=i||0,m=k||0,f=0,h=0,n=false,o=g.timestamp(),p=0,
|
||||
q=0,r=function(v,A,D){if(v>0){q=Math.round(Math.max(v*-1,Math.min(0,A)));if(p!==q){p=q;if(u===8)a.parent()["scroll"+D](q*-1);else{v={};v[D.toLowerCase()]=q;a.css(v)}}}},w=function(v){if(!(g.timestamp()-o<50)){n=true;c=b.getMousePosition(v).x;d=b.getMousePosition(v).y}};if(u===8){a.parent().scrollTop(m*-1).scrollLeft(l*-1);a.css({top:0,left:0})}this.$("stage").unbind("mousemove",w).bind("mousemove",w);g.addTimer("pan",function(){if(n){f=a.width()-b._stageWidth;h=a.height()-b._stageHeight;i=c/b._stageWidth*
|
||||
f*-1;k=d/b._stageHeight*h*-1;l+=(i-l)/b._options.imagePanSmoothness;m+=(k-m)/b._options.imagePanSmoothness;r(h,m,"Top");r(f,l,"Left")}},50,true);return this}},proxy:function(a,b){if(typeof a!=="function")return function(){};b=b||this;return function(){return a.apply(b,g.array(arguments))}},removePan:function(){this.$("stage").unbind("mousemove");g.clearTimer("pan");return this},addElement:function(){var a=this._dom;e.each(g.array(arguments),function(b,c){a[c]=g.create("galleria-"+c)});return this},
|
||||
attachKeyboard:function(){this._keyboard.attach.apply(this._keyboard,g.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,g.array(arguments));return this},appendChild:function(a,b){this.$(a).append(this.get(b)||b);return this},prependChild:function(a,b){this.$(a).prepend(this.get(b)||b);return this},remove:function(){this.$(g.array(arguments).join(",")).remove();return this},append:function(a){var b,c;for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===
|
||||
Array)for(c=0;a[b][c];c++)this.appendChild(b,a[b][c]);else this.appendChild(b,a[b]);return this},_scaleImage:function(a,b){b=e.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition},b);(a||this._controls.getActive()).scale(b);return this},updateCarousel:function(){this._carousel.update();return this},rescale:function(a,b,c){var d=this;
|
||||
if(typeof a==="function"){c=a;a=void 0}var i=function(){d._stageWidth=a||d.$("stage").width();d._stageHeight=b||d.$("stage").height();d._scaleImage();d._options.carousel&&d.updateCarousel();d.trigger(j.RESCALE);typeof c==="function"&&c.call(d)};j.WEBKIT&&!a&&!b?g.addTimer("scale",i,5):i.call(d);return this},refreshImage:function(){this._scaleImage();this._options.imagePan&&this.addPan();return this},show:function(a,b,c){if(!(a===false||!this._options.queue&&this._queue.stalled)){a=Math.max(0,Math.min(parseInt(a,
|
||||
10),this.getDataLength()-1));b=typeof b!=="undefined"?!!b:a<this.getIndex();c=c||false;if(!c&&j.History)j.History.value(a.toString());else{this._active=a;Array.prototype.push.call(this._queue,{index:a,rewind:b});this._queue.stalled||this._show();return this}}},_show:function(){var a=this,b=this._queue[0],c=this.getData(b.index);if(c){var d=c.image,i=this._controls.getActive(),k=this._controls.getNext(),l=k.isCached(d),m=this._thumbnails[b.index],f=function(){a._queue.stalled=false;g.toggleQuality(k.image,
|
||||
a._options.imageQuality);e(i.container).css({zIndex:0,opacity:0});e(k.container).css({zIndex:1,opacity:1});a._controls.swap();a._options.imagePan&&a.addPan(k.image);c.link&&e(k.image).css({cursor:"pointer"}).bind(y(),function(){if(a._options.popupLinks)s.open(c.link,"_blank");else s.location.href=c.link});Array.prototype.shift.call(a._queue);a._queue.length&&a._show();a._playCheck();a.trigger({type:j.IMAGE,index:b.index,imageTarget:k.image,thumbTarget:m.image})};this._options.carousel&&this._options.carouselFollow&&
|
||||
this._carousel.follow(b.index);if(this._options.preload){var h,n,o=this.getNext();try{for(n=this._options.preload;n>0;n--){h=new j.Picture;h.add(a.getData(o).image);o=a.getNext(o)}}catch(p){}}g.show(k.container);e(a._thumbnails[b.index].container).addClass("active").siblings(".active").removeClass("active");a.trigger({type:j.LOADSTART,cached:l,index:b.index,imageTarget:k.image,thumbTarget:m.image});k.load(d,function(q){a._scaleImage(q,{complete:function(r){g.show(r.container);"image"in i&&g.toggleQuality(i.image,
|
||||
false);g.toggleQuality(r.image,false);a._queue.stalled=true;a.removePan();a.setInfo(b.index);a.setCounter(b.index);a.trigger({type:j.LOADFINISH,cached:l,index:b.index,imageTarget:r.image,thumbTarget:a._thumbnails[b.index].image});var w=i.image===null&&a._options.transitionInitial?a._options.transition_Initial:a._options.transition;w in G===false?f():G[w].call(a,{prev:i.image,next:r.image,rewind:b.rewind,speed:a._options.transitionSpeed||400},f)}})})}},getNext:function(a){a=typeof a==="number"?a:this.getIndex();
|
||||
return a===this.getDataLength()-1?0:a+1},getPrev:function(a){a=typeof a==="number"?a:this.getIndex();return a===0?this.getDataLength()-1:a-1},next:function(){this.getDataLength()>1&&this.show(this.getNext(),false);return this},prev:function(){this.getDataLength()>1&&this.show(this.getPrev(),true);return this},get:function(a){return a in this._dom?this._dom[a]:null},getData:function(a){return a in this._data?this._data[a]:this._data[this._active]},getDataLength:function(){return this._data.length},
|
||||
getIndex:function(){return typeof this._active==="number"?this._active:false},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(a){return typeof a==="undefined"?this._options:this._options[a]},setOptions:function(a,b){if(typeof a==="object")e.extend(this._options,a);else this._options[a]=b;return this},play:function(a){this._playing=true;this._playtime=a||this._playtime;this._playCheck();this.trigger(j.PLAY);return this},pause:function(){this._playing=
|
||||
false;this.trigger(j.PAUSE);return this},playToggle:function(a){return this._playing?this.pause():this.play(a)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var a=this,b=0,c=g.timestamp(),d="play"+this._id;if(this._playing){g.clearTimer(d);var i=function(){b=g.timestamp()-c;if(b>=a._playtime&&a._playing){g.clearTimer(d);a.next()}else if(a._playing){a.trigger({type:j.PROGRESS,percent:Math.ceil(b/a._playtime*100),seconds:Math.floor(b/
|
||||
1E3),milliseconds:b});g.addTimer(d,i,20)}};g.addTimer(d,i,20)}},setIndex:function(a){this._active=a;return this},setCounter:function(a){if(typeof a==="number")a++;else if(typeof a==="undefined")a=this.getIndex()+1;this.get("current").innerHTML=a;if(u){a=this.$("counter");var b=a.css("opacity"),c=a.attr("style");c&&parseInt(b,10)===1?a.attr("style",c.replace(/filter[^\;]+\;/i,"")):this.$("counter").css("opacity",b)}return this},setInfo:function(a){var b=this,c=this.getData(a);e.each(["title","description",
|
||||
"author"],function(d,i){var k=b.$("info-"+i);c[i]?k[c[i].length?"show":"hide"]().html(c[i]):k.empty().hide()});return this},hasInfo:function(a){var b="title description".split(" "),c;for(c=0;b[c];c++)if(this.getData(a)[b[c]])return true;return false},jQuery:function(a){var b=this,c=[];e.each(a.split(","),function(i,k){k=e.trim(k);b.get(k)&&c.push(k)});var d=e(b.get(c.shift()));e.each(c,function(i,k){d=d.add(b.get(k))});return d},$:function(){return this.jQuery.apply(this,g.array(arguments))}};e.each(K,
|
||||
function(a,b){var c=/_/.test(b)?b.replace(/_/g,""):b;j[b.toUpperCase()]="galleria."+c});e.extend(j,{IE9:u===9,IE8:u===8,IE7:u===7,IE6:u===6,IE:!!u,WEBKIT:/webkit/.test(x),SAFARI:/safari/.test(x),CHROME:/chrome/.test(x),QUIRK:u&&t.compatMode&&t.compatMode==="BackCompat",MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!s.opera,IPHONE:/iphone/.test(x),IPAD:/ipad/.test(x),ANDROID:/android/.test(x),TOUCH:!!(/iphone/.test(x)||/ipad/.test(x)||/android/.test(x))});j.addTheme=function(a){a.name||j.raise("No theme name specified");
|
||||
a.defaults=typeof a.defaults!=="object"?{}:L(a.defaults);var b=false,c;if(typeof a.css==="string"){e("link").each(function(d,i){c=RegExp(a.css);if(c.test(i.href)){b=true;j.theme=a;return false}});b||e("script").each(function(d,i){c=RegExp("galleria\\."+a.name.toLowerCase()+"\\.");if(c.test(i.src)){b=i.src.replace(/[^\/]*$/,"")+a.css;g.addTimer("css",function(){g.loadCSS(b,"galleria-theme",function(){j.theme=a})},1)}});b||j.raise("No theme CSS loaded")}else j.theme=a;return a};j.loadTheme=function(a,
|
||||
b){var c=false,d=C.length;j.theme=void 0;g.loadScript(a,function(){c=true});g.wait({until:function(){return c},error:function(){j.raise("Theme at "+a+" could not load, check theme path.",true)},success:function(){if(d){var i=[];e.each(j.get(),function(k,l){var m=e.extend(l._original.options,{data_source:l._data},b);l.$("container").remove();var f=new j;f._id=l._id;f.init(l._original.target,m);i.push(f)});C=i}},timeout:2E3})};j.get=function(a){if(C[a])return C[a];else if(typeof a!=="number")return C;
|
||||
else j.raise("Gallery index "+a+" not found")};j.addTransition=function(a,b){G[a]=b};j.utils=g;j.log=function(){try{s.console.log.apply(s.console,g.array(arguments))}catch(a){try{s.opera.postError.apply(s.opera,arguments)}catch(b){s.alert(g.array(arguments).split(", "))}}};j.raise=function(a,b){if(E||b)throw Error((b?"Fatal error":"Error")+": "+a);};j.Picture=function(a){this.id=a||null;this.image=null;this.container=g.create("galleria-image");e(this.container).css({overflow:"hidden",position:"relative"});
|
||||
this.original={width:0,height:0};this.loaded=this.ready=false};j.Picture.prototype={cache:{},add:function(a){var b=0,c=this,d=new Image,i=function(){if((!this.width||!this.height)&&b<1E3){b++;e(d).load(i).attr("src",a+"?"+(new Date).getTime())}c.original={height:this.height,width:this.width};c.cache[a]=a;c.loaded=true};e(d).css("display","block");if(c.cache[a]){d.src=a;i.call(d);return d}e(d).load(i).attr("src",a);return d},show:function(){g.show(this.image)},hide:function(){g.moveOut(this.image)},
|
||||
clear:function(){this.image=null},isCached:function(a){return!!this.cache[a]},load:function(a,b){var c=this;e(this.container).empty(true);this.image=this.add(a);g.hide(this.image);e(this.container).append(this.image);g.wait({until:function(){return c.loaded&&c.image.complete&&c.original.width&&c.image.width},success:function(){s.setTimeout(function(){b.call(c,c)},50)},error:function(){s.setTimeout(function(){b.call(c,c)},50);j.raise("image not loaded in 10 seconds: "+a)},timeout:1E4});return this.container},
|
||||
scale:function(a){a=e.extend({width:0,height:0,min:void 0,max:void 0,margin:0,complete:function(){},position:"center",crop:false},a);if(!this.image)return this.container;var b,c,d=this,i=e(d.container);g.wait({until:function(){b=a.width||i.width()||g.parseValue(i.css("width"));c=a.height||i.height()||g.parseValue(i.css("height"));return b&&c},success:function(){var k=(b-a.margin*2)/d.original.width,l=(c-a.margin*2)/d.original.height,m={"true":Math.max(k,l),width:k,height:l,"false":Math.min(k,l)}[a.crop.toString()];
|
||||
if(a.max)m=Math.min(a.max,m);if(a.min)m=Math.max(a.min,m);e(d.container).width(b).height(c);e.each(["width","height"],function(o,p){e(d.image)[p](d.image[p]=d[p]=Math.round(d.original[p]*m))});var f={},h={};k=function(o,p,q){var r=0;if(/\%/.test(o)){o=parseInt(o,10)/100;p=d.image[p]||e(d.image)[p]();r=Math.ceil(p*-1*o+q*o)}else r=g.parseValue(o);return r};var n={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};e.each(a.position.toLowerCase().split(" "),function(o,p){if(p==="center")p=
|
||||
"50%";f[o?"top":"left"]=p});e.each(f,function(o,p){n.hasOwnProperty(p)&&e.extend(h,n[p])});f=f.top?e.extend(f,h):h;f=e.extend({top:"50%",left:"50%"},f);e(d.image).css({position:"relative",top:k(f.top,"height",c),left:k(f.left,"width",b)});d.show();d.ready=true;a.complete.call(d,d)},error:function(){j.raise("Could not scale image: "+d.image.src)},timeout:1E3});return this}};e.extend(e.easing,{galleria:function(a,b,c,d,i){if((b/=i/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},galleriaIn:function(a,
|
||||
b,c,d,i){return d*(b/=i)*b*b*b+c},galleriaOut:function(a,b,c,d,i){return-d*((b=b/i-1)*b*b*b-1)+c}});e.fn.galleria=function(a){return this.each(function(){(new j).init(this,a)})};s.Galleria=j})(jQuery);
|
||||
96
WebContent/js/galleria/themes/classic/classic-demo.html
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Galleria Classic Theme</title>
|
||||
<style>
|
||||
|
||||
/* Demo styles */
|
||||
html,body{background:#222;margin:0;}
|
||||
body{border-top:4px solid #000;}
|
||||
.content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;}
|
||||
h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;}
|
||||
p{margin:0 0 20px}
|
||||
a {color:#22BCB9;text-decoration:none;}
|
||||
.cred{margin-top:20px;font-size:11px;}
|
||||
|
||||
/* This rule is read by Galleria to define the gallery height: */
|
||||
#galleria{height:320px;}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- load jQuery -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
|
||||
|
||||
<!-- load Galleria -->
|
||||
<script src="../../galleria-1.2.2.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>Galleria Classic Theme</h1>
|
||||
<p>Demonstrating a basic gallery example.</p>
|
||||
|
||||
<!-- Adding gallery images. We use resized thumbnails here for better performance, but it’s not necessary -->
|
||||
|
||||
<div id="galleria">
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/1000px-Locomotives-Roundhouse2.jpg">
|
||||
<img title="Locomotives Roundhouse"
|
||||
alt="Steam locomotives of the Chicago & North Western Railway."
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/100px-Locomotives-Roundhouse2.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/1000px-Icebergs_in_the_High_Arctic_-_20050907.jpg">
|
||||
<img title="Icebergs in the High Arctic"
|
||||
alt="”The debris loading isn't particularly extensive, but the color is usual.”"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/100px-Icebergs_in_the_High_Arctic_-_20050907.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/1000px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg">
|
||||
<img title="Araña"
|
||||
alt="Xysticus cristatus, A Estrada, Galicia, Spain"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/100px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/1000px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg">
|
||||
<img title="Museo storia naturale"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/100px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/1000px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg">
|
||||
<img title="Grjótagjá caves in summer 2009"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/100px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/1000px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg">
|
||||
<img title="Thermes"
|
||||
alt="Xanthi hot-spa springs, Xanthi Prefecture, Greece"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/100px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/1024px-Polish_Army_Ko%C5%82obrzeg_077.JPG">
|
||||
<img title="Polish Army Kołobrzeg"
|
||||
alt="A display of the Polish Army. Both the soldier, and the vehicle belong to the 7th Pomeranian Coastal Defence Brigade, a part of the Szczecin-based 12th Mechanized Division ”Bolesław Krzywousty”"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/100px-Polish_Army_Ko%C5%82obrzeg_077.JPG">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/1024px-20100213_Zlatograd_Bulgaria_3.jpg">
|
||||
<img title="Zlatograd Bulgaria"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/100px-20100213_Zlatograd_Bulgaria_3.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/1024px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg">
|
||||
<img title="09-28-2001 in New York City"
|
||||
alt="New York, NY, September 28, 2001 -- Debris on surrounding roofs at the site of the World Trade Center. Photo by Andrea Booher/ FEMA News Photo"
|
||||
src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/100px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg">
|
||||
</a>
|
||||
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/1024px-Antennae%2C_Hubble_images.jpg">
|
||||
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/100px-Antennae%2C_Hubble_images.jpg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
// Load the classic theme
|
||||
Galleria.loadTheme('galleria.classic.min.js');
|
||||
|
||||
// Initialize Galleria
|
||||
$('#galleria').galleria();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
WebContent/js/galleria/themes/classic/classic-loader.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WebContent/js/galleria/themes/classic/classic-map.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
200
WebContent/js/galleria/themes/classic/galleria.classic.css
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
/*
|
||||
* Galleria Classic Theme
|
||||
* Copyright (c) 2010, Aino
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
.galleria-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #000;
|
||||
}
|
||||
.galleria-container img {
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-o-user-select: none;
|
||||
}
|
||||
.galleria-stage {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
bottom: 60px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.galleria-thumbnails-container {
|
||||
height: 50px;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
.galleria-carousel .galleria-thumbnails-list {
|
||||
margin-left: 30px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
.galleria-thumbnails .galleria-image {
|
||||
height: 40px;
|
||||
width: 60px;
|
||||
background: #000;
|
||||
margin: 0 5px 0 0;
|
||||
border: 1px solid #000;;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.galleria-counter {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
text-align: right;
|
||||
color: #fff;
|
||||
font: normal 11px/1 arial,sans-serif;
|
||||
z-index: 2;
|
||||
}
|
||||
.galleria-loader {
|
||||
background: #000;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 2;
|
||||
display: none;
|
||||
background: url(classic-loader.gif) no-repeat 2px 2px;
|
||||
}
|
||||
.galleria-info {
|
||||
width: 50%;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
}
|
||||
.galleria-info-text {
|
||||
background-color: #000;
|
||||
padding: 12px;
|
||||
display: none;
|
||||
/* IE7 */ zoom:1;
|
||||
}
|
||||
.galleria-info-title {
|
||||
font: bold 12px/1.1 arial,sans-serif;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
.galleria-info-description {
|
||||
font: italic 12px/1.4 georgia,serif;
|
||||
margin: 0;
|
||||
color: #bbb;
|
||||
}
|
||||
.galleria-info-close {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
background-position: -753px -11px;
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
}
|
||||
.galleria-info-close:hover{
|
||||
opacity:1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.galleria-info-link {
|
||||
background-position: -669px -5px;
|
||||
opacity: .7;
|
||||
filter: alpha(opacity=70);
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
background-color: #000;
|
||||
}
|
||||
.galleria-info-link:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.galleria-image-nav {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -62px;
|
||||
width: 100%;
|
||||
height: 62px;
|
||||
left: 0;
|
||||
}
|
||||
.galleria-image-nav-left,
|
||||
.galleria-image-nav-right {
|
||||
opacity: .3;
|
||||
filter: alpha(opacity=30);
|
||||
cursor: pointer;
|
||||
width: 62px;
|
||||
height: 124px;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
background-position: 0 46px;
|
||||
}
|
||||
.galleria-image-nav-right {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
background-position: -254px 46px;
|
||||
z-index: 2;
|
||||
}
|
||||
.galleria-image-nav-left:hover,
|
||||
.galleria-image-nav-right:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.galleria-thumb-nav-left,
|
||||
.galleria-thumb-nav-right {
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
background-position: -495px 5px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 40px;
|
||||
width: 23px;
|
||||
z-index: 3;
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
}
|
||||
.galleria-thumb-nav-right {
|
||||
background-position: -578px 5px;
|
||||
border-right: none;
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
.galleria-thumbnails-container .disabled {
|
||||
opacity: .2;
|
||||
filter: alpha(opacity=20);
|
||||
cursor: default;
|
||||
}
|
||||
.galleria-thumb-nav-left:hover,
|
||||
.galleria-thumb-nav-right:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
background-color: #111;
|
||||
}
|
||||
.galleria-thumbnails-container .disabled:hover {
|
||||
opacity: 0.2;
|
||||
filter: alpha(opacity=20);
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.galleria-carousel .galleria-thumb-nav-left,
|
||||
.galleria-carousel .galleria-thumb-nav-right {
|
||||
display: block;
|
||||
}
|
||||
.galleria-thumb-nav-left,
|
||||
.galleria-thumb-nav-right,
|
||||
.galleria-info-link,
|
||||
.galleria-info-close,
|
||||
.galleria-image-nav-left,
|
||||
.galleria-image-nav-right {
|
||||
background-image: url(classic-map.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
90
WebContent/js/galleria/themes/classic/galleria.classic.js
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* @preserve Galleria Classic Theme 2011-02-14
|
||||
* http://galleria.aino.se
|
||||
*
|
||||
* Copyright (c) 2011, Aino
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
/*global jQuery, Galleria */
|
||||
|
||||
(function($) {
|
||||
|
||||
Galleria.addTheme({
|
||||
name: 'classic',
|
||||
author: 'Galleria',
|
||||
css: 'galleria.classic.css',
|
||||
defaults: {
|
||||
transition: 'slide',
|
||||
thumbCrop: 'height',
|
||||
|
||||
// set this to false if you want to show the caption all the time:
|
||||
_toggleInfo: true
|
||||
},
|
||||
init: function(options) {
|
||||
|
||||
// add some elements
|
||||
this.addElement('info-link','info-close');
|
||||
this.append({
|
||||
'info' : ['info-link','info-close']
|
||||
});
|
||||
|
||||
// cache some stuff
|
||||
var info = this.$('info-link,info-close,info-text'),
|
||||
touch = Galleria.TOUCH,
|
||||
click = touch ? 'touchstart' : 'click';
|
||||
|
||||
// show loader & counter with opacity
|
||||
this.$('loader,counter').show().css('opacity', 0.4);
|
||||
|
||||
// some stuff for non-touch browsers
|
||||
if (! touch ) {
|
||||
this.addIdleState( this.get('image-nav-left'), { left:-50 });
|
||||
this.addIdleState( this.get('image-nav-right'), { right:-50 });
|
||||
this.addIdleState( this.get('counter'), { opacity:0 });
|
||||
}
|
||||
|
||||
// toggle info
|
||||
if ( options._toggleInfo === true ) {
|
||||
info.bind( click, function() {
|
||||
info.toggle();
|
||||
});
|
||||
} else {
|
||||
info.show();
|
||||
this.$('info-link, info-close').hide();
|
||||
}
|
||||
|
||||
// bind some stuff
|
||||
this.bind('thumbnail', function(e) {
|
||||
|
||||
if (! touch ) {
|
||||
// fade thumbnails
|
||||
$(e.thumbTarget).css('opacity', 0.6).parent().hover(function() {
|
||||
$(this).not('.active').children().stop().fadeTo(100, 1);
|
||||
}, function() {
|
||||
$(this).not('.active').children().stop().fadeTo(400, 0.6);
|
||||
});
|
||||
|
||||
if ( e.index === options.show ) {
|
||||
$(e.thumbTarget).css('opacity',1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.bind('loadstart', function(e) {
|
||||
if (!e.cached) {
|
||||
this.$('loader').show().fadeTo(200, 0.4);
|
||||
}
|
||||
|
||||
this.$('info').toggle( this.hasInfo() );
|
||||
|
||||
$(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6);
|
||||
});
|
||||
|
||||
this.bind('loadfinish', function(e) {
|
||||
this.$('loader').fadeOut(200);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
10
WebContent/js/galleria/themes/classic/galleria.classic.min.js
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
Galleria Classic Theme 2011-02-14
|
||||
http://galleria.aino.se
|
||||
|
||||
Copyright (c) 2011, Aino
|
||||
Licensed under the MIT license.
|
||||
*/
|
||||
(function(b){Galleria.addTheme({name:"classic",author:"Galleria",css:"galleria.classic.css",defaults:{transition:"slide",thumbCrop:"height",_toggleInfo:true},init:function(e){this.addElement("info-link","info-close");this.append({info:["info-link","info-close"]});var c=this.$("info-link,info-close,info-text"),d=Galleria.TOUCH,f=d?"touchstart":"click";this.$("loader,counter").show().css("opacity",0.4);if(!d){this.addIdleState(this.get("image-nav-left"),{left:-50});this.addIdleState(this.get("image-nav-right"),
|
||||
{right:-50});this.addIdleState(this.get("counter"),{opacity:0})}if(e._toggleInfo===true)c.bind(f,function(){c.toggle()});else{c.show();this.$("info-link, info-close").hide()}this.bind("thumbnail",function(a){if(!d){b(a.thumbTarget).css("opacity",0.6).parent().hover(function(){b(this).not(".active").children().stop().fadeTo(100,1)},function(){b(this).not(".active").children().stop().fadeTo(400,0.6)});a.index===e.show&&b(a.thumbTarget).css("opacity",1)}});this.bind("loadstart",function(a){a.cached||
|
||||
this.$("loader").show().fadeTo(200,0.4);this.$("info").toggle(this.hasInfo());b(a.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",0.6)});this.bind("loadfinish",function(){this.$("loader").fadeOut(200)})}})})(jQuery);
|
||||