Skip to content

Commit

Permalink
Merge pull request #257 from DDMAL/develop
Browse files Browse the repository at this point in the history
Diva v3.2.0
  • Loading branch information
magoni committed Jun 3, 2015
2 parents a7ed1d4 + 2bf79c0 commit 8960ab1
Show file tree
Hide file tree
Showing 30 changed files with 1,553 additions and 651 deletions.
65 changes: 50 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
#!/bin/bash

# Path to the Closure Compiler .jar file
usage()
{
echo "Flags:"
echo " -h Show this message"
echo " -r (version) Specify release version"
echo " -c (closure) Specify closure compiler location"
echo " "
echo "Build options:"
echo " all Builds CSS and Javascript, copies source to build directory"
echo " less Compiles CSS from the LESS source"
echo " minify Builds Javascript source"
echo " test Runs unit tests with PhantomJS"
echo " release Builds release package"

exit 1
}

# Default path to the Closure Compiler
CLOSURE_COMPILER_PATH="/usr/local/bin/closure-compiler"

RELEASE=

SKIP=0

while getopts "hr:c:" OPT; do
case $OPT in
h)
usage;;
r)
RELEASE=$OPTARG
SKIP=$(($SKIP + 2));;
c)
CLOSURE_COMPILER_PATH=$OPTARG
SKIP=$(($SKIP + 2));;
esac
done

args=("$@")
TYPE=${args[$SKIP]}

# If running in Travis CI, use local compiler.jar
if [ "$TRAVIS" = "true" ]; then
CLOSURE_COMPILER_PATH="java -jar ../../compiler.jar"
elif [ ! -f $CLOSURE_COMPILER_PATH ]; then
echo "Closure Compiler not found at:" $CLOSURE_COMPILER_PATH
echo "Please specify using -c flag."
exit 1
fi

less ()
Expand All @@ -14,6 +55,7 @@ less ()
# Creates a minified version called diva.min.css in build/css
# and a non-minified version called diva.css.
# See build/css/readme.md for more information.
echo "Compiling CSS."
mkdir -p build/css
lessc source/css/imports.less > build/css/diva.css
lessc source/css/imports.less > build/css/diva.min.css -x
Expand All @@ -26,20 +68,20 @@ minify ()
# all the relevant Javascript (except for jQuery, which must
# be included separately).
# See build/js/readme.md for more information.
echo "Using Closure path:" $CLOSURE_COMPILER_PATH
echo "Compiling JS."

source_files=( "utils.js" "diva.js" "plugins/*" )

mkdir -p build/js
cd source/js && eval $CLOSURE_COMPILER_PATH" --js "${source_files[@]:0}" --js_output_file ../../build/js/diva.min.js"
cd ../../
cp -R source/js/ build/js/
cp -R source/js/* build/js/
}

all ()
{
if [ -d "build" ]; then
echo "Removing old build directory"
echo "Removing old build directory."
rm -r build/*
fi

Expand Down Expand Up @@ -70,7 +112,7 @@ release()
# Creates a zip file containing just the files we need for the release.
VERSION=$1
if [ -z "$1"]; then
echo "Syntax: ./build.sh release VERSION"
echo "Syntax: ./build.sh -r VERSION release"
exit 1
fi

Expand Down Expand Up @@ -103,19 +145,12 @@ release()
zip -r $release_dir".zip" $release_dir
}

case "$1" in
case $TYPE in
"less" ) less;;
"minify" ) minify;;
"test" ) test;;
"all" ) all;;
"release" ) release $2;;
* )
echo "Build options:"
echo " all - Builds CSS and Javascript, copies source to build directory"
echo " less - Compiles CSS from the LESS source"
echo " minify - Builds Javascript source"
echo " test - Runs unit tests with PhantomJS"
echo " release VERSION - Builds release package"
;;
"release" ) release $RELEASE;;
* ) usage;;
esac

36 changes: 27 additions & 9 deletions build/css/diva.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@
display: none;
padding: 8px;
float: left;
clear: left;
}
.diva-tools .diva-tools-left .diva-zoom-buttons-label {
display: none;
padding: 8px;
float: left;
clear: left;
}
.diva-tools .diva-tools-left .diva-zoom-out-button {
display: none;
Expand Down Expand Up @@ -92,7 +90,6 @@
display: none;
padding: 8px;
float: left;
clear: left;
}
.diva-tools .diva-tools-left.in-fullscreen {
float: left;
Expand Down Expand Up @@ -140,7 +137,6 @@
top: 0px;
right: 30px;
z-index: 101;
width: 230px;
height: 73px;
padding: 15px;
border: 1px solid #dddddd;
Expand Down Expand Up @@ -250,19 +246,21 @@
border-left: 0px;
float: right;
}
.diva-link-popup {
font-size: 10pt;
.diva-popup {
background: #ffffff;
border: 1px solid #dddddd;
position: absolute;
border: 1px solid #99bbe8;
padding: .6em;
z-index: 101;
position: absolute;
-webkit-box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.5);
-moz-box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.5);
box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.5);
}
.diva-link-popup {
font-size: 10pt;
}
.diva-link-popup input {
width: 15em;
width: 18em;
}
.diva-link-popup input:focus {
outline: none;
Expand Down Expand Up @@ -559,3 +557,23 @@
background-position: -25px center;
}
/* End download plugin */
/* Begin autoscroll plugin */
.diva-autoscroll-icon {
float: right;
border-right: none;
background-image: url("../img/plugins/play.png");
}
.diva-autoscroll-prefs {
display: none;
margin-right: .6em;
}
.diva-autoscroll-prefs-text {
float: left;
}
.diva-autoscroll-prefs-input {
float: right;
margin-left: .6em;
}
.diva-autoscroll-pps {
width: 9em;
}
2 changes: 1 addition & 1 deletion build/css/diva.min.css

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions build/demo/autoscroll.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Diva.js Demo Page</title>
<link rel="stylesheet" href="/css/diva.min.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="/js/diva.js" type="text/javascript"></script>
<script src="/js/plugins/autoscroll.js" type="text/javascript"></script>
<script src="/js/utils.js" type="text/javascript"></script>
<style>
body, html{
height:90%;
}
#diva-wrapper{
height:100%;
}
.diva-outer{
height:100%;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#diva-wrapper').diva({
enableAutoHeight: true,
fixedHeightGrid: false,
iipServerURL: "http://diva.simssa.ca/fcgi-bin/iipsrv.fcgi",
objectData: "/demo/beromunster.json",
imageDir: "/srv/images/beromunster",
enableCanvas: true,
enableDownload: true,
enableAutoscroll: true
});
});
</script>
</head>
<body>
<div id="diva-wrapper"></div>
</body>
</html>
Binary file added build/img/plugins/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<li><a href="/demo/single.html">A basic Diva instance. </a></li>
<li><a href="/demo/horizontal_scrolling.html">A demonstration of horizontal scrolling.</a></li>
<li><a href="/demo/highlight.html">A demonstration of the highlight plugin.</a></li>
<li><a href="/demo/autoscroll.html">A demonstration of the autoscroll plugin.</a></li>
</ul>
</body>
</html>
Loading

0 comments on commit 8960ab1

Please sign in to comment.