debian/0000775000000000000000000000000012417760351007176 5ustar debian/cron.d0000664000000000000000000000017412265606646010315 0ustar 0 * * * * www-data if test -x /usr/share/drupal7/scripts/cron.sh ; then /usr/share/drupal7/scripts/cron.sh ; fi debian/files.htaccess0000664000000000000000000000123112265606646012023 0ustar # This file should be copied to all of your sites' "files" directories # (both public and private) to prevent the remote code execution # described in https://drupal.org/SA-CORE-2013-003 # Turn off all options we don't need. Options None Options +FollowSymLinks # Set the catch-all handler to prevent scripts from being executed. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 # Override the handler again if we're run later in the evaluation list. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 # If we know how to do it safely, disable the PHP engine entirely. php_flag engine off debian/drupal7.config0000664000000000000000000000216112265606646011752 0ustar #!/bin/bash # Debconf config script for Drupal set -e # Source debconf library . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/config ]; then # we support mysql and pgsql dbc_dbtypes="mysql, pgsql" dbc_dbname=drupal7 dbc_dbuser=drupal7 # source dbconfig-common stuff . /usr/share/dbconfig-common/dpkg/config --debconf-ok dbc_go drupal7 $@ fi if [ "$DPKG_DEBUG" = "developer" ]; then set -x fi ################################################## # Begin installation directories definition block# ################################################## package_name="drupal7" datadir="/var/lib/${package_name}" backupdir="${datadir}/backups/" docdir="/usr/share/doc/${package_name}" upgradesdir="${docdir}/upgrades" configdir="/etc/drupal/7" configfile="${configdir}/conf.php" includefile="${configdir}/apache2.conf" ################################################ # End installation directories definition block # ################################################ ######################################################################## # The actual configuration OLDVERSION="$2" db_stop exit 0 debian/examples0000664000000000000000000000004412265606646010744 0ustar sites/default/default.settings.php debian/drupal7.install0000664000000000000000000000064412265606646012157 0ustar *.php usr/share/drupal7 includes usr/share/drupal7 misc usr/share/drupal7 modules usr/share/drupal7 themes usr/share/drupal7 robots.txt usr/share/drupal7 profiles usr/share/drupal7 debian/etc/apache2.conf etc/drupal/7 debian/etc/settings.php etc/drupal/7/sites/default debian/cron.sh usr/share/drupal7/scripts debian/dbconfig.template usr/share/drupal7/templates debian/files.htaccess usr/share/doc/drupal7debian/drupal7.postrm0000664000000000000000000000336412265606646012037 0ustar #! /bin/bash # postrm script for ${package_name} # set -e if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi # source dbconfig-common stuff if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then . /usr/share/dbconfig-common/dpkg/postrm dbc_go drupal7 $@ fi # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package if [ "$DPKG_DEBUG" = "developer" ]; then set -x fi package_name="drupal7" datadir="/var/lib/${package_name}/" backupdir="${datadir}backups/" nukedir="/usr/share/${package_name}/" docdir="/usr/share/doc/${package_name}/" sqlfile="${docdir}database/database.mysql" upgradesdir="${docdir}upgrades/" configdir="/etc/drupal/7/" configfile="${configdir}conf.php" includefile="${configdir}apache2.conf" dbconfigfile="${configdir}/sites/default/dbconfig.php" cronfile="/etc/cron.d/${package_name}" case "$1" in purge|remove) if [ "$1" = "purge" ]; then rm -f ${dbconfigfile} if which ucf >/dev/null 2>&1; then ucf --purge ${dbconfigfile} fi db_purge || true fi ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/watch0000664000000000000000000000024412265606646010236 0ustar version=3 http://drupal.org/project/drupal .*/drupal-(\d+(?:\.\d+)*)\.(?:tgz|tar\.(?:gz|bz2|xz)) # Bart Martens Sat, 23 Feb 2013 22:22:47 +0000 debian/drupal7.links0000664000000000000000000000022412265606646011623 0ustar etc/drupal/7/htaccess usr/share/drupal7/.htaccess etc/drupal/7/sites usr/share/drupal7/sites var/lib/drupal7/files etc/drupal/7/sites/default/files debian/drupal7.dirs0000664000000000000000000000022612265606646011446 0ustar etc/drupal/7/sites/default etc/apache2/conf-available var/lib/drupal7/files var/lib/drupal7/backups usr/share/doc/drupal7 usr/share/lintian/overrides debian/compat0000664000000000000000000000000212265606646010403 0ustar 7 debian/rules0000775000000000000000000000143112265606646010264 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v PACKAGE = $(shell dh_listpackages) DESTDIR = $(CURDIR)/debian/$(PACKAGE) %: dh $@ override_dh_installdirs: dh_installdirs -X.svn -XCVS override_dh_install: dh_install -XCVS -X.svn # fix permissions find $(DESTDIR)/usr/share/drupal7 \ -name '*.png' -o -name '*.jpg' | xargs chmod a-x chmod +x $(DESTDIR)/usr/share/drupal7/scripts/* # rm $(DESTDIR)/usr/share/drupal7/misc/jquery.js install -m640 .htaccess debian/drupal7/etc/drupal/7/htaccess install -m644 debian/drupal7.lintian debian/drupal7/usr/share/lintian/overrides/drupal7 ln -s ../../drupal/7/apache.conf $(DESTDIR)/etc/apache2/conf-available/drupal7.conf override_dh_installdocs: dh_installdocs -XCVS -X.svn debian/changelog0000664000000000000000000010771112417760351011057 0ustar drupal7 (7.26-1ubuntu0.1) trusty-security; urgency=medium * SECURITY UPDATE: Unauthenticated SQL injection (LP: #1381969) - debian/patches/SA-CORE-2014-005-D7.patch: Fix SQL injection - https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patch - CVE-2014-3704 -- Gianfranco Costamagna Thu, 16 Oct 2014 11:31:19 +0200 drupal7 (7.26-1) unstable; urgency=high * New upstream release * Setting urgency to high as this release closes several important vulnerabilities; see advisory in https://drupal.org/SA-CORE-2014-001 + Impersionation while using OpenID + Access bypass in the taxonomy module + Security hardening in the Form API -- Gunnar Wolf Wed, 15 Jan 2014 16:33:24 -0600 drupal7 (7.24-2) unstable; urgency=low * Update packaging+instructions for the Apache 2.4 configuration style changes (Closes: #669742) * Avoid some errors when running the cron shell script (Closes: #717522) * Debian policy updated to 3.9.5.0 (no changes needed) -- Gunnar Wolf Fri, 29 Nov 2013 13:27:45 -0600 drupal7 (7.24-1) unstable; urgency=high * New upstream release * Setting urgency to high as this release closes several high profile vulnerabilities; see advisory in https://drupal.org/SA-CORE-2013-003 * Added a sample /usr/share/doc/files.htaccess and a corresponding note in NEWS.Debian as local administrators should use it to avoid remote code execution -- Gunnar Wolf Wed, 20 Nov 2013 19:01:24 -0600 drupal7 (7.23-1) unstable; urgency=low * New upstream release * Updated the Vcs fields in debian/control to point to the new git repository -- Gunnar Wolf Thu, 29 Aug 2013 13:59:24 -0500 drupal7 (7.22-2) unstable; urgency=low * Move debian/dbconfig.template to usr/share/drupal7/templates instead of being in /usr/share/doc/drupal7 (Closes: #710065) -- Gunnar Wolf Mon, 24 Jun 2013 18:55:45 -0500 drupal7 (7.22-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: #685006) - Remove patches integrated upstream + debian/patches/40_SA-CORE-2012-003 + debian/patches/50_SA-CORE-2012-004 + debian/patches/60_SA-CORE-2013-001 + debian/patches/70_SA-CORE-2013-002 - Fixes Test module failure with curl >= 5.4.4 (Closes: #703322) * debian/control - Bumped Standard-Version to 3.9.4, no change needed - Added Gunnar Wolf to Uploaders * debian/cron.sh - Fixed CRON_KEY not resetting each loop iteration (Closes: #659848) (Thanks to Michael Wikberg ) - Fixed missing report of errors except last one (Closes: #689333) (Thanks to Gunnar Wolf ) * debian/README.Debian - Fixed location of locally installed modules (Closes: #685333) * debian/watch - Updated by Bart Martens -- Luigi Gangitano Sat, 20 Apr 2013 18:29:57 +0200 drupal7 (7.14-2) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * Acknowledge NMUs from Gunnar Wolf * Incorporated fix for DoS on image derivative generation (Ref: SA-CORE-2013-002, CVE-2013-0316) (Closes: #701165) * Removed update warnings for Drupal core, since security fixes are provided by Debian updates. (Closes: #700545) -- Luigi Gangitano Sat, 23 Feb 2013 15:12:35 +0100 drupal7 (7.14-1.3) unstable; urgency=low * Non-maintainer upload. * Incorporated the fix for SA-CORE-2013-001 (the full diff between 7.18 and 7.19) (Closes: #698334) * Added the missing DEP3 header to the patch introduced in 7.14-1.2 -- Gunnar Wolf Tue, 29 Jan 2013 12:21:13 -0600 drupal7 (7.14-1.2) unstable; urgency=low * Non-maintainer upload. * Incorporated the fix for SA-CORE-2012-004 (the full diff between 7.17 and 7.18) -- Gunnar Wolf Fri, 11 Jan 2013 17:57:47 -0600 drupal7 (7.14-1.1) unstable; urgency=low * Non-maintainer upload. * Incorporated the fix for SA-CORE-2012-003 (the full diff between 7.15 and 7.16) -- Gunnar Wolf Fri, 19 Oct 2012 13:08:29 -0500 drupal7 (7.14-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes DoS, Unvalidated Form Redirect, Multiple Vulnerabilities (Ref: SA-CORE-2012-002, CVE-2012-1588,CVE-2012-1589, CVE-2012-1590,i CVE-2012-1591) (Closes: #671402) - Fixes errors in install.php (Closes: #670415) * debian/control - Bumped Standard-Version to 3.9.3.0, no change needed -- Luigi Gangitano Thu, 10 May 2012 20:21:41 +0200 drupal7 (7.12-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release -- Luigi Gangitano Thu, 15 Feb 2012 21:51:54 +0100 drupal7 (7.11-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes Access bypass, Cross Site Request Forgery, Multiple vulnerabilities (Ref: SA-CORE-2012-001, CVE-2012-0825, CVE-2012-0826, CVE-2012-0827) (Closes: #658337) -- Luigi Gangitano Sun, 05 Feb 2012 18:16:47 +0100 drupal7 (7.10-1.1) unstable; urgency=low * Non-maintainer upload. * debian/rules: set PACKAGE variable. (Closes: #655794) * Remove debian/README.source (no longer uses dpatch). -- Ansgar Burchardt Sat, 21 Jan 2012 12:02:49 +0100 drupal7 (7.10-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (closes: #652544) * debian/* - Switch to source format 3.0 (quilt) -- Luigi Gangitano Mon, 26 Dec 2011 17:48:10 +0100 drupal7 (7.9-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: #647168) * debian/{cron.sh,README.Debian,etc/settings.php} - Added secret key in cron job (Closes: 639387) (thanks to Christoph Schindler) -- Luigi Gangitano Wed, 02 Nov 2011 18:48:16 +0100 drupal7 (7.8-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: #640078) * debian/docs - Removed duplicate CHANGELOG entry * debian/rules - Added missing targets binary-arch build-arch build-indep -- Luigi Gangitano Sun, 04 Sep 2011 21:22:24 +0200 drupal7 (7.6-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes access bypass in private file fields and comments (Ref: SA-CORE-2011-003, CVE-TBA) -- Luigi Gangitano Thu, 28 Jul 2011 02:17:32 +0200 drupal7 (7.4-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release (Closes: #633385) * debian/control - Bumped Standard-Version to 3.9.2.0, no change needed * debian/drupal7.{config,install,postinst,postrm} - Renamed apache.conf to apache2.conf (Closes: #632925) -- Luigi Gangitano Wed, 13 Jul 2011 16:15:35 +0200 drupal7 (7.2-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release * debian/patches/30_DFSG-sources - Added uncompressed sources of javascript files * debian/control - Removed article from start of description -- Luigi Gangitano Mon, 20 Jun 2011 02:05:42 +0200 drupal7 (7.0-2) unstable; urgency=low * debian/copyright - Added copyright notices for include JQuery libraries -- Luigi Gangitano Sun, 15 May 2011 23:55:24 +0200 drupal7 (7.0-1) unstable; urgency=low * New upstream release [ Luigi Gangitano ] * debian/etc/settings.php - Updated default configuration file * debian/drupal.{dirs,links,install,postinst,postrm} - Removed automatic link from apache2 configuration file * debian/README.Debian - Added instructions on how to enable drupal in Apache2 * debian/{drupal7.postinst,docs,dbconfig.template} - Generate database configuration from template [ Kinga Marjai ] * debian/control - Removed dependency on exim4, now depends on default-mda - Bumped Standard-Version to 3.9.1, no change needed * debian/drupal6.postrm - Made postrm check for restart.sh in case dependencies were not properly installed (thanks to Bhavani Shankar.R, from Ubuntu) * debian/cron.sh - Added --fail option to curl to work around missing base_url in configuration files * debian/cron.d - Fixed conditional to avoid warnings on removed package -- Luigi Gangitano Sat, 05 Mar 2011 17:43:23 +0100 drupal7 (7.0~alpha2-1) UNRELEASED; urgency=low [ Luigi Gangitano ] * New upstream branch 7.0 * debian/* - Rename file and directories from 6 to 7 - In debian/control switch to Source: drupal7 * debian/etc/settings.php - Updated default configuration file [ Kinga Marjai ] * debian/rules - Don't set debconf version dependency -- Luigi Gangitano Tue, 3 Mar 2010 22:59:34 +0100 drupal6 (6.15-2) UNRELEASED; urgency=low [ Alexandre De Dommelin ] * Added patch to remove warnings about Drupal core updates (Closes: #521288) * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed) -- Luigi Gangitano Wed, 10 Feb 2010 17:11:35 +0100 drupal6 (6.15-1) unstable; urgency=low * New upstream release (Closes: #561726) - Fixes several XSS vulnerabilities (Closes: #562165) (Ref: SA-CORE-2009-009, CVE-2009-4369, CVE-2009-4370, CVE-2009-4371) * debian/rules - Use dh_prep instead of dh_clean -k * debian/control - Upgraded versioned dependency on debhelper to 7 * debian/README.source - Added directions on source handling -- Luigi Gangitano Mon, 11 Jan 2010 19:47:13 +0100 drupal6 (6.14-1) unstable; urgency=low * New upstream release - Removed security patches integrate upstream + 20_SA-CORE-2009-007 - Fixes multiple vulnerabilities (Ref: SA-CORE-2009-008) (Closes: #547140) * debian/control - Bumped Standard-Version to 3.8.3, no change needed * debian/compat - Switch debhelper compatibility to 7 * debian/copyright - Added reference to copyright file with version -- Luigi Gangitano Sun, 20 Sep 2009 04:57:57 +0200 drupal6 (6.13-1) UNRELEASED; urgency=low * New upstream release -- Luigi Gangitano Mon, 13 Jul 2009 19:42:38 +0200 drupal6 (6.12-1.1) unstable; urgency=high * Non-maintainer upload by the Security Team. * Apply upstream patch to fix: - XSS in the forum module - Input format access bypass via signatures - Password leakage via URLs (no CVE id yet; SA-CORE-2009-007; Closes: #535435). -- Nico Golde Mon, 06 Jul 2009 20:27:45 +0200 drupal6 (6.12-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: #529309) (Acknoledges NMU by Security Team) (Closes: #531386) - Removed security patch integrate upstream + 20_xss * debian/{control,rules,links} - Removed dependency on libjs-jquery and use jquery.js from drupal sources to avoid conflict with newer version of jquery (Closes: #530779) -- Luigi Gangitano Tue, 02 Jun 2009 18:25:58 +0200 drupal6 (6.11-1.1) unstable; urgency=high * Non-maintainer upload by the Security Team. * Fix several XSS issues (SA-CORE-2009-006; Closes: #529190). -- Nico Golde Thu, 28 May 2009 20:45:35 +0200 drupal6 (6.11-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - Fixes XSS vulnerability (Ref: SA-CORE-2009-005, CVE-2009-1575, CVE-2009-1576) (Closes: #526378) -- Luigi Gangitano Mon, 04 May 2009 19:56:12 +0200 drupal6 (6.10-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - This version fixes two Windows-only security issues (Ref: SA-CORE-2009-003, SA-CORE-2009-004) Debian is not affected by this vulnerabilites -- Luigi Gangitano Sun, 01 Mar 2009 18:26:25 +0100 drupal6 (6.9-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - Removed security patch integrate upstream + 12_SA-2008-073 + 13_SA-CORE-2009-001 * debian/cron.sh - Handle sites/all correctly (Closes: #513522) -- Luigi Gangitano Mon, 16 Feb 2009 19:37:31 +0100 drupal6 (6.6-3) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * debian/patches/13_SA-CORE-2009-001 - Added upstream patch fixing multiple vulnerabilities (Ref: SA-CORE-2009-001, CVE-TBD) -- Luigi Gangitano Fri, 16 Jan 2009 01:49:58 +0100 drupal6 (6.6-2) unstable; urgency=high * debian/patches/12_SA-2008-073 - Moved NMU changes to dpatch file * debian/control - Added dependency on ${misc:Depends} to make lintian happy * debian/drupal6.{postinst,postrm} - Changed apache configuration link name to drupal6.conf, to avoid collision with drupal5 (Closes: #509769, #505146) - Set default Postgres encoding to UTF8 (Closes: #508506) * debian/README.Debian - Fixed link to installation script (Closes: 507914) -- Luigi Gangitano Thu, 08 Jan 2009 20:49:51 +0100 drupal6 (6.6-1.1) unstable; urgency=high * Non-maintainer upload. * Urgency high because this fixes a security issue * Include upstream patch for SA-2008-073, to fix a security issue: The update system is vulnerable to Cross site request forgeries. Malicious users may cause the superuser (user 1) to execute old updates that may damage the database. (Ref: SA-2008-073, CVE-2008-6170, CVE-2008-6532, CVE-2008-6533) (Closes: #508473) -- Patrick Schoenfeld Fri, 12 Dec 2008 09:30:28 +0100 drupal6 (6.6-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes two security vulnerabilities (Ref: SA-2008-067, CVE-TBA) (Closes: #503222) * debian/drual6.postrm - Fixed missing -e option to make lintian happy * debian/patches/10_cronjob.dpatch - Added patch descritpion to make lintian happy * debian/control - Bumped Standard-Version to 3.8.0, no change needed * debian/{control,rules,links} - Added dependency on libjs-jquery and use jquery.js from it -- Luigi Gangitano Fri, 24 Oct 2008 23:06:15 +0200 drupal6 (6.5-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - Removed security patch integrate upstream + 11-SA-2008-060 -- Luigi Gangitano Mon, 20 Oct 2008 23:59:27 +0200 drupal6 (6.4-2) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * debian/patches/11-SA-2008-060 - Added upstream patch fixing several security vulnerabilities (Ref: SA-2008-060, CVE-TBA) (Closes: #501640) * debian/README.Debian - Added a notice about cookie security and session.cookie_secure configuration (Ref: CVE-2008-3661) (Closes: #501058) -- Luigi Gangitano Fri, 14 Oct 2008 15:47:20 +0200 drupal6 (6.4-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - Fixes several XSS vulnerabilities (Ref: SA-2008-047, CVE-TBD) -- Luigi Gangitano Fri, 15 Aug 2008 01:35:59 +0200 drupal6 (6.3-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: 465833) * debian/links - Changed files directory link to match new upstream configuration * debian/README.Debian - Fixed references to database population script and added instructions to enable apache2 mod_rewrite. -- Luigi Gangitano Mon, 11 Aug 2008 19:16:04 +0200 drupal6 (6.0-1) UNRELEASED; urgency=low [ Luigi Gangitano ] * New upstream branch 6.0 * debian/* - Rename file and directories from 5 to 6 - In debian/control switch to Source: drupal6 -- Luigi Gangitano Mon, 11 Aug 2008 12:00:12 +0100 drupal5 (5.7-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release - Fixes several non-security related bugs (Closes: #464876) * debian/po/hu.po - Updated Hungarian debconf templates translation (Thanks to Miklos Lukacs) (Closes: #459378) * debian/cron.sh - Fixed cron script for multisite setup (thanks to Fernando Lucas Rodriguez) (Closes: #464599) * debian/watch - Removed unused 'uupdate' token -- Luigi Gangitano Tue, 12 Feb 2008 11:40:29 +0100 drupal5 (5.6-2) unstable; urgency=low [ Luigi Gangitano ] * debian/cron.d - Fix typo in cron script that makes it running every minutes, set it to one hour (Closes: #456182) -- Luigi Gangitano Sat, 26 Jan 2008 20:51:39 +0100 drupal5 (5.6-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes Cross site request forgery in Aggregator module (Ref: SA-2008-005, CVE-TBA) - Fixes Cross site scripting vulnerability with IE6 and user submitted UTF8 input (Ref: SA-2008-006, CVE-TBA) * debian/cron.d - Run cron script every hour and not every 5 minutes (Closes: #456182) * debian/rules - Removed binary-arch section, moved all actions to binary-indep * debian/control - Swapped httpd | apache2 order to comply with policy - Bumped Standard-Version to 3.7.3, no change needed -- Luigi Gangitano Fri, 11 Jan 2008 15:02:09 +0100 drupal5 (5.5-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes SQL Injection vulnerability in contributed modules (Ref: DRUPAL-SA-2007-031, CVE-2007-6299) * debian/cron.sh - Added check of BASE_URL in baseurl.php (Closes: #448774) -- Luigi Gangitano Fri, 07 Dec 2007 21:29:18 +0100 drupal5 (5.3-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes several security vulnerabilities + DRUPAL-SA-2007-024 (Ref: CVE-2007-5595) + DRUPAL-SA-2007-025 (Ref: CVE-2007-5593) + DRUPAL-SA-2007-026 (Ref: CVE-2007-5596) + DRUPAL-SA-2007-029 (Ref: CVE-2007-5594) + DRUPAL-SA-2007-030 (Ref: CVE-2007-5597) -- Luigi Gangitano Sat, 20 Oct 2007 09:52:38 +0200 drupal5 (5.2-3) unstable; urgency=low * debian/drupal5.install - Install default robots.txt (Closes: #440291) * debian/control - Changed Recommends to postgresql -- Luigi Gangitano Thu, 23 Aug 2007 15:44:15 +0200 drupal5 (5.2-2) unstable; urgency=low * debian/README.Debian - Fixed references to configuration directory * debian/etc/settings.php - Apply fixes from upstream version (Closes: #435433) -- Luigi Gangitano Fri, 27 Jul 2007 02:12:20 +0200 drupal5 (5.2-1) unstable; urgency=high [ Luigi Gangitano ] * Urgency high due to security fixes * New upstream release - Fixes XSS in server variables (Ref: DRUPAL-SA-2007-018, CVE: TBD) - Fixes XSRF in Forms API (Ref: DRUPAL-SA-2007-017, CVE: TBD) * debian/copyright - Fixed FSF address to make lintian happy * debian/control - Removed dependencies on php4 - Updated httpd real package dependency to apache2 - Changed Build-Depend-Indep to Build-Depend (policy 7.6) -- Luigi Gangitano Fri, 27 Jul 2007 01:48:04 +0200 drupal5 (5.1-3) unstable; urgency=low [ Luigi Gangitano ] * debian/control - Removed dependencies on 8.1 version of postgresql packages - Fixed typo in postgresql-server package (Closes: #429229) -- Luigi Gangitano Wed, 29 Jun 2007 21:39:33 +0200 drupal5 (5.1-2) unstable; urgency=low [ Luigi Gangitano ] - debian/control * Added Xs-Vcs-{Svn,Browser} tags - debian/README.Debian * Added istructions on Postgres database install and PHP memory limit (Closes: #427001) [ Bart Cornelis (cobaco) ] - New Norwegian Bokmael translation by Hans Fredrik Nordhaug -- Luigi Gangitano Tue, 13 Mar 2007 00:21:14 +0100 drupal5 (5.1-1) unstable; urgency=low [ Luigi Gangitano ] * New upstream release (Closes: #409522) * debian/{links,drupal5.install,cron.d,etc/apache.conf} - Applied patch from Karl-Heinz Nirschl fixing paths [ Bart Cornelis ] Translations * Updated Dutch translation by Bart Cornelis * Updated Japanese translation by Hideki Yamane * Updated German translation by Helge Kreutzmann (Closes: #413891) * Updated Portuguese translation by Miguel Figueiredo (Closes: #413905) * New Swedisch Translation by Daniel Nylander * New Tamil translation by Tirumurti Vasudevan (Closes: #413824) * New Czech translation by Miroslav Kure (Closes: #413798) * New Russion translation by Yuriy Talakan (Closes: #414063) * New Basque translation by Piarres Beobide (Closes: #413966) * New Galician translation by Jacobo Tarrio (Closes: #413764) -- Luigi Gangitano Sat, 10 Mar 2007 20:04:24 +0100 drupal5 (5.0-1) UNRELEASED; urgency=low * (NOT RELEASED YET) New upstream release * debian/* - Rename file and directories from 4.7 to 5 - In debian/control switch to Source: drupal5 - Add watch file * debian/control - Removed Suggests on ssl enabled packages - Removed dependencies on apache and added dependency on httpd | apache - Added dependency on php4-gd | php5-gd * debian/{rules,drupal5.install} - Removed reference to not-existing directory 'database' * debian/patches/10_cronjob.dpatch - Updated patch to new cron script -- Luigi Gangitano Fri, 26 Jan 2007 20:04:24 +0100 drupal (4.7.5-2) UNRELEASED; urgency=low [ Luigi Gangitano ] * NOT RELEASED YET * debian/control - Bumped Standards-Version to 3.7.2 (no change needed) - Removed dependency on postgsql-{client,server}-8.0 which is not in the archive anymore * Translations - Updated Dutch translations by Bart Cornelis -- Bart Cornelis (cobaco) Tue, 23 Jan 2007 11:50:45 +0100 drupal (4.7.5-1) unstable; urgency=low * New upstream release - Fixes Denial of Service (DRUPAL-SA-2007-002) - Fixes CSS Vulnerability (DRUPAL-SA-2007-001) -- Luigi Gangitano Sun, 7 Jan 2007 00:33:33 +0100 drupal (4.7.4-3) unstable; urgency=low * debian/po/fr.po - Updated French debconf templates translation (Thanks to Thomas Huriaux) (Closes: #404967) * debian/control - Add php5 dependency (Closes: #405162) -- Luigi Gangitano Sun, 7 Jan 2007 00:13:36 +0100 drupal (4.7.4-2) unstable; urgency=low * debian/control - Fixed dependency on postgresql-client - Removed dependency on makepasswd (not needed since we use dbconfig.common) - Removed dependency on php4-cli (not needed with new cron script) - Promote Recommends: php4 to Depends: php4 * debian/etc/settings.php - Fix warning if baseurl.php does not exists * debian/copyright - Fixed copyright information as requested by ftp-master -- Luigi Gangitano Tue, 5 Dec 2006 15:37:25 +0100 drupal (4.7.4-1) unstable; urgency=low * Prepare package for new inclusion in Debian - Thanks to Karl-Heinz Nirschl for keeping this package in his repository and allowing me to start from his work - Change (binary) package name to drupal-4.7 allowing for multiple version to be installed concurrently, so admins can control upgrade between releases - Add dependency on dbconfig-common and switch custom config script to use functions provided by dbconfig-common (Closes: #366692) - Removed unused templates - Added dependency on curl for cron script execution - Take over removal request (Closes: #375496) - Update to latest revision (Closes: #307821, #365047, #365709) -- Luigi Gangitano Thu, 23 Nov 2006 21:53:19 +0100 drupal (4.7.4-0brainlog1) unstable; urgency=low * new upstream release because patches do not apply cleanly * fixes: DRUPAL-SA-2006-024, DRUPAL-SA-2006-025, DRUPAL-SA-2006-026 -- Karl-Heinz Nirschl Fri, 20 Oct 2006 19:26:16 +0200 drupal (4.7.2-0brainlog4) unstable; urgency=low * add security fix DRUPAL-SA-2006-011 XSS Vulnerability in user module * move scripts dir to doc -- Karl-Heinz Nirschl Thu, 3 Aug 2006 19:46:57 +0200 drupal (4.7.2-0brainlog3) unstable; urgency=low * fix initial database generation - now checks for mysql version -- Karl-Heinz Nirschl Sat, 8 Jul 2006 13:13:12 +0200 drupal (4.7.2-0brainlog2) unstable; urgency=low * Using a fresh tarball and no .svn files. * Fix x. permissions. * Use debian mysql maint password for mysql install -- Tzafrir Cohen Fri, 7 Jul 2006 15:59:41 +0300 drupal (4.7.2-0brainlog1) unstable; urgency=low * new upstream release * add patch handling to package - make cron job less verbose -- Karl-Heinz Nirschl Fri, 16 Jun 2006 17:13:50 +0200 drupal (4.7.1-0brainlog1) unstable; urgency=low * new upstream version -- Karl-Heinz Nirschl Mon, 29 May 2006 14:01:48 +0200 drupal (4.6.5-0brainlog1) unstable; urgency=low * update to drupal 4.6.5 (new upstream) -- Karl-Heinz Nirschl Mon, 29 May 2006 13:58:55 +0200 drupal (4.6.3-0brainlog1) unstable; urgency=low * New upstream version (Closes: #307821) * based on the drupal 4.5.2-4 debian package * remove the auto update database stuff * added debconf entry for the base_url -- Karl-Heinz Nirschl Thu, 29 Sep 2005 19:10:17 +0200 drupal (4.5.2-4) unstable; urgency=low * [Miguel Figueiredo ] Added Portuguese translation (Closes: #301394) * [Valentina Commissari ] Added Italian translation (Closes: #301946) * [Gleydson Mazioli da Silva ] Updated Brazilian Portuguese translation. * Fixed typo in package description (Closes: #306997) -- Hilko Bengen Thu, 19 May 2005 21:23:27 +0200 drupal (4.5.2-3) unstable; urgency=high * Fixes "Bypass access via comments" problem mentioned in http://drupal.org/node/19009. Patch from Gerhard Killesreiter, thanks. I consider this a critical bug, hence urgency=high. * [Sergio Talens-Oliag ] Updated Spanish and Catalan Debconf translations and converted them to UTF-8. -- Hilko Bengen Tue, 22 Mar 2005 11:14:36 +0100 drupal (4.5.2-2) unstable; urgency=low * Changed includes/bootstrap.inc: conf.php (or $site.php) is loaded from /etc/drupal directly, without the need for any link. * Removed indentations from sed script which is used to edit the configuration file. * Rolled back session.inc to version found in 4.5.1; fixes bug documented in http://drupal.org/node/15666 * Added documentation about manual update procedure in README.Debian and Debconf templates (Closes: #293804) * Added documentation about adding modules and themes that are not part of the package. * NEWS.Debian mentions where to get Marvin and UnConeD themes that used to be part of the Drupal distribution. -- Hilko Bengen Tue, 15 Mar 2005 15:16:26 +0100 drupal (4.5.2-1) unstable; urgency=low * New upstream version (Closes: #290745; That was fast, wasn't it?) * Updates Japanese Debconf template, thanks to Hideki Yamane (Closes: #290439) * The config file /etc/drupal/conf.php is only generated if it hasn't existed. It is no longer edited. -- Hilko Bengen Sun, 16 Jan 2005 14:49:50 +0100 drupal (4.5.1-2) unstable; urgency=low * /etc/drupal/conf.php is no longer a conffile (Closes: #289624) * Should install with mysql-client-4.1 now (Closes: #285733) -- Hilko Bengen Wed, 12 Jan 2005 02:16:28 +0100 drupal (4.5.1-1) unstable; urgency=low * New upstream version (Closes: #277547, #289216, #278345) * Marvin and UnConeD have been split off into separate packages, as they are not officially supported by upstream any longer. * Added Japanese Debconf template (Closes: #288040) -- Hilko Bengen Sun, 9 Jan 2005 04:21:03 +0100 drupal (4.4.2-2) unstable; urgency=low * Bump version dependency to 0.0.37 where better support for PostgreSQL is included (Closes: 263730) * Another patch to node.module for DB-independennce (Closes: 258015) -- Hilko Bengen Wed, 18 Aug 2004 00:39:58 +0200 drupal (4.4.2-1) unstable; urgency=low * New upstream bugfix release - PostgreSQL support fixed in node.module (Closes: #258015, #258016) * Fixed sed statement in postinst so it will work with woody's sed. (Closes: #257529) * Depends: sharutils (Closes: #258156) * Cron script checks whether /usr/share/drupal/scripts/cron.sh exists and is executable (Closes: #251853) -- Hilko Bengen Tue, 20 Jul 2004 00:03:06 +0200 drupal (4.4.1-3) unstable; urgency=low * Included Marvin and Unconed themes from contrib (Closes: #255039) -- Hilko Bengen Mon, 28 Jun 2004 14:34:40 +0200 drupal (4.4.1-2) unstable; urgency=high * Applied admin_node.patch from against the "Invalid argument supplied for foreach() in /usr/share/drupal/modules/node.module" error (Closes: #242992) * Fixed removal of links in webserver directories * Shut up cron.sh (Closes: #251853) * Install misc/ directory (images and css) (Closes: #253550) * Fixed PostgreSQL removal, added some docs (Closes: #253282) -- Hilko Bengen Thu, 10 Jun 2004 16:06:47 +0200 drupal (4.4.1-1) unstable; urgency=low * New upstream version (Closes: #246307) * Added to cron.d (Closes: #242199) * Create language in database/database.pgsql (Closes: #242572) * Fixed dependencies (Closes: #242622): - Depends on php4-cgi (since it's used by maintainer scripts) - Recommends: php4 | libapache2-mod-php4 (After all, one _can_ run Drupal with a PHP-CGI setup * Fixed generation of links in webserver directories (Closes: #249488) * Out-of-the-box support for multiple sites (Closes: #246009) * Put themes directory under /usr/share/drupal. Themes are no longer handled as conffiles. * Fixed path to database.mysql in README.Debian (Closes: #246414) -- Hilko Bengen Tue, 25 May 2004 10:12:34 +0200 drupal (4.3.2-3) unstable; urgency=low * Rewrote README.Debian, copying substantial parts from the INSTALL file (Closes: #240505) * Re-added a (commented-out) directive for restricting access to admin.php to htaccess file -- Hilko Bengen Sun, 28 Mar 2004 17:38:11 +0200 drupal (4.3.2-2) unstable; urgency=low * [Bart Cornelis ] Added Dutch debconf translation (Closes: #232230) * [Sergio Talens-Oliag ] Added Spanish and Catalan debconf translations (Closes: #235018 * [Gleydson Mazioli da Silva ] Added Brazilian Portugese debconf translation (Closes: #185829) * [Christian Perrier ] Added French debconf translation (Closes: #200722) * Added German debconf translation -- Hilko Bengen Tue, 16 Mar 2004 00:43:55 +0100 drupal (4.3.2-1) unstable; urgency=low * New maintainer (Closes: #227771) * New upstream release (Closes: #204241, #220066) - Test shows that kuro5hin RSS feed can be imported just fine (Closes: #184252) - The encoding bug in ping.module appears to have been fixed (Closes: #215643) * Revamped installation and automatic upgrade procedure - Update sets password in config.php _and_ database (Closes: #193545) - It's possible to install the package without performing any database setup at all (Closes: #201202) * Fixed /etc/drupal/apache.conf (Closes: #219143) * Basic PostgreSQL support -- user and database are created (Closes: #186563) * Should work with apache2 (Closes: #235912) -- Hilko Bengen Thu, 11 Mar 2004 17:30:11 +0100 drupal (4.1.0-10) unstable; urgency=low * Maintainer field set to QA Group * New Brazilian Portuguese debconf template translation, provided by Andre Luis Lopes . Closes: #228109 -- Emanuele Rocca Sun, 1 Feb 2004 20:35:04 +0100 drupal (4.1.0-9.1) unstable; urgency=low * NMU * French debconf templates translation. Closes: #200722 * Correction to english templates for (I guess) better english and formulations. Closes: #186566 * Brazilian portuguese debconf tempaltes translation. Closes: #185829 -- Christian Perrier Tue, 16 Sep 2003 08:55:38 +0200 drupal (4.1.0-9) unstable; urgency=low * Two corrections in postinst to allow manually setting up the DB on upgrade. -- Hugo Espuny Wed, 19 Mar 2003 22:02:50 +0100 drupal (4.1.0-8) unstable; urgency=low * Added patch from drupal.org (Closes: #185217) * Minor typo on apache.conf * Now htaccess is set up dynamically. * Example of restricted admin.php is now at htaccess * Debconf now does not repeat questions after preconfiguring. -- Hugo Espuny Wed, 19 Mar 2003 20:09:45 +0100 drupal (4.1.0-7) unstable; urgency=high * Added securing point to README.Debian * Alias directive on /etc/drupal/apache.conf now is changed dynamically according with debconf question. -- Hugo Espuny Fri, 14 Mar 2003 20:33:29 +0100 drupal (4.1.0-6) unstable; urgency=high * Corrected postrm problem whe downgrading to certain versions. -- Hugo Espuny Fri, 14 Mar 2003 19:38:15 +0100 drupal (4.1.0-5) unstable; urgency=low * Corrected mv themes order in rules file. -- Hugo Espuny Fri, 14 Mar 2003 19:22:12 +0100 drupal (4.1.0-4) unstable; urgency=low * Corrected themes moving engine. (Closes: #184752) * Themes are now configfiles (since 4.1.0-2). I forgot to say... -- Hugo Espuny Fri, 14 Mar 2003 17:30:45 +0100 drupal (4.1.0-3) unstable; urgency=low * Updated to policy version 3.5.9 -- Hugo Espuny Fri, 14 Mar 2003 00:28:18 +0100 drupal (4.1.0-2) unstable; urgency=low * Corrected directive "AllowOverride None" to "AllowOverride All" in /etc/drupal/apache.conf. (Closes: #184183) * Corrected directive to in /etc/drupal/apache.conf. * Corrected cron file, postinst and templates. Now debconf asks for the whole URL, not only TCP port. (Closes: #184182) (Closes: #184182) Thanks to John Goerzen to point me those. * News feed now works properly. (Closes: #184252) (Closes: #184253) -- Hugo Espuny Wed, 12 Mar 2003 18:25:35 +0100 drupal (4.1.0-1) unstable; urgency=high * New upstream version (Closes: #178506) (Closes: #173107) * Moved to use po-debconf. * Fixed README.Debian (Closes: #173103) (Closes: #184111) -- Hugo Espuny Fri, 7 Mar 2003 21:09:02 +0100 drupal (4.0-4) unstable; urgency=low * Corrected a bug on cron.d file. -- Hugo Espuny Wed, 11 Dec 2002 22:39:16 +0100 drupal (4.0-3) unstable; urgency=low * Corrected /etc/cron.d/drupal (thanx to Paul van Tilburg ). (Closes: #172153) * Corrected link in README.Debian. (Closes: #169949) * Changed priority to extra. * postrm now executes an abort install properly. * Updated policy standars to 3.5.8 -- Hugo Espuny Tue, 10 Dec 2002 00:38:36 +0100 drupal (4.0-2) unstable; urgency=low * Minor typo correction in templates file. * Minor bug correction about webserver port in postinst. * Added versioned dependency on wget to support HTTPS * Moved update.php to /usr/share/doc/drupal/upgrades -- Hugo Espuny Wed, 30 Oct 2002 16:54:06 +0100 drupal (4.0-1) unstable; urgency=low * New debian package. (Closes: #164676) * Code taken from phpnuke package. -- Hugo Espuny Tue, 29 Oct 2002 21:21:26 +0100 debian/docs0000664000000000000000000000014612265606646010061 0ustar MAINTAINERS.txt UPGRADE.txt INSTALL.mysql.txt INSTALL.pgsql.txt INSTALL.sqlite.txt README.txt scripts debian/drupal7.prerm0000664000000000000000000000025312265606646011632 0ustar #! /bin/bash # prerm script for ${package_name} # set -e . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm dbc_go drupal7 $@ #DEBHELPER# exit 0 debian/drupal7.lintian0000664000000000000000000000044412265606646012145 0ustar drupal7: package-contains-upstream-install-documentation usr/share/doc/drupal7/INSTALL.mysql.txt drupal7: package-contains-upstream-install-documentation usr/share/doc/drupal7/INSTALL.pgsql.txt drupal7: package-contains-upstream-install-documentation usr/share/doc/drupal7/INSTALL.sqlite.txt debian/source/0000775000000000000000000000000012265606646010505 5ustar debian/source/format0000664000000000000000000000001412265606646011713 0ustar 3.0 (quilt) debian/NEWS0000664000000000000000000000243612265606646007711 0ustar drupal7 (7.24-1) unstable; urgency=high In order to avoid a remote code execution vulnerability (described in https://drupal.org/SA-CORE-2013-003), it is recommended to create a .htaccess file (or an equivalent configuration directive in case you are not using Apache to serve your Drupal sites) in each of your sites' "files" directories (both public and private, in case you have both configured). This file's contents should include the following declarations: # Turn off all options we don't need. Options None Options +FollowSymLinks # Set the catch-all handler to prevent scripts from being executed. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 # Override the handler again if we're run later in the evaluation list. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 # If we know how to do it safely, disable the PHP engine entirely. php_flag engine off You will find a copy of this file in /usr/share/doc/drupal7/files.htaccess, but, as it's not in a Debian-controlled directory (but on a local one), we cannot install it for you. -- Gunnar Wolf Wed, 20 Nov 2013 19:17:41 -0600 debian/README.Debian0000664000000000000000000001720012265606646011246 0ustar Drupal for Debian ----------------- 1. Introduction 2. Manual initial database generation and configuration 3. Enabling access in Apache 4. Database population script 5. Deleting the Drupal database 6. Changes to Apache 2 configuration 7. Securing your portal 8. Set up independent "cron" maintenance jobs 9. Upgrading database from previous versions 10. Virtual hosts 11. Additional themes and modules 12. Privacy of session cookies A. Customizing themes B. Links for more support 1. Introduction --------------- The latest version of Drupal can always be found at . A running database server is needed for this package to work. It doesn't matter whether the DBMS runs on the same machine as the web server. MySQL and PostgreSQL servers are supported by this package. You can change the DBMS configuration after installation by running dpkg-reconfigure drupal7 2. Manual initial database generation and configuration ------------------------------------------------------- This is only necessary if you chose not to automatically create the database at installation time or if automatic creation failed. Directions on how to create a database for you drupal portal can be found in INSTALL.mysql.txt and INSTALL.pgsql.txt files in /usr/share/doc/drupal7. 3. Enabling access in Apache ---------------------------- Drupal 7 is not enabled by default in Apache 2. To enable web access to the drupal application, simply run this command as root: # a2enconf drupal7 4. Database population script ----------------------------- Once a database is set up and configured, drupal needs to create tables and insert default records into it. This can be done running the install.php script on portal web site, e.g. http://localhost/drupal7/install.php 4. Deleting the Drupal database ------------------------------- The database may be deleted automatically on purging the package (debconf prompt the user asking to do it or not). If you want to purge the data stored at MySQl database manually you can use the following command: mysqladmin -p drop drupal7 being the user who admin MySQL. 5. Changes to Apache 2 configuration ------------------------------------ By default, Drupal passes path arguments to itself via its dynamically generated URLs. This results in URLs that look like "http://www.example.com/?q=node/83." This can make URLs hard to read and it prevents some search engines from indexing the pages with these URLs You can tell Drupal to use "clean URLs", eliminating the "?q=" in internal URLs, simply enabling mod_rewrite in apache 2 configuration (a2enmod rewrite). Please note that you may need to adjust the /etc/drupal/7/htaccess configuration file to match your site configuration. 6. Securing your portal ----------------------- It is very good security measure to restrict access to admin.php only to trusted IP's and localhost (you can see an example at /etc/drupal/7/htaccess) As an added security measure, is a good idea to set up a ssl-enabled web server in your apache, and allow access to admin page only to ssl streams. 7. Upgrading database from previous versions -------------------------------------------- From version 4.7.4 drupal packages will be separated for each major version. Automatic upgrading the database will not be attempted anymore. To upgrade an existing version of drupal, install the new package and manually configure the database to point to the existing database, then execute the upstream upgrade script by pointing a web browser to Then remove the old package. WARNING: be sure to _NOT_ remove the old package's database. 8. Set up independent "cron" maintenance jobs --------------------------------------------- Many Drupal modules have tasks that must be run periodically, including the Search module (building and updating the index used for keyword searching), the Aggregator module (retrieving feeds from other sites), and the System module (performing routine maintenance and pruning of database tables). These tasks are known as "cron maintenance tasks", named after the Unix/Linux "cron" utility. When you install Drupal, its built-in cron feature is enabled, which automatically runs the cron tasks periodically, triggered by people visiting pages of your site. You can configure the built-in cron feature by navigating to Administration > Configuration > System > Cron. It is also possible to run the cron tasks independent of site visits; this is recommended for most sites. To do this, you will need to set up an automated process to visit the page cron.php on your site, which executes the cron tasks. The URL of the cron.php page requires a "cron key" to protect against unauthorized access. Your site's cron key is automatically generated during installation and is specific to your site. The full URL of the page, with the cron key, is available in the "Cron maintenance tasks" section of the Status report page at Administration > Reports > Status report. To complete setup, add the cron key from the report above to the $cron_key variable in site's settings.php or cronkey.php under /etc/drupal/7/sites/. 9. Virtual hosts ---------------- Drupal supports a setup with multiple virtual hosts. Each virtual host has its own configuration directory in /etc/drupal/7/sites/_virtualhost_. At install time the 'default' virtual host is created with the required settings.php configuration file. To create new virtual hosts simply duplicate the default virtual host directory and adjust the settings.php and dbconfig.php configuration files. This package supports running cron scripts on each virtual host, as long as you define the $base_url variable in the virtual host settings.php configuration file. 10. Additional modules and themes --------------------------------- Drupal looks for modules and themes in the modules/ and themes/ subdirectories, respectively. However, it would be a bad idea to put additional modules and themes into those directories because they might be overwritten on upgrades. Instead, create links to another directory that won't be touched by dpkg, e.g. in the /usr/local hierarchy: # mkdir -p /usr/local/share/drupal/7/modules # mkdir -p /usr/local/share/drupal/7/themes # ln -s /usr/local/share/drupal/7/modules /usr/share/drupal7/modules/local # ln -s /usr/local/share/drupal/7/themes /usr/share/drupal7/themes/local 11. Privacy of session cookies ------------------------------ Drupal does not set the secure flag for the session cookie in an https session, which can cause the cookie to be sent in http requests and make it easier for remote attackers to capture this cookie. If you are using drupal on an https connection you can fix this issue setting the session.cookie_secure PHP properties to on either in the global PHP configuration file or adding the following line to /etc/drupal/7/htaccess: php_value session.cookie_secure 1 A. Customizing themes --------------------- To create or customize a theme for your site, I recommend to start with an existing theme (as exmaple), copy it to a different location # cp -ai /etc/drupal/7/themes/example /etc/drupal/7/themes/Custom and modify this new created theme. You can now select your "Custom" theme in the Preferences menu from the admin interface. You should not modify and use an included theme in the package directly, as your changes could be overwritten next time you upgrade drupal. B. Links for more support ------------------------- * http://www.drupal.org/ - Drupal's project page for those willing to get involved in the ongoing development * http://drupal.org/documentation/install - online installation guidelines -- Gunnar Wolf , Fri, 29 Nov 2013 13:24:58 -0600 debian/copyright0000664000000000000000000000667512265606646011156 0ustar This package was debianized by Hugo Espuny on Sat, 29 Jun 2002 22:13:16 +0200. The current Debian Maintainer is Luigi Gangitano It was downloaded from http://www.drupal.org Upstream authors: Dries Buytaert James Walker Moshe Weitzman Charlie Lowe Steven Wittens Károly Négyesi Gabor Hojtsy Richard Archer Matt Westgate Piotr Krukowiecki Károly Négyesi Jeremy Andrews Károly Négyesi Hilko Bengen Gerhard Killesreiter Copyright: 2000-2008 Dries Buytaert This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ================================================================================ misc/jquery.js: jQuery JavaScript Library v1.4.4 http://jquery.com/ Copyright 2010, John Resig Dual licensed under the MIT or GPL Version 2 licenses. http://jquery.org/license Includes Sizzle.js http://sizzlejs.com/ Copyright 2010, The Dojo Foundation Released under the MIT, BSD, and GPL Licenses. ================================================================================ misc/jquery.ba-bbq.js: jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 http://benalman.com/projects/jquery-bbq-plugin/ Copyright (c) 2010 "Cowboy" Ben Alman Dual licensed under the MIT and GPL licenses. http://benalman.com/about/license/ jQuery hashchange event - v1.2 - 2/11/2010 http://benalman.com/projects/jquery-hashchange-plugin/ Copyright (c) 2010 "Cowboy" Ben Alman Dual licensed under the MIT and GPL licenses. http://benalman.com/about/license/ ================================================================================ misc/jquery.cookie.js: Cookie plugin 1.0 Copyright (c) 2006 Klaus Hartl (stilbuero.de) Dual licensed under the MIT and GPL licenses. ================================================================================ misc/jquery.form.js: jQuery Form Plugin version: 2.52 (07-DEC-2010) @requires jQuery v1.3.2 or later Dual licensed under the MIT and GPL licenses. ================================================================================ misc/jquery.form.js: jQuery Once Plugin v1.2 http://plugins.jquery.com/project/once Dual licensed under the MIT and GPL licenses. ================================================================================ On Debian systems, the complete text of the GNU General Public License, version 2, can be found in /usr/share/common-licenses/GPL-2. The Debian packaging is (C) 2006-2008, Luigi Gangitano and is licensed under the GPL, see above. debian/drupal7.postinst0000664000000000000000000000247312265606646012376 0ustar #!/bin/bash # postinst script for drupal set -e dbc_generate_include='template:/etc/drupal/7/sites/default/dbconfig.php' dbc_generate_include_owner='root:www-data' dbc_generate_include_perms='640' dbc_generate_include_args='-o template_infile=/usr/share/drupal7/templates/dbconfig.template' dbc_pgsql_createdb_encoding='UTF8' . /usr/share/debconf/confmodule # source dbconfig-common stuff'); . /usr/share/dbconfig-common/dpkg/postinst dbc_go drupal7 $@ if [ "$DPKG_DEBUG" = "developer" ]; then set -x fi package_name="drupal7" datadir="/var/lib/${package_name}" filesdir="${datadir}/files" backupdir="${datadir}/backups" pkgdir="/usr/share/${package_name}" docdir="/usr/share/doc/${package_name}" upgradesdir="${docdir}/upgrades" configdir="/etc/drupal/7" default_configfile="${configdir}/sites/default/settings.php" includefile="${configdir}/apache2.conf" cronfile="/etc/cron.d/${package_name}" OLDVERSION="$2" case "$1" in configure) # Permissions dpkg-statoverride --list $filesdir || dpkg-statoverride --add --force --update www-data www-data 0750 $filesdir ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/cron.sh0000775000000000000000000000201012265606646010476 0ustar #!/bin/sh for site in /etc/drupal/7/sites/* ; do BASE_URL="" CRON_KEY="" FULL_URL="" if [ ! "`basename $site`" = "all" ]; then for file in $site/baseurl.php $site/settings.php; do [ -f "$file" ] && BASE_URL=`grep '^$base_url' $file | cut -d"'" -f2` [ "X$BASE_URL" != "X" ] && break done for file in $site/cronkey.php $site/settings.php; do [ -f "$file" ] && CRON_KEY=`grep '^$cron_key' $file | cut -d"'" -f2` [ "X$CRON_KEY" != "X" ] && break done if [ "X$BASE_URL" = "X" ] ; then if [ -f "$site/settings.php" ]; then BASE_URL='http://localhost/drupal7' else break fi fi if [ "X$CRON_KEY" = "X" ] ; then FULL_URL="$BASE_URL/cron.php" else FULL_URL="$BASE_URL/cron.php?cron_key=$CRON_KEY" fi if curl -S --fail --silent --compressed --insecure --location $FULL_URL ; then # Success! true else echo "Error running the periodic maintenance for $site: CURL exit code $?" echo "Requested URL: $FULL_URL" fi fi done debian/control0000664000000000000000000000221212417755630010602 0ustar Source: drupal7 Section: web Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Luigi Gangitano Uploaders: Gunnar Wolf Build-Depends: debhelper (>= 7.0.50~) Homepage: http://www.drupal.org/ Standards-Version: 3.9.5.0 Vcs-Git: git://git.debian.org/git/collab-maint/drupal7.git Vcs-Browser: http://git.debian.org/git/collab-maint/drupal7.git Package: drupal7 Architecture: all Depends: ${misc:Depends}, apache2 | httpd, php5, php5-mysql | php5-pgsql, php5-gd, default-mta | mail-transport-agent, wwwconfig-common (>= 0.0.37), mysql-client | virtual-mysql-client | postgresql-client, dbconfig-common, curl Recommends: mysql-server | postgresql Description: fully-featured content management framework Drupal is a dynamic web site platform which allows an individual or community of users to publish, manage and organize a variety of content, Drupal integrates many popular features of content management systems, weblogs, collaborative tools and discussion-based community software into one easy-to-use package. . This package contains version 7 of Drupal. debian/patches/0000775000000000000000000000000012417760146010627 5ustar debian/patches/SA-CORE-2014-005-D7.patch0000664000000000000000000000152212417760146014037 0ustar Subject: Fix SQL injection flaw Origin: https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patch diff --git a/includes/database/database.inc b/includes/database/database.inc index f78098b..01b6385 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -733,7 +733,7 @@ abstract class DatabaseConnection extends PDO { // to expand it out into a comma-delimited set of placeholders. foreach (array_filter($args, 'is_array') as $key => $data) { $new_keys = array(); - foreach ($data as $i => $value) { + foreach (array_values($data) as $i => $value) { // This assumes that there are no other placeholders that use the same // name. For example, if the array placeholder is defined as :example // and there is already an :example_2 placeholder, this will generate debian/patches/10_cronjob.patch0000664000000000000000000000066712265606646013622 0ustar Author: Description: Disable reporting to system log every cron run --- a/includes/common.inc +++ b/includes/common.inc @@ -5256,7 +5256,7 @@ // Record cron time. variable_set('cron_last', REQUEST_TIME); - watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE); + #watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE); // Release cron lock. lock_release('cron'); debian/patches/series0000664000000000000000000000013412417755545012051 0ustar 10_cronjob.patch 30_DFSG-sources.patch 71_debian_security_warning SA-CORE-2014-005-D7.patch debian/patches/20_drupal_core_updates.dpatch0000775000000000000000000001037512265606646016357 0ustar #! /bin/sh /usr/share/dpatch/dpatch-run ## drupal_core_updates.dpatch by Alexandre De Dommelin ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Remove warnings about available Drupal core updates @DPATCH@ diff -urNad drupal6~/modules/update/update.fetch.inc drupal6/modules/update/update.fetch.inc --- drupal6~/modules/update/update.fetch.inc 2010-02-10 17:39:19.000000000 +0100 +++ drupal6/modules/update/update.fetch.inc 2010-02-10 22:09:43.000000000 +0100 @@ -153,12 +153,10 @@ $status = update_requirements('runtime'); $params = array(); $notify_all = (variable_get('update_notification_threshold', 'all') == 'all'); - foreach (array('core', 'contrib') as $report_type) { - $type = 'update_'. $report_type; - if (isset($status[$type]['severity']) - && ($status[$type]['severity'] == REQUIREMENT_ERROR || ($notify_all && $status[$type]['reason'] == UPDATE_NOT_CURRENT))) { - $params[$report_type] = $status[$type]['reason']; - } + + if (isset($status['update_contrib']['severity']) + && ($status['update_contrib']['severity'] == REQUIREMENT_ERROR || ($notify_all && $status['update_contrib']['reason'] == UPDATE_NOT_CURRENT))) { + $params['contrib'] = $status['update_contrib']['reason']; } if (!empty($params)) { $notify_list = variable_get('update_notify_emails', ''); diff -urNad drupal6~/modules/update/update.module drupal6/modules/update/update.module --- drupal6~/modules/update/update.module 2010-02-10 21:42:41.000000000 +0100 +++ drupal6/modules/update/update.module 2010-02-10 22:07:29.000000000 +0100 @@ -74,15 +74,13 @@ case 'admin/build/modules': include_once './includes/install.inc'; $status = update_requirements('runtime'); - foreach (array('core', 'contrib') as $report_type) { - $type = 'update_'. $report_type; - if (isset($status[$type]['severity'])) { - if ($status[$type]['severity'] == REQUIREMENT_ERROR) { - drupal_set_message($status[$type]['description'], 'error'); - } - elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) { - drupal_set_message($status[$type]['description'], 'warning'); - } + + if (isset($status['update_contrib']['severity'])) { + if ($status['update_contrib']['severity'] == REQUIREMENT_ERROR) { + drupal_set_message($status['update_contrib']['description'], 'error'); + } + elseif ($status['update_contrib']['severity'] == REQUIREMENT_WARNING) { + drupal_set_message($status['update_contrib']['description'], 'warning'); } } return '

