Initial import.
15
.classpath
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/ZUtil"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="jst.web"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Ziver/Documents/Programmering/Java/libs/xuggler/xuggle-xuggler-5.4.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
37
.project
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Zallery</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>ZUtil</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
11
.settings/.jsdtscope
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
||||
7
.settings/org.eclipse.jdt.core.prefs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#Tue Jun 22 19:38:02 CEST 2010
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
12
.settings/org.eclipse.wst.common.component
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="Zallery">
|
||||
<wb-resource deploy-path="/" source-path="/WebContent"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
||||
<dependent-module archiveName="ZUtil.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ZUtil/ZUtil">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="Zallery"/>
|
||||
<property name="java-output-path" value="/Zallery/build/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
9
.settings/org.eclipse.wst.common.project.facet.core.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<runtime name="Apache Tomcat v6.0"/>
|
||||
<fixed facet="jst.web"/>
|
||||
<fixed facet="jst.java"/>
|
||||
<installed facet="jst.java" version="6.0"/>
|
||||
<installed facet="jst.web" version="2.5"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
||||
1
.settings/org.eclipse.wst.jsdt.ui.superType.container
Normal file
|
|
@ -0,0 +1 @@
|
|||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
||||
1
.settings/org.eclipse.wst.jsdt.ui.superType.name
Normal file
|
|
@ -0,0 +1 @@
|
|||
Window
|
||||
3
.settings/org.eclipse.wst.ws.service.policy.prefs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#Mon Aug 16 22:06:03 CEST 2010
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.wst.ws.service.policy.projectEnabled=false
|
||||
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);
|
||||
}
|
||||