diff --git a/.gitignore b/.gitignore index 3136ef4b..bd47dd68 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ target/ # Package Files # *.jar *.war -*.ear \ No newline at end of file +*.ear +*.swp +.project +.settings +.classpath diff --git a/.travis.yml b/.travis.yml index bace98f7..cfdf9199 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: java +script: mvn install --quiet -DskipTests=true -P static-resource-optimization + notifications: - email: - - supersonic-dev@googlegroups.com + email: false # blacklist upstream build since they will not have a TravisCI config branches: diff --git a/INSTALL b/INSTALL index 9990ac58..61046c3c 100644 --- a/INSTALL +++ b/INSTALL @@ -8,9 +8,8 @@ Linux First install the packages needed to build Supersonic. It depends on Java and the Maven build environment: - Debian/Ubuntu/Mint -sudo apt-get install maven2 openjdk-6-jdk +sudo apt-get install maven2 openjdk-6-jdk lintian RedHat/Fedora su -c "yum install java-1.6.0-openjdk-devel maven2" @@ -27,8 +26,22 @@ Change directory into the folder which holds the Supersonic source code and run Maven to install a binary package for your distribution: cd + +If you would like to install a specific project only use the following syntax and replace accordingly. +Each project name is specified by its POM file and happens to match the directory name in Supersonic. For instance, +to build the Debian project replace with subsonic-installer-debian. + +mvn -P full -pl -am install + +To build for every available platform do + mvn clean -P full; mvn install -P full +In case of dependency issues, try + +mvn install -P full -U + + Then install the now built binary package for your distribution: diff --git a/pom.xml b/pom.xml index 9903b74c..c1753608 100644 --- a/pom.xml +++ b/pom.xml @@ -4,19 +4,19 @@ 4.0.0 com.github.mach5.supersonic supersonic - 4.7.beta1 + 4.7 Supersonic pom - Mach5 - https://github.com/mach5/supersonic + Der-Jan + https://github.com/Der-Jan/supersonic 2011 - https://github.com/mach5/supersonic - scm:git:git://github.com/mach5/supersonic.git - scm:git:git@github.com:mach5/supersonic.git + https://github.com/Der-Jan/supersonic + scm:git:git://github.com/Der-Jan/supersonic.git + scm:git:git@github.com:Der-Jan/supersonic.git @@ -57,11 +57,14 @@ oss.sonatype.org http://oss.sonatype.org/content/groups/public + + ooo-maven-repo + http://ooo-maven.googlecode.com/hg/repository + subsonic-main - @@ -73,10 +76,87 @@ subsonic-installer-mac subsonic-installer-debian subsonic-installer-rpm + subsonic-backend + subsonic-site subsonic-assembly - + + static-resource-optimization + + + + + net.alchim31.maven + yuicompressor-maven-plugin + 1.1 + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + net.alchim31.maven + yuicompressor-maven-plugin + [1.1,) + + compress + + + + + false + + + + + + net.alchim31.maven + yuicompressor-maven-plugin + [1.1,) + + jslint + + + + + false + + + + + + + + + + + + net.alchim31.maven + yuicompressor-maven-plugin + + + package + + jslint + compress + + + + + true + true + true + + + + + @@ -167,11 +247,6 @@ buildnumber-maven-plugin 1.0 - - net.alchim31.maven - yuicompressor-maven-plugin - 1.1 - com.jayway.maven.plugins.android.generation2 android-maven-plugin @@ -200,36 +275,6 @@ - - - net.alchim31.maven - yuicompressor-maven-plugin - [1.1,) - - compress - - - - - false - - - - - - net.alchim31.maven - yuicompressor-maven-plugin - [1.1,) - - jslint - - - - - false - - - @@ -237,8 +282,8 @@ - + org.apache.maven.plugins @@ -269,24 +314,6 @@ - - net.alchim31.maven - yuicompressor-maven-plugin - - - package - - jslint - compress - - - - - true - true - true - - diff --git a/subsonic-assembly/pom.xml b/subsonic-assembly/pom.xml index f52bbe7b..121c00b5 100644 --- a/subsonic-assembly/pom.xml +++ b/subsonic-assembly/pom.xml @@ -10,7 +10,7 @@ com.github.mach5.supersonic supersonic - 4.7.beta1 + 4.7 diff --git a/subsonic-booter/pom.xml b/subsonic-booter/pom.xml index 186f270e..7f79990a 100644 --- a/subsonic-booter/pom.xml +++ b/subsonic-booter/pom.xml @@ -5,11 +5,10 @@ com.github.mach5.supersonic supersonic-booter Supersonic Booter - com.github.mach5.supersonic supersonic - 4.7.beta1 + 4.7 diff --git a/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/agent/SettingsPanel.java b/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/agent/SettingsPanel.java index 3910303e..7c06a47d 100644 --- a/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/agent/SettingsPanel.java +++ b/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/agent/SettingsPanel.java @@ -61,7 +61,7 @@ public void readValues() { contextPathComboBox.setSelectedItem(getContextPathFromOptionsFile()); int httpsPort = getHttpsPortFromOptionsFile(); boolean httpsEnabled = httpsPort != 0; - httpsPortTextField.setValue(httpsEnabled ? httpsPort : 443); + httpsPortTextField.setValue(httpsEnabled ? httpsPort : 4443); httpsPortTextField.setEnabled(httpsEnabled); httpsPortCheckBox.setSelected(httpsEnabled); } @@ -156,7 +156,7 @@ public void actionPerformed(ActionEvent e) { defaultButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { portTextField.setValue(SubsonicDeployer.DEFAULT_PORT); - httpsPortTextField.setValue(443); + httpsPortTextField.setValue(4443); httpsPortTextField.setEnabled(false); httpsPortCheckBox.setSelected(false); memoryTextField.setValue(SubsonicDeployer.DEFAULT_MEMORY_LIMIT); @@ -273,7 +273,7 @@ public void saveSettings(int memoryLimit, int port, int httpsPort, String contex } private File getOptionsFile() throws SettingsException { - File file = new File("subsonic-service.exe.vmoptions"); + File file = new File("supersonic-service.exe.vmoptions"); if (!file.isFile() || !file.exists()) { throw new SettingsException("File " + file.getAbsolutePath() + " not found."); } diff --git a/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/deployer/SubsonicDeployer.java b/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/deployer/SubsonicDeployer.java index f19ec27e..1156b814 100644 --- a/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/deployer/SubsonicDeployer.java +++ b/subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/deployer/SubsonicDeployer.java @@ -26,7 +26,7 @@ * The following system properties may be used to customize the behaviour: *
    *
  • subsonic.contextPath - The context path at which Subsonic is deployed. Default "/".
  • - *
  • subsonic.port - The port Subsonic will listen to. Default 80.
  • + *
  • subsonic.port - The port Subsonic will listen to. Default 4040.
  • *
  • subsonic.httpsPort - The port Subsonic will listen to for HTTPS. Default 0, which disables HTTPS.
  • *
  • subsonic.war - Subsonic WAR file, or exploded directory. Default "subsonic.war".
  • *
  • subsonic.createLinkFile - If set to "true", a Subsonic.url file is created in the working directory.
  • @@ -39,9 +39,9 @@ public class SubsonicDeployer implements SubsonicDeployerService { public static final String DEFAULT_HOST = "0.0.0.0"; - public static final int DEFAULT_PORT = 80; + public static final int DEFAULT_PORT = 4040; public static final int DEFAULT_HTTPS_PORT = 0; - public static final int DEFAULT_MEMORY_LIMIT = 100; + public static final int DEFAULT_MEMORY_LIMIT = 150; public static final String DEFAULT_CONTEXT_PATH = "/"; public static final String DEFAULT_WAR = "supersonic.war"; private static final int MAX_IDLE_TIME_MILLIS = 7 * 24 * 60 * 60 * 1000; // One week. diff --git a/subsonic-booter/src/main/script/supersonic.sh b/subsonic-booter/src/main/script/supersonic.sh index 4cb10109..9c610eeb 100644 --- a/subsonic-booter/src/main/script/supersonic.sh +++ b/subsonic-booter/src/main/script/supersonic.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ################################################################################### # Shell script for starting Supersonic. See https://github.com/Mach5/supersonic @@ -17,6 +17,7 @@ SUPERSONIC_ARGFILE=${SUPERSONIC_HOME}/supersonic.args SUPERSONIC_DEFAULT_MUSIC_FOLDER=/var/music SUPERSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast SUPERSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists +SUPERSONIC_SOUNDCARD_DEVICE= quiet=0 @@ -45,6 +46,7 @@ usage() { echo " only has effect the first time Supersonic is started. Default '/var/music/Podcast'" echo " --default-playlist-folder=DIR Configure Supersonic to use this folder for playlists. This option " echo " only has effect the first time Supersonic is started. Default '/var/playlists'" + echo " --soundcard-device=DEVICE If provided, use the given soundcard device as output" exit 1 } @@ -82,9 +84,10 @@ start() { # Restarts must persist argument across calls to start() if [ "$1" = "keepargs" ]; then - SUPERSONIC_ARGS=`cat ${SUPERSONIC_ARGFILE}` + mapfile -t SUPERSONIC_ARGS < ${SUPERSONIC_ARGFILE} else - SUPERSONIC_ARGS="-Xmx${SUPERSONIC_MAX_MEMORY}m \ + SUPERSONIC_ARGS=() + SUPERSONIC_ARGS=(-Xmx${SUPERSONIC_MAX_MEMORY}m \ -Dsubsonic.home=${SUPERSONIC_HOME} \ -Dsubsonic.host=${SUPERSONIC_HOST} \ -Dsubsonic.port=${SUPERSONIC_PORT} \ @@ -92,14 +95,15 @@ start() { -Dsubsonic.contextPath=${SUPERSONIC_CONTEXT_PATH} \ -Dsubsonic.defaultMusicFolder=${SUPERSONIC_DEFAULT_MUSIC_FOLDER} \ -Dsubsonic.defaultPodcastFolder=${SUPERSONIC_DEFAULT_PODCAST_FOLDER} \ - -Dsubsonic.defaultPlaylistFolder=${SUPERSONIC_DEFAULT_PLAYLIST_FOLDER} \ - -Djava.awt.headless=true \ + -Dsubsonic.defaultPlaylistFolder=${SUPERSONIC_DEFAULT_PLAYLIST_FOLDER}) + [ "$SUPERSONIC_SOUNDCARD_DEVICE" ] && SUPERSONIC_ARGS+=(-Djavax.sound.sampled.SourceDataLine=#"$SUPERSONIC_SOUNDCARD_DEVICE") + SUPERSONIC_ARGS+=(-Djava.awt.headless=true \ -verbose:gc \ - -jar supersonic-booter-jar-with-dependencies.jar" - echo ${SUPERSONIC_ARGS} > ${SUPERSONIC_ARGFILE} + -jar supersonic-booter-jar-with-dependencies.jar) + echo "${SUPERSONIC_ARGS[@]}" > ${SUPERSONIC_ARGFILE} fi - ${JAVA} ${SUPERSONIC_ARGS} > ${LOG} 2>&1 & + ${JAVA} "${SUPERSONIC_ARGS[@]}" > ${LOG} 2>&1 & # Write pid to pidfile if it is defined. if [ $SUPERSONIC_PIDFILE ]; then @@ -204,6 +208,20 @@ while [ $# -ge 1 ]; do --default-playlist-folder=?*) SUPERSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=} ;; + --soundcard-device=?*) + SUPERSONIC_SOUNDCARD_DEVICE=${1#--soundcard-device=} + # parse remaining arguments for possible device name terms + for TERM in "$@" + do + if [[ $TERM != --* && $TERM != "start" && $TERM != "stop" && $TERM != "restart" && $TERM != "status" ]] + then + SUPERSONIC_SOUNDCARD_DEVICE="$SUPERSONIC_SOUNDCARD_DEVICE $TERM" + elif [[ $TERM != --soundcard-device=* ]] + then + break + fi + done + ;; start) start ;; diff --git a/subsonic-installer-debian/pom.xml b/subsonic-installer-debian/pom.xml index ac854e54..f55dab2a 100644 --- a/subsonic-installer-debian/pom.xml +++ b/subsonic-installer-debian/pom.xml @@ -10,7 +10,7 @@ com.github.mach5.supersonic supersonic - 4.7.beta1 + 4.7 diff --git a/subsonic-installer-debian/src/DEBIAN/control b/subsonic-installer-debian/src/DEBIAN/control index d1ed6b99..627ceaa0 100644 --- a/subsonic-installer-debian/src/DEBIAN/control +++ b/subsonic-installer-debian/src/DEBIAN/control @@ -2,6 +2,7 @@ Package: supersonic Version: @VERSION@ Section: Multimedia Priority: optional +Depends: default-jre-headless Recommends: lame, ffmpeg Architecture: all Maintainer: Timo Reimann diff --git a/subsonic-installer-debian/src/DEBIAN/preinst b/subsonic-installer-debian/src/DEBIAN/preinst index 54f88f5e..5d917b12 100644 --- a/subsonic-installer-debian/src/DEBIAN/preinst +++ b/subsonic-installer-debian/src/DEBIAN/preinst @@ -6,3 +6,10 @@ set -e if [ -e /etc/init.d/supersonic ]; then invoke-rc.d supersonic stop fi + +# Backup database. +if [ -e /var/subsonic/db ]; then + rm -rf /var/subsonic/db.backup + cp -R /var/subsonic/db /var/subsonic/db.backup +fi + diff --git a/subsonic-installer-debian/src/etc/default/supersonic b/subsonic-installer-debian/src/etc/default/supersonic index 40513d95..d4cb073b 100644 --- a/subsonic-installer-debian/src/etc/default/supersonic +++ b/subsonic-installer-debian/src/etc/default/supersonic @@ -9,12 +9,12 @@ # explanation of the different options. # # For example, to specify that Supersonic should use port 80 (for http) -# and 443 (for https), and use a Java memory heap size of 120 MB, use +# and 443 (for https), and use a Java memory heap size of 200 MB, use # the following: # -# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=120" +# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200" -SUBSONIC_ARGS="--max-memory=100" +SUBSONIC_ARGS="--max-memory=150" # The user which should run the Supersonic process. Default "root". @@ -22,4 +22,4 @@ SUBSONIC_ARGS="--max-memory=100" # below 1024. Also make sure to grant the user write permissions in # the music directories, otherwise changing album art and tags will fail. -SUBSONIC_USER=root \ No newline at end of file +SUBSONIC_USER=root diff --git a/subsonic-installer-mac/pom.xml b/subsonic-installer-mac/pom.xml index c3569c8e..6b766777 100644 --- a/subsonic-installer-mac/pom.xml +++ b/subsonic-installer-mac/pom.xml @@ -11,6 +11,7 @@ com.github.mach5.supersonic supersonic 4.7.beta1 + 4.7 @@ -51,20 +52,20 @@ - - - + + + @@ -72,16 +73,16 @@ - - + + - + - + diff --git a/subsonic-installer-mac/src/postinstall.sh b/subsonic-installer-mac/src/postinstall.sh index 95ddc230..4e82ecef 100644 --- a/subsonic-installer-mac/src/postinstall.sh +++ b/subsonic-installer-mac/src/postinstall.sh @@ -1,6 +1,6 @@ #!/bin/bash -SUBSONIC_HOME="/Library/Application Support/Subsonic" +SUBSONIC_HOME="/Library/Application Support/Supersonic" chmod oug+rwx "$SUBSONIC_HOME" chown root:admin "$SUBSONIC_HOME" @@ -10,4 +10,4 @@ chown root:admin "$SUBSONIC_HOME/transcode" rm -rf "$SUBSONIC_HOME/jetty" -echo Subsonic installation done +echo Supersonic installation done diff --git a/subsonic-installer-mac/src/preinstall.sh b/subsonic-installer-mac/src/preinstall.sh index b87ec2e1..318dce64 100755 --- a/subsonic-installer-mac/src/preinstall.sh +++ b/subsonic-installer-mac/src/preinstall.sh @@ -1,4 +1,12 @@ #!/bin/bash -# Placeholder script. Nothing here. +SUBSONIC_HOME="/Library/Application Support/Subsonic" + +# Backup database. +#rm -rf "$SUBSONIC_HOME/jetty" + +if [ -e "$SUBSONIC_HOME/db" ]; then + rm -rf "$SUBSONIC_HOME/db.backup" + cp -R "$SUBSONIC_HOME/db" "$SUBSONIC_HOME/db.backup" +fi diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg-contents.xml b/subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg-contents.xml deleted file mode 100644 index 21cf344f..00000000 --- a/subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg-contents.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - group - owner - - \ No newline at end of file diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/03lame-contents.xml b/subsonic-installer-mac/src/subsonic.pmdoc/03lame-contents.xml deleted file mode 100644 index de4c4c50..00000000 --- a/subsonic-installer-mac/src/subsonic.pmdoc/03lame-contents.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - group - owner - - \ No newline at end of file diff --git a/subsonic-installer-mac/src/subsonic.icns b/subsonic-installer-mac/src/supersonic.icns similarity index 100% rename from subsonic-installer-mac/src/subsonic.icns rename to subsonic-installer-mac/src/supersonic.icns diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/01subsonic-contents.xml b/subsonic-installer-mac/src/supersonic.pmdoc/01supersonic-contents.xml similarity index 71% rename from subsonic-installer-mac/src/subsonic.pmdoc/01subsonic-contents.xml rename to subsonic-installer-mac/src/supersonic.pmdoc/01supersonic-contents.xml index fa7d64db..be051bcb 100644 --- a/subsonic-installer-mac/src/subsonic.pmdoc/01subsonic-contents.xml +++ b/subsonic-installer-mac/src/supersonic.pmdoc/01supersonic-contents.xml @@ -1,6 +1,6 @@ - + mode @@ -16,15 +16,15 @@ - + mode mode - + mode - + mode mode @@ -33,4 +33,4 @@ mode - \ No newline at end of file + diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/01subsonic.xml b/subsonic-installer-mac/src/supersonic.pmdoc/01supersonic.xml similarity index 82% rename from subsonic-installer-mac/src/subsonic.pmdoc/01subsonic.xml rename to subsonic-installer-mac/src/supersonic.pmdoc/01supersonic.xml index 444e9b16..0a916918 100644 --- a/subsonic-installer-mac/src/subsonic.pmdoc/01subsonic.xml +++ b/subsonic-installer-mac/src/supersonic.pmdoc/01supersonic.xml @@ -1,11 +1,11 @@ - net.sourceforge.subsonic.subsonic.Subsonic.pkg + com.github.mach5.supersonic.supersonic.Supersonic.pkg 1.0 - ../target/Subsonic.app + ../target/Supersonic.app /Applications @@ -35,13 +35,13 @@ postinstall.sh - 01subsonic-contents.xml - + 01supersonic-contents.xml + /CVS$ /\.svn$ /\.cvsignore$ /\.cvspass$ /\.DS_Store$ - \ No newline at end of file + diff --git a/subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg-contents.xml b/subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg-contents.xml new file mode 100644 index 00000000..b54ba664 --- /dev/null +++ b/subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg-contents.xml @@ -0,0 +1,7 @@ + + + group + owner + + diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg.xml b/subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg.xml similarity index 82% rename from subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg.xml rename to subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg.xml index 4dc8235d..2e249586 100644 --- a/subsonic-installer-mac/src/subsonic.pmdoc/02ffmpeg.xml +++ b/subsonic-installer-mac/src/supersonic.pmdoc/02ffmpeg.xml @@ -1,12 +1,12 @@ - net.sourceforge.subsonic.subsonic.ffmpeg.pkg + com.github.mach5.supersonic.supersonic.ffmpeg.pkg 1.0 ../../subsonic-transcode/mac/ffmpeg - /Library/Application Support/Subsonic/transcode + /Library/Application Support/Supersonic/transcode @@ -26,4 +26,4 @@ /\.cvspass$ /\.DS_Store$ - \ No newline at end of file + diff --git a/subsonic-installer-mac/src/supersonic.pmdoc/03lame-contents.xml b/subsonic-installer-mac/src/supersonic.pmdoc/03lame-contents.xml new file mode 100644 index 00000000..985a5704 --- /dev/null +++ b/subsonic-installer-mac/src/supersonic.pmdoc/03lame-contents.xml @@ -0,0 +1,7 @@ + + + group + owner + + diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/03lame.xml b/subsonic-installer-mac/src/supersonic.pmdoc/03lame.xml similarity index 81% rename from subsonic-installer-mac/src/subsonic.pmdoc/03lame.xml rename to subsonic-installer-mac/src/supersonic.pmdoc/03lame.xml index 35c04391..295321bf 100644 --- a/subsonic-installer-mac/src/subsonic.pmdoc/03lame.xml +++ b/subsonic-installer-mac/src/supersonic.pmdoc/03lame.xml @@ -1,12 +1,12 @@ - net.sourceforge.subsonic.subsonic.lame.pkg + com.github.mach5.supersonic.supersonic.lame.pkg 1.0 ../../subsonic-transcode/mac/lame - /Library/Application Support/Subsonic/transcode + /Library/Application Support/Supersonic/transcode @@ -24,4 +24,4 @@ /\.cvspass$ /\.DS_Store$ - \ No newline at end of file + diff --git a/subsonic-installer-mac/src/subsonic.pmdoc/index.xml b/subsonic-installer-mac/src/supersonic.pmdoc/index.xml similarity index 62% rename from subsonic-installer-mac/src/subsonic.pmdoc/index.xml rename to subsonic-installer-mac/src/supersonic.pmdoc/index.xml index 309ef92b..a471eb03 100644 --- a/subsonic-installer-mac/src/subsonic.pmdoc/index.xml +++ b/subsonic-installer-mac/src/supersonic.pmdoc/index.xml @@ -1,8 +1,8 @@ - Subsonic - /Users/sindre/Projects/subsonic/subsonic-installer-mac/target/Subsonic.pkg - net.sourceforge.subsonic + Supersonic + ../target/Supersonic.pkg + com.github.mach5.supersonic @@ -12,23 +12,23 @@ - - + + - + - + - subsonic.icns + supersonic.icns - 01subsonic.xml + 01supersonic.xml 02ffmpeg.xml 03lame.xml properties.title @@ -36,4 +36,4 @@ description properties.anywhereDomain properties.systemDomain - \ No newline at end of file + diff --git a/subsonic-installer-rpm/pom.xml b/subsonic-installer-rpm/pom.xml index 25b3f668..448f5f9a 100644 --- a/subsonic-installer-rpm/pom.xml +++ b/subsonic-installer-rpm/pom.xml @@ -10,7 +10,7 @@ com.github.mach5.supersonic supersonic - 4.7.beta1 + 4.7 diff --git a/subsonic-installer-rpm/src/etc/init.d/supersonic b/subsonic-installer-rpm/src/etc/init.d/supersonic index a0c152ef..c996b3da 100644 --- a/subsonic-installer-rpm/src/etc/init.d/supersonic +++ b/subsonic-installer-rpm/src/etc/init.d/supersonic @@ -58,7 +58,7 @@ do_start() [ -e /tmp/supersonic ] && chown -R $SUPERSONIC_USER /tmp/supersonic echo $"Starting $NAME ..." - su -c "$DAEMON $DAEMON_ARGS" $SUPERSONIC_USER + su -c "$DAEMON $DAEMON_ARGS start" $SUPERSONIC_USER RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $LOCKFILE diff --git a/subsonic-installer-rpm/src/supersonic.service b/subsonic-installer-rpm/src/supersonic.service new file mode 100644 index 00000000..51837e71 --- /dev/null +++ b/subsonic-installer-rpm/src/supersonic.service @@ -0,0 +1,60 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/supersonic.service", +# containing +# .include /lib/systemd/system/supersonic.service +# ...make your changes here... +# For more info about custom unit files, see +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F + +# For example, if you want to change the server's HTTPS port number to 4043, +# create a file named "/etc/systemd/system/supersonic.service" containing: +# .include /lib/systemd/system/supersonic.service +# [Service] +# Environment=HTTPS_PORT=4043 +# This will override the setting appearing below. + +# Note: do not use a PGDATA pathname containing spaces, or you will +# break supersonic-setup. + +# Note: in F-17 and beyond, /usr/lib/... is recommended in the .include line +# though /lib/... will still work. + +[Unit] +Description=SuperSonic media server +After=network.target + +[Service] + +# Common customisations. +Environment=SUPERSONIC_HOME=/var/supersonic +Environment=SUPERSONIC_HOST=0.0.0.0 +Environment=SUPERSONIC_PORT=4040 +Environment=SUPERSONIC_HTTPS_PORT=4043 +Environment=SUPERSONIC_CONTEXT_PATH=/ +Environment=SUPERSONIC_MAX_MEMORY=100 +Environment=SUPERSONIC_DEFAULT_MUSIC_FOLDER=/var/music +Environment=SUPERSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast +Environment=SUPERSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists +Environment=SUPERSONIC_LOGFILE=${SUPERSONIC_HOME}/supersonic_sh.log + +# NOTE: If you uncomment this do not forget to adjust the sound card +#Environment=SUPERSONIC_SOUNDCARD_ARGS=-Djavax.sound.sampled.SourceDataLine=#aw0 + +# User and Group +User=supersonic +Group=supersonic + +WorkingDirectory=/usr/share/supersonic + +### PREREQ: +# +# /usr/bin/mkdir -f /tmp/supersonic /var/supersonic +# /usr/bin/chown -R ${SUPERSONIC_USER}.${SUPERSONIC_USER} /tmp/supersonic /var/supersonic +# + +# Daemon +ExecStart=/bin/bash -c "exec /usr/bin/java -Xmx${SUPERSONIC_MAX_MEMORY}m -Dsubsonic.home=${SUPERSONIC_HOME} -Dsubsonic.host=${SUPERSONIC_HOST} -Dsubsonic.port=${SUPERSONIC_PORT} -Dsubsonic.httpsPort=${SUPERSONIC_HTTPS_PORT} -Dsubsonic.contextPath=${SUPERSONIC_CONTEXT_PATH} -Dsubsonic.defaultMusicFolder=${SUPERSONIC_DEFAULT_MUSIC_FOLDER} -Dsubsonic.defaultPodcastFolder=${SUPERSONIC_DEFAULT_PODCAST_FOLDER} -Dsubsonic.defaultPlaylistFolder=${SUPERSONIC_DEFAULT_PLAYLIST_FOLDER} ${SUPERSONIC_SOUNDCARD_ARGS} -Djava.awt.headless=true -verbose:gc -jar supersonic-booter-jar-with-dependencies.jar > ${SUPERSONIC_LOGFILE} 2>&1" + +[Install] +WantedBy=multi-user.target diff --git a/subsonic-installer-rpm/src/supersonic.spec b/subsonic-installer-rpm/src/supersonic.spec index 5c06a3fd..15825e1e 100644 --- a/subsonic-installer-rpm/src/supersonic.spec +++ b/subsonic-installer-rpm/src/supersonic.spec @@ -6,6 +6,7 @@ Summary: A web-based music streamer, jukebox and Podcast receiver Group: Applications/Multimedia License: GPLv3 URL: http://subsonic.org +Obsoletes: subsonic %description Supersonic is a web-based music streamer, jukebox and Podcast receiver, @@ -15,9 +16,11 @@ from home. Apps for Android, iPhone and Windows Phone are also available. -Java 1.6 or higher is required to run Subsonic. +Java 1.6 or higher is required to run Supersonic. +Supersonic is a free clone of Subsonic. Subsonic can be found at http://subsonic.org +Supersonic can be found at https://github.com/Mach5/supersonic %files %defattr(644,root,root,755) @@ -31,6 +34,10 @@ Subsonic can be found at http://subsonic.org %pre # Stop Subsonic service. +if [ -e /etc/init.d/subsonic ]; then + service subsonic stop +fi +# Stop Supersonic service. if [ -e /etc/init.d/supersonic ]; then service supersonic stop fi @@ -38,18 +45,18 @@ fi exit 0 %post -ln -sf /usr/share/subsonic/subsonic.sh /usr/bin/subsonic -chmod 750 /var/subsonic +ln -sf /usr/share/supersonic/supersonic.sh /usr/bin/supersonic +chmod 750 /var/supersonic # Clear jetty cache. -rm -rf /var/subsonic/jetty +rm -rf /var/supersonic/jetty # For SELinux: Set security context -chcon -t java_exec_t /etc/init.d/subsonic 2>/dev/null +chcon -t java_exec_t /etc/init.d/supersonic 2>/dev/null -# Configure and start Subsonic service. -chkconfig --add subsonic -service subsonic start +# Configure and start Supersonic service. +chkconfig --add supersonic +service supersonic start exit 0 @@ -58,13 +65,13 @@ exit 0 if [ $1 = 0 ] ; then # Stop the service. - [ -e /etc/init.d/subsonic ] && service subsonic stop + [ -e /etc/init.d/supersonic ] && service supersonic stop # Remove symlink. - rm -f /usr/bin/subsonic + rm -f /usr/bin/supersonic # Remove startup scripts. - chkconfig --del subsonic + chkconfig --del supersonic fi diff --git a/subsonic-installer-windows/pom.xml b/subsonic-installer-windows/pom.xml index 86dbcb29..4b37b52e 100644 --- a/subsonic-installer-windows/pom.xml +++ b/subsonic-installer-windows/pom.xml @@ -1,119 +1,119 @@ - - - 4.0.0 - com.github.mach5.supersonic - supersonic-installer-windows - pom - Supersonic Installer for Windows - - - com.github.mach5.supersonic - supersonic - 4.7.beta1 - - - - c:/Program Files/exe4j - c:/Program Files/NSIS - - - - - - com.github.mach5.supersonic - supersonic-main - ${project.version} - war - - - - com.github.mach5.supersonic - supersonic-booter - ${project.version} - - - - - - - - windows - - - windows - - - - - - - maven-antrun-plugin - - - exe4j - compile - - - Compiling exe4j... - - - - - - - - - - - - - - - - - - - run - - - - - nsis - compile - - - Compiling NSIS script... - - - - - - - - - run - - - - - - - com.github.github - downloads-maven-plugin - 0.4 - - Supersonic ${project.version}-SNAPSHOT Windows Installer - true - - *-setup.exe - - - - - - - - - - + + + 4.0.0 + com.github.mach5.supersonic + supersonic-installer-windows + pom + Supersonic Installer for Windows + + + com.github.mach5.supersonic + supersonic + 4.7 + + + + c:/Program Files/exe4j + c:/Program Files/NSIS + + + + + + com.github.mach5.supersonic + supersonic-main + ${project.version} + war + + + + com.github.mach5.supersonic + supersonic-booter + ${project.version} + + + + + + + + windows + + + windows + + + + + + + maven-antrun-plugin + + + exe4j + compile + + + Compiling exe4j... + + + + + + + + + + + + + + + + + + + run + + + + + nsis + compile + + + Compiling NSIS script... + + + + + + + + + run + + + + + + + com.github.github + downloads-maven-plugin + 0.4 + + Supersonic ${project.version}-SNAPSHOT Windows Installer + true + + *-setup.exe + + + + + + + + + + diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe.vmoptions b/subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe.vmoptions similarity index 88% rename from subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe.vmoptions rename to subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe.vmoptions index 2f8294cc..291ff123 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe.vmoptions +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe.vmoptions @@ -1 +1 @@ --Xmx16m +-Xmx16m diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe4j b/subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe4j similarity index 75% rename from subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe4j rename to subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe4j index 82b72987..c0d221ca 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-agent-elevated.exe4j +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-agent-elevated.exe4j @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe.vmoptions b/subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe.vmoptions similarity index 88% rename from subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe.vmoptions rename to subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe.vmoptions index 2f8294cc..291ff123 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe.vmoptions +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe.vmoptions @@ -1 +1 @@ --Xmx16m +-Xmx16m diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe4j b/subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe4j similarity index 98% rename from subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe4j rename to subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe4j index d139e154..3d93b212 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-agent.exe4j +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-agent.exe4j @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-service.exe.vmoptions b/subsonic-installer-windows/src/main/exe4j/supersonic-service.exe.vmoptions similarity index 71% rename from subsonic-installer-windows/src/main/exe4j/subsonic-service.exe.vmoptions rename to subsonic-installer-windows/src/main/exe4j/supersonic-service.exe.vmoptions index 6d0fbb1b..72a857fe 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-service.exe.vmoptions +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-service.exe.vmoptions @@ -1,6 +1,6 @@ --Xmx100m --verbose:gc --Dsubsonic.host=0.0.0.0 --Dsubsonic.port=80 --Dsubsonic.httpsPort=0 --Dsubsonic.contextPath=/ +-Xmx150m +-verbose:gc +-Dsubsonic.host=0.0.0.0 +-Dsubsonic.port=4040 +-Dsubsonic.httpsPort=0 +-Dsubsonic.contextPath=/ diff --git a/subsonic-installer-windows/src/main/exe4j/subsonic-service.exe4j b/subsonic-installer-windows/src/main/exe4j/supersonic-service.exe4j similarity index 98% rename from subsonic-installer-windows/src/main/exe4j/subsonic-service.exe4j rename to subsonic-installer-windows/src/main/exe4j/supersonic-service.exe4j index d449a5eb..0de5f913 100644 --- a/subsonic-installer-windows/src/main/exe4j/subsonic-service.exe4j +++ b/subsonic-installer-windows/src/main/exe4j/supersonic-service.exe4j @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/subsonic-installer-windows/src/main/nsis/subsonic.nsi b/subsonic-installer-windows/src/main/nsis/supersonic.nsi similarity index 88% rename from subsonic-installer-windows/src/main/nsis/subsonic.nsi rename to subsonic-installer-windows/src/main/nsis/supersonic.nsi index b5528f20..14851a24 100644 --- a/subsonic-installer-windows/src/main/nsis/subsonic.nsi +++ b/subsonic-installer-windows/src/main/nsis/supersonic.nsi @@ -1,203 +1,208 @@ -# subsonic.nsi - -!include "WordFunc.nsh" -!include "MUI.nsh" - -!insertmacro VersionCompare - -# The name of the installer -Name "Supersonic" - -# The default installation directory -InstallDir $PROGRAMFILES\Supersonic - -# Registry key to check for directory (so if you install again, it will -# overwrite the old one automatically) -InstallDirRegKey HKLM "Software\Supersonic" "Install_Dir" - -#-------------------------------- -#Interface Configuration - -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp" -!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Getting Started.html" -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Getting Started document" - -#-------------------------------- -# Pages - -# This page checks for JRE -Page custom CheckInstalledJRE - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_WELCOME -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - -# Languages -!insertmacro MUI_LANGUAGE "English" - -Section "Subsonic" - - SectionIn RO - - # Install for all users - SetShellVarContext "all" - - # Take backup of existing subsonic-service.exe.vmoptions - CopyFiles /SILENT $INSTDIR\subsonic-service.exe.vmoptions $TEMP\subsonic-service.exe.vmoptions - - # Silently uninstall existing version. - ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR' - - # Remove previous Jetty temp directory. - RMDir /r "c:\supersonic\jetty" - - # Set output path to the installation directory. - SetOutPath $INSTDIR - - # Write files. - File ..\..\..\target\supersonic-agent.exe - File ..\..\..\target\subsonic-agent.exe.vmoptions - File ..\..\..\target\supersonic-agent-elevated.exe - File ..\..\..\target\subsonic-agent-elevated.exe.vmoptions - File ..\..\..\target\supersonic-service.exe - File ..\..\..\target\subsonic-service.exe.vmoptions - File ..\..\..\..\subsonic-booter\target\supersonic-booter-jar-with-dependencies.jar - File ..\..\..\..\subsonic-main\README.TXT - File ..\..\..\..\subsonic-main\LICENSE.TXT - File "..\..\..\..\subsonic-main\Getting Started.html" - File ..\..\..\..\subsonic-main\target\supersonic.war - File ..\..\..\..\subsonic-main\target\classes\version.txt - File ..\..\..\..\subsonic-main\target\classes\build_number.txt - - # Write the installation path into the registry - WriteRegStr HKLM SOFTWARE\Supersonic "Install_Dir" "$INSTDIR" - - # Write the uninstall keys for Windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "DisplayName" "Supersonic" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "NoRepair" 1 - WriteUninstaller "uninstall.exe" - - # Restore subsonic-service.exe.vmoptions - CopyFiles /SILENT $TEMP\subsonic-service.exe.vmoptions $INSTDIR\subsonic-service.exe.vmoptions - Delete $TEMP\subsonic-service.exe.vmoptions - - # Write transcoding pack files. - SetOutPath "c:\supersonic\transcode" - File ..\..\..\..\subsonic-transcode\windows\*.* - - # Add Windows Firewall exception. - # (Requires NSIS plugin found on http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin to be installed - # as NSIS_HOME/Plugins/SimpleFC.dll) - SimpleFC::AddApplication "Supersonic Service" "$INSTDIR\supersonic-service.exe" 0 2 "" 1 - SimpleFC::AddApplication "Supersonic Agent" "$INSTDIR\supersonic-agent.exe" 0 2 "" 1 - SimpleFC::AddApplication "Supersonic Agent (Elevated)" "$INSTDIR\supersonic-agent-elevated.exe" 0 2 "" 1 - - # Install and start service. - ExecWait '"$INSTDIR\supersonic-service.exe" -install' - ExecWait '"$INSTDIR\supersonic-service.exe" -start' - - # Start agent. - Exec '"$INSTDIR\supersonic-agent-elevated.exe" -balloon' - -SectionEnd - - -Section "Start Menu Shortcuts" - - CreateDirectory "$SMPROGRAMS\Supersonic" - CreateShortCut "$SMPROGRAMS\Supersonic\Open Supersonic.lnk" "$INSTDIR\supersonic.url" "" "$INSTDIR\supersonic-agent.exe" 0 - CreateShortCut "$SMPROGRAMS\Supersonic\Supersonic Tray Icon.lnk" "$INSTDIR\supersonic-agent.exe" "-balloon" "$INSTDIR\supersonic-agent.exe" 0 - CreateShortCut "$SMPROGRAMS\Supersonic\Start Supersonic Service.lnk" "$INSTDIR\supersonic-service.exe" "-start" "$INSTDIR\supersonic-service.exe" 0 - CreateShortCut "$SMPROGRAMS\Supersonic\Stop Supersonic Service.lnk" "$INSTDIR\supersonic-service.exe" "-stop" "$INSTDIR\supersonic-service.exe" 0 - CreateShortCut "$SMPROGRAMS\Supersonic\Uninstall Supersonic.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 - CreateShortCut "$SMPROGRAMS\Supersonic\Getting Started.lnk" "$INSTDIR\Getting Started.html" "" "$INSTDIR\Getting Started.html" 0 - - CreateShortCut "$SMSTARTUP\Supersonic.lnk" "$INSTDIR\supersonic-agent.exe" "" "$INSTDIR\supersonic-agent.exe" 0 - -SectionEnd - - -# Uninstaller - -Section "Uninstall" - - # Uninstall for all users - SetShellVarContext "all" - - # Stop and uninstall service if present. - ExecWait '"$INSTDIR\supersonic-service.exe" -stop' - ExecWait '"$INSTDIR\supersonic-service.exe" -uninstall' - - # Stop agent by killing it. - # (Requires NSIS plugin found on http://nsis.sourceforge.net/Processes_plug-in to be installed - # as NSIS_HOME/Plugins/Processes.dll) - Processes::KillProcess "supersonic-agent" - Processes::KillProcess "supersonic-agent-elevated" - Processes::KillProcess "ffmpeg" - Processes::KillProcess "lame" - - # Remove registry keys - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" - DeleteRegKey HKLM SOFTWARE\Supersonic - - # Remove files. - Delete "$SMSTARTUP\Supersonic.lnk" - RMDir /r "$SMPROGRAMS\Supersonic" - Delete "$INSTDIR\build_number.txt" - Delete "$INSTDIR\elevate.exe" - Delete "$INSTDIR\Getting Started.html" - Delete "$INSTDIR\LICENSE.TXT" - Delete "$INSTDIR\README.TXT" - Delete "$INSTDIR\supersonic.url" - Delete "$INSTDIR\supersonic.war" - Delete "$INSTDIR\supersonic-agent.exe" - Delete "$INSTDIR\subsonic-agent.exe.vmoptions" - Delete "$INSTDIR\supersonic-agent-elevated.exe" - Delete "$INSTDIR\subsonic-agent-elevated.exe.vmoptions" - Delete "$INSTDIR\supersonic-booter-jar-with-dependencies.jar" - Delete "$INSTDIR\supersonic-service.exe" - Delete "$INSTDIR\subsonic-service.exe.vmoptions" - Delete "$INSTDIR\uninstall.exe" - Delete "$INSTDIR\version.txt" - RMDir /r "$INSTDIR\log" - RMDir "$INSTDIR" - - # Remove Windows Firewall exception. - # (Requires NSIS plugin found on http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin to be installed - # as NSIS_HOME/Plugins/SimpleFC.dll) - SimpleFC::RemoveApplication "$INSTDIR\elevate.exe" - SimpleFC::RemoveApplication "$INSTDIR\supersonic-service.exe" - SimpleFC::RemoveApplication "$INSTDIR\supersonic-agent.exe" - SimpleFC::RemoveApplication "$INSTDIR\supersonic-agent-elevated.exe" - -SectionEnd - - -Function CheckInstalledJRE - # Read the value from the registry into the $0 register - ReadRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" CurrentVersion - - # Check JRE version. At least 1.6 is required. - # $1=0 Versions are equal - # $1=1 Installed version is newer - # $1=2 Installed version is older (or non-existent) - ${VersionCompare} $0 "1.6" $1 - IntCmp $1 2 InstallJRE 0 0 - Return - - InstallJRE: - # Launch Java web installer. - MessageBox MB_OK "Java 6 was not found and will now be installed." - File /oname=$TEMP\jre-setup.exe jre-6u27-windows-i586-iftw.exe - ExecWait '"$TEMP\jre-setup.exe"' $0 - Delete "$TEMP\jre-setup.exe" - -FunctionEnd +# supersonic.nsi + +!include "WordFunc.nsh" +!include "MUI.nsh" + +!insertmacro VersionCompare + +# The name of the installer +Name "Supersonic" + +# The default installation directory +InstallDir $PROGRAMFILES\Supersonic + +# Registry key to check for directory (so if you install again, it will +# overwrite the old one automatically) +InstallDirRegKey HKLM "Software\Supersonic" "Install_Dir" + +#-------------------------------- +#Interface Configuration + +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp" +!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Getting Started.html" +!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Getting Started document" + +#-------------------------------- +# Pages + +# This page checks for JRE +Page custom CheckInstalledJRE + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Languages +!insertmacro MUI_LANGUAGE "English" + +Section "Supersonic" + + SectionIn RO + + # Install for all users + SetShellVarContext "all" + + # Take backup of existing supersonic-service.exe.vmoptions + CopyFiles /SILENT $INSTDIR\supersonic-service.exe.vmoptions $TEMP\supersonic-service.exe.vmoptions + + # Silently uninstall existing version. + ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR' + + # Remove previous Jetty temp directory. + RMDir /r "c:\supersonic\jetty" + + # Backup database. + RMDir /r "c:\supesonic\db.backup" + CreateDirectory "c:\supersonic\db.backup" + CopyFiles /SILENT "c:\supersonic\db\*" "c:\supersonic\db.backup" + + # Set output path to the installation directory. + SetOutPath $INSTDIR + + # Write files. + File ..\..\..\target\supersonic-agent.exe + File ..\..\..\target\supersonic-agent.exe.vmoptions + File ..\..\..\target\supersonic-agent-elevated.exe + File ..\..\..\target\supersonic-agent-elevated.exe.vmoptions + File ..\..\..\target\supersonic-service.exe + File ..\..\..\target\supersonic-service.exe.vmoptions + File ..\..\..\..\subsonic-booter\target\supersonic-booter-jar-with-dependencies.jar + File ..\..\..\..\subsonic-main\README.TXT + File ..\..\..\..\subsonic-main\LICENSE.TXT + File "..\..\..\..\subsonic-main\Getting Started.html" + File ..\..\..\..\subsonic-main\target\supersonic.war + File ..\..\..\..\subsonic-main\target\classes\version.txt + File ..\..\..\..\subsonic-main\target\classes\build_number.txt + + # Write the installation path into the registry + WriteRegStr HKLM SOFTWARE\Supersonic "Install_Dir" "$INSTDIR" + + # Write the uninstall keys for Windows + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "DisplayName" "Supersonic" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" "NoRepair" 1 + WriteUninstaller "uninstall.exe" + + # Restore supersonic-service.exe.vmoptions + CopyFiles /SILENT $TEMP\supersonic-service.exe.vmoptions $INSTDIR\supersonic-service.exe.vmoptions + Delete $TEMP\supersonic-service.exe.vmoptions + + # Write transcoding pack files. + SetOutPath "c:\supersonic\transcode" + File ..\..\..\..\subsonic-transcode\windows\*.* + + # Add Windows Firewall exception. + # (Requires NSIS plugin found on http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin to be installed + # as NSIS_HOME/Plugins/SimpleFC.dll) + SimpleFC::AddApplication "Supersonic Service" "$INSTDIR\supersonic-service.exe" 0 2 "" 1 + SimpleFC::AddApplication "Supersonic Agent" "$INSTDIR\supersonic-agent.exe" 0 2 "" 1 + SimpleFC::AddApplication "Supersonic Agent (Elevated)" "$INSTDIR\supersonic-agent-elevated.exe" 0 2 "" 1 + + # Install and start service. + ExecWait '"$INSTDIR\supersonic-service.exe" -install' + ExecWait '"$INSTDIR\supersonic-service.exe" -start' + + # Start agent. + Exec '"$INSTDIR\supersonic-agent-elevated.exe" -balloon' + +SectionEnd + + +Section "Start Menu Shortcuts" + + CreateDirectory "$SMPROGRAMS\Supersonic" + CreateShortCut "$SMPROGRAMS\Supersonic\Open Supersonic.lnk" "$INSTDIR\supersonic.url" "" "$INSTDIR\supersonic-agent.exe" 0 + CreateShortCut "$SMPROGRAMS\Supersonic\Supersonic Tray Icon.lnk" "$INSTDIR\supersonic-agent.exe" "-balloon" "$INSTDIR\supersonic-agent.exe" 0 + CreateShortCut "$SMPROGRAMS\Supersonic\Start Supersonic Service.lnk" "$INSTDIR\supersonic-service.exe" "-start" "$INSTDIR\supersonic-service.exe" 0 + CreateShortCut "$SMPROGRAMS\Supersonic\Stop Supersonic Service.lnk" "$INSTDIR\supersonic-service.exe" "-stop" "$INSTDIR\supersonic-service.exe" 0 + CreateShortCut "$SMPROGRAMS\Supersonic\Uninstall Supersonic.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\Supersonic\Getting Started.lnk" "$INSTDIR\Getting Started.html" "" "$INSTDIR\Getting Started.html" 0 + + CreateShortCut "$SMSTARTUP\Supersonic.lnk" "$INSTDIR\supersonic-agent.exe" "" "$INSTDIR\supersonic-agent.exe" 0 + +SectionEnd + + +# Uninstaller + +Section "Uninstall" + + # Uninstall for all users + SetShellVarContext "all" + + # Stop and uninstall service if present. + ExecWait '"$INSTDIR\supersonic-service.exe" -stop' + ExecWait '"$INSTDIR\supersonic-service.exe" -uninstall' + + # Stop agent by killing it. + # (Requires NSIS plugin found on http://nsis.sourceforge.net/Processes_plug-in to be installed + # as NSIS_HOME/Plugins/Processes.dll) + Processes::KillProcess "supersonic-agent" + Processes::KillProcess "supersonic-agent-elevated" + Processes::KillProcess "ffmpeg" + Processes::KillProcess "lame" + + # Remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Supersonic" + DeleteRegKey HKLM SOFTWARE\Supersonic + + # Remove files. + Delete "$SMSTARTUP\Supersonic.lnk" + RMDir /r "$SMPROGRAMS\Supersonic" + Delete "$INSTDIR\build_number.txt" + Delete "$INSTDIR\elevate.exe" + Delete "$INSTDIR\Getting Started.html" + Delete "$INSTDIR\LICENSE.TXT" + Delete "$INSTDIR\README.TXT" + Delete "$INSTDIR\supersonic.url" + Delete "$INSTDIR\supersonic.war" + Delete "$INSTDIR\supersonic-agent.exe" + Delete "$INSTDIR\supersonic-agent.exe.vmoptions" + Delete "$INSTDIR\supersonic-agent-elevated.exe" + Delete "$INSTDIR\supersonic-agent-elevated.exe.vmoptions" + Delete "$INSTDIR\supersonic-booter-jar-with-dependencies.jar" + Delete "$INSTDIR\supersonic-service.exe" + Delete "$INSTDIR\supersonic-service.exe.vmoptions" + Delete "$INSTDIR\uninstall.exe" + Delete "$INSTDIR\version.txt" + RMDir /r "$INSTDIR\log" + RMDir "$INSTDIR" + + # Remove Windows Firewall exception. + # (Requires NSIS plugin found on http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin to be installed + # as NSIS_HOME/Plugins/SimpleFC.dll) + SimpleFC::RemoveApplication "$INSTDIR\elevate.exe" + SimpleFC::RemoveApplication "$INSTDIR\supersonic-service.exe" + SimpleFC::RemoveApplication "$INSTDIR\supersonic-agent.exe" + SimpleFC::RemoveApplication "$INSTDIR\supersonic-agent-elevated.exe" + +SectionEnd + + +Function CheckInstalledJRE + # Read the value from the registry into the $0 register + ReadRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" CurrentVersion + + # Check JRE version. At least 1.6 is required. + # $1=0 Versions are equal + # $1=1 Installed version is newer + # $1=2 Installed version is older (or non-existent) + ${VersionCompare} $0 "1.6" $1 + IntCmp $1 2 InstallJRE 0 0 + Return + + InstallJRE: + # Launch Java web installer. + MessageBox MB_OK "Java 6 was not found and will now be installed." + File /oname=$TEMP\jre-setup.exe jre-6u27-windows-i586-iftw.exe + ExecWait '"$TEMP\jre-setup.exe"' $0 + Delete "$TEMP\jre-setup.exe" + +FunctionEnd diff --git a/subsonic-main/Getting Started.html b/subsonic-main/Getting Started.html index e6c467bf..785907da 100644 --- a/subsonic-main/Getting Started.html +++ b/subsonic-main/Getting Started.html @@ -7,6 +7,7 @@ Getting Started with Supersonic - + -
    - -
    + \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/top.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/top.jsp index f2a63ae2..b62eef3b 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/jsp/top.jsp +++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/top.jsp @@ -9,6 +9,7 @@ + @@ -35,6 +36,10 @@ " title="${nowPlaying}" alt="${nowPlaying}">
    ${nowPlaying} + + " title="${starred}" alt="${starred}">
    + ${starred} + " title="${podcast}" alt="${podcast}">
    ${podcast} diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/transcodingSettings.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/transcodingSettings.jsp index a641cb53..8178e17d 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/jsp/transcodingSettings.jsp +++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/transcodingSettings.jsp @@ -2,11 +2,15 @@ <%@ include file="head.jsp" %> + <%@ include file="jquery.jsp" %> + + +
    @@ -52,6 +56,29 @@ + + + + + + + + + + +
    + + + + +
    + + + + +
    + +

    " style="margin-right:0.3em"> " onclick="location.href='nowPlaying.view'" style="margin-right:1.3em"> diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/userSettings.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/userSettings.jsp index e9271563..5d642532 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/jsp/userSettings.jsp +++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/userSettings.jsp @@ -1,9 +1,10 @@ <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%> +<%--@elvariable id="command" type="net.sourceforge.subsonic.command.UserSettingsCommand"--%> <%@ include file="head.jsp" %> + <%@ include file="jquery.jsp" %> - @@ -12,23 +13,24 @@ + @@ -46,7 +46,7 @@ var width = "${model.popout ? '100%' : '600'}"; var height = "${model.popout ? '85%' : '360'}"; - swfobject.embedSWF("", "placeholder1", width, height, "9.0.0", false, flashvars, params, attributes); + swfobject.embedSWF("", "placeholder1", width, height, "9.0.0", false, flashvars, params, attributes); } function playerReady(thePlayer) { diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/wap/loadPlaylist.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/wap/loadPlaylist.jsp index 38a26e6a..2640cce0 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/jsp/wap/loadPlaylist.jsp +++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/wap/loadPlaylist.jsp @@ -12,9 +12,9 @@ - + - ${fn:escapeXml(fn:substringBefore(playlist.name, '.'))}
    + ${fn:escapeXml(playlist.name)}

    diff --git a/subsonic-main/src/main/webapp/WEB-INF/subsonic-servlet.xml b/subsonic-main/src/main/webapp/WEB-INF/subsonic-servlet.xml index 999354a7..101b368e 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/subsonic-servlet.xml +++ b/subsonic-main/src/main/webapp/WEB-INF/subsonic-servlet.xml @@ -30,6 +30,17 @@ + + + + + + + + + + + @@ -66,6 +77,7 @@ + @@ -92,16 +104,15 @@ - + - - - + + @@ -110,21 +121,6 @@ - - - - - - - - - - - - - - - @@ -134,6 +130,14 @@ + + + + + + + + @@ -166,6 +170,9 @@ + + + @@ -247,8 +254,8 @@ - - + + @@ -285,6 +292,10 @@ + + + + @@ -317,6 +328,7 @@ + @@ -332,13 +344,14 @@ + - + @@ -349,6 +362,7 @@ + @@ -359,9 +373,6 @@ - - - @@ -376,6 +387,7 @@ mainController + playlistController helpController lyricsController leftController @@ -383,25 +395,23 @@ statusController moreController uploadController + importPlaylistController + multiController setMusicFileInfoController shareManagementController setRatingController topController - randomPlaylistController - loadPlaylistController - loadPlaylistController - loadPlaylistController - loadPlaylistController - loadPlaylistController - savePlaylistController + randomPlayQueueController changeCoverArtController multiController multiController multiController + multiController multiController multiController videoPlayerController nowPlayingController + starredController searchController settingsController playerSettingsController @@ -420,7 +430,7 @@ allmusicController homeController editTagsController - playlistController + playQueueController coverArtController avatarController proxyController @@ -439,6 +449,7 @@ restController m3uController streamController + hlsController externalPlayerController diff --git a/subsonic-main/src/main/webapp/WEB-INF/web.xml b/subsonic-main/src/main/webapp/WEB-INF/web.xml index 9727fe32..d2391f25 100644 --- a/subsonic-main/src/main/webapp/WEB-INF/web.xml +++ b/subsonic-main/src/main/webapp/WEB-INF/web.xml @@ -58,6 +58,10 @@ subsonic /rest/* + + subsonic + /hls/* + subsonic /share/* @@ -95,6 +99,15 @@ /* + + RESTFilter + net.sourceforge.subsonic.filter.RESTFilter + + + RESTFilter + /rest/* + + RequestEncodingFilter net.sourceforge.subsonic.filter.RequestEncodingFilter @@ -136,17 +149,6 @@ - - The "Expires" HTTP header is set to avoid overly eager browser caching of - pages that implements LastModified. - ExpiresFilter - net.sourceforge.subsonic.filter.ResponseHeaderFilter - - Expires - Thu, 01 Dec 1994 16:00:00 GMT - - - CacheFilter /icons/* @@ -166,7 +168,7 @@ NoCacheFilter - /playlist.view + /playQueue.view NoCacheFilter @@ -185,11 +187,6 @@ /home.view - - ExpiresFilter - /left.view - - AcegiFilter org.acegisecurity.util.FilterToBeanProxy diff --git a/subsonic-main/src/main/webapp/flash/jw-player-5.10.swf b/subsonic-main/src/main/webapp/flash/jw-player-5.10.swf new file mode 100644 index 00000000..c8390978 Binary files /dev/null and b/subsonic-main/src/main/webapp/flash/jw-player-5.10.swf differ diff --git a/subsonic-main/src/main/webapp/flash/jw-player-5.6.swf b/subsonic-main/src/main/webapp/flash/jw-player-5.6.swf deleted file mode 100644 index b98411bb..00000000 Binary files a/subsonic-main/src/main/webapp/flash/jw-player-5.6.swf and /dev/null differ diff --git a/subsonic-main/src/main/webapp/icons/apps.png b/subsonic-main/src/main/webapp/icons/apps.png new file mode 100644 index 00000000..5adc9e9f Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/apps.png differ diff --git a/subsonic-main/src/main/webapp/icons/coolandclean/starred.png b/subsonic-main/src/main/webapp/icons/coolandclean/starred.png new file mode 100644 index 00000000..0d6de44d Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/coolandclean/starred.png differ diff --git a/subsonic-main/src/main/webapp/icons/minisub.png b/subsonic-main/src/main/webapp/icons/minisub.png new file mode 100644 index 00000000..50355bef Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/minisub.png differ diff --git a/subsonic-main/src/main/webapp/icons/star_off_small.png b/subsonic-main/src/main/webapp/icons/star_off_small.png deleted file mode 100644 index 6bc28fce..00000000 Binary files a/subsonic-main/src/main/webapp/icons/star_off_small.png and /dev/null differ diff --git a/subsonic-main/src/main/webapp/icons/star_on.png b/subsonic-main/src/main/webapp/icons/star_on.png deleted file mode 100644 index 49a57b6f..00000000 Binary files a/subsonic-main/src/main/webapp/icons/star_on.png and /dev/null differ diff --git a/subsonic-main/src/main/webapp/icons/star_on_small.png b/subsonic-main/src/main/webapp/icons/star_on_small.png deleted file mode 100644 index d2e38455..00000000 Binary files a/subsonic-main/src/main/webapp/icons/star_on_small.png and /dev/null differ diff --git a/subsonic-main/src/main/webapp/icons/starred.png b/subsonic-main/src/main/webapp/icons/starred.png new file mode 100644 index 00000000..5476c401 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/starred.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/add.png b/subsonic-main/src/main/webapp/icons/subStandard/add.png new file mode 100644 index 00000000..9e7c3d39 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/add.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/android.png b/subsonic-main/src/main/webapp/icons/subStandard/android.png new file mode 100644 index 00000000..367e5e1d Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/android.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/back.png b/subsonic-main/src/main/webapp/icons/subStandard/back.png new file mode 100644 index 00000000..29a7dfb1 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/back.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/background_main.png b/subsonic-main/src/main/webapp/icons/subStandard/background_main.png new file mode 100644 index 00000000..94c21244 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/background_main.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/clear_rating.png b/subsonic-main/src/main/webapp/icons/subStandard/clear_rating.png new file mode 100644 index 00000000..0b08773e Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/clear_rating.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/donate.png b/subsonic-main/src/main/webapp/icons/subStandard/donate.png new file mode 100644 index 00000000..b308cb89 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/donate.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/donate_small.png b/subsonic-main/src/main/webapp/icons/subStandard/donate_small.png new file mode 100644 index 00000000..42cf047c Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/donate_small.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/down.png b/subsonic-main/src/main/webapp/icons/subStandard/down.png new file mode 100644 index 00000000..f7d3bd4e Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/down.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/download.png b/subsonic-main/src/main/webapp/icons/subStandard/download.png new file mode 100644 index 00000000..64187102 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/download.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/error.png b/subsonic-main/src/main/webapp/icons/subStandard/error.png new file mode 100644 index 00000000..d9e16022 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/error.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/facebook.png b/subsonic-main/src/main/webapp/icons/subStandard/facebook.png new file mode 100644 index 00000000..ea905cf1 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/facebook.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/favicon.ico b/subsonic-main/src/main/webapp/icons/subStandard/favicon.ico new file mode 100644 index 00000000..d2c13383 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/favicon.ico differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/forward.png b/subsonic-main/src/main/webapp/icons/subStandard/forward.png new file mode 100644 index 00000000..cf6d679f Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/forward.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/googleplus.png b/subsonic-main/src/main/webapp/icons/subStandard/googleplus.png new file mode 100644 index 00000000..f07cfc0e Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/googleplus.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/help.png b/subsonic-main/src/main/webapp/icons/subStandard/help.png new file mode 100644 index 00000000..4783a987 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/help.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/help_small.png b/subsonic-main/src/main/webapp/icons/subStandard/help_small.png new file mode 100644 index 00000000..f0aa15c3 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/help_small.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/home.png b/subsonic-main/src/main/webapp/icons/subStandard/home.png new file mode 100644 index 00000000..2984a84a Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/home.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/log.png b/subsonic-main/src/main/webapp/icons/subStandard/log.png new file mode 100644 index 00000000..7cda6f73 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/log.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/logo.png b/subsonic-main/src/main/webapp/icons/subStandard/logo.png new file mode 100644 index 00000000..65db730a Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/logo.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/more.png b/subsonic-main/src/main/webapp/icons/subStandard/more.png new file mode 100644 index 00000000..d7efab20 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/more.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/now_playing.png b/subsonic-main/src/main/webapp/icons/subStandard/now_playing.png new file mode 100644 index 00000000..de3cd7c4 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/now_playing.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/paypal.gif b/subsonic-main/src/main/webapp/icons/subStandard/paypal.gif new file mode 100644 index 00000000..d017250a Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/paypal.gif differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/phone.png b/subsonic-main/src/main/webapp/icons/subStandard/phone.png new file mode 100644 index 00000000..dd497911 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/phone.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/play.png b/subsonic-main/src/main/webapp/icons/subStandard/play.png new file mode 100644 index 00000000..796dcec2 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/play.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/playing.png b/subsonic-main/src/main/webapp/icons/subStandard/playing.png new file mode 100644 index 00000000..b8ac3c7b Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/playing.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/podcast.png b/subsonic-main/src/main/webapp/icons/subStandard/podcast.png new file mode 100644 index 00000000..2a3adaf0 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/podcast.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/podcast_small.png b/subsonic-main/src/main/webapp/icons/subStandard/podcast_small.png new file mode 100644 index 00000000..07665e82 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/podcast_small.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/progress.png b/subsonic-main/src/main/webapp/icons/subStandard/progress.png new file mode 100644 index 00000000..ddd5a913 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/progress.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/random.png b/subsonic-main/src/main/webapp/icons/subStandard/random.png new file mode 100644 index 00000000..ded729ee Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/random.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/rating_half.png b/subsonic-main/src/main/webapp/icons/subStandard/rating_half.png new file mode 100644 index 00000000..ced9f2c2 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/rating_half.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/rating_off.png b/subsonic-main/src/main/webapp/icons/subStandard/rating_off.png new file mode 100644 index 00000000..6f30c3b1 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/rating_off.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/rating_on.png b/subsonic-main/src/main/webapp/icons/subStandard/rating_on.png new file mode 100644 index 00000000..c6594255 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/rating_on.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/remove.png b/subsonic-main/src/main/webapp/icons/subStandard/remove.png new file mode 100644 index 00000000..134da490 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/remove.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/search.png b/subsonic-main/src/main/webapp/icons/subStandard/search.png new file mode 100644 index 00000000..159a365a Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/search.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/settings.png b/subsonic-main/src/main/webapp/icons/subStandard/settings.png new file mode 100644 index 00000000..e909f36a Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/settings.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/starred.png b/subsonic-main/src/main/webapp/icons/subStandard/starred.png new file mode 100644 index 00000000..5aa44c7b Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/starred.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/status.png b/subsonic-main/src/main/webapp/icons/subStandard/status.png new file mode 100644 index 00000000..36716692 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/status.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/twitter.png b/subsonic-main/src/main/webapp/icons/subStandard/twitter.png new file mode 100644 index 00000000..24cbc202 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/twitter.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/up.png b/subsonic-main/src/main/webapp/icons/subStandard/up.png new file mode 100644 index 00000000..3a1827f1 Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/up.png differ diff --git a/subsonic-main/src/main/webapp/icons/subStandard/upload.png b/subsonic-main/src/main/webapp/icons/subStandard/upload.png new file mode 100644 index 00000000..586c274f Binary files /dev/null and b/subsonic-main/src/main/webapp/icons/subStandard/upload.png differ diff --git a/subsonic-main/src/main/webapp/mini/MIT-license.txt b/subsonic-main/src/main/webapp/mini/MIT-license.txt new file mode 100644 index 00000000..d31b1065 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/MIT-license.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2011-2012 Trevor Squillario https://github.com/tsquillario/MiniSub + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/README b/subsonic-main/src/main/webapp/mini/README new file mode 100644 index 00000000..24929117 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/README @@ -0,0 +1,18 @@ +MiniSub - HTML5 Mini Player for Subsonic + +Imagine you can stream all your music from home, to any device, where ever you are. That is Subsonic! Now imagine having a Web App to stream your music that is as beautiful and well designed as it is functional, that is MiniSub! + +MiniSub is an HTML5 Mini Player for the Subsonic streaming server. + +Features +- Flexible Layout (will scale to whatever size your browser window is) +- Customizable (features can be turned on/off and settings are saved) +- Keyboard shortcuts (back, forward, play/pause, skip to artist) +- Playlists (create new, add to existing, delete) +- Artist/Album Ratings +- Chat and Now Playing +- Last.fm + +You will need a Subsonic server to be able to play your own music. Subsonic is a free, web-based media streamer, providing ubiquitous access to your music. Use it to share your music with friends, or to listen to your own music while at work. Please see http://www.subsonic.org + +Change Log inside... \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/images/ajax-loader.gif b/subsonic-main/src/main/webapp/mini/images/ajax-loader.gif new file mode 100644 index 00000000..09d621ed Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/ajax-loader.gif differ diff --git a/subsonic-main/src/main/webapp/mini/images/albumdefault_120.jpg b/subsonic-main/src/main/webapp/mini/images/albumdefault_120.jpg new file mode 100644 index 00000000..71b34791 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/albumdefault_120.jpg differ diff --git a/subsonic-main/src/main/webapp/mini/images/albumdefault_25.jpg b/subsonic-main/src/main/webapp/mini/images/albumdefault_25.jpg new file mode 100644 index 00000000..0e6e4f59 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/albumdefault_25.jpg differ diff --git a/subsonic-main/src/main/webapp/mini/images/albumdefault_50.jpg b/subsonic-main/src/main/webapp/mini/images/albumdefault_50.jpg new file mode 100644 index 00000000..0d32d88f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/albumdefault_50.jpg differ diff --git a/subsonic-main/src/main/webapp/mini/images/albumdefault_56.jpg b/subsonic-main/src/main/webapp/mini/images/albumdefault_56.jpg new file mode 100644 index 00000000..fd41c873 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/albumdefault_56.jpg differ diff --git a/subsonic-main/src/main/webapp/mini/images/albumdefault_60.jpg b/subsonic-main/src/main/webapp/mini/images/albumdefault_60.jpg new file mode 100644 index 00000000..8d4daa46 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/albumdefault_60.jpg differ diff --git a/subsonic-main/src/main/webapp/mini/images/arrow_down_8x8.png b/subsonic-main/src/main/webapp/mini/images/arrow_down_8x8.png new file mode 100644 index 00000000..04872385 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/arrow_down_8x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/arrow_left_gl_12x12.png b/subsonic-main/src/main/webapp/mini/images/arrow_left_gl_12x12.png new file mode 100644 index 00000000..5619aabe Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/arrow_left_gl_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/arrow_right_gl_12x12.png b/subsonic-main/src/main/webapp/mini/images/arrow_right_gl_12x12.png new file mode 100644 index 00000000..fae3d98f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/arrow_right_gl_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/asc.gif b/subsonic-main/src/main/webapp/mini/images/asc.gif new file mode 100644 index 00000000..74157867 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/asc.gif differ diff --git a/subsonic-main/src/main/webapp/mini/images/bg.gif b/subsonic-main/src/main/webapp/mini/images/bg.gif new file mode 100644 index 00000000..fac668fc Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/bg.gif differ diff --git a/subsonic-main/src/main/webapp/mini/images/chat_alt_stroke_12x12.png b/subsonic-main/src/main/webapp/mini/images/chat_alt_stroke_12x12.png new file mode 100644 index 00000000..652334bb Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/chat_alt_stroke_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/check_8x7.png b/subsonic-main/src/main/webapp/mini/images/check_8x7.png new file mode 100644 index 00000000..35a3ef20 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/check_8x7.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/cog_16x16.png b/subsonic-main/src/main/webapp/mini/images/cog_16x16.png new file mode 100644 index 00000000..a1221bf9 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/cog_16x16.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/comment_stroke_12x11.png b/subsonic-main/src/main/webapp/mini/images/comment_stroke_12x11.png new file mode 100644 index 00000000..9f46bd30 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/comment_stroke_12x11.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/comment_stroke_gl_12x11.png b/subsonic-main/src/main/webapp/mini/images/comment_stroke_gl_12x11.png new file mode 100644 index 00000000..9bcac043 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/comment_stroke_gl_12x11.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/desc.gif b/subsonic-main/src/main/webapp/mini/images/desc.gif new file mode 100644 index 00000000..3b30b3c5 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/desc.gif differ diff --git a/subsonic-main/src/main/webapp/mini/images/download_gd_9x12.png b/subsonic-main/src/main/webapp/mini/images/download_gd_9x12.png new file mode 100644 index 00000000..622857b9 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/download_gd_9x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/download_gl_9x12.png b/subsonic-main/src/main/webapp/mini/images/download_gl_9x12.png new file mode 100644 index 00000000..95d4e396 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/download_gl_9x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/first_12x12.png b/subsonic-main/src/main/webapp/mini/images/first_12x12.png new file mode 100644 index 00000000..f4cbc8fe Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/first_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/first_24x24.png b/subsonic-main/src/main/webapp/mini/images/first_24x24.png new file mode 100644 index 00000000..570d4dfb Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/first_24x24.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/first_32x32.png b/subsonic-main/src/main/webapp/mini/images/first_32x32.png new file mode 100644 index 00000000..98936fc9 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/first_32x32.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/fork_11x12.png b/subsonic-main/src/main/webapp/mini/images/fork_11x12.png new file mode 100644 index 00000000..397fd927 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/fork_11x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/hash_gd_14x16.png b/subsonic-main/src/main/webapp/mini/images/hash_gd_14x16.png new file mode 100644 index 00000000..a57d3ed8 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/hash_gd_14x16.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/headphones_gd_16x14.png b/subsonic-main/src/main/webapp/mini/images/headphones_gd_16x14.png new file mode 100644 index 00000000..92cc7a25 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/headphones_gd_16x14.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/last_12x12.png b/subsonic-main/src/main/webapp/mini/images/last_12x12.png new file mode 100644 index 00000000..bcf9d6e3 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/last_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/last_24x24.png b/subsonic-main/src/main/webapp/mini/images/last_24x24.png new file mode 100644 index 00000000..e45a67ea Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/last_24x24.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/last_32x32.png b/subsonic-main/src/main/webapp/mini/images/last_32x32.png new file mode 100644 index 00000000..9663f0e3 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/last_32x32.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/layers_alt_gd_12x12.png b/subsonic-main/src/main/webapp/mini/images/layers_alt_gd_12x12.png new file mode 100644 index 00000000..597f0944 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/layers_alt_gd_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/layers_alt_gl_12x12.png b/subsonic-main/src/main/webapp/mini/images/layers_alt_gl_12x12.png new file mode 100644 index 00000000..ce8a6356 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/layers_alt_gl_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/list_gd_16x14.png b/subsonic-main/src/main/webapp/mini/images/list_gd_16x14.png new file mode 100644 index 00000000..5d46c848 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/list_gd_16x14.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/magnifying_glass_alt_12x12.png b/subsonic-main/src/main/webapp/mini/images/magnifying_glass_alt_12x12.png new file mode 100644 index 00000000..ef83f1fe Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/magnifying_glass_alt_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/minus_8x2.png b/subsonic-main/src/main/webapp/mini/images/minus_8x2.png new file mode 100644 index 00000000..fa248268 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/minus_8x2.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/minus_gl_8x2.png b/subsonic-main/src/main/webapp/mini/images/minus_gl_8x2.png new file mode 100644 index 00000000..4cdb3bac Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/minus_gl_8x2.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/move_horizontal_3x8.png b/subsonic-main/src/main/webapp/mini/images/move_horizontal_3x8.png new file mode 100644 index 00000000..30ee416a Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/move_horizontal_3x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/new_window_12x12.png b/subsonic-main/src/main/webapp/mini/images/new_window_12x12.png new file mode 100644 index 00000000..17466da3 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/new_window_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/pause_24x32.png b/subsonic-main/src/main/webapp/mini/images/pause_24x32.png new file mode 100644 index 00000000..c17f9e8e Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/pause_24x32.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/play_24x32.png b/subsonic-main/src/main/webapp/mini/images/play_24x32.png new file mode 100644 index 00000000..8a2c534a Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/play_24x32.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/play_6x8.png b/subsonic-main/src/main/webapp/mini/images/play_6x8.png new file mode 100644 index 00000000..46d333c1 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/play_6x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/play_alt_8x8.png b/subsonic-main/src/main/webapp/mini/images/play_alt_8x8.png new file mode 100644 index 00000000..64e01a12 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/play_alt_8x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/play_alt_gd_16x16.png b/subsonic-main/src/main/webapp/mini/images/play_alt_gd_16x16.png new file mode 100644 index 00000000..c7637093 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/play_alt_gd_16x16.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/play_gl_6x8.png b/subsonic-main/src/main/webapp/mini/images/play_gl_6x8.png new file mode 100644 index 00000000..f88955de Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/play_gl_6x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/plus_12x12.png b/subsonic-main/src/main/webapp/mini/images/plus_12x12.png new file mode 100644 index 00000000..adb0e84c Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/plus_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/plus_16x16.png b/subsonic-main/src/main/webapp/mini/images/plus_16x16.png new file mode 100644 index 00000000..47f4a8cb Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/plus_16x16.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/plus_8x8.png b/subsonic-main/src/main/webapp/mini/images/plus_8x8.png new file mode 100644 index 00000000..336c52db Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/plus_8x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/plus_gl_8x8.png b/subsonic-main/src/main/webapp/mini/images/plus_gl_8x8.png new file mode 100644 index 00000000..8eaae004 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/plus_gl_8x8.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/reload_9x11.png b/subsonic-main/src/main/webapp/mini/images/reload_9x11.png new file mode 100644 index 00000000..1378ed8f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/reload_9x11.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/rss_12x12.png b/subsonic-main/src/main/webapp/mini/images/rss_12x12.png new file mode 100644 index 00000000..2514b688 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/rss_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_lg_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_lg_12x12.png new file mode 100644 index 00000000..1b0c962e Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_lg_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_lgo_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_lgo_12x12.png new file mode 100644 index 00000000..82ec22ab Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_lgo_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_w_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_w_12x12.png new file mode 100644 index 00000000..81b770cb Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_w_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_wo_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_wo_12x12.png new file mode 100644 index 00000000..04cd5636 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_wo_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_y_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_y_12x12.png new file mode 100644 index 00000000..5dd2695e Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_y_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/star_yo_12x12.png b/subsonic-main/src/main/webapp/mini/images/star_yo_12x12.png new file mode 100644 index 00000000..a1720147 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/star_yo_12x12.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/subsonic-36.png b/subsonic-main/src/main/webapp/mini/images/subsonic-36.png new file mode 100644 index 00000000..45d2f615 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/subsonic-36.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.ico b/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.ico new file mode 100644 index 00000000..8090bbe1 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.ico differ diff --git a/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.png b/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.png new file mode 100644 index 00000000..6bc0ad7b Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/subsonic_32x32.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/subsonic_48x48.png b/subsonic-main/src/main/webapp/mini/images/subsonic_48x48.png new file mode 100644 index 00000000..0816ce96 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/subsonic_48x48.png differ diff --git a/subsonic-main/src/main/webapp/mini/images/x_11x11.png b/subsonic-main/src/main/webapp/mini/images/x_11x11.png new file mode 100644 index 00000000..f9310ca5 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/images/x_11x11.png differ diff --git a/subsonic-main/src/main/webapp/mini/index.html b/subsonic-main/src/main/webapp/mini/index.html new file mode 100644 index 00000000..ca0137ca --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/index.html @@ -0,0 +1,338 @@ + + + + + Subsonic - MiniSub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    + + + +
    +
    +
    + All + None + + Playlist + + + Current + +All + +
    + + + +
    +
    +
    +
    +
    + +
      +
    • Auto Albums
    • +
    • Recently Added
    • +
    • Random
    • +
    • Top Rated
    • +
    • Recently Played
    • +
    • Most Played
    • +
    +
      +
      +
        +
        + + + +
        +
        + +
        +
        +
        + + Empty +
        +
        + All + None + + Playlist + +
        +
        + + + +
        +
        +
        +
        +
        + +
        + +
        +
        +
        +
        +
        +
          +
        • Auto Playlists
        • +
        • Random
        • +
        +
        • Saved Playlists
        +
          +
          +
          + + + +
          +
          +
          +
          +
          + Reset + Save +
          +
          +
          +
          +

          Login

          +
          +
          +
          +
          +
          +
          +
          +
          +

          Keyboard Shortcuts

          +
            +
          • [a-z] Use to Quickly Browse to an Artist
          • +
          • Home Scroll to Top of Artist List
          • +
          • Spacebar Play/Pause
          • +
          • Next Track
          • +
          • Previous Track
          • +
          • +
          +
          +
          +
          +

          Options

          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          + +
          +
          + +
          +
          + +
          +
          + +
          +
          + +
          +
          +

          Change Log

          +
            + +
          • 5/22/2012 - 2.0.1 + Drag and drop sorting for Current and all other Playlists + Fixed bug with artist index list +
          • +
          • 5/21/2012 - 1.9.8 + Support for 4.7beta1 in preparation for next full release + Ability to download Playlist or Song + Playing a song from a Playlist or Album will add the rest of the songs to the Current Playlist + Clicking an album takes you to the album (helpful from a playlist) + Added ability to search Albums or Songs + Ability to create new Playlist from any selected songs + Change track position while playing (lost after switch to SM2) + Added song rating to Player +
          • +
          • 4/3/2012 - 1.9.4 + URL Querystring support for setting of variables + Added legacy support for Subsonic 4.5 + Fixed Chrome audio bugs +
          • +
          • 3/31/2012 - 1.9 + Switched to SoundManager2 audio library (changing track position currently not functional, next update) + Other minor bug fixes +
          • +
          • 3/27/2012 - 1.8 + Added Download link to Albums + Fixed bug with Next/Previous keyboard shortcuts + Moved navigation since most displays are widescreen + Added folder picker, choice will be saved in cookie +
          • +
          • 3/9/2012 - 1.7 + - Ability to hide A-Z bar on Artists list + - Desktop Notifications on browsers that support webkitNotifications + - Redesigned player to utilize entire width of screen +
          • +
          • 3/6/2012.022 can be installed anywhere, Chrome App support, JSONP implementation
          • +
          • 2/22/2012.021 added sidebar for chat and now playing, bug fixes
          • +
          • 1/25/2012.020 table layout for songs, bug fixes, display tweaks
          • +
          • 1/18/2012.019 rating support, random playlist, new preferences added
          • +
          • 1/9/2012.018 added media keyboard bindings from @itchy
          • +
          • 1/5/2012.017 added FancyBox to CoverArt, improved current playlist functions
          • +
          • 11/22/2011.016 single artist bug fix, added API error notification
          • +
          • 11/15/2011.015 fixed search issue, added last.fm support from @smrq
          • +
          • 10/14/2011.014 multiple api call issue fix
          • +
          • 10/14/2011.013 moved auto playlists, album display tweaks
          • +
          • 10/13/2011.012 added Current Playlist, fixed some bugs
          • +
          • 10/2/2011.011 added play button from album list
          • +
          • 10/1/2011.010 fix for subdirectory custom installs
          • +
          • 9/30/2011.009 now playing support, added back button to track list, other tweaks
          • +
          • 9/17/2011.008 pause/play button tweak
          • +
          • 9/17/2011.007 display tweaks for tablet, chat feature added
          • +
          • 8/25/2011.006 flexible layout, added buttons to player
          • +
          • 8/24/2011.005 playlist fixes, added auto playlists
          • +
          • 8/17/2011.004 https fix, audio player tweaks
          • +
          • 8/15/2011.003 Fixed song details on player
          • +
          • 8/15/2011.001 Initial Release
          • +
          • Show More
          • +
          +
          +
          +
          +

          Links

          +
            +
          • MiniSub on GitHub - https://github.com/tsquillario/MiniSub
          • +
          • MiniSub Chrome App - Chrome Web Store
          • +
          • +
          • +
          +

          Thanks

          + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
            +
          • +
          • +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          00:00/00:00
          +
          +
          +
          +
          +
          +
          +
          +
          + + diff --git a/subsonic-main/src/main/webapp/mini/js/app.js b/subsonic-main/src/main/webapp/mini/js/app.js new file mode 100644 index 00000000..004a403f --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/app.js @@ -0,0 +1,73 @@ +// Global Variables +var debug = false; +var audio; +var hostURL = location.href; +var baseURL; +var version; + +//Sound manager +soundManager.url = 'js/sm/swf'; +soundManager.preferFlash = false; +soundManager.debugMode = false; +//soundManager.useHTML5Audio = true; + +// Set auth cookies if specified in URL on launch +var u = getParameterByName('u'); +var p = getParameterByName('p'); +var s = getParameterByName('s'); +if (u && p && s) { + if (!$.cookie('username')) { + $.cookie('username', u, { expires: 365 }); + } + if (!$.cookie('password')) { + $.cookie('password', p, { expires: 365 }); + } + if (!$.cookie('Server')) { + $.cookie('Server', s, { expires: 365 }); + } + window.location.href = getPathFromUrl(window.location); +} +if ($.cookie('Server')) { + baseURL = $.cookie('Server') + '/rest'; +} +var applicationName; +if ($.cookie('ApplicationName')) { + applicationName = $.cookie('ApplicationName'); +} else { + applicationName = 'MiniSub'; +} +var username = $.cookie('username'); +var password = $.cookie('password'); +var auth = makeBaseAuth(username, password); +var passwordenc = 'enc:' + HexEncode($.cookie('password')); +var version = '1.6.0'; + +function loadTabContent(tab) { + switch (tab) { + case '#tabLibrary': + if (debug) { console.log("TAG LIBRARY"); } + if ($.cookie('MusicFolders')) { + loadArtists($.cookie('MusicFolders'), false); + } else { + loadArtists(); + } + getMusicFolders(); + break; + case '#tabCurrent': + if (debug) { console.log("TAG CURRENT"); } + var header = generateSongHeaderHTML(); + $("#CurrentPlaylistContainer thead").html(header); + break; + case '#tabPlaylists': + if (debug) { console.log("TAG PLAYLIST"); } + loadPlaylists(); + break; + case '#tabPreferences': + break; + default: + break; + } +} + + + diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/blank.gif b/subsonic-main/src/main/webapp/mini/js/fancybox/blank.gif new file mode 100644 index 00000000..35d42e80 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/blank.gif differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_close.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_close.png new file mode 100644 index 00000000..07035307 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_close.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_loading.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_loading.png new file mode 100644 index 00000000..25030179 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_loading.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_left.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_left.png new file mode 100644 index 00000000..ebaa6a4f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_left.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_right.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_right.png new file mode 100644 index 00000000..873294e9 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_nav_right.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_e.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_e.png new file mode 100644 index 00000000..2eda0893 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_e.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_n.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_n.png new file mode 100644 index 00000000..69aa10e2 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_n.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_ne.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_ne.png new file mode 100644 index 00000000..79f6980a Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_ne.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_nw.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_nw.png new file mode 100644 index 00000000..7182cd93 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_nw.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_s.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_s.png new file mode 100644 index 00000000..d8858bfb Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_s.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_se.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_se.png new file mode 100644 index 00000000..541e3ffd Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_se.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_sw.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_sw.png new file mode 100644 index 00000000..b451689f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_sw.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_w.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_w.png new file mode 100644 index 00000000..8a4e4a88 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_shadow_w.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_left.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_left.png new file mode 100644 index 00000000..6049223d Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_left.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_main.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_main.png new file mode 100644 index 00000000..8044271f Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_main.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_over.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_over.png new file mode 100644 index 00000000..d9f458f4 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_over.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_right.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_right.png new file mode 100644 index 00000000..e36d9db2 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancy_title_right.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-x.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-x.png new file mode 100644 index 00000000..c2130f86 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-x.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-y.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-y.png new file mode 100644 index 00000000..7ef399b9 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox-y.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox.png b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox.png new file mode 100644 index 00000000..65e14f68 Binary files /dev/null and b/subsonic-main/src/main/webapp/mini/js/fancybox/fancybox.png differ diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.css b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.css new file mode 100644 index 00000000..8fe0fbd5 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.css @@ -0,0 +1,359 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ + +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.js b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.js new file mode 100644 index 00000000..a8520051 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.js @@ -0,0 +1,1156 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function($) { + var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, + + selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], + + ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, + + loadingTimer, loadingFrame = 1, + + titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
          ')[0], { prop: 0 }), + + isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, + + /* + * Private methods + */ + + _abort = function() { + loading.hide(); + + imgPreloader.onerror = imgPreloader.onload = null; + + if (ajaxLoader) { + ajaxLoader.abort(); + } + + tmp.empty(); + }, + + _error = function() { + if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { + loading.hide(); + busy = false; + return; + } + + selectedOpts.titleShow = false; + + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + + tmp.html( '

          The requested content cannot be loaded.
          Please try again later.

          ' ); + + _process_inline(); + }, + + _start = function() { + var obj = selectedArray[ selectedIndex ], + href, + type, + title, + str, + emb, + ret; + + _abort(); + + selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); + + ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); + + if (ret === false) { + busy = false; + return; + } else if (typeof ret == 'object') { + selectedOpts = $.extend(selectedOpts, ret); + } + + title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; + + if (obj.nodeName && !selectedOpts.orig) { + selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); + } + + if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { + title = selectedOpts.orig.attr('alt'); + } + + href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; + + if ((/^(?:javascript)/i).test(href) || href == '#') { + href = null; + } + + if (selectedOpts.type) { + type = selectedOpts.type; + + if (!href) { + href = selectedOpts.content; + } + + } else if (selectedOpts.content) { + type = 'html'; + + } else if (href) { + if (href.match(imgRegExp)) { + type = 'image'; + + } else if (href.match(swfRegExp)) { + type = 'swf'; + + } else if ($(obj).hasClass("iframe")) { + type = 'iframe'; + + } else if (href.indexOf("#") === 0) { + type = 'inline'; + + } else { + type = 'ajax'; + } + } + + if (!type) { + _error(); + return; + } + + if (type == 'inline') { + obj = href.substr(href.indexOf("#")); + type = $(obj).length > 0 ? 'inline' : 'ajax'; + } + + selectedOpts.type = type; + selectedOpts.href = href; + selectedOpts.title = title; + + if (selectedOpts.autoDimensions) { + if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + } else { + selectedOpts.autoDimensions = false; + } + } + + if (selectedOpts.modal) { + selectedOpts.overlayShow = true; + selectedOpts.hideOnOverlayClick = false; + selectedOpts.hideOnContentClick = false; + selectedOpts.enableEscapeButton = false; + selectedOpts.showCloseButton = false; + } + + selectedOpts.padding = parseInt(selectedOpts.padding, 10); + selectedOpts.margin = parseInt(selectedOpts.margin, 10); + + tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); + + $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { + $(this).replaceWith(content.children()); + }); + + switch (type) { + case 'html' : + tmp.html( selectedOpts.content ); + _process_inline(); + break; + + case 'inline' : + if ( $(obj).parent().is('#fancybox-content') === true) { + busy = false; + return; + } + + $('
          ') + .hide() + .insertBefore( $(obj) ) + .bind('fancybox-cleanup', function() { + $(this).replaceWith(content.children()); + }).bind('fancybox-cancel', function() { + $(this).replaceWith(tmp.children()); + }); + + $(obj).appendTo(tmp); + + _process_inline(); + break; + + case 'image': + busy = false; + + $.fancybox.showActivity(); + + imgPreloader = new Image(); + + imgPreloader.onerror = function() { + _error(); + }; + + imgPreloader.onload = function() { + busy = true; + + imgPreloader.onerror = imgPreloader.onload = null; + + _process_image(); + }; + + imgPreloader.src = href; + break; + + case 'swf': + selectedOpts.scrolling = 'no'; + + str = ''; + emb = ''; + + $.each(selectedOpts.swf, function(name, val) { + str += ''; + emb += ' ' + name + '="' + val + '"'; + }); + + str += ''; + + tmp.html(str); + + _process_inline(); + break; + + case 'ajax': + busy = false; + + $.fancybox.showActivity(); + + selectedOpts.ajax.win = selectedOpts.ajax.success; + + ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { + url : href, + data : selectedOpts.ajax.data || {}, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if ( XMLHttpRequest.status > 0 ) { + _error(); + } + }, + success : function(data, textStatus, XMLHttpRequest) { + var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; + if (o.status == 200) { + if ( typeof selectedOpts.ajax.win == 'function' ) { + ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); + + if (ret === false) { + loading.hide(); + return; + } else if (typeof ret == 'string' || typeof ret == 'object') { + data = ret; + } + } + + tmp.html( data ); + _process_inline(); + } + } + })); + + break; + + case 'iframe': + _show(); + break; + } + }, + + _process_inline = function() { + var + w = selectedOpts.width, + h = selectedOpts.height; + + if (w.toString().indexOf('%') > -1) { + w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; + + } else { + w = w == 'auto' ? 'auto' : w + 'px'; + } + + if (h.toString().indexOf('%') > -1) { + h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; + + } else { + h = h == 'auto' ? 'auto' : h + 'px'; + } + + tmp.wrapInner('
          '); + + selectedOpts.width = tmp.width(); + selectedOpts.height = tmp.height(); + + _show(); + }, + + _process_image = function() { + selectedOpts.width = imgPreloader.width; + selectedOpts.height = imgPreloader.height; + + $("").attr({ + 'id' : 'fancybox-img', + 'src' : imgPreloader.src, + 'alt' : selectedOpts.title + }).appendTo( tmp ); + + _show(); + }, + + _show = function() { + var pos, equal; + + loading.hide(); + + if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + $.event.trigger('fancybox-cancel'); + + busy = false; + return; + } + + busy = true; + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { + wrap.css('height', wrap.height()); + } + + currentArray = selectedArray; + currentIndex = selectedIndex; + currentOpts = selectedOpts; + + if (currentOpts.overlayShow) { + overlay.css({ + 'background-color' : currentOpts.overlayColor, + 'opacity' : currentOpts.overlayOpacity, + 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', + 'height' : $(document).height() + }); + + if (!overlay.is(':visible')) { + if (isIE6) { + $('select:not(#fancybox-tmp select)').filter(function() { + return this.style.visibility !== 'hidden'; + }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { + this.style.visibility = 'inherit'; + }); + } + + overlay.show(); + } + } else { + overlay.hide(); + } + + final_pos = _get_zoom_to(); + + _process_title(); + + if (wrap.is(":visible")) { + $( close.add( nav_left ).add( nav_right ) ).hide(); + + pos = wrap.position(), + + start_pos = { + top : pos.top, + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); + + content.fadeTo(currentOpts.changeFade, 0.3, function() { + var finish_resizing = function() { + content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); + }; + + $.event.trigger('fancybox-change'); + + content + .empty() + .removeAttr('filter') + .css({ + 'border-width' : currentOpts.padding, + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }); + + if (equal) { + finish_resizing(); + + } else { + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.changeSpeed, + easing : currentOpts.easingChange, + step : _draw, + complete : finish_resizing + }); + } + }); + + return; + } + + wrap.removeAttr("style"); + + content.css('border-width', currentOpts.padding); + + if (currentOpts.transitionIn == 'elastic') { + start_pos = _get_zoom_from(); + + content.html( tmp.contents() ); + + wrap.show(); + + if (currentOpts.opacity) { + final_pos.opacity = 0; + } + + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.speedIn, + easing : currentOpts.easingIn, + step : _draw, + complete : _finish + }); + + return; + } + + if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { + title.show(); + } + + content + .css({ + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }) + .html( tmp.contents() ); + + wrap + .css(final_pos) + .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); + }, + + _format_title = function(title) { + if (title && title.length) { + if (currentOpts.titlePosition == 'float') { + return '
          ' + title + '
          '; + } + + return '
          ' + title + '
          '; + } + + return false; + }, + + _process_title = function() { + titleStr = currentOpts.title || ''; + titleHeight = 0; + + title + .empty() + .removeAttr('style') + .removeClass(); + + if (currentOpts.titleShow === false) { + title.hide(); + return; + } + + titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); + + if (!titleStr || titleStr === '') { + title.hide(); + return; + } + + title + .addClass('fancybox-title-' + currentOpts.titlePosition) + .html( titleStr ) + .appendTo( 'body' ) + .show(); + + switch (currentOpts.titlePosition) { + case 'inside': + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'marginLeft' : currentOpts.padding, + 'marginRight' : currentOpts.padding + }); + + titleHeight = title.outerHeight(true); + + title.appendTo( outer ); + + final_pos.height += titleHeight; + break; + + case 'over': + title + .css({ + 'marginLeft' : currentOpts.padding, + 'width' : final_pos.width - (currentOpts.padding * 2), + 'bottom' : currentOpts.padding + }) + .appendTo( outer ); + break; + + case 'float': + title + .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) + .appendTo( wrap ); + break; + + default: + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'paddingLeft' : currentOpts.padding, + 'paddingRight' : currentOpts.padding + }) + .appendTo( wrap ); + break; + } + + title.hide(); + }, + + _set_navigation = function() { + if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { + $(document).bind('keydown.fb', function(e) { + if (e.keyCode == 27 && currentOpts.enableEscapeButton) { + e.preventDefault(); + $.fancybox.close(); + + } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { + e.preventDefault(); + $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); + } + }); + } + + if (!currentOpts.showNavArrows) { + nav_left.hide(); + nav_right.hide(); + return; + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { + nav_left.show(); + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { + nav_right.show(); + } + }, + + _finish = function () { + if (!$.support.opacity) { + content.get(0).style.removeAttribute('filter'); + wrap.get(0).style.removeAttribute('filter'); + } + + if (selectedOpts.autoDimensions) { + content.css('height', 'auto'); + } + + wrap.css('height', 'auto'); + + if (titleStr && titleStr.length) { + title.show(); + } + + if (currentOpts.showCloseButton) { + close.show(); + } + + _set_navigation(); + + if (currentOpts.hideOnContentClick) { + content.bind('click', $.fancybox.close); + } + + if (currentOpts.hideOnOverlayClick) { + overlay.bind('click', $.fancybox.close); + } + + $(window).bind("resize.fb", $.fancybox.resize); + + if (currentOpts.centerOnScroll) { + $(window).bind("scroll.fb", $.fancybox.center); + } + + if (currentOpts.type == 'iframe') { + $('').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('
          '), + loading = $('
          '), + overlay = $('
          '), + wrap = $('
          ') + ); + + outer = $('
          ') + .append('
          ') + .appendTo( wrap ); + + outer.append( + content = $('
          '), + close = $(''), + title = $('
          '), + + nav_left = $(''), + nav_right = $('') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + +})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.pack.js b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.pack.js new file mode 100644 index 00000000..1373ed08 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/fancybox/jquery.fancybox-1.3.4.pack.js @@ -0,0 +1,46 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("
          ")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('

          The requested content cannot be loaded.
          Please try again later.

          '); +F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| +c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= +false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('
          ').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", +function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='';P="";b.each(e.swf,function(x,H){C+='';P+=" "+x+'="'+H+'"'});C+='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== +"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('
          ');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, +opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? +d.titlePosition=="float"?'
          '+s+'
          ':'
          '+s+"
          ":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); +y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== +i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); +f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== +37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); +s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j); +f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); +j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== +"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), +10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; +b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= +0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ +1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= +true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; +b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- +d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
          '),t=b('
          '),u=b('
          '),f=b('
          '));D=b('
          ').append('
          ').appendTo(f); +D.append(j=b('
          '),E=b(''),n=b('
          '),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); +b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}}; +b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", +easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/libs/api.js b/subsonic-main/src/main/webapp/mini/js/libs/api.js new file mode 100644 index 00000000..7a033940 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/libs/api.js @@ -0,0 +1,710 @@ +function loadArtists(id, refresh) { + if (debug) { console.log("LOAD ARTISTS"); } + if (refresh) { + $('#ArtistContainer').empty(); + } + var url; + if (id == "all") { + url = baseURL + '/getIndexes.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp'; + } else if (id) { + url = baseURL + '/getIndexes.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&musicFolderId=' + id; + } else { + url = baseURL + '/getIndexes.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp'; + } + if (debug) { console.log(url); } + var content = $('#ArtistContainer').html(); + if (content === "") { + // Load Artist List + $.ajax({ + url: url, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + done: function () { if (debug) { console.log("DONE!"); } }, + error: function () { if (debug) { console.log("ERROR!"); } }, + success: function (data) { + if (debug) { console.log("SUCCESS"); } + if (data["subsonic-response"].status === 'ok') { + var indexlist, indexname; + + if (data["subsonic-response"].version != '') { + version = data["subsonic-response"].version; + } + // There is a bug in the API that doesn't return a JSON array for one artist + var indexes = []; + if (data["subsonic-response"].indexes.index.length > 0) { + indexes = data["subsonic-response"].indexes.index; + } else { + indexes[0] = data["subsonic-response"].indexes.index; + } + + $.each(indexes, function (i, index) { + indexname = index.name; + $('
        • ' + indexname + '
        • ').appendTo("#ArtistContainer"); + indexlist += '
        • ' + indexname + '
        • '; + var artists = []; + if (index.artist.length > 0) { + artists = index.artist; + } else { + artists[0] = index.artist; + } + $.each(artists, function (i, artist) { + if (artist.name !== undefined) { + var html = ""; + html += '
        • '; + html += '' + artist.name + ''; + html += '
        • '; + $(html).appendTo("#ArtistContainer"); + } + }); + }); + //$(indexlist).appendTo("#IndexList"); + $("#BottomIndex").empty(); + $(indexlist).appendTo("#BottomIndex"); + } else { + var error = data["subsonic-response"].status; + var errorcode = data["subsonic-response"].error.code; + var errormsg = data["subsonic-response"].error.message; + alert('Status: ' + error + ', Code: ' + errorcode + ', Message: ' + errormsg); + //var errorhtml = '
        • ' + error + '
        • '; + //$(errorhtml).appendTo("#IndexList"); + } + } + }); + } +} +function getMusicFolders() { + $.ajax({ + url: baseURL + '/getMusicFolders.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp', + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].musicFolders.musicFolder !== undefined) { + // There is a bug in the API that doesn't return a JSON array for one artist + var folders = []; + if (data["subsonic-response"].musicFolders.musicFolder.length > 0) { + folders = data["subsonic-response"].musicFolders.musicFolder; + } else { + folders[0] = data["subsonic-response"].musicFolders.musicFolder; + } + + var savedMusicFolder = $.cookie('MusicFolders'); + var options = []; + options.push(''); + $.each(folders, function (i, folder) { + if (savedMusicFolder == folder.id) { + options.push(''); + } else { + options.push(''); + } + }); + $('#MusicFolders').html(options.join('')); + } else { + } + } + }); +} +function getAlbums(id, action, appendto) { + $('.first').trigger('click'); + $.ajax({ + url: baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (action === '') { + $('#AlbumRows').empty(); + } + if (action === 'autoplay') { + $('#CurrentPlaylistContainer tbody').empty(); + } + if (data["subsonic-response"].directory.child !== undefined) { + // There is a bug in the API that doesn't return a JSON array for one artist + var children = []; + if (data["subsonic-response"].directory.child.length > 0) { + children = data["subsonic-response"].directory.child; + } else { + children[0] = data["subsonic-response"].directory.child; + } + + var rowcolor; + var albumhtml; + var isDir; + var header; + $.each(children, function (i, child) { + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + isDir = child.isDir; + if (isDir === true) { + albumhtml = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, child.artist, child.userRating); + } else { + var track; + if (child.track === undefined) { track = " "; } else { track = child.track; } + var time = secondsToTime(child.duration); + albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, time['m'], time['s']); + } + $(albumhtml).appendTo(appendto); + }); + if (appendto === '#CurrentPlaylistContainer') { + updateMessage(children.length + ' Song(s) Added'); + } + if (appendto === '#AlbumRows' && isDir === true) { + header = generateAlbumHeaderHTML(); + } + if (appendto === '#AlbumRows' && isDir === false) { + header = generateSongHeaderHTML(); + $('#songactions').show(); + } + $("#AlbumHeader").html(header); + if (action === 'autoplay') { + autoPlay(); + } + } + } + }); +} +function getAlbumListBy(id) { + var size; + if ($.cookie('AutoAlbumSize') === null) { + size = 15; + } else { + size = $.cookie('AutoAlbumSize'); + } + $.ajax({ + url: baseURL + '/getAlbumList.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&size=' + size + '&type=' + id, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].albumList.album !== undefined) { + $("#AlbumRows").empty(); + var header = generateAlbumHeaderHTML(); + $("#AlbumHeader").html(header); + // There is a bug in the API that doesn't return a JSON array for one artist + var albums = []; + if (data["subsonic-response"].albumList.album.length > 0) { + albums = data["subsonic-response"].albumList.album; + } else { + albums[0] = data["subsonic-response"].albumList.album; + } + + var rowcolor; + var html; + $.each(albums, function (i, album) { + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + // Only show albums, not songs (Rated songs will also be returned in API call, trying to display them will break Back button, disabled for now) + var albumhtml; + if (album.isDir === true) { + albumhtml = generateAlbumHTML(rowcolor, album.id, album.parent, album.coverArt, album.title, album.artist, album.userRating); + } + $(albumhtml).appendTo("#AlbumRows"); + }); + } else { + $('#AlbumRows').empty(); + } + } + }); +} +function getRandomSongList(action, appendto) { + var size; + if ($.cookie('AutoPlaylistSize') === null) { + size = 25; + } else { + size = $.cookie('AutoPlaylistSize'); + } + $.ajax({ + url: baseURL + '/getRandomSongs.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&size=' + size, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].randomSongs.song !== undefined) { + if (appendto === '#TrackContainer') { + $("#TrackContainer").empty(); + } + if (action === 'autoplay') { + $(appendto).empty(); + } + // There is a bug in the API that doesn't return a JSON array for one artist + var items = []; + if (data["subsonic-response"].randomSongs.song.length > 0) { + items = data["subsonic-response"].randomSongs.song; + } else { + items[0] = data["subsonic-response"].randomSongs.song; + } + + var rowcolor; + var html; + $.each(items, function (i, item) { + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + var track; + if (item.track === undefined) { track = " "; } else { track = item.track; } + var time = secondsToTime(item.duration); + html = generateSongHTML(rowcolor, item.id, item.parent, track, item.title, item.artist, item.album, item.coverArt, item.userRating, time['m'], time['s']); + $(html).appendTo(appendto); + }); + if (appendto === '#CurrentPlaylistContainer') { + updateMessage(items.length + ' Song(s) Added'); + } + if (action === 'autoplay') { + autoPlay(); + } + } else { + $(appendto).empty(); + } + } + }); +} +var updaterNowPlaying; +var updaterNowPlayingData; +function updateNowPlaying() { + updaterNowPlaying = $.periodic({ period: 4000, decay: 1.5, max_period: 1800000 }, function () { + $.ajax({ + periodic: this, + url: baseURL + '/getNowPlaying.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp', + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].nowPlaying.entry === undefined) { + this.periodic.increment(); + $("#NowPlayingList").empty(); + var chathtml = '
          '; + chathtml += 'Nothing :(
          '; + chathtml += '
          '; + $(chathtml).appendTo("#NowPlayingList"); + } else if (updaterNowPlayingData === $.param(data)) { + this.periodic.increment(); + } else { + $("#NowPlayingList").empty(); + var msgs = []; + if (data["subsonic-response"].nowPlaying.entry.length > 0) { + msgs = data["subsonic-response"].nowPlaying.entry; + } else { + msgs[0] = data["subsonic-response"].nowPlaying.entry; + } + this.periodic.reset(); + var sorted = msgs.sort(function (a, b) { + return a.minutesAgo - b.minutesAgo; + }); + $.each(sorted, function (i, msg) { + var chathtml = '
          '; + chathtml += '' + msg.username + '
          '; + chathtml += '' + msg.artist + ' - '; + chathtml += '' + msg.title + ''; + chathtml += '
          '; + $(chathtml).appendTo("#NowPlayingList"); + }); + updaterNowPlayingData = $.param(data); + } + } + }); + }); +} +function stopUpdateNowPlaying() { + updaterNowPlaying.cancel(); +} + +function search(type, query) { + $.ajax({ + url: baseURL + '/search2.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&query=' + query, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].searchResult2 !== "") { + $("#AlbumRows").empty(); + var header; + var children = []; + if (type === 'song') { + header = generateSongHeaderHTML(); + if (data["subsonic-response"].searchResult2.song !== undefined) { + if (data["subsonic-response"].searchResult2.song.length > 0) { + children = data["subsonic-response"].searchResult2.song; + } else { + children[0] = data["subsonic-response"].searchResult2.song; + } + } + } + if (type === 'album') { + header = generateAlbumHeaderHTML(); + if (data["subsonic-response"].searchResult2.album !== undefined) { + if (data["subsonic-response"].searchResult2.album.length > 0) { + children = data["subsonic-response"].searchResult2.album; + } else { + children[0] = data["subsonic-response"].searchResult2.album; + } + } + } + $("#AlbumHeader").html(header); + $.each(children, function (i, child) { + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + isDir = child.isDir; + if (isDir === true) { + albumhtml = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, child.artist, child.userRating); + } else { + var track; + if (child.track === undefined) { track = " "; } else { track = child.track; } + var time = secondsToTime(child.duration); + albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, time['m'], time['s']); + } + $(albumhtml).appendTo("#AlbumRows"); + }); + } + } + }); +} + +function loadPlaylists(refresh) { + if (debug) { console.log("LOAD PLAYLISTS"); } + if (refresh) { + $('#PlaylistContainer').empty(); + } + var content = $('#PlaylistContainer').html(); + if (content === "") { + // Load Playlists + $.ajax({ + url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp', + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + var playlists = []; + if (data["subsonic-response"].playlists.playlist.length > 0) { + playlists = data["subsonic-response"].playlists.playlist; + } else { + playlists[0] = data["subsonic-response"].playlists.playlist; + } + $.each(playlists, function (i, playlist) { + var html = ""; + html += '
        • '; + html += '' + playlist.name + ''; + html += '
          '; + html += '
          '; + html += '
          '; + html += '
        • '; + $(html).appendTo("#PlaylistContainer"); + }); + } + }); + } +} +function loadPlaylistsForMenu(menu) { + $('#' + menu).empty(); + $.ajax({ + url: baseURL + '/getPlaylists.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp', + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + var playlists = []; + if (data["subsonic-response"].playlists.playlist.length > 0) { + playlists = data["subsonic-response"].playlists.playlist; + } else { + playlists[0] = data["subsonic-response"].playlists.playlist; + } + if (menu === 'submenu_AddCurrentToPlaylist') { + $("+ New
          ").appendTo("#" + menu); + } else { + $("+ New
          ").appendTo("#" + menu); + } + $.each(playlists, function (i, playlist) { + if (menu === 'submenu_AddCurrentToPlaylist') { + $("" + playlist.name + "
          ").appendTo("#" + menu); + } else { + $("" + playlist.name + "
          ").appendTo("#" + menu); + } + }); + + //$("+ New Playlist
          ").appendTo("#submenu"); + } + }); +} +function newPlaylist() { + var reply = prompt("Choose a name for your new playlist.", ""); + if (reply) { + $.ajax({ + url: baseURL + '/createPlaylist.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&name=' + reply, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + loadPlaylists(true); + } + }); + } +} +function deletePlaylist(id) { + $.ajax({ + url: baseURL + '/deletePlaylist.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + loadPlaylists(true); + $('#TrackContainer tbody').empty(); + } + }); +} +function addToPlaylist(playlistid, from) { + var selected = []; + var el; + if (from === 'current') { + el = $('#CurrentPlaylist table.songlist tr.selected'); + } else { + el = $('#Albums table.songlist tr.selected'); + } + el.each(function (index) { + selected.push($(this).attr('childid')); + }); + if (selected.length > 0) { + if (playlistid !== 'new') { // Create new playlist from here, will implement in UI later + // Get songs from playlist + var currentsongs = []; + $.ajax({ + url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + playlistid, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + // There is a bug in the API that doesn't return a JSON array for one artist + var children = []; + if (data["subsonic-response"].playlist.entry !== undefined) { + if (data["subsonic-response"].playlist.entry.length > 1) { + children = data["subsonic-response"].playlist.entry; + } else { + children[0] = data["subsonic-response"].playlist.entry; + } + $.each(children, function (i, child) { + currentsongs.push(child.id); + }); + } + var newsongs = []; + var count = 0; + $.each(selected, function (i, songid) { + if (jQuery.inArray(songid, currentsongs) === -1) { + currentsongs.push(songid); + count++; + } + }); + if (count > 0) { + $.ajax({ + type: 'GET', + url: baseURL + '/createPlaylist.view', + dataType: 'jsonp', + timeout: 10000, + data: { u: username, p: passwordenc, v: version, c: applicationName, f: "jsonp", playlistId: playlistid, songId: currentsongs }, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + $('table.songlist tr.song').each(function () { + $(this).removeClass('selected'); + }); + updateMessage('Playlist Updated!'); + }, + traditional: true // Fixes POST with an array in JQuery 1.4 + }); + } + } + }); + } else { + var reply = prompt("Choose a name for your new playlist.", ""); + $.ajax({ + type: 'GET', + url: baseURL + '/createPlaylist.view', + dataType: 'jsonp', + timeout: 10000, + data: { u: username, p: passwordenc, v: version, c: applicationName, f: "jsonp", name: "" + reply + "", songId: selected }, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + $('table.songlist tr.song').each(function () { + $(this).removeClass('selected'); + }); + updateMessage('Playlist Created!'); + }, + traditional: true // Fixes POST with an array in JQuery 1.4 + }); + } + setTimeout(function () { $('div.submenu').fadeOut(); }, 100); + } +} +function addToCurrent(addAll) { + var count; + if (addAll) { + count = $('#AlbumContainer tr.song').length; + } else { + count = $('#AlbumContainer tr.selected').length; + } + if (count > 0) { + if (addAll) { + $('#AlbumContainer tr.song').each(function (index) { + $(this).clone().appendTo('#CurrentPlaylistContainer tbody'); + updateMessage(count + ' Song(s) Added'); + }); + } else { + $('#AlbumContainer tr.selected').each(function (index) { + $(this).clone().appendTo('#CurrentPlaylistContainer tbody'); + updateMessage(count + ' Song(s) Added'); + }); + } + } +} +function downloadItem(id, type) { + var url; + if (type == 'item' && id) { + reqDownload = 'id=' + id; + } + if (type == 'playlist' && id) { + reqDownload = 'playlistUtf8Hex=' + id; + } + if (reqDownload) { + url = baseURL + '/download.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&' + reqDownload; + window.location = url; + } + /* 20120520 OwnCloud Merge + var url; + if (id) { + url = baseURL + '/download.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id; + window.location = url; + } + */ + /* + $('table.songlist tr.selected').each(function (index) { + id = $(this).attr('childid'); + if (id) { + url = baseURL + '/download.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id; + window.location = url; + } + }); + */ +} +function savePlaylist(playlistid) { + var songs = []; + $('#TrackContainer tr.song').each(function (index) { + songs.push($(this).attr('childid')); + }); + if (songs.length > 0) { + $.ajax({ + type: 'GET', + url: baseURL + '/createPlaylist.view', + dataType: 'jsonp', + timeout: 10000, + data: { u: username, p: passwordenc, v: version, c: applicationName, f: "jsonp", playlistId: playlistid, songId: songs }, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + getPlaylist(playlistid); + updateMessage('Playlist Updated!'); + }, + traditional: true // Fixes POST with an array in JQuery 1.4 + }); + } +} +function getPlaylist(id, action, appendto) { + $.ajax({ + url: baseURL + '/getPlaylist.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + id, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].playlist.entry !== undefined) { + if (appendto === '#TrackContainer tbody') { + $(appendto).empty(); + var header = generateSongHeaderHTML(); + $("#TrackContainer thead").html(header); + } + if (action === 'autoplay') { + $(appendto).empty(); + } + // There is a bug in the API that doesn't return a JSON array for one artist + var children = []; + if (data["subsonic-response"].playlist.entry.length > 0) { + children = data["subsonic-response"].playlist.entry; + } else { + children[0] = data["subsonic-response"].playlist.entry; + } + + var rowcolor; + var html; + $.each(children, function (i, child) { + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + var track; + if (child.track === undefined) { track = " "; } else { track = child.track; } + var time = secondsToTime(child.duration); + html = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, time['m'], time['s']); + $(html).appendTo(appendto); + }); + if (appendto === '#CurrentPlaylistContainer tbody') { + updateMessage(children.length + ' Song(s) Added'); + } + if (action === 'autoplay') { + autoPlay(); + } + } else { + if (appendto === '#TrackContainer tbody') { + $(appendto).empty(); + } + } + } + }); +} diff --git a/subsonic-main/src/main/webapp/mini/js/libs/chat.js b/subsonic-main/src/main/webapp/mini/js/libs/chat.js new file mode 100644 index 00000000..2b07f963 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/libs/chat.js @@ -0,0 +1,66 @@ +var starttime; +var updater; +function updateChatMessages() { + updater = $.periodic({ period: 1000, decay: 1.5, max_period: 1800000 }, function () { + $.ajax({ + periodic: this, + url: baseURL + '/getChatMessages.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&since=' + starttime, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + if (data["subsonic-response"].chatMessages.chatMessage === undefined) { + this.periodic.increment(); + } else { + var msgs = []; + if (data["subsonic-response"].chatMessages.chatMessage.length > 0) { + msgs = data["subsonic-response"].chatMessages.chatMessage; + } else { + msgs[0] = data["subsonic-response"].chatMessages.chatMessage; + } + this.periodic.reset(); + var sorted = msgs.sort(function (a, b) { + return a.time - b.time; + }); + var x = 1; + $.each(sorted, function (i, msg) { + var chathtml = '
          '; + chathtml += '' + $.format.date(new Date(parseInt(msg.time, 10)), 'hh:mm:ss a') + ' '; + chathtml += '' + msg.username + '
          '; + chathtml += '' + msg.message + ''; + chathtml += '
          '; + $(chathtml).appendTo("#ChatMsgs"); + if (x === sorted.length) { + starttime = msg.time; + } + x++; + }); + $("#ChatMsgs").linkify(); + $("#ChatMsgs").attr({ scrollTop: $("#ChatMsgs").attr("scrollHeight") }); + } + } + }); + }); +} +function stopUpdateChatMessages() { + updater.cancel(); +} +function addChatMessage(msg) { + $.ajax({ + type: 'GET', + url: baseURL + '/addChatMessage.view', + dataType: 'jsonp', + timeout: 10000, + data: { u: username, p: passwordenc, v: version, c: applicationName, f: "jsonp", message: msg }, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + updater.reset(); + }, + traditional: true // Fixes POST with an array in JQuery 1.4 + }); +} diff --git a/subsonic-main/src/main/webapp/mini/js/libs/generators.js b/subsonic-main/src/main/webapp/mini/js/libs/generators.js new file mode 100644 index 00000000..28be0259 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/libs/generators.js @@ -0,0 +1,72 @@ +function generateAlbumHeaderHTML() { + var html; + html = 'AlbumArtist'; + return html; +} +function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist, rating) { + var html; + html = ''; + html += ''; + html += ''; + html += ''; + if (rating === 5) { + html += ''; + } else { + html += ''; + } + html += ''; + if (coverart == undefined) { + html += ''; + } else { + html += ''; + } + html += '' + title + ''; + html += '' + artist + ''; + html += ''; + return html; +} +function generateSongHeaderHTML() { + var html; + html = 'TrackTitleArtistAlbumTime'; + return html; +} +function generateSongHTML(rowcolor, childid, parentid, track, title, artist, album, coverart, rating, m, s) { + var html; + html = ''; + html += ''; + html += ''; + html += ''; + html += ''; + if (rating === 5) { + html += ''; + } else { + html += ''; + } + html += ''; + html += '' + track + ''; + html += '' + title + ''; + html += '' + artist + ''; + var coverartSrc; + if (coverart == undefined) { + coverartSrc = 'images/albumdefault_25.jpg'; + } else { + coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=25&id=' + coverart; + } + html += '' + album + ''; + html += '' + m + ':' + s + ''; + html += ''; + return html; +} + +function refreshRowColor(el) { + $.each($(el + ' tr.song'), function (i) { + $(this).removeClass('even odd'); + var rowcolor; + if (i % 2 === 0) { + rowcolor = 'even'; + } else { + rowcolor = 'odd'; + } + $(this).addClass(rowcolor); + }); +} diff --git a/subsonic-main/src/main/webapp/mini/js/libs/player.js b/subsonic-main/src/main/webapp/mini/js/libs/player.js new file mode 100644 index 00000000..4dab319b --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/libs/player.js @@ -0,0 +1,206 @@ +var scrobbled = false; +function playSong(el, songid, albumid) { + $.ajax({ + url: baseURL + '/getMusicDirectory.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + albumid, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function (data) { + var title, artist, album, rating; + if (data["subsonic-response"].directory !== undefined) { + // There is a bug in the API that doesn't return a JSON array for one artist + var children = []; + if (data["subsonic-response"].directory.child.length > 0) { + children = data["subsonic-response"].directory.child; + } else { + children[0] = data["subsonic-response"].directory.child; + } + $.each(children, function (i, child) { + if (child.id == songid) { + title = child.title; + artist = child.artist; + album = child.album; + coverart = child.coverArt; + rating = child.userRating; + } + }); + } + if (rating == 5) { + $('#songdetails_rate').attr('class', 'favorite'); + } else { + $('#songdetails_rate').attr('class', 'rate'); + } + $('#songdetails_song').html(title); + $('#songdetails_song').attr('parentid', albumid); + $('#songdetails_song').attr('childid', songid); + $('#songdetails_artist').html(artist + ' - ' + album); + var coverartSrc, coverartFullSrc; + if (coverart == undefined) { + coverartSrc = 'images/albumdefault_50.jpg'; + coverartFullSrc = ''; + } else { + coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=50&id=' + coverart; + coverartFullSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + coverart; + } + $('#coverartimage').attr('href', coverartFullSrc); + $('#coverartimage img').attr('src', coverartSrc); + $('#playermiddle').css('visibility', 'visible'); + $('#songdetails').css('visibility', 'visible'); + // SoundManager Initialize + var salt = Math.floor(Math.random() * 100000); + if (audio) { + soundManager.destroySound('audio'); + } + soundManager.onready(function () { + if (debug) { + console.log("SM HTML5 STATUS"); + $.each(soundManager.html5, function (key, value) { + console.log(key + ': ' + value); + }); + } + audio = soundManager.createSound({ + id: 'audio', + url: baseURL + '/stream.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&id=' + songid + '&salt=' + salt, + stream: true, + whileloading: function () { + if (debug) { console.log('loaded:' + this.bytesLoaded + ' total:' + this.bytesTotal); } + var percent = this.bytesLoaded / this.bytesTotal; + var scrubber = $('#audio_wrapper0').find(".scrubber"); + var loaded = $('#audio_wrapper0').find(".loaded"); + loaded.css('width', (scrubber.get(0).offsetWidth * percent) + 'px'); + }, + whileplaying: function () { + if (debug) { console.log('position:' + this.position + ' duration:' + this.duration); } + var percent = this.position / this.duration; + var scrubber = $('#audio_wrapper0').find(".scrubber"); + var progress = $('#audio_wrapper0').find(".progress"); + progress.css('width', (scrubber.get(0).offsetWidth * percent) + 'px'); + + var played = $('#audio_wrapper0').find(".played"); + var p = (this.duration / 1000) * percent, + m = Math.floor(p / 60), + s = Math.floor(p % 60); + played.html((m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s); + + // Scrobble song once percentage is reached + if (!scrobbled && p > 30 && (percent > 0.5 || p > 480)) { + if (debug) { console.log("LAST.FM SCROBBLE"); } + scrobbleSong(true); + } + }, + onload: function () { + var duration = $('#audio_wrapper0').find(".duration"); + var dp = this.duration / 1000, + dm = Math.floor(dp / 60), + ds = Math.floor(dp % 60); + duration.html((dm < 10 ? '0' : '') + dm + ':' + (ds < 10 ? '0' : '') + ds); + var scrubber = $('#audio_wrapper0').find(".scrubber"); + scrubber.unbind("click"); + scrubber.click(function (e) { + var x = (e.pageX - this.offsetLeft) / scrubber.width(); + var position = Math.round(dp * 1000 * x); + audio.play({ + position: position + }); + }); + }, + onfinish: function () { + var next = $('#CurrentPlaylistContainer tr.playing').next(); + changeTrack(next); + } + }); + audio.play('audio'); + }); + + $('table.songlist tr.song').removeClass('playing'); + $(el).addClass('playing'); + $('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png'); + $('#PlayTrack').addClass('playing'); + scrobbleSong(false); + scrobbled = false; + + if ($.cookie('EnableNotifications')) { + showNotification(coverartSrc, toHTML.un(title), toHTML.un(artist + ' - ' + album)); + } + if ($.cookie('ScrollTitle')) { + scrollTitle(toHTML.un(artist) + ' - ' + toHTML.un(title)); + } else { + setTitle(toHTML.un(artist) + ' - ' + toHTML.un(title)); + } + } + }); +} +function scrobbleSong(submission) { + var songid = $('#songdetails_song').attr('childid'); + $.ajax({ + url: baseURL + '/scrobble.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + songid + "&submission=" + submission, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + if (submission) { + scrobbled = true; + } + } + }); +} +function rateSong(songid, rating) { + $.ajax({ + url: baseURL + '/setRating.view?u=' + username + '&p=' + passwordenc + '&v=' + version + '&c=' + applicationName + '&f=jsonp&id=' + songid + "&rating=" + rating, + method: 'GET', + dataType: 'jsonp', + timeout: 10000, + beforeSend: function (req) { + req.setRequestHeader('Authorization', auth); + }, + success: function () { + updateMessage('Rating Updated!'); + } + }); +} +function playPauseSong() { + var el = '#PlayTrack'; + if ($(el).hasClass('playing')) { + $(el).find('img').attr('src', 'images/play_24x32.png'); + $(el).removeClass('playing'); + $(el).addClass('paused'); + soundManager.pause('audio'); + } else if ($(el).hasClass('paused')) { + $(el).find('img').attr('src', 'images/pause_24x32.png'); + $(el).removeClass('paused'); + $(el).addClass('playing'); + soundManager.resume('audio'); + } else { + // Start playing song + var play = $('#CurrentPlaylistContainer tr.selected').first(); + if (changeTrack(play)) { + $(el).find('img').attr('src', 'images/pause_24x32.png'); + $(el).addClass('playing'); + } else { + var first = $('#CurrentPlaylistContainer tr').first(); + changeTrack(first); + } + } +} +function changeTrack(next) { + var songid = $(next).attr('childid'); + if (songid !== undefined) { + var albumid = $(next).attr('parentid'); + playSong(next, songid, albumid); + return true; + } else { + return false; + } +} +function autoPlay() { + var firstsong = $('#CurrentPlaylistContainer tr.song:first'); + var songid = $(firstsong).attr('childid'); + var albumid = $(firstsong).attr('parentid'); + playSong(firstsong, songid, albumid); +} diff --git a/subsonic-main/src/main/webapp/mini/js/libs/utils.js b/subsonic-main/src/main/webapp/mini/js/libs/utils.js new file mode 100644 index 00000000..d12d5ce1 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/libs/utils.js @@ -0,0 +1,181 @@ +/* Reusable Functions */ +function confirmDelete() { + var question = confirm('Are you sure you want to delete the selected item(s)?'); + if (question) { + return true; + } + else { + return false; + } +} +function makeBaseAuth(user, password) { + var tok = user + ':' + password; + var hash = $.base64Encode(tok); + return "Basic " + hash; +} +function HexEncode(n) { + for (var u = "0123456789abcdef", i = [], r = [], t = 0; t < 256; t++) + i[t] = u.charAt(t >> 4) + u.charAt(t & 15); + for (t = 0; t < n.length; t++) + r[t] = i[n.charCodeAt(t)]; + return r.join("") +} +function findKeyForCode(code) { + var map = { 'keymap': [ + { 'key': 'a', 'code': 65 }, + { 'key': 'b', 'code': 66 }, + { 'key': 'c', 'code': 67 }, + { 'key': 'd', 'code': 68 }, + { 'key': 'e', 'code': 69 }, + { 'key': 'f', 'code': 70 }, + { 'key': 'g', 'code': 71 }, + { 'key': 'h', 'code': 72 }, + { 'key': 'i', 'code': 73 }, + { 'key': 'j', 'code': 74 }, + { 'key': 'k', 'code': 75 }, + { 'key': 'l', 'code': 76 }, + { 'key': 'm', 'code': 77 }, + { 'key': 'n', 'code': 78 }, + { 'key': 'o', 'code': 79 }, + { 'key': 'p', 'code': 80 }, + { 'key': 'q', 'code': 81 }, + { 'key': 'r', 'code': 82 }, + { 'key': 's', 'code': 83 }, + { 'key': 't', 'code': 84 }, + { 'key': 'u', 'code': 85 }, + { 'key': 'v', 'code': 86 }, + { 'key': 'w', 'code': 87 }, + { 'key': 'x', 'code': 88 }, + { 'key': 'y', 'code': 89 }, + { 'key': 'z', 'code': 90 } + ] + }; + var keyFound = 0; + $.each(map.keymap, function (i, mapping) { + if (mapping.code === code) { + keyFound = mapping.key; + } + }); + return keyFound; +} +function popOut() +{ + window.open(hostURL, "External Player", "status = 1, height = 735, width = 840, resizable = 0"); +} +function secondsToTime(secs) { + var hours = Math.floor(secs / (60 * 60)); + + var divisor_for_minutes = secs % (60 * 60); + var minutes = Math.floor(divisor_for_minutes / 60); + + var divisor_for_seconds = divisor_for_minutes % 60; + var seconds = Math.ceil(divisor_for_seconds); + if (seconds < 10) { + seconds = '0' + seconds; + } + + var obj = { + "h": hours, + "m": minutes, + "s": seconds + }; + return obj; +} +function updateMessage(msg) { + $('#messages').text(msg); + $('#messages').fadeIn(); + setTimeout(function () { $('#messages').fadeOut(); }, 5000); +} +// Convert to unicode support +var toHTML = { + on: function (str) { + var a = [], + i = 0; + for (; i < str.length; ) a[i] = str.charCodeAt(i++); + return "&#" + a.join(";&#") + ";" + }, + un: function (str) { + return str.replace(/&#(x)?([^&]{1,5});?/g, + function (a, b, c) { + return String.fromCharCode(parseInt(c, b ? 16 : 10)) + }) + } +}; +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); + var regexS = "[\\?&]" + name + "=([^&#]*)"; + var regex = new RegExp(regexS); + var results = regex.exec(window.location.search); + if (results == null) + return ""; + else + return decodeURIComponent(results[1].replace(/\+/g, " ")); +} +function getPathFromUrl(url) { + var strurl = url.toString(); + var u = strurl.substring(0, strurl.indexOf('?')); + return u +} +function setTitle(text) { + if (text != "") { + document.title = text; + } +} +var timer = null; +var scrollMsg = ""; +var pos = 0; +function scrollTitle(text) { + if (scrollMsg === "") { + if (text === "") { + scrollMsg = document.title; + } else { + scrollMsg = text; + } + } else { + if (text != undefined && text != scrollMsg) { + scrollMsg = text; + } + } + var msg = scrollMsg; + var speed = 1200; + var endChar = " "; + var ml = msg.length; + + title = msg.substr(pos, ml) + endChar + msg.substr(0, pos); + document.title = title; + + pos++; + if (pos > ml) { + pos = 0; + } else { + timer = window.setTimeout("scrollTitle()", speed); + } + // To stop timer, clearTimeout(timer); +} +function requestPermissionIfRequired() { + if (!hasNotificationPermission() && (window.webkitNotifications)) { + window.webkitNotifications.requestPermission(); + } +} +function hasNotificationPermission() { + return !!(window.webkitNotifications) && (window.webkitNotifications.checkPermission() == 0); +} +var notifications = new Array(); +function showNotification(pic, title, text) { + if (hasNotificationPermission()) { + closeAllNotifications() + var popup = window.webkitNotifications.createNotification(pic, title, text); + notifications.push(popup); + setTimeout(function (notWin) { + notWin.cancel(); + }, 10000, popup); + popup.show(); + } else { + console.log("showNotification: No Permission"); + } +} +function closeAllNotifications() { + for (notification in notifications) { + notifications[notification].cancel(); + } +} diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery-1.7.2.min.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery-1.7.2.min.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery-1.7.2.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
          a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
          "+""+"
          ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
          t
          ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
          ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery-ui-1.8.20.min.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery-ui-1.8.20.min.js new file mode 100644 index 00000000..7542166b --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery-ui-1.8.20.min.js @@ -0,0 +1,17 @@ +/*! jQuery UI - v1.8.20 - 2012-04-30 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.20",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.20 - 2012-04-30 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.sortable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f + * Encodes the given data with base64. + * String $.base64Encode ( String str ) + *
          + * Decodes a base64 encoded data. + * String $.base64Decode ( String str ) + * + * + * Encodes and Decodes the given data in base64. + * This encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean, such as mail bodies. + * Base64-encoded data takes about 33% more space than the original data. + * This javascript code is used to encode / decode data using base64 (this encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean). Script is fully compatible with UTF-8 encoding. You can use base64 encoded data as simple encryption mechanism. + * If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag). + * This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin. + * + * Example + * Code + * + * $.base64Encode("I'm Persian."); + * + * Result + * + * "SSdtIFBlcnNpYW4u" + * + * Code + * + * $.base64Decode("SSdtIFBlcnNpYW4u"); + * + * Result + * + * "I'm Persian." + * + * + * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com > + * @link http://www.semnanweb.com/jquery-plugin/base64.html + * @see http://www.webtoolkit.info/ + * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License] + * @param {jQuery} {base64Encode:function(input)) + * @param {jQuery} {base64Decode:function(input)) + * @return string + */ + + (function($){ + + var keyString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + var uTF8Encode = function(string) { + string = string.replace(/\x0d\x0a/g, "\x0a"); + var output = ""; + for (var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + output += String.fromCharCode(c); + } else if ((c > 127) && (c < 2048)) { + output += String.fromCharCode((c >> 6) | 192); + output += String.fromCharCode((c & 63) | 128); + } else { + output += String.fromCharCode((c >> 12) | 224); + output += String.fromCharCode(((c >> 6) & 63) | 128); + output += String.fromCharCode((c & 63) | 128); + } + } + return output; + }; + + var uTF8Decode = function(input) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + while ( i < input.length ) { + c = input.charCodeAt(i); + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if ((c > 191) && (c < 224)) { + c2 = input.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = input.charCodeAt(i+1); + c3 = input.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + return string; + } + + $.extend({ + base64Encode: function(input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + input = uTF8Encode(input); + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output = output + keyString.charAt(enc1) + keyString.charAt(enc2) + keyString.charAt(enc3) + keyString.charAt(enc4); + } + return output; + }, + base64Decode: function(input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i < input.length) { + enc1 = keyString.indexOf(input.charAt(i++)); + enc2 = keyString.indexOf(input.charAt(i++)); + enc3 = keyString.indexOf(input.charAt(i++)); + enc4 = keyString.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + } + output = uTF8Decode(output); + return output; + } + }); + })(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.cookie.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.cookie.js new file mode 100644 index 00000000..6a3e394b --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.cookie.js @@ -0,0 +1,41 @@ +/** + * jQuery Cookie plugin + * + * Copyright (c) 2010 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +jQuery.cookie = function (key, value, options) { + + // key and at least value given, set cookie... + if (arguments.length > 1 && String(value) !== "[object Object]") { + options = jQuery.extend({}, options); + + if (value === null || value === undefined) { + options.expires = -1; + } + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setDate(t.getDate() + days); + } + + value = String(value); + + return (document.cookie = [ + encodeURIComponent(key), '=', + options.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // key and possibly options given, get cookie... + options = value || {}; + var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; + return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; +}; diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.dateFormat-1.0.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.dateFormat-1.0.js new file mode 100644 index 00000000..0b7a4fe9 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.dateFormat-1.0.js @@ -0,0 +1,263 @@ +(function ($) { + + var daysInWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; + var shortMonthsInYear = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var longMonthsInYear = ["January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December"]; + var shortMonthsToNumber = []; + shortMonthsToNumber["Jan"] = "01"; + shortMonthsToNumber["Feb"] = "02"; + shortMonthsToNumber["Mar"] = "03"; + shortMonthsToNumber["Apr"] = "04"; + shortMonthsToNumber["May"] = "05"; + shortMonthsToNumber["Jun"] = "06"; + shortMonthsToNumber["Jul"] = "07"; + shortMonthsToNumber["Aug"] = "08"; + shortMonthsToNumber["Sep"] = "09"; + shortMonthsToNumber["Oct"] = "10"; + shortMonthsToNumber["Nov"] = "11"; + shortMonthsToNumber["Dec"] = "12"; + + $.format = (function () { + function strDay(value) { + return daysInWeek[parseInt(value, 10)] || value; + } + + function strMonth(value) { + var monthArrayIndex = parseInt(value, 10) - 1; + return shortMonthsInYear[monthArrayIndex] || value; + } + + function strLongMonth(value) { + var monthArrayIndex = parseInt(value, 10) - 1; + return longMonthsInYear[monthArrayIndex] || value; + } + + var parseMonth = function (value) { + return shortMonthsToNumber[value] || value; + }; + + var parseTime = function (value) { + var retValue = value; + var millis = ""; + if (retValue.indexOf(".") !== -1) { + var delimited = retValue.split('.'); + retValue = delimited[0]; + millis = delimited[1]; + } + + var values3 = retValue.split(":"); + + if (values3.length === 3) { + hour = values3[0]; + minute = values3[1]; + second = values3[2]; + + return { + time: retValue, + hour: hour, + minute: minute, + second: second, + millis: millis + }; + } else { + return { + time: "", + hour: "", + minute: "", + second: "", + millis: "" + }; + } + }; + + return { + date: function (value, format) { + /* + value = new java.util.Date() + 2009-12-18 10:54:50.546 + */ + try { + var date = null; + var year = null; + var month = null; + var dayOfMonth = null; + var dayOfWeek = null; + var time = null; + if (typeof value.getFullYear === "function") { + year = value.getFullYear(); + month = value.getMonth() + 1; + dayOfMonth = value.getDate(); + dayOfWeek = value.getDay(); + time = parseTime(value.toTimeString()); + } else if (value.search(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d{0,3}[-+]?\d{2}:\d{2}/) != -1) { /* 2009-04-19T16:11:05+02:00 */ + var values = value.split(/[T\+-]/); + year = values[0]; + month = values[1]; + dayOfMonth = values[2]; + time = parseTime(values[3].split(".")[0]); + date = new Date(year, month - 1, dayOfMonth); + dayOfWeek = date.getDay(); + } else { + var values = value.split(" "); + switch (values.length) { + case 6: + /* Wed Jan 13 10:43:41 CET 2010 */ + year = values[5]; + month = parseMonth(values[1]); + dayOfMonth = values[2]; + time = parseTime(values[3]); + date = new Date(year, month - 1, dayOfMonth); + dayOfWeek = date.getDay(); + break; + case 2: + /* 2009-12-18 10:54:50.546 */ + var values2 = values[0].split("-"); + year = values2[0]; + month = values2[1]; + dayOfMonth = values2[2]; + time = parseTime(values[1]); + date = new Date(year, month - 1, dayOfMonth); + dayOfWeek = date.getDay(); + break; + case 7: + /* Tue Mar 01 2011 12:01:42 GMT-0800 (PST) */ + case 9: + /*added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0800 (China Standard Time) */ + case 10: + /* added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0200 (W. Europe Daylight Time) */ + year = values[3]; + month = parseMonth(values[1]); + dayOfMonth = values[2]; + time = parseTime(values[4]); + date = new Date(year, month - 1, dayOfMonth); + dayOfWeek = date.getDay(); + break; + default: + return value; + } + } + + var pattern = ""; + var retValue = ""; + /* + Issue 1 - variable scope issue in format.date + Thanks jakemonO + */ + for (var i = 0; i < format.length; i++) { + var currentPattern = format.charAt(i); + pattern += currentPattern; + switch (pattern) { + case "ddd": + retValue += strDay(dayOfWeek); + pattern = ""; + break; + case "dd": + if (format.charAt(i + 1) == "d") { + break; + } + if (String(dayOfMonth).length === 1) { + dayOfMonth = '0' + dayOfMonth; + } + retValue += dayOfMonth; + pattern = ""; + break; + case "MMMM": + retValue += strLongMonth(month); + pattern = ""; + break; + case "MMM": + if (format.charAt(i + 1) === "M") { + break; + } + retValue += strMonth(month); + pattern = ""; + break; + case "MM": + if (format.charAt(i + 1) == "M") { + break; + } + if (String(month).length === 1) { + month = '0' + month; + } + retValue += month; + pattern = ""; + break; + case "yyyy": + retValue += year; + pattern = ""; + break; + case "HH": + retValue += time.hour; + pattern = ""; + break; + case "hh": + /* time.hour is "00" as string == is used instead of === */ + retValue += (time.hour == 0 ? 12 : time.hour < 13 ? time.hour : time.hour - 12); + pattern = ""; + break; + case "mm": + retValue += time.minute; + pattern = ""; + break; + case "ss": + /* ensure only seconds are added to the return string */ + retValue += time.second.substring(0, 2); + pattern = ""; + break; + case "SSS": + retValue += time.millis.substring(0, 3); + pattern = ""; + break; + case "a": + retValue += time.hour >= 12 ? "PM" : "AM"; + pattern = ""; + break; + case " ": + retValue += currentPattern; + pattern = ""; + break; + case "/": + retValue += currentPattern; + pattern = ""; + break; + case ":": + retValue += currentPattern; + pattern = ""; + break; + default: + if (pattern.length === 2 && pattern.indexOf("y") !== 0 && pattern != "SS") { + retValue += pattern.substring(0, 1); + pattern = pattern.substring(1, 2); + } else if ((pattern.length === 3 && pattern.indexOf("yyy") === -1)) { + pattern = ""; + } + } + } + return retValue; + } catch (e) { + console.log(e); + return value; + } + } + }; + }()); +}(jQuery)); + + +$(document).ready(function () { + $(".shortDateFormat").each(function (idx, elem) { + if ($(elem).is(":input")) { + $(elem).val($.format.date($(elem).val(), "dd/MM/yyyy")); + } else { + $(elem).text($.format.date($(elem).text(), "dd/MM/yyyy")); + } + }); + $(".longDateFormat").each(function (idx, elem) { + if ($(elem).is(":input")) { + $(elem).val($.format.date($(elem).val(), "dd/MM/yyyy hh:mm:ss")); + } else { + $(elem).text($.format.date($(elem).text(), "dd/MM/yyyy hh:mm:ss")); + } + }); +}); diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.disable.text.select.pack.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.disable.text.select.pack.js new file mode 100644 index 00000000..30d391c4 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.disable.text.select.pack.js @@ -0,0 +1,19 @@ +/** + * .disableTextSelect - Disable Text Select Plugin + * + * Version: 1.1 + * Updated: 2007-11-28 + * + * Used to stop users from selecting text + * + * Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/) + * + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + **/ + +/** + * Requirements: + * - jQuery (John Resig, http://www.jquery.com/) + **/ +(function($){if($.browser.mozilla){$.fn.disableTextSelect=function(){return this.each(function(){$(this).css({"MozUserSelect":"none"})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).css({"MozUserSelect":""})})}}else{if($.browser.msie){$.fn.disableTextSelect=function(){return this.each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).unbind("selectstart.disableTextSelect")})}}else{$.fn.disableTextSelect=function(){return this.each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).unbind("mousedown.disableTextSelect")})}}}})(jQuery) diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.hotkeys.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.hotkeys.js new file mode 100644 index 00000000..fbd71c71 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.hotkeys.js @@ -0,0 +1,99 @@ +/* + * jQuery Hotkeys Plugin + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Based upon the plugin by Tzury Bar Yochay: + * http://github.com/tzuryby/hotkeys + * + * Original idea by: + * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ +*/ + +(function(jQuery){ + + jQuery.hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + + function keyHandler( handleObj ) { + // Only care when a possible input has been specified + if ( typeof handleObj.data !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.toLowerCase().split(" "); + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + event.target.type === "text") ) { + return; + } + + // Keypress represents characters, not special keys + var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], + character = String.fromCharCode( event.which ).toLowerCase(), + key, modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + + } else { + possible[ modif + character ] = true; + possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); + +})( jQuery ); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.linkify-1.0-min.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.linkify-1.0-min.js new file mode 100644 index 00000000..d8051a1d --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.linkify-1.0-min.js @@ -0,0 +1,3 @@ +// encoding: utf-8 +// $.fn.linkify 1.0 - MIT/GPL Licensed - More info: http://github.com/maranomynet/linkify/ +(function(b){var x=/(^|["'(\s]|<)(www\..+?\..+?)((?:[:?]|\.+)?(?:\s|$)|>|[)"',])/g,y=/(^|["'(\s]|<)((?:(?:https?|ftp):\/\/|mailto:).+?)((?:[:?]|\.+)?(?:\s|$)|>|[)"',])/g,z=function(h){return h.replace(x,'$1$2$3').replace(y,'$1$2$3').replace(/"<``>/g,'"http')},s=b.fn.linkify=function(c){if(!b.isPlainObject(c)){c={use:(typeof c=='string')?c:undefined,handleLinks:b.isFunction(c)?c:arguments[1]}}var d=c.use,k=s.plugins||{},l=[z],f,m=[],n=c.handleLinks;if(d==undefined||d=='*'){for(var i in k){l.push(k[i])}}else{d=b.isArray(d)?d:b.trim(d).split(/ *, */);var o,i;for(var p=0,A=d.length;p1&&/\S/.test(a)){var q,r;f=f||b('
          ')[0];f.innerHTML='';f.appendChild(e.cloneNode(false));var u=f.childNodes;for(var v=0,g;(g=l[v]);v++){var w=u.length,j;while(w--){j=u[w];if(j.nodeType==3){a=j.nodeValue;if(a.length>1&&/\S/.test(a)){r=a;a=a.replace(/&/g,'&').replace(//g,'>');a=b.isFunction(g)?g(a):a.replace(g.re,g.tmpl);q=q||r!=a;r!=a&&b(j).after(a).remove()}}}}a=f.innerHTML;if(n){a=b('
          ').html(a);m=m.concat(a.find('a').toArray().reverse());a=a.contents()}q&&b(e).after(a).remove()}}else if(e.nodeType==1&&!/^(a|button|textarea)$/i.test(e.tagName)){arguments.callee.call(e)}}});n&&n(b(m.reverse()));return this};s.plugins={mailto:{re:/(^|["'(\s]|<)([^"'(\s&]+?@.+\.[a-z]{2,7})(([:?]|\.+)?(\s|$)|>|[)"',])/gi,tmpl:'$1$2$3'}}})(jQuery); diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.periodic.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.periodic.js new file mode 100644 index 00000000..dc7e8c47 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.periodic.js @@ -0,0 +1,99 @@ +/*! + * jQuery periodic plugin + * + * Copyright 2010, Tom Anderson + * Dual licensed under the MIT or GPL Version 2 licenses. + * + */ + +jQuery.periodic = function (options, callback) { + + // if the first argument is a function then assume the options aren't being passed + if (jQuery.isFunction(options)) { + callback = options; + options = {}; + } + + // Merge passed settings with default values + var settings = jQuery.extend({}, jQuery.periodic.defaults, { + ajax_complete : ajaxComplete, + increment : increment, + reset : reset, + cancel : cancel + }, options); + + // bookkeeping variables + settings.cur_period = settings.period; + settings.tid = false; + var prev_ajax_response = ''; + + run(); + + // return settings so user can tweak them externally + return settings; + + // run (or restart if already running) the looping construct + function run() { + // clear/stop existing timer (multiple calls to run() won't result in multiple timers) + cancel(); + // let it rip! + settings.tid = setTimeout(function() { + // set the context (this) for the callback to the settings object + callback.call(settings); + + // compute the next value for cur_period + increment(); + + // queue up the next run + if(settings.tid) + run(); + }, settings.cur_period); + } + + // utility function for use with ajax calls + function ajaxComplete(xhr, status) { + if (status === 'success' && prev_ajax_response !== xhr.responseText) { + // reset the period whenever the response changes + prev_ajax_response = xhr.responseText; + reset(); + } + } + + // compute the next delay + function increment() { + settings.cur_period *= settings.decay; + if (settings.cur_period < settings.period) { + // don't let it drop below the minimum + reset(); + } else if (settings.cur_period > settings.max_period) { + settings.cur_period = settings.max_period; + if (settings.on_max !== undefined) { + // call the user-supplied callback if we reach max_period + settings.on_max.call(settings); + } + } + } + + function reset() { + settings.cur_period = settings.period; + // restart with the new timeout + run(); + } + + function cancel() { + clearTimeout(settings.tid); + settings.tid = null; + } + + // other functions we might want to implement + function pause() {} + function resume() {} + function log() {} +}; + +jQuery.periodic.defaults = { + period : 4000, // 4 sec. + max_period : 1800000, // 30 min. + decay : 1.5, // time period multiplier + on_max : undefined // called if max_period is reached +}; \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.scrollTo-1.4.2-min.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.scrollTo-1.4.2-min.js new file mode 100644 index 00000000..5e787781 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.scrollTo-1.4.2-min.js @@ -0,0 +1,11 @@ +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 5/25/2009 + * @author Ariel Flesler + * @version 1.4.2 + * + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + */ +;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/plugins/jquery.shuffle.js b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.shuffle.js new file mode 100644 index 00000000..2a2b8ffa --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/plugins/jquery.shuffle.js @@ -0,0 +1,15 @@ +/** + * jQuery Shuffle (http://mktgdept.com/jquery-shuffle) + * A jQuery plugin for shuffling a set of elements + * + * v0.0.1 - 13 November 2009 + * + * Copyright (c) 2009 Chad Smith (http://twitter.com/chadsmith) + * Dual licensed under the MIT and GPL licenses. + * http://www.opensource.org/licenses/mit-license.php + * http://www.opensource.org/licenses/gpl-license.php + * + * Shuffle elements using: $(selector).shuffle() or $.shuffle(selector) + * + **/ +(function(d){d.fn.shuffle=function(c){c=[];return this.each(function(){c.push(d(this).clone(true))}).each(function(a,b){d(b).replaceWith(c[a=Math.floor(Math.random()*c.length)]);c.splice(a,1)})};d.shuffle=function(a){return d(a).shuffle()}})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/sm/soundmanager2-jsmin.js b/subsonic-main/src/main/webapp/mini/js/sm/soundmanager2-jsmin.js new file mode 100644 index 00000000..84dbe7e9 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/sm/soundmanager2-jsmin.js @@ -0,0 +1,105 @@ +/** @license + + + SoundManager 2: JavaScript Sound for the Web + ---------------------------------------------- + http://schillmania.com/projects/soundmanager2/ + + Copyright (c) 2007, Scott Schiller. All rights reserved. + Code provided under the BSD License: + http://schillmania.com/projects/soundmanager2/license.txt + + V2.97a.20120318 +*/ +(function(F){function W(W,la){function n(a){return function(d){var e=this._t;return!e||!e._a?(e&&e.sID?c._wD(m+"ignoring "+d.type+": "+e.sID):c._wD(m+"ignoring "+d.type),null):a.call(this,d)}}this.flashVersion=8;this.debugMode=!0;this.debugFlash=!1;this.consoleOnly=this.useConsole=!0;this.waitForWindowLoad=!1;this.bgColor="#ffffff";this.useHighPerformance=!1;this.html5PollingInterval=this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useFlashBlock= +!1;this.useHTML5Audio=!0;this.html5Test=/^(probably|maybe)$/i;this.preferFlash=!0;this.noSWFCache=!1;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}}; +this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null, +duration:null};this.movieID="sm2-container";this.id=la||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20120318";this.movieURL=this.version=null;this.url=W||null;this.altURL=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1, +movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};var ma;try{ma="undefined"!==typeof Audio&&"undefined"!==typeof(new Audio).canPlayType}catch(fb){ma=!1}this.hasHTML5=ma;this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only= +!1;var Ea,c=this,g=null,m="HTML5::",r,t=navigator.userAgent,i=F,O=i.location.href.toString(),k=document,na,X,j,A=[],oa=!0,w,P=!1,Q=!1,p=!1,x=!1,Y=!1,o,Za=0,R,v,pa,G,H,Z,Fa,qa,D,$,aa,I,ra,sa,ba,ca,J,Ga,ta,$a=["log","info","warn","error"],Ha,da,Ia,S=null,ua=null,q,va,K,Ja,ea,fa,wa,s,ga=!1,xa=!1,Ka,La,Ma,ha=0,T=null,ia,y=null,Na,ja,U,B,ya,za,Oa,l,Pa=Array.prototype.slice,E=!1,u,ka,Qa,z,Ra,Aa=t.match(/(ipad|iphone|ipod)/i),ab=t.match(/firefox/i),bb=t.match(/droid/i),C=t.match(/msie/i),cb=t.match(/webkit/i), +V=t.match(/safari/i)&&!t.match(/chrome/i),db=t.match(/opera/i),Ba=t.match(/(mobile|pre\/|xoom)/i)||Aa,Ca=!O.match(/usehtml5audio/i)&&!O.match(/sm2\-ignorebadua/i)&&V&&!t.match(/silk/i)&&t.match(/OS X 10_6_([3-7])/i),Sa="undefined"!==typeof console&&"undefined"!==typeof console.log,Da="undefined"!==typeof k.hasFocus?k.hasFocus():null,L=V&&"undefined"===typeof k.hasFocus,Ta=!L,Ua=/(mp3|mp4|mpa)/i,M=k.location?k.location.protocol.match(/http/i):null,Va=!M?"http://":"",Wa=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|mp4v|3gp|3g2)\s*(?:$|;)/i, +Xa="mpeg4,aac,flv,mov,mp4,m4v,f4v,m4a,mp4v,3gp,3g2".split(","),eb=RegExp("\\.("+Xa.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!M;this._global_a=null;if(Ba&&(c.useHTML5Audio=!0,c.preferFlash=!1,Aa))E=c.ignoreFlash=!0;this.supported=this.ok=function(){return y?p&&!x:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return r(c)||k[c]||i[c]};this.createSound=function(a){function d(){b=ea(b);c.sounds[f.id]=new Ea(f);c.soundIDs.push(f.id); +return c.sounds[f.id]}var e,b=null,f=e=null;e="soundManager.createSound(): "+q(!p?"notReady":"notOK");if(!p||!c.ok())return wa(e),!1;2===arguments.length&&(a={id:arguments[0],url:arguments[1]});b=v(a);b.url=ia(b.url);f=b;f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+q("badID",f.id),2);c._wD("soundManager.createSound(): "+f.id+" ("+f.url+")",1);if(s(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id];if(ja(f))e=d(),c._wD("Loading sound "+ +f.id+" via HTML5"),e._setup_html5(f);else{if(8=a)return!1;for(a-=1;0<=a;a--)if(c=l[a],!c.fired&&b.position>=c.position)c.fired=!0,n++,c.method.apply(c.scope,[c.position]);return!0};this._resetOnPosition=function(b){var a,c;a=l.length;if(!a)return!1;for(a-=1;0<=a;a--)if(c=l[a],c.fired&&b<=c.position)c.fired=!1,n--; +return!0};u=function(){var a=b._iO,d=a.from,f=a.to,e,h;h=function(){c._wD(b.sID+': "to" time of '+f+" reached.");b.clearOnPosition(f,h);b.stop()};e=function(){c._wD(b.sID+': playing "from" '+d);if(null!==f&&!isNaN(f))b.onPosition(f,h)};if(null!==d&&!isNaN(d))a.position=d,a.multiShot=!1,e();return a};Ya=function(){var a,c=b._iO.onposition;if(c)for(a in c)if(c.hasOwnProperty(a))b.onPosition(parseInt(a,10),c[a])};t=function(){var a,c=b._iO.onposition;if(c)for(a in c)c.hasOwnProperty(a)&&b.clearOnPosition(parseInt(a, +10))};i=function(){b.isHTML5&&Ka(b)};N=function(){b.isHTML5&&La(b)};f=function(){l=[];n=0;p=!1;b._hasTimer=null;b._a=null;b._html5_canplay=!1;b.bytesLoaded=null;b.bytesTotal=null;b.duration=b._iO&&b._iO.duration?b._iO.duration:null;b.durationEstimate=null;b.eqData=[];b.eqData.left=[];b.eqData.right=[];b.failures=0;b.isBuffering=!1;b.instanceOptions={};b.instanceCount=0;b.loaded=!1;b.metadata={};b.readyState=0;b.muted=!1;b.paused=!1;b.peakData={left:0,right:0};b.waveformData={left:[],right:[]};b.playState= +0;b.position=null};f();this._onTimer=function(a){var c,f=!1,h={};if(b._hasTimer||a){if(b._a&&(a||(0e.duration?b.duration:e.duration:parseInt(b.bytesTotal/b.bytesLoaded*b.duration, +10),void 0===b.durationEstimate)b.durationEstimate=b.duration;3!==b.readyState&&e.whileloading&&e.whileloading.apply(b)};this._whileplaying=function(a,c,d,f,e){var h=b._iO;if(isNaN(a)||null===a)return!1;b.position=a;b._processOnPosition();if(!b.isHTML5&&8j)c._wD(q("needfl9")),c.flashVersion=j=9;c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===j?" (AS3/Flash 9)":" (AS2/Flash 8)");8'}if(P&&Q)return!1;if(c.html5Only)return qa(),e(),c.oMC=r(c.movieID),X(),Q=P=!0,!1;var f=d||c.url,g=c.altURL||f,h;h=ba();var i,l,j=K(),m,n=null,n=(n=k.getElementsByTagName("html")[0])&&n.dir&&n.dir.match(/rtl/i),a="undefined"===typeof a?c.id:a;qa();c.url=Ia(M?f:g);d=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(null!==c.wmode&&(t.match(/msie 8/i)||!C&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))o("spcWmode"),c.wmode=null;h={name:a, +id:a,src:d,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Va+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)h.FlashVars="debug=1";c.wmode||delete h.wmode;if(C)f=k.createElement("div"),l=['',b("movie",d),b("AllowScriptAccess",c.allowScriptAccess),b("quality",h.quality),c.wmode?b("wmode",c.wmode):"",b("bgcolor",c.bgColor),b("hasPriority","true"),c.debugFlash?b("FlashVars",h.FlashVars):"",""].join("");else for(i in f=k.createElement("embed"),h)h.hasOwnProperty(i)&&f.setAttribute(i,h[i]);ta();j=K();if(h=ba())if(c.oMC=r(c.movieID)||k.createElement("div"),c.oMC.id){m=c.oMC.className;c.oMC.className=(m?m+" ":"movieContainer")+(j?" "+j:"");c.oMC.appendChild(f); +if(C)i=c.oMC.appendChild(k.createElement("div")),i.className="sm2-object-box",i.innerHTML=l;Q=!0}else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+j;i=j=null;if(!c.useFlashBlock)if(c.useHighPerformance)j={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(j={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},n)j.left=Math.abs(parseInt(j.left,10))+"px";if(cb)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(m in j)j.hasOwnProperty(m)&& +(c.oMC.style[m]=j[m]);try{C||c.oMC.appendChild(f);h.appendChild(c.oMC);if(C)i=c.oMC.appendChild(k.createElement("div")),i.className="sm2-object-box",i.innerHTML=l;Q=!0}catch(p){throw Error(q("domError")+" \n"+p.toString());}}P=!0;e();c._wD("soundManager::createMovie(): Trying to load "+d+(!M&&c.altURL?" (alternate URL)":""),1);return!0};aa=function(){if(c.html5Only)return ca(),!1;if(g)return!1;g=c.getMovie(c.id);if(!g)S?(C?c.oMC.innerHTML=ua:c.oMC.appendChild(S),S=null,P=!0):ca(c.id,c.url),g=c.getMovie(c.id); +g&&o("waitEI");c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return!0};Z=function(){setTimeout(Fa,1E3)};Fa=function(){if(ga)return!1;ga=!0;l.remove(i,"load",Z);if(L&&!Da)return o("waitFocus"),!1;var a;p||(a=c.getMoviePercent(),c._wD(q("waitImpatient",100===a?" (SWF loaded)":0 3) { + $(el).hide(); + } + }); + resizeContent(); +}); +window.onbeforeunload = function () { + closeAllNotifications(); +}; +$(window).resize(function () { + resizeContent(); +}); +function resizeContent() { + var screenwidth = $(window).width(); + $('.tabcontent').css({ 'height': (($(window).height() - 109)) + 'px' }); + $('.smsection').css({ 'height': (($(window).height() - 152)) + 'px' }); + var smheight = $('.smsection').height(); + var smwidth = $('.smsection').width(); + $('#BottomContainer').css({ 'top': smheight + 35 + 'px' }); + if ($.cookie('sidebar')) { + var tabwidth = $(window).width() - 264; + if (tabwidth >= 700) { + $('.tabcontent').css({ 'width': tabwidth + 'px' }); + } + var sbheight = $(window).height() - 152; + $('#SideBar').css({ 'height': (sbheight + 108) + 'px' }); + $('#ChatMsgs').css({ 'height': (sbheight - 166) + 'px' }); + } else { + var tabwidth = $(window).width() - 58; + if (tabwidth >= 700) { + $('.tabcontent').css({ 'width': tabwidth + 'px' }); + } + } + var tabwidth = $('.tabcontent').width(); + $('#AlbumContainer, #TrackContainer, #CurrentPlaylistContainer').css({ 'width': (tabwidth - smwidth - 30) + 'px' }); + $('#CurrentPlaylistContainer').css({ 'width': (tabwidth - 30) + 'px' }); + $('#player').css({ 'width': tabwidth + 'px' }); +} +function resizeSMSection(x) { + var defwidth = 200; + var smwidth = $('.smsection').width(); + var newsmwidth = smwidth + parseInt(x); + var newwidth = newsmwidth - defwidth; + if (smwidth != newsmwidth && newsmwidth > 150 && newsmwidth < 500) { + $('.smsection').css({ 'width': (newsmwidth) + 'px' }); + $('.actions').css({ 'width': (newsmwidth - 5) + 'px' }); + $('#BottomContainer').css({ 'width': (newsmwidth - 16) + 'px' }); + $.cookie('defaultsmwidth', newwidth, { expires: 365, path: '/' }); + var ulwidth = newsmwidth + 6; + $('#AlbumContainer').css({ 'margin-left': ulwidth + 'px' }); + $('#TrackContainer').css({ 'margin-left': ulwidth + 'px' }); + } +} \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/js/ui-ready.js b/subsonic-main/src/main/webapp/mini/js/ui-ready.js new file mode 100644 index 00000000..52b39246 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/js/ui-ready.js @@ -0,0 +1,616 @@ +$(document).ready(function () { + //User config staff + $('#Username').val($.cookie('username')); + $('#Password').val($.cookie('password')); + $('#AutoAlbumSize').val($.cookie('AutoAlbumSize')); + $('#AutoPlaylistSize').val($.cookie('AutoPlaylistSize')); + $('#Server').val($.cookie('Server')); + $('#ApplicationName').val($.cookie('ApplicationName')); + + // Set Preferences defaults + if ($.cookie('HideAZ')) { + $('#HideAZ').attr('checked', true); + } else { + $('#HideAZ').attr('checked', false); + } + if ($.cookie('EnableNotifications')) { + $('#EnableNotifications').attr('checked', true); + } else { + $('#EnableNotifications').attr('checked', false); + } + if ($.cookie('ScrollTitle')) { + $('#ScrollTitle').attr('checked', true); + } else { + $('#ScrollTitle').attr('checked', false); + } + if ($.cookie('Debug')) { + $('#Debug').attr('checked', true); + debug = true; + } else { + $('#Debug').attr('checked', false); + } + + // Tabs + $(".tabcontent").hide(); //Hide all content + if (!$.cookie('username') && !$.cookie('password') && !$.cookie('Server')) { + $('ul.tabs li a').each(function () { + if ($(this).attr("href") == '#tabPreferences') { + $(this).addClass("active"); //Add "active" class to selected tab + } + }); + $("#tabPreferences").show(); //Show first tab content + loadTabContent('#tabPreferences'); + } else { + if (window.location.hash) { + var hash = window.location.hash; + $('ul.tabs li a').each(function () { + if ($(this).attr("href") == hash) { + $(this).addClass("active"); //Add "active" class to selected tab + } + }); + $(hash).show(); //Fade in the active ID content + loadTabContent(hash); + } else { + $("ul.tabs li:first a").addClass("active").show(); //Activate first tab + $(".tabcontent:first").show(); //Show first tab content + var firstTab = $("ul.tabs li:first a").attr("href"); + loadTabContent(firstTab); + } + } + + // Tabs - Click Event + $("ul.tabs li a").click(function () { + $("ul.tabs li a").removeClass("active"); //Remove any "active" class + $(this).addClass("active"); //Add "active" class to selected tab + $(".tabcontent").hide(); //Hide all tab content + + var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content + $(activeTab).show(); //Fade in the active ID content + loadTabContent(activeTab); + }); + + // Ajax Loading Screen + $(".toploading").ajaxStart(function () { + $(this).show(); + }); + $(".toploading").ajaxStop(function () { + $(this).hide(); + }); + + // Keyboard shortcuts + $(document).keydown(function (e) { + var source = e.target.id; + if (source != 'Search' && source != 'ChatMsg') { + var unicode = e.charCode ? e.charCode : e.keyCode; + // a-z + if (unicode >= 65 && unicode <= 90) { + var key = findKeyForCode(unicode); + var el = '#index_' + key.toUpperCase(); + $('#Artists').stop().scrollTo(el, 400); + // right arrow + } else if (unicode == 39 || unicode == 176) { + var next = $('#CurrentPlaylistContainer tr.playing').next(); + if (!next.length) next = $('#CurrentPlaylistContainer li').first(); + changeTrack(next); + // back arrow + } else if (unicode == 37 || unicode == 177) { + var prev = $('#CurrentPlaylistContainer tr.playing').prev(); + if (!prev.length) prev = $('#CurrentPlaylistContainer tr').last(); + changeTrack(prev); + // spacebar + } else if (unicode == 32 || unicode == 179 || unicode == 0179) { + playPauseSong(); + } else if (unicode == 36) { + $('#Artists').stop().scrollTo('#auto', 400); + } + } + }); + + // Main Click Events + // Albums Click Event + $('#MusicFolders').live('change', function () { + var folder = $(this).val(); + loadArtists(folder, true); + $.cookie('MusicFolders', folder, { expires: 365 }); + }); + $('#ArtistContainer li.item').live('click', function () { + $('#AutoAlbumContainer li').removeClass('selected'); + $('#ArtistContainer li').removeClass('selected'); + $(this).addClass('selected'); + getAlbums($(this).attr("id"), '', '#AlbumRows'); + }); + $('#BottomIndex li a').live('click', function () { + var el = 'a[name = "index_' + $(this).text() + '"]'; + $('#Artists').stop().scrollTo(el, 400); + return false; + }); + $('#AutoAlbumContainer li.item').live('click', function () { + $('#AutoAlbumContainer li').removeClass('selected'); + $('#ArtistContainer li').removeClass('selected'); + $(this).addClass('selected'); + getAlbumListBy($(this).attr("id")); + }); + $('tr.album a.play').live('click', function (e) { + var albumid = $(this).parent().parent().attr('childid'); + var artistid = $(this).parent().parent().attr('parentid'); + getAlbums(albumid, 'autoplay', '#CurrentPlaylistContainer'); + return false; + }); + $('tr.album a.add').live('click', function (e) { + var albumid = $(this).parent().parent().attr('childid'); + var artistid = $(this).parent().parent().attr('parentid'); + getAlbums(albumid, 'add', '#CurrentPlaylistContainer'); + return false; + }); + $('tr.album a.download').live('click', function (event) { + var itemid = $(this).parent().parent().attr('childid'); + downloadItem(itemid, 'item'); + return false; + }); + $('tr.album a.rate').live('click', function (event) { + var itemid = $(this).parent().parent().attr('childid'); + rateSong(itemid, 5); + $(this).removeClass('rate'); + $(this).addClass('favorite'); + return false; + }); + $('tr.album a.favorite').live('click', function (event) { + var itemid = $(this).parent().parent().attr('childid'); + rateSong(itemid, 0); + $(this).removeClass('favorite'); + $(this).addClass('rate'); + return false; + }); + $('tr.album').live('click', function (e) { + var albumid = $(this).attr('childid'); + var artistid = $(this).attr('parentid'); + getAlbums(albumid, '', '#AlbumRows'); + return false; + }); + + // Track - Click Events + // Multiple Select + $('.noselect').disableTextSelect(); + var lastChecked = null; + $('table.songlist tr.song').live('click', function (event) { + var checkboxclass = 'table.songlist tr.song'; + var songid = $(this).attr('childid'); + var albumid = $(this).attr('parentid'); + if (!event.ctrlKey) { + $(checkboxclass).removeClass('selected'); + } + if ($(this).hasClass('selected')) { + $(this).removeClass('selected'); + } else { + $(this).addClass('selected'); + } + if (!lastChecked) { + lastChecked = this; + return; + } + if (event.shiftKey) { + var start = $(checkboxclass).index(this); + var end = $(checkboxclass).index(lastChecked); + for (i = Math.min(start, end); i <= Math.max(start, end); i++) { + $(checkboxclass).eq(i).addClass('selected'); + } + } + lastChecked = this; + }); + // Double Click + $('table.songlist tr.song').live('dblclick', function (e) { + e.preventDefault(); + //$(this).addClass('playing').siblings().removeClass('playing'); + var songid = $(this).attr('childid'); + var albumid = $(this).attr('parentid'); + playSong('', this, songid, albumid); + }); + $('table.songlist tr.song a.play').live('click', function (event) { + var songid = $(this).parent().parent().attr('childid'); + var albumid = $(this).parent().parent().attr('parentid'); + if (!$('#tabCurrent').is(':visible')) { + $('#CurrentPlaylistContainer tbody').empty(); + var track = $(this).parent().parent(); + $(track).clone().appendTo('#CurrentPlaylistContainer'); + id = 0; + count = 0; + while (id !== undefined) { + track = track.next(); + id = $(track).attr('childid'); + $(track).clone().appendTo('#CurrentPlaylistContainer'); + count++; + } + updateMessage(count + ' Song(s) Added'); + var firstsong = $('#CurrentPlaylistContainer tr.song:first'); + songid = $(firstsong).attr('childid'); + albumid = $(firstsong).attr('parentid'); + playSong(firstsong, songid, albumid); + } else { + playSong($(this).parent().parent(), songid, albumid); + } + /* 20120520 OwnCloud Merge + var songid = $(this).parent().parent().attr('childid'); + var albumid = $(this).parent().parent().attr('parentid'); + playSong($(this).parent().parent(), songid, albumid); + */ + return false; + }); + $('table.songlist tr.song a.download').live('click', function (event) { + var itemid = $(this).parent().parent().attr('childid'); + downloadItem(itemid, 'item'); + return false; + }); + $('table.songlist tr.song a.add').live('click', function (event) { + var track = $(this).parent().parent(); + $(track).clone().appendTo('#CurrentPlaylistContainer'); + return false; + }); + $('table.songlist tr.song a.remove').live('click', function (event) { + var track = $(this).parent().parent(); + $(track).remove(); + refreshRowColor('table.songlist'); + return false; + }); + $('table.songlist tr.song a.rate').live('click', function (event) { + var songid = $(this).parent().parent().attr('childid'); + rateSong(songid, 5); + $(this).removeClass('rate'); + $(this).addClass('favorite'); + return false; + }); + $('table.songlist tr.song a.favorite').live('click', function (event) { + var songid = $(this).parent().parent().attr('childid'); + rateSong(songid, 0); + $(this).removeClass('favorite'); + $(this).addClass('rate'); + return false; + }); + $('li.index').live('click', function (e) { + $('#Artists').stop().scrollTo('#auto', 400); + return false; + }); + + // Music Library Click Events + $('a#action_AddToPlaylist').click(function () { + var submenu = $('div#submenu_AddToPlaylist'); + if (submenu.is(":visible")) { + submenu.fadeOut(); + } else { + loadPlaylistsForMenu('submenu_AddToPlaylist'); + //get the position of the placeholder element + pos = $(this).offset(); + width = $(this).width(); + height = $(this).height(); + //show the menu directly over the placeholder + submenu.css({ "left": (pos.left) + "px", "top": (pos.top + height + 14) + "px" }).fadeIn(400); + } + return false; + }); + var submenu_active = false; + $('div.submenu').mouseenter(function () { + submenu_active = true; + }); + $('div.submenu').mouseleave(function () { + submenu_active = false; + setTimeout(function () { if (submenu_active == false) $('div.submenu').fadeOut(); }, 400); + }); + $('a#action_AddToCurrent').click(function () { + addToCurrent(false); + return false; + }); + $('a#action_AddAllToCurrent').click(function () { + addToCurrent(true); + return false; + }); + $('a#action_PlayAlbum').click(function () { + $('#CurrentPlaylistContainer tbody').empty(); + addToCurrent(true); + // Start playing song + var first = $('#CurrentPlaylistContainer tr.song').first(); + changeTrack(first); + return false; + }); + $('#action_RefreshArtists').click(function () { + loadArtists("", true); + return false; + }); + $('#action_IncreaseWidth').click(function () { + resizeSMSection(50); + return false; + }); + $('#action_DecreaseWidth').click(function () { + resizeSMSection(-50); + return false; + }); + $('#action_SelectAll').click(function () { + $('#Albums tr.song').each(function () { + $(this).addClass('selected'); + }); + return false; + }); + $('#action_SelectNone').click(function () { + $('#Albums tr.song').each(function () { + $(this).removeClass('selected'); + }); + return false; + }); + $('input#Search').keydown(function (e) { + var unicode = e.charCode ? e.charCode : e.keyCode; + if (unicode == 13) { + $('#action_Search').click(); + } + }); + $('#action_Search').click(function () { + var query = $('#Search').val(); + var type = $('#SearchType').val(); + search(type, query); + $('#Search').val(""); + return false; + }); + // Current Playlist Click Events + $('#action_Shuffle').live('click', function () { + $('#CurrentPlaylistContainer tbody tr.song').shuffle(); + refreshRowColor('#CurrentPlaylistContainer tbody'); + return false; + }); + $('#action_Empty').live('click', function () { + $('#CurrentPlaylistContainer tbody').empty(); + return false; + }); + $('a#action_AddCurrentToPlaylist').click(function () { + var submenu = $('div#submenu_AddCurrentToPlaylist'); + if (submenu.is(":visible")) { + submenu.fadeOut(); + } else { + loadPlaylistsForMenu('submenu_AddCurrentToPlaylist'); + //get the position of the placeholder element + pos = $(this).offset(); + width = $(this).width(); + height = $(this).height(); + //show the menu directly over the placeholder + submenu.css({ "left": (pos.left) + "px", "top": (pos.top + height + 14) + "px" }).fadeIn(400); + } + }); + $('#action_CurrentSelectAll').click(function () { + $('#CurrentPlaylist tr.song').each(function () { + $(this).addClass('selected'); + }); + return false; + }); + $('#action_CurrentSelectNone').click(function () { + $('#CurrentPlaylist tr.song').each(function () { + $(this).removeClass('selected'); + }); + return false; + }); + // Playlist Click Events + $('#AutoPlaylistContainer li.item').live('click', function () { + $('#AutoPlaylistContainer li').removeClass('selected'); + $('#PlaylistContainer li').removeClass('selected'); + $(this).addClass('selected'); + getRandomSongList('', '#TrackContainer'); + }); + $('#AutoPlaylistContainer li.item a.play').live('click', function () { + getRandomSongList('autoplay', '#CurrentPlaylistContainer'); + return false; + }); + $('#AutoPlaylistContainer li.item a.add').live('click', function () { + getRandomSongList('', '#CurrentPlaylistContainer'); + return false; + }); + $('#PlaylistContainer li.item').live('click', function () { + $('#AutoPlaylistContainer li').removeClass('selected'); + $('#PlaylistContainer li').removeClass('selected'); + $(this).addClass('selected'); + getPlaylist($(this).attr("id"), '', '#TrackContainer tbody'); + }); + $('#PlaylistContainer li.item a.play').live('click', function () { + getPlaylist($(this).parent().parent().attr("id"), 'autoplay', '#CurrentPlaylistContainer tbody'); + return false; + }); + $('#PlaylistContainer li.item a.download').live('click', function (event) { + var itemid = $(this).parent().parent().attr('id'); + downloadItem(itemid, 'playlist'); + return false; + }); + $('#PlaylistContainer li.item a.add').live('click', function () { + getPlaylist($(this).parent().parent().attr("id"), '', '#CurrentPlaylistContainer tbody'); + return false; + }); + $('#action_RefreshPlaylists').click(function () { + loadPlaylists(true); + return false; + }); + $('#action_DeletePlaylist').click(function () { + if ($('#PlaylistContainer li.selected').length > 0) { + if (confirmDelete()) { + $('#PlaylistContainer li.selected').each(function () { + deletePlaylist($(this).attr("id")); + }); + } + } + return false; + }); + $('#action_SavePlaylist').click(function () { + if ($('#PlaylistContainer li.selected').length > 0) { + $('#PlaylistContainer li.selected').each(function () { + savePlaylist($(this).attr("id")); + }); + } + return false; + }); + $('#action_RemoveSongs').click(function () { + if ($('#TrackContainer tr.selected').length > 0) { + $('#TrackContainer tr.selected').each(function () { + $(this).remove(); + }); + } + return false; + }); + $('#action_ShufflePlaylist').live('click', function () { + $('#TrackContainer tbody tr.song').shuffle(); + refreshRowColor('#TrackContainer tbody'); + return false; + }); + + // Player Click Events + $('#PlayTrack').live('click', function () { + playPauseSong(); + return false; + }); + $('#NextTrack').live('click', function () { + var next; + var length = $('#CurrentPlaylistContainer tr.song').size(); + if (length > 0) { + next = $('#CurrentPlaylistContainer tr.playing').next(); + } else { + next = $('#AlbumContainer tr.playing').next(); + } + changeTrack(next); + return false; + }); + $('#PreviousTrack').live('click', function () { + var prev = $('#CurrentPlaylistContainer tr.playing').prev(); + changeTrack(prev); + return false; + }); + $("a#coverartimage").fancybox({ + 'hideOnContentClick': true, + 'type': 'image' + }); + $('#songdetails a.rate').live('click', function (event) { + var itemid = $('#songdetails_song').attr('childid'); + rateSong(itemid, 5); + $(this).removeClass('rate'); + $(this).addClass('favorite'); + return false; + }); + $('#songdetails a.favorite').live('click', function (event) { + var itemid = $('#songdetails_song').attr('childid'); + rateSong(itemid, 0); + $(this).removeClass('favorite'); + $(this).addClass('rate'); + return false; + }); + + // Side Bar Click Events + $('#action_ToggleSideBar').live('click', function () { + if ($.cookie('sidebar')) { + $.cookie('sidebar', null); + $('#SideBar').hide(); + stopUpdateChatMessages(); + stopUpdateNowPlaying(); + } else { + $.cookie('sidebar', true, { expires: 365 }); + $('#SideBar').show(); + updateChatMessages(); + updateNowPlaying(); + } + resizeContent(); + return false; + }); + $('input#ChatMsg').keydown(function (e) { + var unicode = e.charCode ? e.charCode : e.keyCode; + if (unicode == 13) { + var msg = $('#ChatMsg').val(); + if (msg != '') { + addChatMessage(msg); + } + $('#ChatMsg').val(""); + } + }); + + // Preferences Click Events + $('#SavePreferences').live('click', function () { + var username = $('#Username').val(); + var password = $('#Password').val(); + $.cookie('username', username, { expires: 365 }); + $.cookie('password', password, { expires: 365 }); + var AutoAlbumSize = $('#AutoAlbumSize').val(); + var AutoPlaylistSize = $('#AutoPlaylistSize').val(); + $.cookie('AutoAlbumSize', AutoAlbumSize, { expires: 365 }); + $.cookie('AutoPlaylistSize', AutoPlaylistSize, { expires: 365 }); + var server = $('#Server').val(); + if (server != "") { + $.cookie('Server', server, { expires: 365 }); + } + var applicationname = $('#ApplicationName').val(); + if (applicationname != "") { + $.cookie('ApplicationName', applicationname, { expires: 365 }); + } + location.reload(true); + }); + $('#HideAZ').live('click', function () { + if ($('#HideAZ').is(':checked')) { + $.cookie('HideAZ', '1', { expires: 365 }); + $('#BottomContainer').hide(); + } else { + $.cookie('HideAZ', null); + $('#BottomContainer').show(); + } + }); + $('#EnableNotifications').live('click', function () { + if ($('#EnableNotifications').is(':checked')) { + requestPermissionIfRequired(); + if (hasNotificationPermission()) { + $.cookie('EnableNotifications', '1', { expires: 365 }); + } + } else { + $.cookie('EnableNotifications', null); + } + }); + $('#ScrollTitle').live('click', function () { + if ($('#ScrollTitle').is(':checked')) { + $.cookie('ScrollTitle', '1', { expires: 365 }); + } + }); + $('#Debug').live('click', function () { + if ($('#Debug').is(':checked')) { + $.cookie('Debug', '1', { expires: 365 }); + debug = true; + } + }); + $('input#Password').keydown(function (e) { + var unicode = e.charCode ? e.charCode : e.keyCode; + if (unicode == 13) { + $('#SavePreferences').click(); + } + }); + $('#ResetPreferences').live('click', function () { + $.cookie('username', null); + $.cookie('password', null); + $.cookie('AutoAlbumSize', null); + $.cookie('AutoPlaylistSize', null); + $.cookie('Server', null); + $.cookie('ApplicationName', null); + $.cookie('HideAZ', null); + location.reload(true); + }); + $('#ChangeLogShowMore').live('click', function () { + $('ul#ChangeLog li.log').each(function (i, el) { + $(el).show(); + }); + return false; + }); + + // JQuery UI Sortable - Drag and drop sorting + var fixHelper = function (e, ui) { + ui.children().each(function () { + $(this).width($(this).width()); + }); + return ui; + }; + $("#CurrentPlaylistContainer tbody").sortable({ + helper: fixHelper, + stop: function () { + refreshRowColor('#CurrentPlaylistContainer tbody'); + } + }).disableSelection(); + $("#TrackContainer tbody").sortable({ + helper: fixHelper, + stop: function () { + refreshRowColor('#TrackContainer tbody'); + } + }).disableSelection(); + +}); // End document.ready \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/mini/style/Style.css b/subsonic-main/src/main/webapp/mini/style/Style.css new file mode 100644 index 00000000..8b8ffe65 --- /dev/null +++ b/subsonic-main/src/main/webapp/mini/style/Style.css @@ -0,0 +1,1138 @@ +body +{ + font: 100% Trebuchet MS, Arial, Helvetica, sans-serif; + background: #fafafa; + margin: 0; + padding: 0; + text-align: center; + color: #5b5b4e; +} +img +{ + border: none; + background: none; +} +h3.title +{ + font-weight: bold; + font-size: 14px; + font-variant: small-caps; + padding: 0; + margin: 5px 0; +} + +.border { border: 2px solid #d9d9d9; } +.floatleft { float: left; } +.floatright { float: right; } +.clear { clear: both; } +.clearright { clear: right; } +.clearleft { clear: left; } +.alignleft { text-align: left; } +.alignright { text-align: right; } +.aligncenter { text-align: center; } +.padright { padding: 0 10px 0 0; } +.odd { background: #fff; } +.even { background: #f4f4f4; } +.red { color: #E64F4C; } +.italic { font-style: italic; } + +#container { + text-align: left; + min-height: 600px; + min-width: 810px; +} +#nav +{ + height: 127px; + padding: 44px 0 0 0; + background: url('../images/subsonic-36.png') no-repeat 6px 4px; + position: absolute; + top: 0px; + left: 0px; + z-index: 99; +} +#nav ul +{ + list-style-type: none; + padding: 0; + margin: 0 0 0 4px; +} +#nav li +{ + width: 50px; +} +#nav a +{ + display: block; + padding: 13px 9px 13px 15px; + color: #7C7C7C; + letter-spacing: -1px; + font-weight: bold; + font-size: 17px; + text-decoration: none; + background: #f4f4f4; + border: 1px solid #E4E4E4; + border-right: 1px solid #D5D5D5; + border-bottom: none; +} +#nav a:hover +{ + color: #545454; + border: 1px solid #D5D5D5; + border-bottom: none; +} +#nav a.first +{ + border-top: 1px solid #E4E4E4; +} +#nav a.first:hover +{ + color: #545454; + border: 1px solid #D5D5D5; + border-bottom: none; +} +#nav a.last +{ + border-bottom: 1px solid #E4E4E4; +} +#nav a.last:hover +{ + color: #545454; + border: 1px solid #D5D5D5; +} +#nav a.active +{ + color: #545454; + background: #ffffff; + border: 1px solid #CBCBCB; + border-right: none; +} +#nav a.active:hover +{ + color: #545454; + border: 1px solid #CBCBCB; + border-right: none; +} +#nav a img +{ + display: block; + margin: 3px 0 4px 1px; +} +#nav a.active img +{ + display: block; + margin: 3px 0 4px 1px; +} + +#content +{ + background: #EDEDED; + overflow: hidden; +} +#content h2 +{ + font-size: 18px; + margin: 5px; + padding: 0; +} +.tabcontent +{ + min-height: 400px; + min-width: 700px; + margin-left: 53px; +} +.smsection +{ + width: 200px; + min-height: 360px; + padding: 0 0 40px 0; + float: left; + overflow-y: auto; + overflow-x: hidden; + background: #fff; + border-right: 1px solid #cbcbcb; + position: absolute; + top: 39px; + left: 60px; + outline: none; +} +.lgsection +{ + height: 100%; + width: 100%; + min-height: 400px; + overflow: auto; + background: #fff; + border: 1px solid #cbcbcb; + margin-top: 5px; +} +.fullsection +{ + height: 100%; + width: 100%; + min-width: 450px; + min-height: 400px; + overflow: auto; + background: #fff; + border: 1px solid #cbcbcb; + margin-top: 5px; +} +.padder +{ + padding: 5px; +} +.subsection +{ + margin: 15px 20px; +} +.subsection small +{ + font-size: 10px; + margin: 0 5px; +} +.loading +{ + display: none; + height: 100%; + width: 100%; + background: url('../images/ajax-loader.gif') no-repeat center center #f4f4f4; +} +.toploading +{ + display: none; + height: 35px; + width: 40px; + margin: 0 0 0 7px; + background: url('../images/ajax-loader.gif') no-repeat center center; + float: left; +} +#messages +{ + display: none; + color: #4B95E5; + float: right; + font-size: 12px; + padding: 5px; + position: absolute; + z-index: 99; + top: 0; + right: 58px; + background: #fff; + border: 1px solid #A6CBF3; + border-top: none; +} +/* Library Style */ +ul.simplelist +{ + list-style-type: none; + margin: 0; + padding: 0; +} +ul.simplelist li +{ + font-size: 13px; + cursor: pointer; + padding: 8px; + border-bottom: 1px solid #f2f2f2; +} +ul.simplelist li a +{ + text-decoration: none; + color: #545454; +} +ul.simplelist li:hover +{ + background: #EEF5FD; +} +ul.simplelist li.index +{ + background: #F0F0F0; + border-bottom: 1px solid #DDDDDD; + color: #A7A7A7; + font-size: 11px; + font-weight: bold; + margin: 2px 0; + padding: 1px 4px; +} +ul.simplelist li.index a +{ + color: #A7A7A7; +} +ul.mainlist li.selected +{ + color: #f2f2f2; + background-color: #4B95E5; +} +ul.mainlist li.item a.play +{ + width: 20px; + height: 18px; + display: block; + margin: 0 5px 0 0; + background: url('../images/play_gl_6x8.png') no-repeat 6px center; +} +ul.mainlist li.item a.play:hover +{ + background: url('../images/play_6x8.png') no-repeat 6px center #DEECFB; +} +ul.mainlist li.item a.download +{ + float: left; + width: 20px; + height: 18px; + display: block; + background: url('../images/download_gl_9x12.png') no-repeat 5px center; +} +ul.mainlist li.item a.download:hover +{ + background: url('../images/download_gd_9x12.png') no-repeat 5px center #DEECFB; +} +ul.mainlist li.item a.add +{ + width: 20px; + height: 18px; + display: block; + margin: 0 5px 0 0; + background: url('../images/plus_gl_8x8.png') no-repeat 6px center; +} +ul.mainlist li.item a.add:hover +{ + background: url('../images/plus_8x8.png') no-repeat 6px center #DEECFB; +} +#AlbumContainer +{ + margin: 5px 5px 5px 206px; +} +#TrackContainer +{ + margin: 5px 5px 5px 206px; +} +#CurrentPlaylistContainer tr.song a.add +{ + display: none; +} +#CurrentPlaylistContainer tr.song a.remove +{ + width: 20px; + height: 20px; + display: block; + float: left; + margin: 0; + background: url('../images/minus_gl_8x2.png') no-repeat 6px center; +} +#CurrentPlaylistContainer tr.song a.remove:hover +{ + background: url('../images/minus_8x2.png') no-repeat 6px center #DEECFB; +} +#BreadCrumb a +{ + color: #4B95E5; + font-size: 12px; +} +#BreadCrumb a:hover +{ + text-decoration: underline; +} +table.songlist +{ + margin: 5px; + border-collapse: collapse; +} +table.songlist th +{ + font-size: 14px; + font-variant: small-caps; + padding: 5px 4px; +} +table.songlist tr:hover +{ + background: #EEF5FD; +} +table.songlist tr.album +{ + font-size: 13px; + border-bottom: 1px solid #f0f0f0; + cursor: pointer; +} +table.songlist tr.album td +{ + padding: 4px 0 0 2px; +} +table.songlist tr.album td.title +{ +} +table.songlist tr.album td.artist +{ +} +table.songlist tr.album td.itemactions +{ + width: 85px; + padding-left: 10px; +} +table.songlist tr.album td.albumart +{ + padding: 0; + width: 50px; +} +table.songlist tr.album td.albumart img +{ + margin: 5px 10px 0 10px; + padding: 2px; + border: 1px solid #DEDEDE; +} +table.songlist tr.album a.play +{ + float: left; + width: 20px; + height: 50px; + display: block; + background: url('../images/play_gl_6x8.png') no-repeat 7px center; +} +table.songlist tr.album a.play:hover +{ + background: url('../images/play_6x8.png') no-repeat 7px center #DEECFB; +} +table.songlist tr.album a.add +{ + float: left; + width: 20px; + height: 50px; + display: block; + background: url('../images/plus_gl_8x8.png') no-repeat 6px center; +} +table.songlist tr.album a.add:hover +{ + background: url('../images/plus_8x8.png') no-repeat 6px center #DEECFB; +} +table.songlist tr.album a.download +{ + float: left; + width: 20px; + height: 50px; + display: block; + background: url('../images/download_gl_9x12.png') no-repeat 5px center; +} +table.songlist tr.album a.download:hover +{ + background: url('../images/download_gd_9x12.png') no-repeat 5px center #DEECFB; +} +table.songlist tr.album a.remove +{ + display: none; +} +table.songlist tr.album a.rate +{ + float: left; + height: 50px; + width: 20px; + display: block; + background: url('../images/star_wo_12x12.png') 2px center no-repeat; +} +table.songlist tr.album a.rate:hover +{ + background: url('../images/star_lgo_12x12.png') 2px center no-repeat; +} +table.songlist tr.album a.favorite +{ + float: left; + height: 50px; + width: 20px; + margin: 0 5px 0 0; + display: block; + background: url('../images/star_yo_12x12.png') 2px center no-repeat; +} +table.songlist tr.song +{ + cursor: pointer; + border-bottom: 1px solid #f0f0f0; +} +table.songlist tr.song td +{ + font-size: 13px; + padding: 9px 10px; +} +table.songlist tr.song td.itemactions +{ + width: 80px; + padding-left: 27px; +} +table.songlist tr.song td.track +{ + width: 40px; + text-align: right; +} +table.songlist tr.song td.title +{ +} +table.songlist tr.song td.album +{ + padding: 0; + line-height: 31px; +} +table.songlist tr.song td.album a +{ + color: #829FC0; + text-decoration: none; +} +table.songlist tr.song td.album a:hover +{ + text-decoration: underline; +} +table.songlist tr.song td.album img +{ + border: 1px solid #DEDEDE; + display: block; + float: left; + margin: 0 5px; + padding: 2px; +} +table.songlist tr.song td.artist +{ +} +table.songlist tr.song td.time +{ + text-align: right; +} +table.songlist tr.song a.play +{ + float: left; + width: 20px; + height: 20px; + display: block; + margin: 0; + background: url('../images/play_gl_6x8.png') no-repeat 7px center; +} +table.songlist tr.song a.play:hover +{ + background: url('../images/play_6x8.png') no-repeat 7px center #DEECFB; +} +table.songlist tr.song a.download +{ + float: left; + width: 20px; + height: 20px; + display: block; + background: url('../images/download_gl_9x12.png') no-repeat 5px center; +} +table.songlist tr.song a.download:hover +{ + background: url('../images/download_gd_9x12.png') no-repeat 5px center #DEECFB; +} +table.songlist tr.song a.add +{ + float: left; + width: 20px; + height: 20px; + display: block; + margin: 0; + background: url('../images/plus_gl_8x8.png') no-repeat 6px center; +} +table.songlist tr.song a.add:hover +{ + background: url('../images/plus_8x8.png') no-repeat 6px center #DEECFB; +} +table.songlist tr.song a.rate +{ + float: left; + height: 20px; + width: 20px; + margin: 0; + display: block; + background: url('../images/star_wo_12x12.png') center 3px no-repeat; +} +table.songlist tr.song a.rate:hover +{ + background: url('../images/star_lgo_12x12.png') center 3px no-repeat; +} +table.songlist tr.song a.favorite +{ + float: left; + height: 20px; + width: 20px; + margin: 0; + display: block; + background: url('../images/star_yo_12x12.png') center 3px no-repeat; +} +table.songlist tr.playing +{ + background-color: #DEEBFA; +} +table.songlist tr.playing td:first-child +{ + background: url('../images/play_alt_gd_16x16.png') 8px 11px no-repeat; +} +table.songlist tr.selected +{ + color: #f2f2f2; + border-bottom: 1px solid #73ABE7; + background-color: #4B95E5; +} +table.songlist tr.selected td:first-child +{ + background: url('../images/check_8x7.png') 10px 16px no-repeat; +} +table.songlist tr.selected td.album a +{ + color: #f2f2f2; +} +/* tablesorter style */ +table.tablesorter { + font-family:arial; + background-color: #CDCDCD; + margin:10px 0pt 15px; + font-size: 8pt; + width: 100%; + text-align: left; +} +table.tablesorter thead tr th, table.tablesorter tfoot tr th { + background-color: #e6EEEE; + border: 1px solid #FFF; + font-size: 8pt; + padding: 4px; +} +table.tablesorter thead tr .header { + background-image: url(../images/bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} +table.tablesorter tbody td { + color: #3D3D3D; + padding: 4px; + background-color: #FFF; + vertical-align: top; +} +table.tablesorter tbody tr.odd td { + background-color:#F0F0F6; +} +table.tablesorter thead tr .headerSortUp { + background-image: url(../images/asc.gif); +} +table.tablesorter thead tr .headerSortDown { + background-image: url(../images/desc.gif); +} +table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { +background-color: #8dbdd8; +} + +#ArtistContainer +{ + min-height: 360px; +} +#BottomContainer +{ + border-top: 1px solid #F2F2F2; + background: #fff; + position: fixed; + height: 43px; + width: 184px; +} +#BottomContainer ul +{ + list-style-type: none; + margin: 0; + padding: 0 0 0 10px; +} +#BottomContainer #BottomIndex li +{ + float: left; + height: 18px; +} +#BottomContainer #BottomIndex li a +{ + color: #4B95E5; + text-decoration: none; + font-size: 13px; + padding: 0 5px 0 0; +} +#BottomContainer #BottomIndex li a:hover +{ + text-decoration: underline; +} +.actions +{ + width: 195px; + height: 29px; + margin: 4px 0 0 0; + padding: 0 0 0 5px; +} +.subactions +{ + height: 29px; + margin: 4px 0 0 0; + padding: 0 0 0 5px; +} +#songactions +{ + display: none; + float: left; +} +.submenu +{ + position: absolute; + background: #fff; + padding: 5px 10px; + margin: 2px 0 0 1px; + z-index:99; +} +.submenu a +{ + font-size: 12px; + color: #545454; + border: none; + background: none; + padding: 0; + text-decoration: none; +} +.submenu a:hover +{ + text-decoration: underline; +} +#submenu_Chat +{ + left: 490px; + bottom: 59px; + margin: 0 0 0 1px; + position: absolute; + width: 220px; + text-align: right; +} +#SideBar +{ + display: none; + width: 200px; + position: fixed; + top: 38px; + right: 4px; + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #CBCBCB; + min-height: 400px; +} +#SideBar .header +{ + padding: 5px; + font-size: 12px; + color: #545454; + font-variant: small-caps; + font-weight: bold; +} +#ChatMsgs +{ + border-bottom: 1px solid #F2F2F2; + padding: 5px; + margin: 0 0 2px; + text-align: right; + overflow-y: auto; + overflow-x: hidden; +} +#ChatMsgs .msg +{ + margin: 0 0 5px 0; +} +#ChatMsgs span.msg +{ + font-size: 12px; +} +#ChatMsgs span.user +{ + font-size: 10px; + color: #B3B8BE; +} +#ChatMsgs span.time +{ + font-size: 9px; + color: #CAD0D7; +} +#Chat .submit +{ + padding: 0 2px; +} +#submenu_NowPlaying +{ + left: 605px; + bottom: 59px; + margin: 0 0 0 1px; + position: absolute; + width: 220px; + text-align: right; +} +#NowPlaying +{ + border-bottom: 1px solid #F2F2F2; + margin: 2px 0; +} +#NowPlayingList +{ + height: 150px; + padding: 5px; + text-align: right; + overflow-y: auto; + overflow-x: hidden; +} +#NowPlayingList .msg +{ + margin: 0 0 5px 0; + font-size: 11px; +} +#NowPlayingList span.user +{ + font-size: 10px; + color: #B3B8BE; +} +#NowPlayingList span.artist +{ + font-style: italic; +} +#NowPlayingList span.title +{ +} + +/* Player Style */ +#player +{ + background: #fff; + border: 1px solid #cbcbcb; + margin: 2px 0 5px 0; + margin-left: 53px; +} +#audiocontainer +{ +} +.audiojs +{ + width: auto; + height: 56px; + margin: 0; + background: none; + font-family: inherit; + font-size: 10px; + box-shadow: none; + overflow: hidden; +} +.audiojs .play-pause +{ + display: none; +} +.audiojs .scrubber +{ + height: 2px; + margin: 28px 5px 0px 5px; + float: none; + width: auto; + position: relative; + background: #5A5A5A; + border-top: 1px solid #3F3F3F; + border-left: 0px; + border-bottom: 0px; + overflow: hidden; +} +.audiojs .progress +{ + position: absolute; + top: 0px; + left: 0px; + height: 14px; + width: 0px; + background: #CCC; + z-index: 1; + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #CCC), color-stop(0.5, #DDD), color-stop(0.51, #CCC), color-stop(1, #CCC)); + background-image: -moz-linear-gradient(center top, #CCC 0%, #DDD 50%, #CCC 51%, #CCC 100%); +} +.audiojs .loaded +{ + position: absolute; + top: 0px; + left: 0px; + height: 14px; + width: 0px; + background: black; + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222)); + background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); +} +.audiojs .time +{ + float: right; + border: none; + line-height: 17px; + padding: 0 5px; + font-size: 11px; + color: #333333; + text-shadow: none; + height: 36px; + margin: 0px 0px 0px 6px; +} +.audiojs .time em +{ + color: #333333; + padding: 0px 2px 0px 0px; + font-style: normal; +} +.playeractions +{ + margin: 5px 20px 0 20px; + width: 160px; +} +.playeractionssmall +{ + margin: 14px 8px 0 14px; + width: 50px; + float: right; +} +#playermiddle +{ + width: 100%; + /*visibility: hidden;*/ +} +#coverart +{ + width: 50px; + height: 50px; + overflow: hidden; + margin: 2px 8px 0 0; + float: left; + padding: 2px; + border: 1px solid #DEDEDE; +} +#songdetails +{ + width: 280px; + margin: 0 8px; + float: left; + visibility: hidden; +} +#songdetails ul +{ + list-style-type: none; + margin: 4px 0; + padding: 0; + height: 52px; + width: 185px; + overflow: hidden; + white-space: nowrap; + float: left; +} +#songdetails li +{ +} +#songdetails li.song +{ + font-size: 12px; + font-weight: bold; + line-height: 14px; + margin: 12px 0 2px 0; +} +#songdetails li.album +{ + font-size: 11px; + line-height: 14px; +} +#songdetails li span.label +{ + color: #B6B6B6; + display: inline; + margin: 0 4px 0 0; + text-align: right; + width: 37px; +} +#songdetails a.rate +{ + float: left; + height: 60px; + width: 30px; + display: block; + background: url('../images/star_wo_12x12.png') 10px center no-repeat; +} +#songdetails a.rate:hover +{ + background: url('../images/star_lgo_12x12.png') 10px center no-repeat; +} +#songdetails a.favorite +{ + float: left; + height: 60px; + width: 30px; + display: block; + background: url('../images/star_yo_12x12.png') 10px center no-repeat; +} +.vertshade { + position: relative; + top: 0; + left: 229px; + width: 20px; + height: 60px; + background-image: -webkit-gradient( linear, left top, right top, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 1))); +} +ul.preferences +{ + list-style-type: none; + padding: 0; + margin: 0 5px; +} +ul.preferences li +{ + color: #646464; + font-size: 11px; + padding: 8px 0; +} +ul.preferences li.title +{ + font-weight: bold; + font-size: 14px; + font-variant: small-caps; + padding: 0; +} +ul.preferences li em +{ + background: none repeat scroll 0 0 #D3D3D3; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + font-style: normal; + left: -3px; + padding: 3px 9px 3px; + position: relative; +} +ul.preferences li.log +{ + padding: 2px 0; +} +ul.preferences li span.version +{ + color: #646464; + font-weight: bold; + font-size: 11px; + padding: 0; + display: block; +} +ul.preferences li.log span.changes +{ + color: #646464; + font-size: 11px; + padding: 0 0 0 5px; + display: block; +} +span.code +{ + font-family:"Courier New",Courier,mono; + font-size: 11px; +} +#donate +{ + text-align: center; + background: #f2f2f2; + border: 1px solid #E0E0E0; + padding: 10px; +} + + +/* Button Style */ +a.button { + color: #6e6e6e; + font: bold 12px Helvetica, Arial, sans-serif; + text-decoration: none; + padding: 6px 12px; + position: relative; + display: inline-block; + text-shadow: 0 1px 0 #fff; + -webkit-transition: border-color .218s; + -moz-transition: border .218s; + -o-transition: border-color .218s; + transition: border-color .218s; + background: #f3f3f3; + background: -webkit-gradient(linear,0% 40%,0% 70%,from(#F5F5F5),to(#F1F1F1)); + background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#F5F5F5),to(#F1F1F1)); + border: solid 1px #dcdcdc; + border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; +} +a.button:hover { + color: #333; + border-color: #999; + -moz-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) -webkit-box-shadow:0 2px 5px rgba(0, 0, 0, 0.2); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); +} +a.button:active { + color: #000; + border-color: #444; +} +.shadow +{ + box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); +} + +/* Form Style */ +input +{ + font-family: Calibri, Arial, Verdana; + font-size: 14px; + padding: 5px; +} +input.large +{ + border: 1px solid #DCDCDC; + width: 180px; + margin: 5px; +} +input.xlarge +{ + border: 1px solid #DCDCDC; + width: 350px; + margin: 5px; +} +input.chat +{ + border: 1px solid #ffffff; + width: 150px; + margin: 5px; +} +input#Search +{ + border: 1px solid #DCDCDC; + width: 110px; + margin: 0 0 0 5px; +} +select +{ + font-family: Calibri, Arial, Verdana; + padding: 5px; + margin: 5px; + border: 1px solid #d6d6d6; +} +select#SearchType +{ + margin: 0; +} +select#MusicFolders +{ + width: 94%; +} +.submit +{ + margin: 0 5px; +} +label +{ + font-size: 12px; + margin: 0 5px; +} +.inputwrap +{ + float: left; + border: 1px solid #DCDCDC; + padding: 3px; + margin-bottom: 5px; +} +.checkboxes +{ + margin: 10px 5px; + vertical-align: middle; +} +.checkboxes input +{ + float: left; +} +.checkboxes label +{ + float: left; + margin: 5px 5px 0 5px; +} \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/script/jquery-1.7.1.min.js b/subsonic-main/src/main/webapp/script/jquery-1.7.1.min.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/subsonic-main/src/main/webapp/script/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
          a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
          "+""+"
          ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
          t
          ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
          ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

          ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
          ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
          ","
          "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
          ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/script/jquery-ui-1.8.18.custom.min.js b/subsonic-main/src/main/webapp/script/jquery-ui-1.8.18.custom.min.js new file mode 100644 index 00000000..f00a62f1 --- /dev/null +++ b/subsonic-main/src/main/webapp/script/jquery-ui-1.8.18.custom.min.js @@ -0,0 +1,356 @@ +/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* + * jQuery UI Position 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* + * jQuery UI Draggable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
          ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g
          ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* + * jQuery UI Selectable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
          ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* + * jQuery UI Autocomplete 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
            ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* + * jQuery UI Dialog 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
            ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
            ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
            ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
            ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Tabs 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
            ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
          • #{label}
          • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
            ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
            '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
            ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
            '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
            '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
            '+this._get(a,"weekHeader")+"
            '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
            "+(j?"
            "+(g[0]>0&&N==g[1]-1?'
            ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
            ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
            ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
            ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Effects 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c
            ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h
            ").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* + * jQuery UI Effects Fade 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Fold 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* + * jQuery UI Effects Highlight 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Pulsate 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e
            ').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/css/jquery.toastmessage.css b/subsonic-main/src/main/webapp/script/jquery.toastmessage/css/jquery.toastmessage.css new file mode 100644 index 00000000..a68683fb --- /dev/null +++ b/subsonic-main/src/main/webapp/script/jquery.toastmessage/css/jquery.toastmessage.css @@ -0,0 +1,142 @@ +.toast-container { + width: 280px; + z-index: 9999; +} + + +* html .toast-container { + position: absolute; +} + +.toast-item { + height: auto; + background: #333; + opacity: 0.9; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + color: #eee; + padding-top: 20px; + padding-bottom: 20px; + padding-left: 6px; + padding-right: 6px; + font-family: lucida Grande; + font-size: 14px; + border: 2px solid #999; + display: block; + position: relative; + margin: 0 0 12px 0; +} + +.toast-item p { + text-align: left; + margin-left: 50px; +} + +.toast-item-close { + background:url(../images/close.gif); + width:22px; + height:22px; + position: absolute; + top:7px; + right:7px; +} + +.toast-item-image { + width:32px; + height: 32px; + margin-left: 10px; + margin-top: 10px; + margin-right: 10px; + float:left; +} + +.toast-item-image-notice { + background:url(../images/notice.png); +} + +.toast-item-image-success { + background:url(../images/success.png); +} + +.toast-item-image-warning { + background:url(../images/warning.png); +} + +.toast-item-image-error { + background:url(../images/error.png); +} + + +/** + * toast types + * + * pattern: toast-type-[value] + * where 'value' is the real value of the plugin option 'type' + * + */ +.toast-type-notice { + color: white; +} + +.toast-type-success { + color: white; +} + +.toast-type-warning { + color: white; + border-color: #FCBD57; +} + +.toast-type-error { + color: white; + border-color: #B32B2B; +} + +/** + * positions + * + * pattern: toast-position-[value] + * where 'value' is the real value of the plugin option 'position' + * + */ +.toast-position-top-left { + position: fixed; + left: 20px; + top: 20px; +} + +.toast-position-top-center { + position: fixed; + top: 20px; + left: 50%; + margin-left: -140px; +} + +.toast-position-top-right { + position: fixed; + top: 20px; + right: 20px; +} + +.toast-position-middle-left { + position: fixed; + left: 20px; + top: 50%; + margin-top: -40px; +} + +.toast-position-middle-center { + position: fixed; + left: 50%; + margin-left: -140px; + margin-top: -40px; + top: 50%; +} + +.toast-position-middle-right { + position: fixed; + right: 20px; + margin-left: -140px; + margin-top: -40px; + top: 50%; +} diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/close.gif b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/close.gif new file mode 100755 index 00000000..aea6e427 Binary files /dev/null and b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/close.gif differ diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/error.png b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/error.png new file mode 100755 index 00000000..8270104d Binary files /dev/null and b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/error.png differ diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/notice.png b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/notice.png new file mode 100755 index 00000000..93c67f2b Binary files /dev/null and b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/notice.png differ diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/success.png b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/success.png new file mode 100755 index 00000000..7786ac77 Binary files /dev/null and b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/success.png differ diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/warning.png b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/warning.png new file mode 100755 index 00000000..14776e2d Binary files /dev/null and b/subsonic-main/src/main/webapp/script/jquery.toastmessage/images/warning.png differ diff --git a/subsonic-main/src/main/webapp/script/jquery.toastmessage/jquery.toastmessage.js b/subsonic-main/src/main/webapp/script/jquery.toastmessage/jquery.toastmessage.js new file mode 100644 index 00000000..9317dd7e --- /dev/null +++ b/subsonic-main/src/main/webapp/script/jquery.toastmessage/jquery.toastmessage.js @@ -0,0 +1,161 @@ +/* + * Copyright 2010 akquinet + * Licensed 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. + */ + +/** + * This JQuery Plugin will help you in showing some nice Toast-Message like notification messages. The behavior is + * similar to the android Toast class. + * You have 4 different toast types you can show. Each type comes with its own icon and colored border. The types are: + * - notice + * - success + * - warning + * - error + * + * The following methods will display a toast message: + * + * $().toastmessage('showNoticeToast', 'some message here'); + * $().toastmessage('showSuccessToast', "some message here"); + * $().toastmessage('showWarningToast', "some message here"); + * $().toastmessage('showErrorToast', "some message here"); + * + * // user configured toastmessage: + * $().toastmessage('showToast', { + * text : 'Hello World', + * sticky : true, + * position : 'top-right', + * type : 'success', + * close : function () {console.log("toast is closed ...");} + * }); + * + * To see some more examples please have a look into the Tests in src/test/javascript/ToastmessageTest.js + * + * For further style configuration please see corresponding css file: jquery-toastmessage.css + * + * This plugin is based on the jquery-notice (http://sandbox.timbenniks.com/projects/jquery-notice/) + * but is enhanced in several ways: + * + * configurable positioning + * convenience methods for different message types + * callback functionality when closing the toast + * included some nice free icons + * reimplemented to follow jquery plugin good practices rules + * + * Author: Daniel Bremer-Tonn +**/ +(function($) +{ + var settings = { + inEffect: {opacity: 'show'}, // in effect + inEffectDuration: 600, // in effect duration in miliseconds + stayTime: 3000, // time in miliseconds before the item has to disappear + text: '', // content of the item. Might be a string or a jQuery object. Be aware that any jQuery object which is acting as a message will be deleted when the toast is fading away. + sticky: false, // should the toast item sticky or not? + type: 'notice', // notice, warning, error, success + position: 'top-right', // top-left, top-center, top-right, middle-left, middle-center, middle-right ... Position of the toast container holding different toast. Position can be set only once at the very first call, changing the position after the first call does nothing + closeText: '', // text which will be shown as close button, set to '' when you want to introduce an image via css + close: null // callback function when the toastmessage is closed + }; + + var methods = { + init : function(options) + { + if (options) { + $.extend( settings, options ); + } + }, + + showToast : function(options) + { + var localSettings = {}; + $.extend(localSettings, settings, options); + + // declare variables + var toastWrapAll, toastItemOuter, toastItemInner, toastItemClose, toastItemImage; + + toastWrapAll = (!$('.toast-container').length) ? $('
            ').addClass('toast-container').addClass('toast-position-' + localSettings.position).appendTo('body') : $('.toast-container'); + toastItemOuter = $('
            ').addClass('toast-item-wrapper'); + toastItemInner = $('
            ').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('

            ').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter); + toastItemClose = $('

            ').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function() { $().toastmessage('removeToast',toastItemInner, localSettings) }); + toastItemImage = $('
            ').addClass('toast-item-image').addClass('toast-item-image-' + localSettings.type).prependTo(toastItemInner); + + if(navigator.userAgent.match(/MSIE 6/i)) + { + toastWrapAll.css({top: document.documentElement.scrollTop}); + } + + if(!localSettings.sticky) + { + setTimeout(function() + { + $().toastmessage('removeToast', toastItemInner, localSettings); + }, + localSettings.stayTime); + } + return toastItemInner; + }, + + showNoticeToast : function (message) + { + var options = {text : message, type : 'notice'}; + return $().toastmessage('showToast', options); + }, + + showSuccessToast : function (message) + { + var options = {text : message, type : 'success'}; + return $().toastmessage('showToast', options); + }, + + showErrorToast : function (message) + { + var options = {text : message, type : 'error'}; + return $().toastmessage('showToast', options); + }, + + showWarningToast : function (message) + { + var options = {text : message, type : 'warning'}; + return $().toastmessage('showToast', options); + }, + + removeToast: function(obj, options) + { + obj.animate({opacity: '0'}, 600, function() + { + obj.parent().animate({height: '0px'}, 300, function() + { + obj.parent().remove(); + }); + }); + // callback + if (options && options.close !== null) + { + options.close(); + } + } + }; + + $.fn.toastmessage = function( method ) { + + // Method calling logic + if ( methods[method] ) { + return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.toastmessage' ); + } + }; + +})(jQuery); \ No newline at end of file diff --git a/subsonic-main/src/main/webapp/script/scriptaculous.js b/subsonic-main/src/main/webapp/script/scriptaculous.js deleted file mode 100644 index 3e5543bd..00000000 --- a/subsonic-main/src/main/webapp/script/scriptaculous.js +++ /dev/null @@ -1,60 +0,0 @@ -// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 - -// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -var Scriptaculous = { - Version: '1.8.2', - require: function(libraryName) { - // inserting via DOM fails in Safari 2.0, so brute force approach - document.write('