'. t('See the available updates page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) .'

'; @@ -203,7 +201,7 @@ module_load_include('inc', 'update', 'update.compare'); $data = update_calculate_project_data($available); // First, populate the requirements for core: - $requirements['update_core'] = _update_requirement_check($data['drupal'], 'core'); + //$requirements['update_core'] = _update_requirement_check($data['drupal'], 'core'); // We don't want to check drupal a second time. unset($data['drupal']); if (!empty($data)) { diff -urNad drupal6~/modules/update/update.report.inc drupal6/modules/update/update.report.inc --- drupal6~/modules/update/update.report.inc 2010-02-10 21:42:41.000000000 +0100 +++ drupal6/modules/update/update.report.inc 2010-02-10 22:07:29.000000000 +0100 @@ -223,6 +223,13 @@ 'disabled-theme' => t('Disabled themes'), ); foreach ($project_types as $type_name => $type_label) { + if ( $type_name == "core" ) { + $deb_message = array( array('class' => 'info','data' => array("Drupal core updates (including security patches) are applied by your sysadmin through the Debian package management system, you don't need to manually download them."))); + $output .= "\n

". $type_label ."

\n"; + $output .= theme('table', $header, $deb_message,array('class' => 'update')); + continue; + } + if (!empty($rows[$type_name])) { ksort($rows[$type_name]); $output .= "\n

". $type_label ."

\n"; debian/patches/30_DFSG-sources.patch0000664000000000000000000241757312265606646014406 0ustar Author: Luigi Gangitano Description: Add uncompressed sources of javascript files --- /dev/null +++ b/sources/misc/farbtastic/farbtastic.js @@ -0,0 +1,345 @@ +/** + * Farbtastic Color Picker 1.2 + * © 2008 Steven Wittens + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +jQuery.fn.farbtastic = function (callback) { + $.farbtastic(this, callback); + return this; +}; + +jQuery.farbtastic = function (container, callback) { + var container = $(container).get(0); + return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback)); +} + +jQuery._farbtastic = function (container, callback) { + // Store farbtastic object + var fb = this; + + // Insert markup + $(container).html('
'); + var e = $('.farbtastic', container); + fb.wheel = $('.wheel', container).get(0); + // Dimensions + fb.radius = 84; + fb.square = 100; + fb.width = 194; + + // Fix background PNGs in IE6 + if (navigator.appVersion.match(/MSIE [0-6]\./)) { + $('*', e).each(function () { + if (this.currentStyle.backgroundImage != 'none') { + var image = this.currentStyle.backgroundImage; + image = this.currentStyle.backgroundImage.substring(5, image.length - 2); + $(this).css({ + 'backgroundImage': 'none', + 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')" + }); + } + }); + } + + /** + * Link to the given element(s) or callback. + */ + fb.linkTo = function (callback) { + // Unbind previous nodes + if (typeof fb.callback == 'object') { + $(fb.callback).unbind('keyup', fb.updateValue); + } + + // Reset color + fb.color = null; + + // Bind callback or elements + if (typeof callback == 'function') { + fb.callback = callback; + } + else if (typeof callback == 'object' || typeof callback == 'string') { + fb.callback = $(callback); + fb.callback.bind('keyup', fb.updateValue); + if (fb.callback.get(0).value) { + fb.setColor(fb.callback.get(0).value); + } + } + return this; + } + fb.updateValue = function (event) { + if (this.value && this.value != fb.color) { + fb.setColor(this.value); + } + } + + /** + * Change color with HTML syntax #123456 + */ + fb.setColor = function (color) { + var unpack = fb.unpack(color); + if (fb.color != color && unpack) { + fb.color = color; + fb.rgb = unpack; + fb.hsl = fb.RGBToHSL(fb.rgb); + fb.updateDisplay(); + } + return this; + } + + /** + * Change color with HSL triplet [0..1, 0..1, 0..1] + */ + fb.setHSL = function (hsl) { + fb.hsl = hsl; + fb.rgb = fb.HSLToRGB(hsl); + fb.color = fb.pack(fb.rgb); + fb.updateDisplay(); + return this; + } + + ///////////////////////////////////////////////////// + + /** + * Retrieve the coordinates of the given event relative to the center + * of the widget. + */ + fb.widgetCoords = function (event) { + var x, y; + var el = event.target || event.srcElement; + var reference = fb.wheel; + + if (typeof event.offsetX != 'undefined') { + // Use offset coordinates and find common offsetParent + var pos = { x: event.offsetX, y: event.offsetY }; + + // Send the coordinates upwards through the offsetParent chain. + var e = el; + while (e) { + e.mouseX = pos.x; + e.mouseY = pos.y; + pos.x += e.offsetLeft; + pos.y += e.offsetTop; + e = e.offsetParent; + } + + // Look for the coordinates starting from the wheel widget. + var e = reference; + var offset = { x: 0, y: 0 } + while (e) { + if (typeof e.mouseX != 'undefined') { + x = e.mouseX - offset.x; + y = e.mouseY - offset.y; + break; + } + offset.x += e.offsetLeft; + offset.y += e.offsetTop; + e = e.offsetParent; + } + + // Reset stored coordinates + e = el; + while (e) { + e.mouseX = undefined; + e.mouseY = undefined; + e = e.offsetParent; + } + } + else { + // Use absolute coordinates + var pos = fb.absolutePosition(reference); + x = (event.pageX || 0*(event.clientX + $('html').get(0).scrollLeft)) - pos.x; + y = (event.pageY || 0*(event.clientY + $('html').get(0).scrollTop)) - pos.y; + } + // Subtract distance to middle + return { x: x - fb.width / 2, y: y - fb.width / 2 }; + } + + /** + * Mousedown handler + */ + fb.mousedown = function (event) { + // Capture mouse + if (!document.dragging) { + $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup); + document.dragging = true; + } + + // Check which area is being dragged + var pos = fb.widgetCoords(event); + fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square; + + // Process + fb.mousemove(event); + return false; + } + + /** + * Mousemove handler + */ + fb.mousemove = function (event) { + // Get coordinates relative to color picker center + var pos = fb.widgetCoords(event); + + // Set new HSL parameters + if (fb.circleDrag) { + var hue = Math.atan2(pos.x, -pos.y) / 6.28; + if (hue < 0) hue += 1; + fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]); + } + else { + var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5)); + var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5)); + fb.setHSL([fb.hsl[0], sat, lum]); + } + return false; + } + + /** + * Mouseup handler + */ + fb.mouseup = function () { + // Uncapture mouse + $(document).unbind('mousemove', fb.mousemove); + $(document).unbind('mouseup', fb.mouseup); + document.dragging = false; + } + + /** + * Update the markers and styles + */ + fb.updateDisplay = function () { + // Markers + var angle = fb.hsl[0] * 6.28; + $('.h-marker', e).css({ + left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px', + top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px' + }); + + $('.sl-marker', e).css({ + left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px', + top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px' + }); + + // Saturation/Luminance gradient + $('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5]))); + + // Linked elements or callback + if (typeof fb.callback == 'object') { + // Set background/foreground color + $(fb.callback).css({ + backgroundColor: fb.color, + color: fb.hsl[2] > 0.5 ? '#000' : '#fff' + }); + + // Change linked value + $(fb.callback).each(function() { + if (this.value && this.value != fb.color) { + this.value = fb.color; + } + }); + } + else if (typeof fb.callback == 'function') { + fb.callback.call(fb, fb.color); + } + } + + /** + * Get absolute position of element + */ + fb.absolutePosition = function (el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + // Resolve relative to offsetParent + if (el.offsetParent) { + var tmp = fb.absolutePosition(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; + }; + + /* Various color utility functions */ + fb.pack = function (rgb) { + var r = Math.round(rgb[0] * 255); + var g = Math.round(rgb[1] * 255); + var b = Math.round(rgb[2] * 255); + return '#' + (r < 16 ? '0' : '') + r.toString(16) + + (g < 16 ? '0' : '') + g.toString(16) + + (b < 16 ? '0' : '') + b.toString(16); + } + + fb.unpack = function (color) { + if (color.length == 7) { + return [parseInt('0x' + color.substring(1, 3)) / 255, + parseInt('0x' + color.substring(3, 5)) / 255, + parseInt('0x' + color.substring(5, 7)) / 255]; + } + else if (color.length == 4) { + return [parseInt('0x' + color.substring(1, 2)) / 15, + parseInt('0x' + color.substring(2, 3)) / 15, + parseInt('0x' + color.substring(3, 4)) / 15]; + } + } + + fb.HSLToRGB = function (hsl) { + var m1, m2, r, g, b; + var h = hsl[0], s = hsl[1], l = hsl[2]; + m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s; + m1 = l * 2 - m2; + return [this.hueToRGB(m1, m2, h+0.33333), + this.hueToRGB(m1, m2, h), + this.hueToRGB(m1, m2, h-0.33333)]; + } + + fb.hueToRGB = function (m1, m2, h) { + h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h); + if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; + if (h * 2 < 1) return m2; + if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6; + return m1; + } + + fb.RGBToHSL = function (rgb) { + var min, max, delta, h, s, l; + var r = rgb[0], g = rgb[1], b = rgb[2]; + min = Math.min(r, Math.min(g, b)); + max = Math.max(r, Math.max(g, b)); + delta = max - min; + l = (min + max) / 2; + s = 0; + if (l > 0 && l < 1) { + s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l)); + } + h = 0; + if (delta > 0) { + if (max == r && max != g) h += (g - b) / delta; + if (max == g && max != b) h += (2 + (b - r) / delta); + if (max == b && max != r) h += (4 + (r - g) / delta); + h /= 6; + } + return [h, s, l]; + } + + // Install mousedown handler (the others are set on the document on-demand) + $('*', e).mousedown(fb.mousedown); + + // Init color + fb.setColor('#000000'); + + // Set linked elements/callback + if (callback) { + fb.linkTo(callback); + } +} \ No newline at end of file --- /dev/null +++ b/sources/misc/jquery-1.4.4.js @@ -0,0 +1,7179 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + rwhite = /\s/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for non-word characters + rnonword = /\W/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && !rnonword.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, + i = 0, + ready = readyList; + + // Reset the list of functions + readyList = null; + + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// Verify that \s matches non-breaking spaces +// (IE fails on this test) +if ( !rwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return (window.jQuery = window.$ = jQuery); + +})(); + + +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + jQuery.now(); + + div.style.display = "none"; + div.innerHTML = "
a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0], + select = document.createElement("select"), + opt = select.appendChild( document.createElement("option") ); + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Will be defined later + deleteExpando: true, + optDisabled: false, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as diabled) + select.disabled = true; + jQuery.support.optDisabled = !opt.disabled; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + } + + div.innerHTML = "
t
"; + var tds = div.getElementsByTagName("td"); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + tds[0].style.display = ""; + tds[1].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + div.innerHTML = ""; + + document.body.removeChild( div ).style.display = "none"; + div = tds = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + + + +var windowData = {}, + rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + expando: "jQuery" + jQuery.now(), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + data: function( elem, name, data ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : null, + cache = jQuery.cache, thisCache; + + if ( isNode && !id && typeof name === "string" && data === undefined ) { + return; + } + + // Get the data from the object directly + if ( !isNode ) { + cache = elem; + + // Compute a unique ID for the element + } else if ( !id ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + if ( isNode ) { + cache[ id ] = jQuery.extend(cache[ id ], name); + + } else { + jQuery.extend( cache, name ); + } + + } else if ( isNode && !cache[ id ] ) { + cache[ id ] = {}; + } + + thisCache = isNode ? cache[ id ] : cache; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : elem, + cache = jQuery.cache, + thisCache = isNode ? cache[ id ] : id; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( isNode && jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( isNode && jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + + // Completely remove the data cache + } else if ( isNode ) { + delete cache[ id ]; + + // Remove all fields from the object + } else { + for ( var n in elem ) { + delete elem[ n ]; + } + } + } + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + var attr = this[0].attributes, name; + data = jQuery.data( this[0] ); + + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }, + focusCounts = { focusin: 0, focusout: 0 }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + // Use a key less likely to result in collisions for plain JS objects. + // Fixes bug #7150. + var eventKey = elem.nodeType ? "events" : "__events__", + events = elemData[ eventKey ], + eventHandle = elemData.handle; + + if ( typeof events === "function" ) { + // On plain objects events is a fn that holds the the data + // which prevents this data from being JSON serialized + // the function does not need to be called, it just contains the data + eventHandle = events.handle; + events = events.events; + + } else if ( !events ) { + if ( !elem.nodeType ) { + // On plain objects, create a fn that acts as the holder + // of the values to avoid JSON serialization of event data + elemData[ eventKey ] = elemData = function(){}; + } + + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + eventKey = elem.nodeType ? "events" : "__events__", + elemData = jQuery.data( elem ), + events = elemData && elemData[ eventKey ]; + + if ( !elemData || !events ) { + return; + } + + if ( typeof events === "function" ) { + elemData = events; + events = events.events; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( typeof elemData === "function" ) { + jQuery.removeData( elem, eventKey ); + + } else if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = elem.nodeType ? + jQuery.data( elem, "handle" ) : + (jQuery.data( elem, "__events__" ) || {}).handle; + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery.data(this, this.nodeType ? "events" : "__events__"); + + if ( typeof events === "function" ) { + events = events.events; + } + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + if ( focusCounts[fix]++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --focusCounts[fix] === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.trigger( e, null, e.target ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) || data === false ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); + + if ( typeof events === "function" ) { + events = events.events; + } + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + jQuery(window).bind("unload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} + + +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName( "*" ); + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !/\W/.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + return context.getElementsByTagName( match[1] ); + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace(/\\/g, ""); + }, + + TAG: function( match, curLoop ) { + return match[1].toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + return "text" === elem.type; + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Make sure that attribute selectors are quoted + query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + if ( context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var old = context.getAttribute( "id" ), + nid = old || id; + + if ( !old ) { + context.setAttribute( "id", nid ); + } + + try { + return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); + + } catch(pseudoError) { + } finally { + if ( !old ) { + context.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /\s]+\/)>/g, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and