/trunk/applications/rendu/index.php |
---|
New file |
0,0 → 1,63 |
<?php |
// declare(encoding='UTF-8'); |
/** Inclusion du fichier principal de l'application*/ |
require_once 'rendu.php'; |
?> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
<meta http-equiv="Content-style-type" content="text/css" /> |
<meta http-equiv="Content-script-type" content="text/javascript" /> |
<meta http-equiv="Content-language" content="fr" /> |
<title><?php echo AppControleur::getMetaTitre(); ?></title> |
<meta name="description" content="<?php echo AppControleur::getMetaDescription();?>" /> |
<meta name="keywords" content="<?php echo AppControleur::getMetaTags();?>" /> |
<meta name="revisit-after" content="15 days" /> |
<meta name="robots" content="index,follow" /> |
<meta name="author" content="Tela Botanica" /> |
<?= Liens::renvoyerStylesInclus() ?> |
<?= Liens::renvoyerScriptsInclus() ?> |
</head> |
<body> |
<div id="reducteur"> |
<div id="bandeau"> |
<div id="bandeau_contenu"> |
<div id="titre_monde"> |
<h1>Observatoire des saisons</h1> |
</div> |
</div> |
</div> |
<div id="droite"> |
<div id="onglets" class="gauche"> |
<?php echo AppControleur::getContenuNavigation(); ?> |
</div> |
<div id="contenu"> |
<div id="entete"> |
<?php echo AppControleur::getContenuTete(); ?> |
</div> |
<div id="texte"> |
<?php echo AppControleur::getContenuCorps(); ?> |
</div> |
<div id="pied_texte"> |
<?php echo AppControleur::getContenuPied(); ?> |
</div> |
</div> |
<div id="pied" style="clear:left"> |
<div> |
<?php echo AppControleur::getChrono(); ?> |
<?php echo AppControleur::getExceptions(); ?> |
</div> |
</div> |
<div id="debug"> </div> |
</div> |
</div> |
</body> |
</html> |
/trunk/applications/rendu/squelettes/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2011,2,1,14,2,48 |
[Settings] |
ShowDotFiles=true |
/trunk/applications/rendu/squelettes/css/jquery_ui/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2011,2,1,14,30,20 |
[Settings] |
ShowDotFiles=true |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ffffff_256x240.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ffffff_256x240.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_flat_10_000000_40x100.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_flat_10_000000_40x100.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_100_fdf5ce_1x400.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_100_fdf5ce_1x400.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_65_ffffff_1x400.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_65_ffffff_1x400.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_diagonals-thick_20_666666_40x40.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_diagonals-thick_20_666666_40x40.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_228ef1_256x240.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_228ef1_256x240.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ffd27a_256x240.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ffd27a_256x240.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_100_f6f6f6_1x400.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_glass_100_f6f6f6_1x400.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_222222_256x240.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_222222_256x240.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ef8c08_256x240.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-icons_ef8c08_256x240.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/trunk/applications/rendu/squelettes/css/jquery_ui/images/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2011,2,1,14,30,26 |
[Settings] |
ShowDotFiles=true |
/trunk/applications/rendu/squelettes/css/jquery_ui/jquery-ui-1.8.9.custom.css |
---|
New file |
0,0 → 1,318 |
/* |
* jQuery UI CSS Framework 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Theming/API |
*/ |
/* Layout helpers |
----------------------------------*/ |
.ui-helper-hidden { display: none; } |
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } |
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } |
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } |
.ui-helper-clearfix { display: inline-block; } |
/* required comment for clearfix to work in Opera \*/ |
* html .ui-helper-clearfix { height:1%; } |
.ui-helper-clearfix { display:block; } |
/* end clearfix */ |
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } |
/* Interaction Cues |
----------------------------------*/ |
.ui-state-disabled { cursor: default !important; } |
/* Icons |
----------------------------------*/ |
/* states and images */ |
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } |
/* Misc visuals |
----------------------------------*/ |
/* Overlays */ |
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
/* |
* jQuery UI CSS Framework 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Theming/API |
* |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px |
*/ |
/* Component containers |
----------------------------------*/ |
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } |
.ui-widget .ui-widget { font-size: 1em; } |
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } |
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } |
.ui-widget-content a { color: #333333; } |
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } |
.ui-widget-header a { color: #ffffff; } |
/* Interaction states |
----------------------------------*/ |
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } |
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } |
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } |
.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } |
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } |
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } |
.ui-widget :active { outline: none; } |
/* Interaction Cues |
----------------------------------*/ |
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } |
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } |
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } |
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } |
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } |
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } |
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } |
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
/* Icons |
----------------------------------*/ |
/* states and images */ |
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } |
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } |
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } |
.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } |
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } |
.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } |
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } |
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } |
/* positioning */ |
.ui-icon-carat-1-n { background-position: 0 0; } |
.ui-icon-carat-1-ne { background-position: -16px 0; } |
.ui-icon-carat-1-e { background-position: -32px 0; } |
.ui-icon-carat-1-se { background-position: -48px 0; } |
.ui-icon-carat-1-s { background-position: -64px 0; } |
.ui-icon-carat-1-sw { background-position: -80px 0; } |
.ui-icon-carat-1-w { background-position: -96px 0; } |
.ui-icon-carat-1-nw { background-position: -112px 0; } |
.ui-icon-carat-2-n-s { background-position: -128px 0; } |
.ui-icon-carat-2-e-w { background-position: -144px 0; } |
.ui-icon-triangle-1-n { background-position: 0 -16px; } |
.ui-icon-triangle-1-ne { background-position: -16px -16px; } |
.ui-icon-triangle-1-e { background-position: -32px -16px; } |
.ui-icon-triangle-1-se { background-position: -48px -16px; } |
.ui-icon-triangle-1-s { background-position: -64px -16px; } |
.ui-icon-triangle-1-sw { background-position: -80px -16px; } |
.ui-icon-triangle-1-w { background-position: -96px -16px; } |
.ui-icon-triangle-1-nw { background-position: -112px -16px; } |
.ui-icon-triangle-2-n-s { background-position: -128px -16px; } |
.ui-icon-triangle-2-e-w { background-position: -144px -16px; } |
.ui-icon-arrow-1-n { background-position: 0 -32px; } |
.ui-icon-arrow-1-ne { background-position: -16px -32px; } |
.ui-icon-arrow-1-e { background-position: -32px -32px; } |
.ui-icon-arrow-1-se { background-position: -48px -32px; } |
.ui-icon-arrow-1-s { background-position: -64px -32px; } |
.ui-icon-arrow-1-sw { background-position: -80px -32px; } |
.ui-icon-arrow-1-w { background-position: -96px -32px; } |
.ui-icon-arrow-1-nw { background-position: -112px -32px; } |
.ui-icon-arrow-2-n-s { background-position: -128px -32px; } |
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } |
.ui-icon-arrow-2-e-w { background-position: -160px -32px; } |
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } |
.ui-icon-arrowstop-1-n { background-position: -192px -32px; } |
.ui-icon-arrowstop-1-e { background-position: -208px -32px; } |
.ui-icon-arrowstop-1-s { background-position: -224px -32px; } |
.ui-icon-arrowstop-1-w { background-position: -240px -32px; } |
.ui-icon-arrowthick-1-n { background-position: 0 -48px; } |
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } |
.ui-icon-arrowthick-1-e { background-position: -32px -48px; } |
.ui-icon-arrowthick-1-se { background-position: -48px -48px; } |
.ui-icon-arrowthick-1-s { background-position: -64px -48px; } |
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } |
.ui-icon-arrowthick-1-w { background-position: -96px -48px; } |
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } |
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } |
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } |
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } |
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } |
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } |
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } |
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } |
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } |
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } |
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } |
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } |
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } |
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } |
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } |
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } |
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } |
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } |
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } |
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } |
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } |
.ui-icon-arrow-4 { background-position: 0 -80px; } |
.ui-icon-arrow-4-diag { background-position: -16px -80px; } |
.ui-icon-extlink { background-position: -32px -80px; } |
.ui-icon-newwin { background-position: -48px -80px; } |
.ui-icon-refresh { background-position: -64px -80px; } |
.ui-icon-shuffle { background-position: -80px -80px; } |
.ui-icon-transfer-e-w { background-position: -96px -80px; } |
.ui-icon-transferthick-e-w { background-position: -112px -80px; } |
.ui-icon-folder-collapsed { background-position: 0 -96px; } |
.ui-icon-folder-open { background-position: -16px -96px; } |
.ui-icon-document { background-position: -32px -96px; } |
.ui-icon-document-b { background-position: -48px -96px; } |
.ui-icon-note { background-position: -64px -96px; } |
.ui-icon-mail-closed { background-position: -80px -96px; } |
.ui-icon-mail-open { background-position: -96px -96px; } |
.ui-icon-suitcase { background-position: -112px -96px; } |
.ui-icon-comment { background-position: -128px -96px; } |
.ui-icon-person { background-position: -144px -96px; } |
.ui-icon-print { background-position: -160px -96px; } |
.ui-icon-trash { background-position: -176px -96px; } |
.ui-icon-locked { background-position: -192px -96px; } |
.ui-icon-unlocked { background-position: -208px -96px; } |
.ui-icon-bookmark { background-position: -224px -96px; } |
.ui-icon-tag { background-position: -240px -96px; } |
.ui-icon-home { background-position: 0 -112px; } |
.ui-icon-flag { background-position: -16px -112px; } |
.ui-icon-calendar { background-position: -32px -112px; } |
.ui-icon-cart { background-position: -48px -112px; } |
.ui-icon-pencil { background-position: -64px -112px; } |
.ui-icon-clock { background-position: -80px -112px; } |
.ui-icon-disk { background-position: -96px -112px; } |
.ui-icon-calculator { background-position: -112px -112px; } |
.ui-icon-zoomin { background-position: -128px -112px; } |
.ui-icon-zoomout { background-position: -144px -112px; } |
.ui-icon-search { background-position: -160px -112px; } |
.ui-icon-wrench { background-position: -176px -112px; } |
.ui-icon-gear { background-position: -192px -112px; } |
.ui-icon-heart { background-position: -208px -112px; } |
.ui-icon-star { background-position: -224px -112px; } |
.ui-icon-link { background-position: -240px -112px; } |
.ui-icon-cancel { background-position: 0 -128px; } |
.ui-icon-plus { background-position: -16px -128px; } |
.ui-icon-plusthick { background-position: -32px -128px; } |
.ui-icon-minus { background-position: -48px -128px; } |
.ui-icon-minusthick { background-position: -64px -128px; } |
.ui-icon-close { background-position: -80px -128px; } |
.ui-icon-closethick { background-position: -96px -128px; } |
.ui-icon-key { background-position: -112px -128px; } |
.ui-icon-lightbulb { background-position: -128px -128px; } |
.ui-icon-scissors { background-position: -144px -128px; } |
.ui-icon-clipboard { background-position: -160px -128px; } |
.ui-icon-copy { background-position: -176px -128px; } |
.ui-icon-contact { background-position: -192px -128px; } |
.ui-icon-image { background-position: -208px -128px; } |
.ui-icon-video { background-position: -224px -128px; } |
.ui-icon-script { background-position: -240px -128px; } |
.ui-icon-alert { background-position: 0 -144px; } |
.ui-icon-info { background-position: -16px -144px; } |
.ui-icon-notice { background-position: -32px -144px; } |
.ui-icon-help { background-position: -48px -144px; } |
.ui-icon-check { background-position: -64px -144px; } |
.ui-icon-bullet { background-position: -80px -144px; } |
.ui-icon-radio-off { background-position: -96px -144px; } |
.ui-icon-radio-on { background-position: -112px -144px; } |
.ui-icon-pin-w { background-position: -128px -144px; } |
.ui-icon-pin-s { background-position: -144px -144px; } |
.ui-icon-play { background-position: 0 -160px; } |
.ui-icon-pause { background-position: -16px -160px; } |
.ui-icon-seek-next { background-position: -32px -160px; } |
.ui-icon-seek-prev { background-position: -48px -160px; } |
.ui-icon-seek-end { background-position: -64px -160px; } |
.ui-icon-seek-start { background-position: -80px -160px; } |
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ |
.ui-icon-seek-first { background-position: -80px -160px; } |
.ui-icon-stop { background-position: -96px -160px; } |
.ui-icon-eject { background-position: -112px -160px; } |
.ui-icon-volume-off { background-position: -128px -160px; } |
.ui-icon-volume-on { background-position: -144px -160px; } |
.ui-icon-power { background-position: 0 -176px; } |
.ui-icon-signal-diag { background-position: -16px -176px; } |
.ui-icon-signal { background-position: -32px -176px; } |
.ui-icon-battery-0 { background-position: -48px -176px; } |
.ui-icon-battery-1 { background-position: -64px -176px; } |
.ui-icon-battery-2 { background-position: -80px -176px; } |
.ui-icon-battery-3 { background-position: -96px -176px; } |
.ui-icon-circle-plus { background-position: 0 -192px; } |
.ui-icon-circle-minus { background-position: -16px -192px; } |
.ui-icon-circle-close { background-position: -32px -192px; } |
.ui-icon-circle-triangle-e { background-position: -48px -192px; } |
.ui-icon-circle-triangle-s { background-position: -64px -192px; } |
.ui-icon-circle-triangle-w { background-position: -80px -192px; } |
.ui-icon-circle-triangle-n { background-position: -96px -192px; } |
.ui-icon-circle-arrow-e { background-position: -112px -192px; } |
.ui-icon-circle-arrow-s { background-position: -128px -192px; } |
.ui-icon-circle-arrow-w { background-position: -144px -192px; } |
.ui-icon-circle-arrow-n { background-position: -160px -192px; } |
.ui-icon-circle-zoomin { background-position: -176px -192px; } |
.ui-icon-circle-zoomout { background-position: -192px -192px; } |
.ui-icon-circle-check { background-position: -208px -192px; } |
.ui-icon-circlesmall-plus { background-position: 0 -208px; } |
.ui-icon-circlesmall-minus { background-position: -16px -208px; } |
.ui-icon-circlesmall-close { background-position: -32px -208px; } |
.ui-icon-squaresmall-plus { background-position: -48px -208px; } |
.ui-icon-squaresmall-minus { background-position: -64px -208px; } |
.ui-icon-squaresmall-close { background-position: -80px -208px; } |
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } |
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } |
.ui-icon-grip-solid-vertical { background-position: -32px -224px; } |
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } |
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } |
.ui-icon-grip-diagonal-se { background-position: -80px -224px; } |
/* Misc visuals |
----------------------------------*/ |
/* Corner radius */ |
.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } |
.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } |
.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } |
.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } |
.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } |
.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } |
.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } |
.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } |
.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } |
/* Overlays */ |
.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } |
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* |
* jQuery UI Slider 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Slider#theming |
*/ |
.ui-slider { position: relative; text-align: left; } |
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } |
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } |
.ui-slider-horizontal { height: .8em; } |
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } |
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } |
.ui-slider-horizontal .ui-slider-range-min { left: 0; } |
.ui-slider-horizontal .ui-slider-range-max { right: 0; } |
.ui-slider-vertical { width: .8em; height: 100px; } |
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } |
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } |
.ui-slider-vertical .ui-slider-range-min { bottom: 0; } |
.ui-slider-vertical .ui-slider-range-max { top: 0; } |
/trunk/applications/rendu/squelettes/css/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2011,2,1,14,30,16 |
[Settings] |
ShowDotFiles=true |
/trunk/applications/rendu/squelettes/css/rendu.css |
---|
New file |
0,0 → 1,46 |
#contenu_application { |
} |
.conteneur_carte { |
height: 450px; |
width: 100%; |
} |
#table_dates { |
width: 100%; |
} |
#table_dates tbody { |
border: none; |
margin-top: 0; |
padding-top: 0; |
} |
#conteneur_slider_date { |
padding-top:10px; |
width: 100%; |
padding-bottom: 0px; |
} |
#slider_date .ui-slider-handle { |
background: none; |
background-color:#ACC700; |
} |
.selecteur_critere { |
padding-right: 5px; |
} |
.criteres { |
padding-bottom: 10px; |
} |
#conteneur_selecteur_liste_annees { |
padding-top: 10px; |
} |
.conteneur_date { |
display: table-cell; |
text-align:center; |
} |
/trunk/applications/rendu/squelettes/js/jquery-1.4.4.js |
---|
New file |
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 = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; |
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 = "<input type='radio' name='radiotest' checked='checked'/>"; |
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 = "<div style='width:4px;'></div>"; |
jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; |
} |
div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>"; |
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 = "<a name='" + id + "'/>"; |
// 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 = "<a href='#'></a>"; |
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 = "<p class='TEST'></p>"; |
// 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 = "<div class='test e'></div><div class='test'></div>"; |
// 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 = /<tbody/i, |
rhtml = /<|&#?\w+;/, |
rnocache = /<(?:script|object|embed|option|style)/i, |
// checked="checked" or checked (html5) |
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, |
raction = /\=([^="'>\s]+\/)>/g, |
wrapMap = { |
option: [ 1, "<select multiple='multiple'>", "</select>" ], |
legend: [ 1, "<fieldset>", "</fieldset>" ], |
thead: [ 1, "<table>", "</table>" ], |
tr: [ 2, "<table><tbody>", "</tbody></table>" ], |
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], |
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], |
area: [ 1, "<map>", "</map>" ], |
_default: [ 0, "", "" ] |
}; |
wrapMap.optgroup = wrapMap.option; |
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; |
wrapMap.th = wrapMap.td; |
// IE can't serialize <link> and <script> tags normally |
if ( !jQuery.support.htmlSerialize ) { |
wrapMap._default = [ 1, "div<div>", "</div>" ]; |
} |
jQuery.fn.extend({ |
text: function( text ) { |
if ( jQuery.isFunction(text) ) { |
return this.each(function(i) { |
var self = jQuery( this ); |
self.text( text.call(this, i, self.text()) ); |
}); |
} |
if ( typeof text !== "object" && text !== undefined ) { |
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); |
} |
return jQuery.text( this ); |
}, |
wrapAll: function( html ) { |
if ( jQuery.isFunction( html ) ) { |
return this.each(function(i) { |
jQuery(this).wrapAll( html.call(this, i) ); |
}); |
} |
if ( this[0] ) { |
// The elements to wrap the target around |
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); |
if ( this[0].parentNode ) { |
wrap.insertBefore( this[0] ); |
} |
wrap.map(function() { |
var elem = this; |
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { |
elem = elem.firstChild; |
} |
return elem; |
}).append(this); |
} |
return this; |
}, |
wrapInner: function( html ) { |
if ( jQuery.isFunction( html ) ) { |
return this.each(function(i) { |
jQuery(this).wrapInner( html.call(this, i) ); |
}); |
} |
return this.each(function() { |
var self = jQuery( this ), |
contents = self.contents(); |
if ( contents.length ) { |
contents.wrapAll( html ); |
} else { |
self.append( html ); |
} |
}); |
}, |
wrap: function( html ) { |
return this.each(function() { |
jQuery( this ).wrapAll( html ); |
}); |
}, |
unwrap: function() { |
return this.parent().each(function() { |
if ( !jQuery.nodeName( this, "body" ) ) { |
jQuery( this ).replaceWith( this.childNodes ); |
} |
}).end(); |
}, |
append: function() { |
return this.domManip(arguments, true, function( elem ) { |
if ( this.nodeType === 1 ) { |
this.appendChild( elem ); |
} |
}); |
}, |
prepend: function() { |
return this.domManip(arguments, true, function( elem ) { |
if ( this.nodeType === 1 ) { |
this.insertBefore( elem, this.firstChild ); |
} |
}); |
}, |
before: function() { |
if ( this[0] && this[0].parentNode ) { |
return this.domManip(arguments, false, function( elem ) { |
this.parentNode.insertBefore( elem, this ); |
}); |
} else if ( arguments.length ) { |
var set = jQuery(arguments[0]); |
set.push.apply( set, this.toArray() ); |
return this.pushStack( set, "before", arguments ); |
} |
}, |
after: function() { |
if ( this[0] && this[0].parentNode ) { |
return this.domManip(arguments, false, function( elem ) { |
this.parentNode.insertBefore( elem, this.nextSibling ); |
}); |
} else if ( arguments.length ) { |
var set = this.pushStack( this, "after", arguments ); |
set.push.apply( set, jQuery(arguments[0]).toArray() ); |
return set; |
} |
}, |
// keepData is for internal use only--do not document |
remove: function( selector, keepData ) { |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { |
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { |
if ( !keepData && elem.nodeType === 1 ) { |
jQuery.cleanData( elem.getElementsByTagName("*") ); |
jQuery.cleanData( [ elem ] ); |
} |
if ( elem.parentNode ) { |
elem.parentNode.removeChild( elem ); |
} |
} |
} |
return this; |
}, |
empty: function() { |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { |
// Remove element nodes and prevent memory leaks |
if ( elem.nodeType === 1 ) { |
jQuery.cleanData( elem.getElementsByTagName("*") ); |
} |
// Remove any remaining nodes |
while ( elem.firstChild ) { |
elem.removeChild( elem.firstChild ); |
} |
} |
return this; |
}, |
clone: function( events ) { |
// Do the clone |
var ret = this.map(function() { |
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { |
// IE copies events bound via attachEvent when |
// using cloneNode. Calling detachEvent on the |
// clone will also remove the events from the orignal |
// In order to get around this, we use innerHTML. |
// Unfortunately, this means some modifications to |
// attributes in IE that are actually only stored |
// as properties will not be copied (such as the |
// the name attribute on an input). |
var html = this.outerHTML, |
ownerDocument = this.ownerDocument; |
if ( !html ) { |
var div = ownerDocument.createElement("div"); |
div.appendChild( this.cloneNode(true) ); |
html = div.innerHTML; |
} |
return jQuery.clean([html.replace(rinlinejQuery, "") |
// Handle the case in IE 8 where action=/test/> self-closes a tag |
.replace(raction, '="$1">') |
.replace(rleadingWhitespace, "")], ownerDocument)[0]; |
} else { |
return this.cloneNode(true); |
} |
}); |
// Copy the events from the original to the clone |
if ( events === true ) { |
cloneCopyEvent( this, ret ); |
cloneCopyEvent( this.find("*"), ret.find("*") ); |
} |
// Return the cloned set |
return ret; |
}, |
html: function( value ) { |
if ( value === undefined ) { |
return this[0] && this[0].nodeType === 1 ? |
this[0].innerHTML.replace(rinlinejQuery, "") : |
null; |
// See if we can take a shortcut and just use innerHTML |
} else if ( typeof value === "string" && !rnocache.test( value ) && |
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && |
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { |
value = value.replace(rxhtmlTag, "<$1></$2>"); |
try { |
for ( var i = 0, l = this.length; i < l; i++ ) { |
// Remove element nodes and prevent memory leaks |
if ( this[i].nodeType === 1 ) { |
jQuery.cleanData( this[i].getElementsByTagName("*") ); |
this[i].innerHTML = value; |
} |
} |
// If using innerHTML throws an exception, use the fallback method |
} catch(e) { |
this.empty().append( value ); |
} |
} else if ( jQuery.isFunction( value ) ) { |
this.each(function(i){ |
var self = jQuery( this ); |
self.html( value.call(this, i, self.html()) ); |
}); |
} else { |
this.empty().append( value ); |
} |
return this; |
}, |
replaceWith: function( value ) { |
if ( this[0] && this[0].parentNode ) { |
// Make sure that the elements are removed from the DOM before they are inserted |
// this can help fix replacing a parent with child elements |
if ( jQuery.isFunction( value ) ) { |
return this.each(function(i) { |
var self = jQuery(this), old = self.html(); |
self.replaceWith( value.call( this, i, old ) ); |
}); |
} |
if ( typeof value !== "string" ) { |
value = jQuery( value ).detach(); |
} |
return this.each(function() { |
var next = this.nextSibling, |
parent = this.parentNode; |
jQuery( this ).remove(); |
if ( next ) { |
jQuery(next).before( value ); |
} else { |
jQuery(parent).append( value ); |
} |
}); |
} else { |
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); |
} |
}, |
detach: function( selector ) { |
return this.remove( selector, true ); |
}, |
domManip: function( args, table, callback ) { |
var results, first, fragment, parent, |
value = args[0], |
scripts = []; |
// We can't cloneNode fragments that contain checked, in WebKit |
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { |
return this.each(function() { |
jQuery(this).domManip( args, table, callback, true ); |
}); |
} |
if ( jQuery.isFunction(value) ) { |
return this.each(function(i) { |
var self = jQuery(this); |
args[0] = value.call(this, i, table ? self.html() : undefined); |
self.domManip( args, table, callback ); |
}); |
} |
if ( this[0] ) { |
parent = value && value.parentNode; |
// If we're in a fragment, just use that instead of building a new one |
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { |
results = { fragment: parent }; |
} else { |
results = jQuery.buildFragment( args, this, scripts ); |
} |
fragment = results.fragment; |
if ( fragment.childNodes.length === 1 ) { |
first = fragment = fragment.firstChild; |
} else { |
first = fragment.firstChild; |
} |
if ( first ) { |
table = table && jQuery.nodeName( first, "tr" ); |
for ( var i = 0, l = this.length; i < l; i++ ) { |
callback.call( |
table ? |
root(this[i], first) : |
this[i], |
i > 0 || results.cacheable || this.length > 1 ? |
fragment.cloneNode(true) : |
fragment |
); |
} |
} |
if ( scripts.length ) { |
jQuery.each( scripts, evalScript ); |
} |
} |
return this; |
} |
}); |
function root( elem, cur ) { |
return jQuery.nodeName(elem, "table") ? |
(elem.getElementsByTagName("tbody")[0] || |
elem.appendChild(elem.ownerDocument.createElement("tbody"))) : |
elem; |
} |
function cloneCopyEvent(orig, ret) { |
var i = 0; |
ret.each(function() { |
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) { |
return; |
} |
var oldData = jQuery.data( orig[i++] ), |
curData = jQuery.data( this, oldData ), |
events = oldData && oldData.events; |
if ( events ) { |
delete curData.handle; |
curData.events = {}; |
for ( var type in events ) { |
for ( var handler in events[ type ] ) { |
jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); |
} |
} |
} |
}); |
} |
jQuery.buildFragment = function( args, nodes, scripts ) { |
var fragment, cacheable, cacheresults, |
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); |
// Only cache "small" (1/2 KB) strings that are associated with the main document |
// Cloning options loses the selected state, so don't cache them |
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment |
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache |
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && |
!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { |
cacheable = true; |
cacheresults = jQuery.fragments[ args[0] ]; |
if ( cacheresults ) { |
if ( cacheresults !== 1 ) { |
fragment = cacheresults; |
} |
} |
} |
if ( !fragment ) { |
fragment = doc.createDocumentFragment(); |
jQuery.clean( args, doc, fragment, scripts ); |
} |
if ( cacheable ) { |
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; |
} |
return { fragment: fragment, cacheable: cacheable }; |
}; |
jQuery.fragments = {}; |
jQuery.each({ |
appendTo: "append", |
prependTo: "prepend", |
insertBefore: "before", |
insertAfter: "after", |
replaceAll: "replaceWith" |
}, function( name, original ) { |
jQuery.fn[ name ] = function( selector ) { |
var ret = [], |
insert = jQuery( selector ), |
parent = this.length === 1 && this[0].parentNode; |
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { |
insert[ original ]( this[0] ); |
return this; |
} else { |
for ( var i = 0, l = insert.length; i < l; i++ ) { |
var elems = (i > 0 ? this.clone(true) : this).get(); |
jQuery( insert[i] )[ original ]( elems ); |
ret = ret.concat( elems ); |
} |
return this.pushStack( ret, name, insert.selector ); |
} |
}; |
}); |
jQuery.extend({ |
clean: function( elems, context, fragment, scripts ) { |
context = context || document; |
// !context.createElement fails in IE with an error but returns typeof 'object' |
if ( typeof context.createElement === "undefined" ) { |
context = context.ownerDocument || context[0] && context[0].ownerDocument || document; |
} |
var ret = []; |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { |
if ( typeof elem === "number" ) { |
elem += ""; |
} |
if ( !elem ) { |
continue; |
} |
// Convert html string into DOM nodes |
if ( typeof elem === "string" && !rhtml.test( elem ) ) { |
elem = context.createTextNode( elem ); |
} else if ( typeof elem === "string" ) { |
// Fix "XHTML"-style tags in all browsers |
elem = elem.replace(rxhtmlTag, "<$1></$2>"); |
// Trim whitespace, otherwise indexOf won't work as expected |
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), |
wrap = wrapMap[ tag ] || wrapMap._default, |
depth = wrap[0], |
div = context.createElement("div"); |
// Go to html and back, then peel off extra wrappers |
div.innerHTML = wrap[1] + elem + wrap[2]; |
// Move to the right depth |
while ( depth-- ) { |
div = div.lastChild; |
} |
// Remove IE's autoinserted <tbody> from table fragments |
if ( !jQuery.support.tbody ) { |
// String was a <table>, *may* have spurious <tbody> |
var hasBody = rtbody.test(elem), |
tbody = tag === "table" && !hasBody ? |
div.firstChild && div.firstChild.childNodes : |
// String was a bare <thead> or <tfoot> |
wrap[1] === "<table>" && !hasBody ? |
div.childNodes : |
[]; |
for ( var j = tbody.length - 1; j >= 0 ; --j ) { |
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { |
tbody[ j ].parentNode.removeChild( tbody[ j ] ); |
} |
} |
} |
// IE completely kills leading whitespace when innerHTML is used |
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { |
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); |
} |
elem = div.childNodes; |
} |
if ( elem.nodeType ) { |
ret.push( elem ); |
} else { |
ret = jQuery.merge( ret, elem ); |
} |
} |
if ( fragment ) { |
for ( i = 0; ret[i]; i++ ) { |
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { |
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); |
} else { |
if ( ret[i].nodeType === 1 ) { |
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); |
} |
fragment.appendChild( ret[i] ); |
} |
} |
} |
return ret; |
}, |
cleanData: function( elems ) { |
var data, id, cache = jQuery.cache, |
special = jQuery.event.special, |
deleteExpando = jQuery.support.deleteExpando; |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { |
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { |
continue; |
} |
id = elem[ jQuery.expando ]; |
if ( id ) { |
data = cache[ id ]; |
if ( data && data.events ) { |
for ( var type in data.events ) { |
if ( special[ type ] ) { |
jQuery.event.remove( elem, type ); |
} else { |
jQuery.removeEvent( elem, type, data.handle ); |
} |
} |
} |
if ( deleteExpando ) { |
delete elem[ jQuery.expando ]; |
} else if ( elem.removeAttribute ) { |
elem.removeAttribute( jQuery.expando ); |
} |
delete cache[ id ]; |
} |
} |
} |
}); |
function evalScript( i, elem ) { |
if ( elem.src ) { |
jQuery.ajax({ |
url: elem.src, |
async: false, |
dataType: "script" |
}); |
} else { |
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); |
} |
if ( elem.parentNode ) { |
elem.parentNode.removeChild( elem ); |
} |
} |
var ralpha = /alpha\([^)]*\)/i, |
ropacity = /opacity=([^)]*)/, |
rdashAlpha = /-([a-z])/ig, |
rupper = /([A-Z])/g, |
rnumpx = /^-?\d+(?:px)?$/i, |
rnum = /^-?\d/, |
cssShow = { position: "absolute", visibility: "hidden", display: "block" }, |
cssWidth = [ "Left", "Right" ], |
cssHeight = [ "Top", "Bottom" ], |
curCSS, |
getComputedStyle, |
currentStyle, |
fcamelCase = function( all, letter ) { |
return letter.toUpperCase(); |
}; |
jQuery.fn.css = function( name, value ) { |
// Setting 'undefined' is a no-op |
if ( arguments.length === 2 && value === undefined ) { |
return this; |
} |
return jQuery.access( this, name, value, true, function( elem, name, value ) { |
return value !== undefined ? |
jQuery.style( elem, name, value ) : |
jQuery.css( elem, name ); |
}); |
}; |
jQuery.extend({ |
// Add in style property hooks for overriding the default |
// behavior of getting and setting a style property |
cssHooks: { |
opacity: { |
get: function( elem, computed ) { |
if ( computed ) { |
// We should always get a number back from opacity |
var ret = curCSS( elem, "opacity", "opacity" ); |
return ret === "" ? "1" : ret; |
} else { |
return elem.style.opacity; |
} |
} |
} |
}, |
// Exclude the following css properties to add px |
cssNumber: { |
"zIndex": true, |
"fontWeight": true, |
"opacity": true, |
"zoom": true, |
"lineHeight": true |
}, |
// Add in properties whose names you wish to fix before |
// setting or getting the value |
cssProps: { |
// normalize float css property |
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" |
}, |
// Get and set the style property on a DOM Node |
style: function( elem, name, value, extra ) { |
// Don't set styles on text and comment nodes |
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { |
return; |
} |
// Make sure that we're working with the right name |
var ret, origName = jQuery.camelCase( name ), |
style = elem.style, hooks = jQuery.cssHooks[ origName ]; |
name = jQuery.cssProps[ origName ] || origName; |
// Check if we're setting a value |
if ( value !== undefined ) { |
// Make sure that NaN and null values aren't set. See: #7116 |
if ( typeof value === "number" && isNaN( value ) || value == null ) { |
return; |
} |
// If a number was passed in, add 'px' to the (except for certain CSS properties) |
if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) { |
value += "px"; |
} |
// If a hook was provided, use that value, otherwise just set the specified value |
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { |
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided |
// Fixes bug #5509 |
try { |
style[ name ] = value; |
} catch(e) {} |
} |
} else { |
// If a hook was provided get the non-computed value from there |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { |
return ret; |
} |
// Otherwise just get the value from the style object |
return style[ name ]; |
} |
}, |
css: function( elem, name, extra ) { |
// Make sure that we're working with the right name |
var ret, origName = jQuery.camelCase( name ), |
hooks = jQuery.cssHooks[ origName ]; |
name = jQuery.cssProps[ origName ] || origName; |
// If a hook was provided get the computed value from there |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { |
return ret; |
// Otherwise, if a way to get the computed value exists, use that |
} else if ( curCSS ) { |
return curCSS( elem, name, origName ); |
} |
}, |
// A method for quickly swapping in/out CSS properties to get correct calculations |
swap: function( elem, options, callback ) { |
var old = {}; |
// Remember the old values, and insert the new ones |
for ( var name in options ) { |
old[ name ] = elem.style[ name ]; |
elem.style[ name ] = options[ name ]; |
} |
callback.call( elem ); |
// Revert the old values |
for ( name in options ) { |
elem.style[ name ] = old[ name ]; |
} |
}, |
camelCase: function( string ) { |
return string.replace( rdashAlpha, fcamelCase ); |
} |
}); |
// DEPRECATED, Use jQuery.css() instead |
jQuery.curCSS = jQuery.css; |
jQuery.each(["height", "width"], function( i, name ) { |
jQuery.cssHooks[ name ] = { |
get: function( elem, computed, extra ) { |
var val; |
if ( computed ) { |
if ( elem.offsetWidth !== 0 ) { |
val = getWH( elem, name, extra ); |
} else { |
jQuery.swap( elem, cssShow, function() { |
val = getWH( elem, name, extra ); |
}); |
} |
if ( val <= 0 ) { |
val = curCSS( elem, name, name ); |
if ( val === "0px" && currentStyle ) { |
val = currentStyle( elem, name, name ); |
} |
if ( val != null ) { |
// Should return "auto" instead of 0, use 0 for |
// temporary backwards-compat |
return val === "" || val === "auto" ? "0px" : val; |
} |
} |
if ( val < 0 || val == null ) { |
val = elem.style[ name ]; |
// Should return "auto" instead of 0, use 0 for |
// temporary backwards-compat |
return val === "" || val === "auto" ? "0px" : val; |
} |
return typeof val === "string" ? val : val + "px"; |
} |
}, |
set: function( elem, value ) { |
if ( rnumpx.test( value ) ) { |
// ignore negative width and height values #1599 |
value = parseFloat(value); |
if ( value >= 0 ) { |
return value + "px"; |
} |
} else { |
return value; |
} |
} |
}; |
}); |
if ( !jQuery.support.opacity ) { |
jQuery.cssHooks.opacity = { |
get: function( elem, computed ) { |
// IE uses filters for opacity |
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? |
(parseFloat(RegExp.$1) / 100) + "" : |
computed ? "1" : ""; |
}, |
set: function( elem, value ) { |
var style = elem.style; |
// IE has trouble with opacity if it does not have layout |
// Force it by setting the zoom level |
style.zoom = 1; |
// Set the alpha filter to set the opacity |
var opacity = jQuery.isNaN(value) ? |
"" : |
"alpha(opacity=" + value * 100 + ")", |
filter = style.filter || ""; |
style.filter = ralpha.test(filter) ? |
filter.replace(ralpha, opacity) : |
style.filter + ' ' + opacity; |
} |
}; |
} |
if ( document.defaultView && document.defaultView.getComputedStyle ) { |
getComputedStyle = function( elem, newName, name ) { |
var ret, defaultView, computedStyle; |
name = name.replace( rupper, "-$1" ).toLowerCase(); |
if ( !(defaultView = elem.ownerDocument.defaultView) ) { |
return undefined; |
} |
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { |
ret = computedStyle.getPropertyValue( name ); |
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { |
ret = jQuery.style( elem, name ); |
} |
} |
return ret; |
}; |
} |
if ( document.documentElement.currentStyle ) { |
currentStyle = function( elem, name ) { |
var left, rsLeft, |
ret = elem.currentStyle && elem.currentStyle[ name ], |
style = elem.style; |
// From the awesome hack by Dean Edwards |
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
// If we're not dealing with a regular pixel number |
// but a number that has a weird ending, we need to convert it to pixels |
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { |
// Remember the original values |
left = style.left; |
rsLeft = elem.runtimeStyle.left; |
// Put in the new values to get a computed value out |
elem.runtimeStyle.left = elem.currentStyle.left; |
style.left = name === "fontSize" ? "1em" : (ret || 0); |
ret = style.pixelLeft + "px"; |
// Revert the changed values |
style.left = left; |
elem.runtimeStyle.left = rsLeft; |
} |
return ret === "" ? "auto" : ret; |
}; |
} |
curCSS = getComputedStyle || currentStyle; |
function getWH( elem, name, extra ) { |
var which = name === "width" ? cssWidth : cssHeight, |
val = name === "width" ? elem.offsetWidth : elem.offsetHeight; |
if ( extra === "border" ) { |
return val; |
} |
jQuery.each( which, function() { |
if ( !extra ) { |
val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; |
} |
if ( extra === "margin" ) { |
val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; |
} else { |
val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; |
} |
}); |
return val; |
} |
if ( jQuery.expr && jQuery.expr.filters ) { |
jQuery.expr.filters.hidden = function( elem ) { |
var width = elem.offsetWidth, |
height = elem.offsetHeight; |
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); |
}; |
jQuery.expr.filters.visible = function( elem ) { |
return !jQuery.expr.filters.hidden( elem ); |
}; |
} |
var jsc = jQuery.now(), |
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, |
rselectTextarea = /^(?:select|textarea)/i, |
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, |
rnoContent = /^(?:GET|HEAD)$/, |
rbracket = /\[\]$/, |
jsre = /\=\?(&|$)/, |
rquery = /\?/, |
rts = /([?&])_=[^&]*/, |
rurl = /^(\w+:)?\/\/([^\/?#]+)/, |
r20 = /%20/g, |
rhash = /#.*$/, |
// Keep a copy of the old load method |
_load = jQuery.fn.load; |
jQuery.fn.extend({ |
load: function( url, params, callback ) { |
if ( typeof url !== "string" && _load ) { |
return _load.apply( this, arguments ); |
// Don't do a request if no elements are being requested |
} else if ( !this.length ) { |
return this; |
} |
var off = url.indexOf(" "); |
if ( off >= 0 ) { |
var selector = url.slice(off, url.length); |
url = url.slice(0, off); |
} |
// Default to a GET request |
var type = "GET"; |
// If the second parameter was provided |
if ( params ) { |
// If it's a function |
if ( jQuery.isFunction( params ) ) { |
// We assume that it's the callback |
callback = params; |
params = null; |
// Otherwise, build a param string |
} else if ( typeof params === "object" ) { |
params = jQuery.param( params, jQuery.ajaxSettings.traditional ); |
type = "POST"; |
} |
} |
var self = this; |
// Request the remote document |
jQuery.ajax({ |
url: url, |
type: type, |
dataType: "html", |
data: params, |
complete: function( res, status ) { |
// If successful, inject the HTML into all the matched elements |
if ( status === "success" || status === "notmodified" ) { |
// See if a selector was specified |
self.html( selector ? |
// Create a dummy div to hold the results |
jQuery("<div>") |
// inject the contents of the document in, removing the scripts |
// to avoid any 'Permission Denied' errors in IE |
.append(res.responseText.replace(rscript, "")) |
// Locate the specified elements |
.find(selector) : |
// If not, just inject the full result |
res.responseText ); |
} |
if ( callback ) { |
self.each( callback, [res.responseText, status, res] ); |
} |
} |
}); |
return this; |
}, |
serialize: function() { |
return jQuery.param(this.serializeArray()); |
}, |
serializeArray: function() { |
return this.map(function() { |
return this.elements ? jQuery.makeArray(this.elements) : this; |
}) |
.filter(function() { |
return this.name && !this.disabled && |
(this.checked || rselectTextarea.test(this.nodeName) || |
rinput.test(this.type)); |
}) |
.map(function( i, elem ) { |
var val = jQuery(this).val(); |
return val == null ? |
null : |
jQuery.isArray(val) ? |
jQuery.map( val, function( val, i ) { |
return { name: elem.name, value: val }; |
}) : |
{ name: elem.name, value: val }; |
}).get(); |
} |
}); |
// Attach a bunch of functions for handling common AJAX events |
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) { |
jQuery.fn[o] = function( f ) { |
return this.bind(o, f); |
}; |
}); |
jQuery.extend({ |
get: function( url, data, callback, type ) { |
// shift arguments if data argument was omited |
if ( jQuery.isFunction( data ) ) { |
type = type || callback; |
callback = data; |
data = null; |
} |
return jQuery.ajax({ |
type: "GET", |
url: url, |
data: data, |
success: callback, |
dataType: type |
}); |
}, |
getScript: function( url, callback ) { |
return jQuery.get(url, null, callback, "script"); |
}, |
getJSON: function( url, data, callback ) { |
return jQuery.get(url, data, callback, "json"); |
}, |
post: function( url, data, callback, type ) { |
// shift arguments if data argument was omited |
if ( jQuery.isFunction( data ) ) { |
type = type || callback; |
callback = data; |
data = {}; |
} |
return jQuery.ajax({ |
type: "POST", |
url: url, |
data: data, |
success: callback, |
dataType: type |
}); |
}, |
ajaxSetup: function( settings ) { |
jQuery.extend( jQuery.ajaxSettings, settings ); |
}, |
ajaxSettings: { |
url: location.href, |
global: true, |
type: "GET", |
contentType: "application/x-www-form-urlencoded", |
processData: true, |
async: true, |
/* |
timeout: 0, |
data: null, |
username: null, |
password: null, |
traditional: false, |
*/ |
// This function can be overriden by calling jQuery.ajaxSetup |
xhr: function() { |
return new window.XMLHttpRequest(); |
}, |
accepts: { |
xml: "application/xml, text/xml", |
html: "text/html", |
script: "text/javascript, application/javascript", |
json: "application/json, text/javascript", |
text: "text/plain", |
_default: "*/*" |
} |
}, |
ajax: function( origSettings ) { |
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings), |
jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type); |
s.url = s.url.replace( rhash, "" ); |
// Use original (not extended) context object if it was provided |
s.context = origSettings && origSettings.context != null ? origSettings.context : s; |
// convert data if not already a string |
if ( s.data && s.processData && typeof s.data !== "string" ) { |
s.data = jQuery.param( s.data, s.traditional ); |
} |
// Handle JSONP Parameter Callbacks |
if ( s.dataType === "jsonp" ) { |
if ( type === "GET" ) { |
if ( !jsre.test( s.url ) ) { |
s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?"; |
} |
} else if ( !s.data || !jsre.test(s.data) ) { |
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; |
} |
s.dataType = "json"; |
} |
// Build temporary JSONP function |
if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) { |
jsonp = s.jsonpCallback || ("jsonp" + jsc++); |
// Replace the =? sequence both in the query string and the data |
if ( s.data ) { |
s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); |
} |
s.url = s.url.replace(jsre, "=" + jsonp + "$1"); |
// We need to make sure |
// that a JSONP style response is executed properly |
s.dataType = "script"; |
// Handle JSONP-style loading |
var customJsonp = window[ jsonp ]; |
window[ jsonp ] = function( tmp ) { |
if ( jQuery.isFunction( customJsonp ) ) { |
customJsonp( tmp ); |
} else { |
// Garbage collect |
window[ jsonp ] = undefined; |
try { |
delete window[ jsonp ]; |
} catch( jsonpError ) {} |
} |
data = tmp; |
jQuery.handleSuccess( s, xhr, status, data ); |
jQuery.handleComplete( s, xhr, status, data ); |
if ( head ) { |
head.removeChild( script ); |
} |
}; |
} |
if ( s.dataType === "script" && s.cache === null ) { |
s.cache = false; |
} |
if ( s.cache === false && noContent ) { |
var ts = jQuery.now(); |
// try replacing _= if it is there |
var ret = s.url.replace(rts, "$1_=" + ts); |
// if nothing was replaced, add timestamp to the end |
s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); |
} |
// If data is available, append data to url for GET/HEAD requests |
if ( s.data && noContent ) { |
s.url += (rquery.test(s.url) ? "&" : "?") + s.data; |
} |
// Watch for a new set of requests |
if ( s.global && jQuery.active++ === 0 ) { |
jQuery.event.trigger( "ajaxStart" ); |
} |
// Matches an absolute URL, and saves the domain |
var parts = rurl.exec( s.url ), |
remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host); |
// If we're requesting a remote document |
// and trying to load JSON or Script with a GET |
if ( s.dataType === "script" && type === "GET" && remote ) { |
var head = document.getElementsByTagName("head")[0] || document.documentElement; |
var script = document.createElement("script"); |
if ( s.scriptCharset ) { |
script.charset = s.scriptCharset; |
} |
script.src = s.url; |
// Handle Script loading |
if ( !jsonp ) { |
var done = false; |
// Attach handlers for all browsers |
script.onload = script.onreadystatechange = function() { |
if ( !done && (!this.readyState || |
this.readyState === "loaded" || this.readyState === "complete") ) { |
done = true; |
jQuery.handleSuccess( s, xhr, status, data ); |
jQuery.handleComplete( s, xhr, status, data ); |
// Handle memory leak in IE |
script.onload = script.onreadystatechange = null; |
if ( head && script.parentNode ) { |
head.removeChild( script ); |
} |
} |
}; |
} |
// Use insertBefore instead of appendChild to circumvent an IE6 bug. |
// This arises when a base node is used (#2709 and #4378). |
head.insertBefore( script, head.firstChild ); |
// We handle everything using the script element injection |
return undefined; |
} |
var requestDone = false; |
// Create the request object |
var xhr = s.xhr(); |
if ( !xhr ) { |
return; |
} |
// Open the socket |
// Passing null username, generates a login popup on Opera (#2865) |
if ( s.username ) { |
xhr.open(type, s.url, s.async, s.username, s.password); |
} else { |
xhr.open(type, s.url, s.async); |
} |
// Need an extra try/catch for cross domain requests in Firefox 3 |
try { |
// Set content-type if data specified and content-body is valid for this type |
if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) { |
xhr.setRequestHeader("Content-Type", s.contentType); |
} |
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. |
if ( s.ifModified ) { |
if ( jQuery.lastModified[s.url] ) { |
xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]); |
} |
if ( jQuery.etag[s.url] ) { |
xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]); |
} |
} |
// Set header so the called script knows that it's an XMLHttpRequest |
// Only send the header if it's not a remote XHR |
if ( !remote ) { |
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
} |
// Set the Accepts header for the server, depending on the dataType |
xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? |
s.accepts[ s.dataType ] + ", */*; q=0.01" : |
s.accepts._default ); |
} catch( headerError ) {} |
// Allow custom headers/mimetypes and early abort |
if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) { |
// Handle the global AJAX counter |
if ( s.global && jQuery.active-- === 1 ) { |
jQuery.event.trigger( "ajaxStop" ); |
} |
// close opended socket |
xhr.abort(); |
return false; |
} |
if ( s.global ) { |
jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] ); |
} |
// Wait for a response to come back |
var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) { |
// The request was aborted |
if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) { |
// Opera doesn't call onreadystatechange before this point |
// so we simulate the call |
if ( !requestDone ) { |
jQuery.handleComplete( s, xhr, status, data ); |
} |
requestDone = true; |
if ( xhr ) { |
xhr.onreadystatechange = jQuery.noop; |
} |
// The transfer is complete and the data is available, or the request timed out |
} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) { |
requestDone = true; |
xhr.onreadystatechange = jQuery.noop; |
status = isTimeout === "timeout" ? |
"timeout" : |
!jQuery.httpSuccess( xhr ) ? |
"error" : |
s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? |
"notmodified" : |
"success"; |
var errMsg; |
if ( status === "success" ) { |
// Watch for, and catch, XML document parse errors |
try { |
// process the data (runs the xml through httpData regardless of callback) |
data = jQuery.httpData( xhr, s.dataType, s ); |
} catch( parserError ) { |
status = "parsererror"; |
errMsg = parserError; |
} |
} |
// Make sure that the request was successful or notmodified |
if ( status === "success" || status === "notmodified" ) { |
// JSONP handles its own success callback |
if ( !jsonp ) { |
jQuery.handleSuccess( s, xhr, status, data ); |
} |
} else { |
jQuery.handleError( s, xhr, status, errMsg ); |
} |
// Fire the complete handlers |
if ( !jsonp ) { |
jQuery.handleComplete( s, xhr, status, data ); |
} |
if ( isTimeout === "timeout" ) { |
xhr.abort(); |
} |
// Stop memory leaks |
if ( s.async ) { |
xhr = null; |
} |
} |
}; |
// Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK) |
// Opera doesn't fire onreadystatechange at all on abort |
try { |
var oldAbort = xhr.abort; |
xhr.abort = function() { |
if ( xhr ) { |
// oldAbort has no call property in IE7 so |
// just do it this way, which works in all |
// browsers |
Function.prototype.call.call( oldAbort, xhr ); |
} |
onreadystatechange( "abort" ); |
}; |
} catch( abortError ) {} |
// Timeout checker |
if ( s.async && s.timeout > 0 ) { |
setTimeout(function() { |
// Check to see if the request is still happening |
if ( xhr && !requestDone ) { |
onreadystatechange( "timeout" ); |
} |
}, s.timeout); |
} |
// Send the data |
try { |
xhr.send( noContent || s.data == null ? null : s.data ); |
} catch( sendError ) { |
jQuery.handleError( s, xhr, null, sendError ); |
// Fire the complete handlers |
jQuery.handleComplete( s, xhr, status, data ); |
} |
// firefox 1.5 doesn't fire statechange for sync requests |
if ( !s.async ) { |
onreadystatechange(); |
} |
// return XMLHttpRequest to allow aborting the request etc. |
return xhr; |
}, |
// Serialize an array of form elements or a set of |
// key/values into a query string |
param: function( a, traditional ) { |
var s = [], |
add = function( key, value ) { |
// If value is a function, invoke it and return its value |
value = jQuery.isFunction(value) ? value() : value; |
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); |
}; |
// Set traditional to true for jQuery <= 1.3.2 behavior. |
if ( traditional === undefined ) { |
traditional = jQuery.ajaxSettings.traditional; |
} |
// If an array was passed in, assume that it is an array of form elements. |
if ( jQuery.isArray(a) || a.jquery ) { |
// Serialize the form elements |
jQuery.each( a, function() { |
add( this.name, this.value ); |
}); |
} else { |
// If traditional, encode the "old" way (the way 1.3.2 or older |
// did it), otherwise encode params recursively. |
for ( var prefix in a ) { |
buildParams( prefix, a[prefix], traditional, add ); |
} |
} |
// Return the resulting serialization |
return s.join("&").replace(r20, "+"); |
} |
}); |
function buildParams( prefix, obj, traditional, add ) { |
if ( jQuery.isArray(obj) && obj.length ) { |
// Serialize array item. |
jQuery.each( obj, function( i, v ) { |
if ( traditional || rbracket.test( prefix ) ) { |
// Treat each array item as a scalar. |
add( prefix, v ); |
} else { |
// If array item is non-scalar (array or object), encode its |
// numeric index to resolve deserialization ambiguity issues. |
// Note that rack (as of 1.0.0) can't currently deserialize |
// nested arrays properly, and attempting to do so may cause |
// a server error. Possible fixes are to modify rack's |
// deserialization algorithm or to provide an option or flag |
// to force array serialization to be shallow. |
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); |
} |
}); |
} else if ( !traditional && obj != null && typeof obj === "object" ) { |
if ( jQuery.isEmptyObject( obj ) ) { |
add( prefix, "" ); |
// Serialize object item. |
} else { |
jQuery.each( obj, function( k, v ) { |
buildParams( prefix + "[" + k + "]", v, traditional, add ); |
}); |
} |
} else { |
// Serialize scalar item. |
add( prefix, obj ); |
} |
} |
// This is still on the jQuery object... for now |
// Want to move this to jQuery.ajax some day |
jQuery.extend({ |
// Counter for holding the number of active queries |
active: 0, |
// Last-Modified header cache for next request |
lastModified: {}, |
etag: {}, |
handleError: function( s, xhr, status, e ) { |
// If a local callback was specified, fire it |
if ( s.error ) { |
s.error.call( s.context, xhr, status, e ); |
} |
// Fire the global callback |
if ( s.global ) { |
jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] ); |
} |
}, |
handleSuccess: function( s, xhr, status, data ) { |
// If a local callback was specified, fire it and pass it the data |
if ( s.success ) { |
s.success.call( s.context, data, status, xhr ); |
} |
// Fire the global callback |
if ( s.global ) { |
jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] ); |
} |
}, |
handleComplete: function( s, xhr, status ) { |
// Process result |
if ( s.complete ) { |
s.complete.call( s.context, xhr, status ); |
} |
// The request was completed |
if ( s.global ) { |
jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] ); |
} |
// Handle the global AJAX counter |
if ( s.global && jQuery.active-- === 1 ) { |
jQuery.event.trigger( "ajaxStop" ); |
} |
}, |
triggerGlobal: function( s, type, args ) { |
(s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args); |
}, |
// Determines if an XMLHttpRequest was successful or not |
httpSuccess: function( xhr ) { |
try { |
// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 |
return !xhr.status && location.protocol === "file:" || |
xhr.status >= 200 && xhr.status < 300 || |
xhr.status === 304 || xhr.status === 1223; |
} catch(e) {} |
return false; |
}, |
// Determines if an XMLHttpRequest returns NotModified |
httpNotModified: function( xhr, url ) { |
var lastModified = xhr.getResponseHeader("Last-Modified"), |
etag = xhr.getResponseHeader("Etag"); |
if ( lastModified ) { |
jQuery.lastModified[url] = lastModified; |
} |
if ( etag ) { |
jQuery.etag[url] = etag; |
} |
return xhr.status === 304; |
}, |
httpData: function( xhr, type, s ) { |
var ct = xhr.getResponseHeader("content-type") || "", |
xml = type === "xml" || !type && ct.indexOf("xml") >= 0, |
data = xml ? xhr.responseXML : xhr.responseText; |
if ( xml && data.documentElement.nodeName === "parsererror" ) { |
jQuery.error( "parsererror" ); |
} |
// Allow a pre-filtering function to sanitize the response |
// s is checked to keep backwards compatibility |
if ( s && s.dataFilter ) { |
data = s.dataFilter( data, type ); |
} |
// The filter can actually parse the response |
if ( typeof data === "string" ) { |
// Get the JavaScript object, if JSON is used. |
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) { |
data = jQuery.parseJSON( data ); |
// If the type is "script", eval it in global context |
} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) { |
jQuery.globalEval( data ); |
} |
} |
return data; |
} |
}); |
/* |
* Create the request object; Microsoft failed to properly |
* implement the XMLHttpRequest in IE7 (can't request local files), |
* so we use the ActiveXObject when it is available |
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so |
* we need a fallback. |
*/ |
if ( window.ActiveXObject ) { |
jQuery.ajaxSettings.xhr = function() { |
if ( window.location.protocol !== "file:" ) { |
try { |
return new window.XMLHttpRequest(); |
} catch(xhrError) {} |
} |
try { |
return new window.ActiveXObject("Microsoft.XMLHTTP"); |
} catch(activeError) {} |
}; |
} |
// Does this browser support XHR requests? |
jQuery.support.ajax = !!jQuery.ajaxSettings.xhr(); |
var elemdisplay = {}, |
rfxtypes = /^(?:toggle|show|hide)$/, |
rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/, |
timerId, |
fxAttrs = [ |
// height animations |
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], |
// width animations |
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], |
// opacity animations |
[ "opacity" ] |
]; |
jQuery.fn.extend({ |
show: function( speed, easing, callback ) { |
var elem, display; |
if ( speed || speed === 0 ) { |
return this.animate( genFx("show", 3), speed, easing, callback); |
} else { |
for ( var i = 0, j = this.length; i < j; i++ ) { |
elem = this[i]; |
display = elem.style.display; |
// Reset the inline display of this element to learn if it is |
// being hidden by cascaded rules or not |
if ( !jQuery.data(elem, "olddisplay") && display === "none" ) { |
display = elem.style.display = ""; |
} |
// Set elements which have been overridden with display: none |
// in a stylesheet to whatever the default browser style is |
// for such an element |
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) { |
jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName)); |
} |
} |
// Set the display of most of the elements in a second loop |
// to avoid the constant reflow |
for ( i = 0; i < j; i++ ) { |
elem = this[i]; |
display = elem.style.display; |
if ( display === "" || display === "none" ) { |
elem.style.display = jQuery.data(elem, "olddisplay") || ""; |
} |
} |
return this; |
} |
}, |
hide: function( speed, easing, callback ) { |
if ( speed || speed === 0 ) { |
return this.animate( genFx("hide", 3), speed, easing, callback); |
} else { |
for ( var i = 0, j = this.length; i < j; i++ ) { |
var display = jQuery.css( this[i], "display" ); |
if ( display !== "none" ) { |
jQuery.data( this[i], "olddisplay", display ); |
} |
} |
// Set the display of the elements in a second loop |
// to avoid the constant reflow |
for ( i = 0; i < j; i++ ) { |
this[i].style.display = "none"; |
} |
return this; |
} |
}, |
// Save the old toggle function |
_toggle: jQuery.fn.toggle, |
toggle: function( fn, fn2, callback ) { |
var bool = typeof fn === "boolean"; |
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { |
this._toggle.apply( this, arguments ); |
} else if ( fn == null || bool ) { |
this.each(function() { |
var state = bool ? fn : jQuery(this).is(":hidden"); |
jQuery(this)[ state ? "show" : "hide" ](); |
}); |
} else { |
this.animate(genFx("toggle", 3), fn, fn2, callback); |
} |
return this; |
}, |
fadeTo: function( speed, to, easing, callback ) { |
return this.filter(":hidden").css("opacity", 0).show().end() |
.animate({opacity: to}, speed, easing, callback); |
}, |
animate: function( prop, speed, easing, callback ) { |
var optall = jQuery.speed(speed, easing, callback); |
if ( jQuery.isEmptyObject( prop ) ) { |
return this.each( optall.complete ); |
} |
return this[ optall.queue === false ? "each" : "queue" ](function() { |
// XXX 'this' does not always have a nodeName when running the |
// test suite |
var opt = jQuery.extend({}, optall), p, |
isElement = this.nodeType === 1, |
hidden = isElement && jQuery(this).is(":hidden"), |
self = this; |
for ( p in prop ) { |
var name = jQuery.camelCase( p ); |
if ( p !== name ) { |
prop[ name ] = prop[ p ]; |
delete prop[ p ]; |
p = name; |
} |
if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) { |
return opt.complete.call(this); |
} |
if ( isElement && ( p === "height" || p === "width" ) ) { |
// Make sure that nothing sneaks out |
// Record all 3 overflow attributes because IE does not |
// change the overflow attribute when overflowX and |
// overflowY are set to the same value |
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; |
// Set display property to inline-block for height/width |
// animations on inline elements that are having width/height |
// animated |
if ( jQuery.css( this, "display" ) === "inline" && |
jQuery.css( this, "float" ) === "none" ) { |
if ( !jQuery.support.inlineBlockNeedsLayout ) { |
this.style.display = "inline-block"; |
} else { |
var display = defaultDisplay(this.nodeName); |
// inline-level elements accept inline-block; |
// block-level elements need to be inline with layout |
if ( display === "inline" ) { |
this.style.display = "inline-block"; |
} else { |
this.style.display = "inline"; |
this.style.zoom = 1; |
} |
} |
} |
} |
if ( jQuery.isArray( prop[p] ) ) { |
// Create (if needed) and add to specialEasing |
(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1]; |
prop[p] = prop[p][0]; |
} |
} |
if ( opt.overflow != null ) { |
this.style.overflow = "hidden"; |
} |
opt.curAnim = jQuery.extend({}, prop); |
jQuery.each( prop, function( name, val ) { |
var e = new jQuery.fx( self, opt, name ); |
if ( rfxtypes.test(val) ) { |
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop ); |
} else { |
var parts = rfxnum.exec(val), |
start = e.cur() || 0; |
if ( parts ) { |
var end = parseFloat( parts[2] ), |
unit = parts[3] || "px"; |
// We need to compute starting value |
if ( unit !== "px" ) { |
jQuery.style( self, name, (end || 1) + unit); |
start = ((end || 1) / e.cur()) * start; |
jQuery.style( self, name, start + unit); |
} |
// If a +=/-= token was provided, we're doing a relative animation |
if ( parts[1] ) { |
end = ((parts[1] === "-=" ? -1 : 1) * end) + start; |
} |
e.custom( start, end, unit ); |
} else { |
e.custom( start, val, "" ); |
} |
} |
}); |
// For JS strict compliance |
return true; |
}); |
}, |
stop: function( clearQueue, gotoEnd ) { |
var timers = jQuery.timers; |
if ( clearQueue ) { |
this.queue([]); |
} |
this.each(function() { |
// go in reverse order so anything added to the queue during the loop is ignored |
for ( var i = timers.length - 1; i >= 0; i-- ) { |
if ( timers[i].elem === this ) { |
if (gotoEnd) { |
// force the next step to be the last |
timers[i](true); |
} |
timers.splice(i, 1); |
} |
} |
}); |
// start the next in the queue if the last step wasn't forced |
if ( !gotoEnd ) { |
this.dequeue(); |
} |
return this; |
} |
}); |
function genFx( type, num ) { |
var obj = {}; |
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { |
obj[ this ] = type; |
}); |
return obj; |
} |
// Generate shortcuts for custom animations |
jQuery.each({ |
slideDown: genFx("show", 1), |
slideUp: genFx("hide", 1), |
slideToggle: genFx("toggle", 1), |
fadeIn: { opacity: "show" }, |
fadeOut: { opacity: "hide" }, |
fadeToggle: { opacity: "toggle" } |
}, function( name, props ) { |
jQuery.fn[ name ] = function( speed, easing, callback ) { |
return this.animate( props, speed, easing, callback ); |
}; |
}); |
jQuery.extend({ |
speed: function( speed, easing, fn ) { |
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { |
complete: fn || !fn && easing || |
jQuery.isFunction( speed ) && speed, |
duration: speed, |
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing |
}; |
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; |
// Queueing |
opt.old = opt.complete; |
opt.complete = function() { |
if ( opt.queue !== false ) { |
jQuery(this).dequeue(); |
} |
if ( jQuery.isFunction( opt.old ) ) { |
opt.old.call( this ); |
} |
}; |
return opt; |
}, |
easing: { |
linear: function( p, n, firstNum, diff ) { |
return firstNum + diff * p; |
}, |
swing: function( p, n, firstNum, diff ) { |
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
} |
}, |
timers: [], |
fx: function( elem, options, prop ) { |
this.options = options; |
this.elem = elem; |
this.prop = prop; |
if ( !options.orig ) { |
options.orig = {}; |
} |
} |
}); |
jQuery.fx.prototype = { |
// Simple function for setting a style value |
update: function() { |
if ( this.options.step ) { |
this.options.step.call( this.elem, this.now, this ); |
} |
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); |
}, |
// Get the current size |
cur: function() { |
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { |
return this.elem[ this.prop ]; |
} |
var r = parseFloat( jQuery.css( this.elem, this.prop ) ); |
return r && r > -10000 ? r : 0; |
}, |
// Start an animation from one number to another |
custom: function( from, to, unit ) { |
var self = this, |
fx = jQuery.fx; |
this.startTime = jQuery.now(); |
this.start = from; |
this.end = to; |
this.unit = unit || this.unit || "px"; |
this.now = this.start; |
this.pos = this.state = 0; |
function t( gotoEnd ) { |
return self.step(gotoEnd); |
} |
t.elem = this.elem; |
if ( t() && jQuery.timers.push(t) && !timerId ) { |
timerId = setInterval(fx.tick, fx.interval); |
} |
}, |
// Simple 'show' function |
show: function() { |
// Remember where we started, so that we can go back to it later |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
this.options.show = true; |
// Begin the animation |
// Make sure that we start at a small width/height to avoid any |
// flash of content |
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); |
// Start by showing the element |
jQuery( this.elem ).show(); |
}, |
// Simple 'hide' function |
hide: function() { |
// Remember where we started, so that we can go back to it later |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
this.options.hide = true; |
// Begin the animation |
this.custom(this.cur(), 0); |
}, |
// Each step of an animation |
step: function( gotoEnd ) { |
var t = jQuery.now(), done = true; |
if ( gotoEnd || t >= this.options.duration + this.startTime ) { |
this.now = this.end; |
this.pos = this.state = 1; |
this.update(); |
this.options.curAnim[ this.prop ] = true; |
for ( var i in this.options.curAnim ) { |
if ( this.options.curAnim[i] !== true ) { |
done = false; |
} |
} |
if ( done ) { |
// Reset the overflow |
if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { |
var elem = this.elem, |
options = this.options; |
jQuery.each( [ "", "X", "Y" ], function (index, value) { |
elem.style[ "overflow" + value ] = options.overflow[index]; |
} ); |
} |
// Hide the element if the "hide" operation was done |
if ( this.options.hide ) { |
jQuery(this.elem).hide(); |
} |
// Reset the properties, if the item has been hidden or shown |
if ( this.options.hide || this.options.show ) { |
for ( var p in this.options.curAnim ) { |
jQuery.style( this.elem, p, this.options.orig[p] ); |
} |
} |
// Execute the complete function |
this.options.complete.call( this.elem ); |
} |
return false; |
} else { |
var n = t - this.startTime; |
this.state = n / this.options.duration; |
// Perform the easing function, defaults to swing |
var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop]; |
var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear"); |
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); |
this.now = this.start + ((this.end - this.start) * this.pos); |
// Perform the next step of the animation |
this.update(); |
} |
return true; |
} |
}; |
jQuery.extend( jQuery.fx, { |
tick: function() { |
var timers = jQuery.timers; |
for ( var i = 0; i < timers.length; i++ ) { |
if ( !timers[i]() ) { |
timers.splice(i--, 1); |
} |
} |
if ( !timers.length ) { |
jQuery.fx.stop(); |
} |
}, |
interval: 13, |
stop: function() { |
clearInterval( timerId ); |
timerId = null; |
}, |
speeds: { |
slow: 600, |
fast: 200, |
// Default speed |
_default: 400 |
}, |
step: { |
opacity: function( fx ) { |
jQuery.style( fx.elem, "opacity", fx.now ); |
}, |
_default: function( fx ) { |
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { |
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; |
} else { |
fx.elem[ fx.prop ] = fx.now; |
} |
} |
} |
}); |
if ( jQuery.expr && jQuery.expr.filters ) { |
jQuery.expr.filters.animated = function( elem ) { |
return jQuery.grep(jQuery.timers, function( fn ) { |
return elem === fn.elem; |
}).length; |
}; |
} |
function defaultDisplay( nodeName ) { |
if ( !elemdisplay[ nodeName ] ) { |
var elem = jQuery("<" + nodeName + ">").appendTo("body"), |
display = elem.css("display"); |
elem.remove(); |
if ( display === "none" || display === "" ) { |
display = "block"; |
} |
elemdisplay[ nodeName ] = display; |
} |
return elemdisplay[ nodeName ]; |
} |
var rtable = /^t(?:able|d|h)$/i, |
rroot = /^(?:body|html)$/i; |
if ( "getBoundingClientRect" in document.documentElement ) { |
jQuery.fn.offset = function( options ) { |
var elem = this[0], box; |
if ( options ) { |
return this.each(function( i ) { |
jQuery.offset.setOffset( this, options, i ); |
}); |
} |
if ( !elem || !elem.ownerDocument ) { |
return null; |
} |
if ( elem === elem.ownerDocument.body ) { |
return jQuery.offset.bodyOffset( elem ); |
} |
try { |
box = elem.getBoundingClientRect(); |
} catch(e) {} |
var doc = elem.ownerDocument, |
docElem = doc.documentElement; |
// Make sure we're not dealing with a disconnected DOM node |
if ( !box || !jQuery.contains( docElem, elem ) ) { |
return box || { top: 0, left: 0 }; |
} |
var body = doc.body, |
win = getWindow(doc), |
clientTop = docElem.clientTop || body.clientTop || 0, |
clientLeft = docElem.clientLeft || body.clientLeft || 0, |
scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ), |
scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft), |
top = box.top + scrollTop - clientTop, |
left = box.left + scrollLeft - clientLeft; |
return { top: top, left: left }; |
}; |
} else { |
jQuery.fn.offset = function( options ) { |
var elem = this[0]; |
if ( options ) { |
return this.each(function( i ) { |
jQuery.offset.setOffset( this, options, i ); |
}); |
} |
if ( !elem || !elem.ownerDocument ) { |
return null; |
} |
if ( elem === elem.ownerDocument.body ) { |
return jQuery.offset.bodyOffset( elem ); |
} |
jQuery.offset.initialize(); |
var computedStyle, |
offsetParent = elem.offsetParent, |
prevOffsetParent = elem, |
doc = elem.ownerDocument, |
docElem = doc.documentElement, |
body = doc.body, |
defaultView = doc.defaultView, |
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, |
top = elem.offsetTop, |
left = elem.offsetLeft; |
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { |
break; |
} |
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; |
top -= elem.scrollTop; |
left -= elem.scrollLeft; |
if ( elem === offsetParent ) { |
top += elem.offsetTop; |
left += elem.offsetLeft; |
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
} |
prevOffsetParent = offsetParent; |
offsetParent = elem.offsetParent; |
} |
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
} |
prevComputedStyle = computedStyle; |
} |
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { |
top += body.offsetTop; |
left += body.offsetLeft; |
} |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { |
top += Math.max( docElem.scrollTop, body.scrollTop ); |
left += Math.max( docElem.scrollLeft, body.scrollLeft ); |
} |
return { top: top, left: left }; |
}; |
} |
jQuery.offset = { |
initialize: function() { |
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, |
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; |
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); |
container.innerHTML = html; |
body.insertBefore( container, body.firstChild ); |
innerDiv = container.firstChild; |
checkDiv = innerDiv.firstChild; |
td = innerDiv.nextSibling.firstChild.firstChild; |
this.doesNotAddBorder = (checkDiv.offsetTop !== 5); |
this.doesAddBorderForTableAndCells = (td.offsetTop === 5); |
checkDiv.style.position = "fixed"; |
checkDiv.style.top = "20px"; |
// safari subtracts parent border width here which is 5px |
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); |
checkDiv.style.position = checkDiv.style.top = ""; |
innerDiv.style.overflow = "hidden"; |
innerDiv.style.position = "relative"; |
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); |
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); |
body.removeChild( container ); |
body = container = innerDiv = checkDiv = table = td = null; |
jQuery.offset.initialize = jQuery.noop; |
}, |
bodyOffset: function( body ) { |
var top = body.offsetTop, |
left = body.offsetLeft; |
jQuery.offset.initialize(); |
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { |
top += parseFloat( jQuery.css(body, "marginTop") ) || 0; |
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; |
} |
return { top: top, left: left }; |
}, |
setOffset: function( elem, options, i ) { |
var position = jQuery.css( elem, "position" ); |
// set position first, in-case top/left are set even on static elem |
if ( position === "static" ) { |
elem.style.position = "relative"; |
} |
var curElem = jQuery( elem ), |
curOffset = curElem.offset(), |
curCSSTop = jQuery.css( elem, "top" ), |
curCSSLeft = jQuery.css( elem, "left" ), |
calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), |
props = {}, curPosition = {}, curTop, curLeft; |
// need to be able to calculate position if either top or left is auto and position is absolute |
if ( calculatePosition ) { |
curPosition = curElem.position(); |
} |
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; |
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; |
if ( jQuery.isFunction( options ) ) { |
options = options.call( elem, i, curOffset ); |
} |
if (options.top != null) { |
props.top = (options.top - curOffset.top) + curTop; |
} |
if (options.left != null) { |
props.left = (options.left - curOffset.left) + curLeft; |
} |
if ( "using" in options ) { |
options.using.call( elem, props ); |
} else { |
curElem.css( props ); |
} |
} |
}; |
jQuery.fn.extend({ |
position: function() { |
if ( !this[0] ) { |
return null; |
} |
var elem = this[0], |
// Get *real* offsetParent |
offsetParent = this.offsetParent(), |
// Get correct offsets |
offset = this.offset(), |
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); |
// Subtract element margins |
// note: when an element has margin: auto the offsetLeft and marginLeft |
// are the same in Safari causing offset.left to incorrectly be 0 |
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; |
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; |
// Add offsetParent borders |
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; |
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; |
// Subtract the two offsets |
return { |
top: offset.top - parentOffset.top, |
left: offset.left - parentOffset.left |
}; |
}, |
offsetParent: function() { |
return this.map(function() { |
var offsetParent = this.offsetParent || document.body; |
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { |
offsetParent = offsetParent.offsetParent; |
} |
return offsetParent; |
}); |
} |
}); |
// Create scrollLeft and scrollTop methods |
jQuery.each( ["Left", "Top"], function( i, name ) { |
var method = "scroll" + name; |
jQuery.fn[ method ] = function(val) { |
var elem = this[0], win; |
if ( !elem ) { |
return null; |
} |
if ( val !== undefined ) { |
// Set the scroll offset |
return this.each(function() { |
win = getWindow( this ); |
if ( win ) { |
win.scrollTo( |
!i ? val : jQuery(win).scrollLeft(), |
i ? val : jQuery(win).scrollTop() |
); |
} else { |
this[ method ] = val; |
} |
}); |
} else { |
win = getWindow( elem ); |
// Return the scroll offset |
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : |
jQuery.support.boxModel && win.document.documentElement[ method ] || |
win.document.body[ method ] : |
elem[ method ]; |
} |
}; |
}); |
function getWindow( elem ) { |
return jQuery.isWindow( elem ) ? |
elem : |
elem.nodeType === 9 ? |
elem.defaultView || elem.parentWindow : |
false; |
} |
// Create innerHeight, innerWidth, outerHeight and outerWidth methods |
jQuery.each([ "Height", "Width" ], function( i, name ) { |
var type = name.toLowerCase(); |
// innerHeight and innerWidth |
jQuery.fn["inner" + name] = function() { |
return this[0] ? |
parseFloat( jQuery.css( this[0], type, "padding" ) ) : |
null; |
}; |
// outerHeight and outerWidth |
jQuery.fn["outer" + name] = function( margin ) { |
return this[0] ? |
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : |
null; |
}; |
jQuery.fn[ type ] = function( size ) { |
// Get window width or height |
var elem = this[0]; |
if ( !elem ) { |
return size == null ? null : this; |
} |
if ( jQuery.isFunction( size ) ) { |
return this.each(function( i ) { |
var self = jQuery( this ); |
self[ type ]( size.call( this, i, self[ type ]() ) ); |
}); |
} |
if ( jQuery.isWindow( elem ) ) { |
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode |
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || |
elem.document.body[ "client" + name ]; |
// Get document width or height |
} else if ( elem.nodeType === 9 ) { |
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater |
return Math.max( |
elem.documentElement["client" + name], |
elem.body["scroll" + name], elem.documentElement["scroll" + name], |
elem.body["offset" + name], elem.documentElement["offset" + name] |
); |
// Get or set width or height on the element |
} else if ( size === undefined ) { |
var orig = jQuery.css( elem, type ), |
ret = parseFloat( orig ); |
return jQuery.isNaN( ret ) ? orig : ret; |
// Set the width or height on the element (default to pixels if value is unitless) |
} else { |
return this.css( type, typeof size === "string" ? size : size + "px" ); |
} |
}; |
}); |
})(window); |
/trunk/applications/rendu/squelettes/js/jquery_ui/jquery-ui-1.8.9.custom.min.js |
---|
New file |
0,0 → 1,83 |
/*! |
* jQuery UI 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI |
*/ |
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.9",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, |
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, |
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); |
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, |
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, |
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); |
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&& |
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery); |
;/*! |
* jQuery UI Widget 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Widget |
*/ |
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h, |
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h; |
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options, |
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")}, |
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this}, |
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); |
;/*! |
* jQuery UI Mouse 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Mouse |
* |
* Depends: |
* jquery.ui.widget.js |
*/ |
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(true===c.data(b.target,a.widgetName+".preventClickEvent")){c.removeData(b.target,a.widgetName+".preventClickEvent");b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent= |
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted= |
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); |
return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", |
true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); |
;/* |
* jQuery UI Slider 1.8.9 |
* |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
* Dual licensed under the MIT or GPL Version 2 licenses. |
* http://jquery.org/license |
* |
* http://docs.jquery.com/UI/Slider |
* |
* Depends: |
* jquery.ui.core.js |
* jquery.ui.mouse.js |
* jquery.ui.widget.js |
*/ |
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");a.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"); |
this.range=d([]);if(a.range){if(a.range===true){this.range=d("<div></div>");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle"); |
if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length<a.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); |
else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= |
false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== |
b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); |
this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, |
g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, |
_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; |
if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= |
this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c<e))c=e;if(c!==this.values(a)){e=this.values();e[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:e});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a], |
value:c});b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value= |
this._trimAlignValue(b);this._refreshValue();this._change(null,0)}return this._value()},values:function(b,a){var c,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):this.value(); |
else return this._values()},_setOption:function(b,a){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation(); |
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b]; |
return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, |
_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); |
if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, |
1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.9"})})(jQuery); |
; |
/trunk/applications/rendu/squelettes/js/jquery-1.4.4.min.js |
---|
New file |
0,0 → 1,167 |
/*! |
* 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(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= |
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| |
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, |
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, |
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, |
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ |
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, |
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, |
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, |
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, |
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== |
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; |
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; |
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", |
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& |
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& |
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], |
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, |
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= |
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| |
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, |
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), |
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, |
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= |
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= |
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= |
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= |
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); |
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, |
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= |
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, |
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", |
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== |
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), |
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, |
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; |
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= |
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, |
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& |
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; |
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, |
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= |
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ |
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= |
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== |
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== |
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ |
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.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(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| |
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, |
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= |
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; |
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== |
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, |
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= |
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== |
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== |
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, |
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= |
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== |
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); |
c.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(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); |
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, |
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; |
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, |
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= |
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); |
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== |
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.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(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== |
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= |
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, |
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, |
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== |
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== |
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- |
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== |
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== |
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; |
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, |
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; |
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), |
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); |
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& |
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| |
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= |
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? |
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; |
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, |
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= |
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): |
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, |
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, |
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& |
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, |
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= |
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, |
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, |
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, |
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); |
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; |
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= |
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, |
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): |
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", |
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| |
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- |
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); |
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, |
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, |
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), |
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); |
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= |
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; |
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, |
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== |
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& |
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, |
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", |
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| |
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= |
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; |
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", |
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& |
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| |
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= |
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", |
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), |
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); |
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", |
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", |
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, |
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== |
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| |
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, |
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* |
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} |
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; |
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| |
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= |
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== |
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& |
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; |
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= |
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", |
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= |
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, |
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, |
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& |
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); |
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ |
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); |
/trunk/applications/rendu/squelettes/js/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2011,2,1,14,2,36 |
[Settings] |
ShowDotFiles=true |
/trunk/applications/rendu/squelettes/js/rendu.js |
---|
New file |
0,0 → 1,347 |
var map = null; |
var tableau_marqueurs = new Array(); |
var infowindow = new google.maps.InfoWindow(); |
var infos_observations = new Array(); |
var type_espece = '0'; |
var espece = '0'; |
var evenement = '0'; |
var annee = '0'; |
var mois = '1'; |
function getUrlBaseJrest() { |
url_page_courante = document.URL; |
if(url_page_courante.indexOf('http://www.') != -1) { |
return urlBaseJrest; |
} else { |
return urlBaseJrest.replace('http://www.','http://'); |
} |
} |
function traiterParametresUrl() { |
var vars = [], hash; |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
for(var i = 0; i < hashes.length; i++) |
{ |
hash = hashes[i].split('='); |
vars.push(hash[0]); |
vars[hash[0]] = hash[1]; |
} |
if(vars['type_espece'] != null) { |
type_espece = vars['type_espece']; |
$('#selecteur_liste_types_especes').val(type_espece); |
} |
if(vars['espece'] != null) { |
if(type_espece != '0') { |
modifierTableauEspeces(); |
} |
espece = vars['espece']; |
$('#selecteur_especes').val(espece); |
} |
if(vars['evenement'] != null) { |
if(espece != 0) { |
modifierTableauEvenement() |
} |
evenement = vars['evenement']; |
$('#selecteur_evenements').val(evenement); |
} |
if(vars['annee'] != null) { |
annee = vars['annee']; |
$('#selecteur_liste_annees').val(annee); |
} else { |
date = new Date() |
annee = date.getFullYear(); |
$('#selecteur_liste_annees').val(annee); |
} |
if(vars['mois'] != null) { |
mois = vars['mois']; |
} else { |
date = new Date() |
mois = date.getMonth() + 1; |
} |
if(vars['cacher_criteres'] != null && vars['cacher_criteres'] == '1') { |
$(".criteres").hide(); |
} |
} |
function obtenirCodeWidget() { |
var UrlBase = window.location; |
UrlBase += '?'; |
if(type_espece != '0') UrlBase += "type_espece="+type_espece; |
if(espece != '0') UrlBase += "&espece="+espece; |
if(evenement != '0') UrlBase += "&evenement="+evenement; |
if(annee != '0') UrlBase += "&annee="+annee; |
if(mois != '0') UrlBase += "&mois="+mois; |
UrlBase += "&cacher_criteres=1"; |
code_widget = '<iframe src="'+UrlBase+'" width="375px" height="470px"><p>Votre navigateur ne supporte pas les iframes.</p></iframe>' |
return code_widget; |
} |
$('#lien_cette_recherche').ready(function() { |
$('#lien_cette_recherche').click(function() { |
window.alert(obtenirCodeWidget()); |
return false; |
}); |
}); |
$(document).ready(function() { |
traiterParametresUrl(); |
}); |
/** |
************************************************************************************************ |
************************************************************************************************ |
Fonctions concernant les gestion des filtres sur la carte |
************************************************************************************************ |
************************************************************************************************ |
**/ |
function initialiserSliderDates() { |
dates = new Array("jan","fev","mar","avr","mai","jun","jui","aou","sep","oct","nov","dec"); |
$("#slider_date").slider({ |
min: 1, |
max: 13, |
value: mois |
}); |
taille_criteres = Math.round($("#slider_date").width()/(dates.length)); |
valeurs_slider = '<table id="table_dates"><tbody><tr>'; |
for (i in dates) { |
valeurs_slider += '<td class="conteneur_date">'+dates[i]+'</td>'; |
} |
valeurs_slider += '</tr></tbody></table>'; |
$("conteneur_date").css(".conteneur_date{ width:"+taille_criteres+"px;}"); |
$("#valeurs_date").html(valeurs_slider); |
$("#slider_date").bind("slide", function(event, ui) { |
mois = $("#slider_date").slider("value"); |
obtenirObservations(); |
return true; |
}); |
$(window).bind("resize", resizeWindow); |
function resizeWindow( e ) { |
taille_criteres = Math.round($("#slider_date").width()/(dates.length)); |
$("#css_slider").html(".conteneur_date{ width:"+taille_criteres+"px;}"); |
} |
} |
function initialiserListeTypesEspeces() { |
$('#selecteur_liste_types_especes').change(function() { |
type_espece = $('select#selecteur_liste_types_especes option:selected').val(); |
modifierTableauEspeces(); |
obtenirObservations(); |
}); |
} |
function modifierTableauEspeces() { |
id_type_espece = $('select#selecteur_liste_types_especes option:selected').val(); |
$elements_liste = tableau_especes[id_type_espece]; |
chaine_elements_liste = ''; |
chaine_elements_liste = '<option value="0" class="espece_type_0" selected="selected"> toutes les espèces </option>'; |
for(i in $elements_liste) { |
chaine_elements_liste += '<option value='+i+'>'+$elements_liste[i]+'</option>'; |
} |
$('#selecteur_especes').html(chaine_elements_liste); |
} |
function initialiserListeEspeces() { |
$('#selecteur_especes').change(function() { |
espece = $('select#selecteur_especes option:selected').val(); |
modifierTableauEvenements(); |
obtenirObservations(); |
}); |
} |
function modifierTableauEvenements() { |
id_espece = $('select#selecteur_especes option:selected').val(); |
$elements_liste = tableau_evenements_especes[id_espece]; |
$elements_liste = $elements_liste.split(','); |
chaine_elements_liste = ''; |
chaine_elements_liste = '<option value="0" class="espece_type_0" selected="selected"> tous les evènements </option>'; |
for(i in $elements_liste) { |
chaine_elements_liste += '<option value='+$elements_liste[i]+'>'+tableau_evenements[$elements_liste[i]]+'</option>'; |
} |
$('#selecteur_evenements').html(chaine_elements_liste); |
} |
function initialiserListeEvenements() { |
$('#selecteur_evenements').change(function() { |
evenement = $('select#selecteur_evenements option:selected').val(); |
obtenirObservations(); |
}); |
} |
function initialiserListeAnnees() { |
$('#selecteur_liste_annees').change(function() { |
annee = $('select#selecteur_liste_annees option:selected').val(); |
obtenirObservations(); |
}); |
} |
$('#slider_date').ready(function() { |
initialiserSliderDates(); |
initialiserListeTypesEspeces(); |
initialiserListeEspeces(); |
initialiserListeEvenements(); |
initialiserListeAnnees(); |
obtenirObservations(); |
}); |
/** |
************************************************************************************************ |
************************************************************************************************ |
Fonctions concernant la carte permettant de pointer d'afficher l'emplacement des observation |
************************************************************************************************ |
************************************************************************************************ |
**/ |
function initialiserCarte() { |
if($('#map_canvas').length == 0) { |
return; |
} |
var latlng = new google.maps.LatLng(47.0504, 2.2347); |
var myOptions = { |
zoom: 5, |
center: latlng, |
mapTypeId: google.maps.MapTypeId.HYBRID |
}; |
map = new google.maps.Map(document.getElementById("map_canvas"), |
myOptions); |
marker = new google.maps.Marker({ |
position: latlng, |
title:"" |
}); |
} |
function obtenirObservations() { |
requete = '?annee='+annee+'&mois='+mois; |
if(type_espece != '0' && espece == '0') { |
requete += '&type_espece='+type_espece; |
} |
if(espece != '0') { |
requete += '&espece='+espece; |
} |
if(evenement != '0') { |
requete += '&evenement='+evenement; |
} |
$.get(getUrlBaseJrest()+'OdsExport/ExportObservationJson/'+requete, function(data) { |
infos_observations = jQuery.parseJSON(data); |
if(tableau_marqueurs.length > 0) { |
viderMarqueurs(); |
} |
for(i in infos_observations) { |
creerEtAjouterMarqueur(i, infos_observations[i]); |
} |
}); |
} |
function creerEtAjouterMarqueur(id_marqueur, infos_obs) { |
latlng = new google.maps.LatLng(infos_obs['latitude'],infos_obs['longitude']); |
tableau_marqueurs[id_marqueur] = new google.maps.Marker({ |
position: latlng, |
title:infos_obs.evenenement |
}); |
google.maps.event.addListener(tableau_marqueurs[id_marqueur], 'click', function() { |
contenu_fenetre = formaterContenuFenetre(infos_obs.obs); |
infowindow.close(); |
infowindow.content = contenu_fenetre; |
infowindow.open(map,this); |
}); |
tableau_marqueurs[id_marqueur].setDraggable(false); |
tableau_marqueurs[id_marqueur].setClickable(true); |
tableau_marqueurs[id_marqueur].setMap(map); |
} |
function viderMarqueurs() { |
infowindow.close(); |
for(i in tableau_marqueurs) { |
tableau_marqueurs[i].setMap(null); |
} |
tableau_marqueurs = new Array(); |
} |
function formaterContenuFenetre(infos_obs) { |
contenu_fenetre = ''; |
for(i in infos_obs) { |
nom_stade =''; |
if(infos_obs[i].code_bbch != '') { |
nom_stade = ' stade '+infos_obs[i].code_bbch; |
} |
contenu_fenetre += '<div class="fenetre_infos">'; |
contenu_fenetre += '<div class="nom_sci">'+infos_obs[i].nom_scientifique+'</div>'; |
contenu_fenetre += '<div class="nom_sci">'+infos_obs[i].evenenement+nom_stade+'</div>'; |
contenu_fenetre += '<div class="date_obs"> Observé le : '+infos_obs[i].date+' </div>'; |
contenu_fenetre += '</div><br />'; |
} |
return contenu_fenetre; |
} |
$('#map_canvas').ready(function() { |
initialiserCarte(); |
}); |
/trunk/applications/rendu/squelettes/cartes/observations.tpl.html |
---|
New file |
0,0 → 1,47 |
<!-- ODS_RENDU - DEBUT CARTE OBS --> |
<div id="contenu_application"> |
<?= $script; ?> |
<div class="criteres"> |
<span class="selecteur_critere" id="conteneur_selecteur_liste_types_especes"> |
<select id="selecteur_liste_types_especes"> |
<option value="0" class="espece_type_0" selected="selected"> type d'espèce </option> |
<?php foreach($especes as $id_type_espece => $type_espece) : ?> |
<option value="<?= $id_type_espece; ?>"> <?= $type_espece['nom']; ?> </option> |
<?php endforeach; ?> |
</select> |
</span> |
<span class="selecteur_critere" id="conteneur_selecteur_liste_especes"> |
<select id="selecteur_especes"> |
<option value="0" class="espece_type_0" selected="selected"> toutes les espèces </option> |
</select> |
</span> |
<span class="selecteur_critere" id="conteneur_selecteur_liste_evenements"> |
<select id="selecteur_evenements"> |
<option value="0" class="espece_type_0" selected="selected"> tous les evènements </option> |
</select> |
</span> |
<div class="selecteur_critere" id="conteneur_selecteur_liste_annees"> |
<select id="selecteur_liste_annees" name="selecteur_liste_annees"> |
<option value="<?= date('Y') ?>" selected="selected"> <?= date('Y') ?> </option> |
<?php for($i = date('Y') - 1 ; $i >= date('Y') - 5; $i--) { ?> |
<option value="<?= $i; ?>"> <?= $i; ?> </option> |
<?php } ?> |
</select> |
</div> |
</div> |
<div class="conteneur_carte" > |
<div id="map_canvas" style="width:100%; height:100%"></div> |
</div> |
<div id="conteneur_slider_date" class="criteres"> |
<div id="slider_date"> </div> |
<div id="valeurs_date"> </div> |
</div> |
<div class="criteres" id="lien_cette_recherche"><a href="<?= $url; ?>">Obtenir le widget de cette recherche </a></div> |
</div> |
<!-- ODS_RENDU - FIN CARTE OBS --> |
/trunk/applications/rendu/controleurs/Liens.php |
---|
New file |
0,0 → 1,138 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Classe de gestion des liens. |
* |
* @package ODS_saisie |
* @category Php 5.2 |
* @author Aurélien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id: Fiche.php 152 2010-09-06 16:19:12Z jpm $ |
*/ |
class Liens extends aControleur { |
public static function construireUrl($tableau_params, $conserver_parametres_actuels = false) { |
if ($conserver_parametres_actuels) { |
return '?'.http_build_query($tableau_params + $_GET); |
} |
return '?'.http_build_query($tableau_params); |
} |
public static function getUrlSquelette() { |
$url_base = self::getUrlBaseComplete(); |
$url_base_squelette = $url_base.Config::get('dossier_squelettes').DS; |
return $url_base_squelette; |
} |
public static function getUrlStyle() { |
$url_base_style = self::getUrlSquelette().'css'.DS; |
return $url_base_style; |
} |
public static function getUrlScript() { |
$url_base_script = self::getUrlSquelette().'js'.DS; |
return $url_base_script; |
} |
public static function getUrlImage() { |
$url_base_image = self::getUrlSquelette().'images'.DS; |
return $url_base_image; |
} |
public static function getUrlImageEspece($nom_sci, $format = 'CXS') { |
$nom_sci_formate = strtolower(str_replace(' ', '_', $nom_sci)); |
if(!file_exists(Config::get('dossier_images_especes').$format.'/'.$nom_sci_formate.'.jpg')) { |
return Config::get('url_images_especes').$format.'/'.'vide.jpg'; |
} |
return Config::get('url_images_especes').$format.'/'.$nom_sci_formate.'.jpg'; |
} |
public static function getCreditImageEspece($nom_sci) { |
$nom_sci_formate = strtolower(str_replace(' ', '_', $nom_sci)); |
if(!file_exists(Config::get('dossier_images_especes').'/'.$nom_sci_formate.'.txt')) { |
$credit = ''; |
} else { |
$credit = file_get_contents(Config::get('dossier_images_especes').'/'.$nom_sci_formate.'.txt'); |
} |
if(trim($credit) != '') { |
$credit = 'Crédits : '.$credit; |
} |
return $credit; |
} |
public static function getUrlBaseReecrite() { |
if(isset($_SERVER['REDIRECT_URL']) && $_SERVER['REDIRECT_URL'] != '') { |
} |
$base_url_reecrite = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REDIRECT_URL']; |
$base_url_reecrite .= '/'; |
return $base_url_reecrite; |
} |
public static function getUrlBase() { |
$base_vrai_chemin = str_replace(realpath($_SERVER['DOCUMENT_ROOT']),'',realpath(Application::getChemin())); |
$base_vrai_chemin .= '/'; |
return $base_vrai_chemin; |
} |
public static function getUrlBaseComplete() { |
return 'http://'.$_SERVER['SERVER_NAME'].str_replace(realpath($_SERVER['DOCUMENT_ROOT']),'',realpath(Application::getChemin())).'/'; |
} |
public static function getUrlConsultationFicheStation($id_station) { |
$params = array( |
'module' => 'Station', |
'action' => 'afficherInformationsStation', |
'id_station' => $id_station |
); |
return self::construireUrl($params); |
} |
public static function renvoyerStylesInclus() { |
$styles = ''; |
$styles .= '<link href="'.self::getUrlStyle().'rendu.css" rel="stylesheet" type="text/css"/>'; |
$styles .= '<link href="'.self::getUrlStyle().'jquery_ui/jquery-ui-1.8.9.custom.css" rel="stylesheet" type="text/css"/>'; |
return $styles; |
} |
public static function renvoyerScriptsInclus() { |
$scripts = ''; |
$scripts .= '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>'; |
$scripts .= '<script type="text/javascript" src="'.self::getUrlScript().'jquery-1.4.4.min.js"></script>'; |
$scripts .= '<script type="text/javascript" src="'.self::getUrlScript().'jquery_ui/jquery-ui-1.8.9.custom.min.js"></script>'; |
$scripts .= '<script> var urlBaseJrest = "'.Config::get('url_jrest').'";</script>'; |
$scripts .= '<script type="text/javascript" src="'.self::getUrlScript().'rendu.js"></script>'; |
return $scripts; |
} |
} |
?> |
/trunk/applications/rendu/controleurs/AppControleur.php |
---|
New file |
0,0 → 1,237 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Classe mère des controleurs de l'application. |
* Elle repartie les demandes utilisateurs dans les différents modules, executent les actions et redistribue le code |
* html dans les différentes fonctions d'affichage. |
* C'est une Singleton. |
* |
* @category PHP 5.2 |
* @package saisie |
* @author Aurélien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license GPL-v3 et CECILL-v2 |
* @version $Id: AppControleur.php 160 2010-09-13 13:10:41Z aurelien $ |
*/ |
class AppControleur extends Controleur { |
/** |
* Instance de la classe pointant sur elle même (pour le pattern singleton) |
*/ |
private static $instance = null; |
/** |
* Instance de l'utilisateur en cours |
*/ |
private static $utilisateur = null; |
/** |
* Paramètres |
*/ |
private static $parametres = array(); |
/** |
* Constructeur vide |
*/ |
public function __construct() { |
$sortie = array('titre' => '', 'description' => '', 'tags' => '', |
'corps' => '', 'tete' => '', 'pied' => '', 'navigation' => ''); |
$url = new Url(Config::get('url_base_index')); |
self::$parametres = array( 'module' => 'Rendu', |
'action' => 'executerActionParDefaut', |
'sortie' => $sortie, |
'url' => $url); |
parent::__construct(); |
} |
/** |
* Initialisation du controleur principal en fonction des paramètres de l'url. |
*/ |
public static function initialiser() { |
self::verifierCreationInstance(); |
self::gererSession(); |
if (isset($_GET['module'])) { |
self::$parametres['module'] = $_GET['module']; |
} |
self::$parametres['url']->setVariableRequete('module', self::$parametres['module']); |
if (isset($_GET['action'])) { |
self::$parametres['action'] = $_GET['action']; |
} |
self::$parametres['url']->setVariableRequete('action', self::$parametres['action']); |
$registre = Registre::getInstance(); |
$registre->set('parametres', &self::$parametres); |
$ClasseModule = self::$parametres['module']; |
$action = self::$parametres['action']; |
$module = new $ClasseModule(); |
$module->$action(); |
self::fusionnerSortie($module->getSortie()); |
} |
private static function gererSession() { |
if (Config::get('session_demarrage')) { |
// Attribution d'un nom à la session |
session_name(Config::get('session_nom')); |
if(!isset($_SESSION)){ |
// Démarrage de la session si besoin |
session_start(); |
} |
} |
} |
/** |
* Fusionne un tableau de sortie par défaut avec le tableau renvoyé par l'action du module. |
* @param array le tableauàfusionner |
*/ |
private static function fusionnerSortie($sortie) { |
self::$parametres['sortie'] = array_merge(self::$parametres['sortie'], $sortie); |
} |
/** |
* Vérifie si l'instance de classe été crée, si non la crée. |
*/ |
private static function verifierCreationInstance() { |
if (empty(self::$instance)) { |
self::$instance = new AppControleur(); |
} |
} |
public static function getInstance() { |
self::verifierCreationInstance(); |
return self::$instance; |
} |
/** |
* Retourne le titre du contenu de l'application. |
*/ |
public static function getMetaTitre() { |
$sortie = self::$parametres['sortie']['titre']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne la description du contenu de l'application. |
*/ |
public static function getMetaDescription() { |
$sortie = self::$parametres['sortie']['description']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne les mots-clés (tags) du contenu de l'application. |
*/ |
public static function getMetaTags() { |
$sortie = self::$parametres['sortie']['tags']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne le contenu du corps de l'application. |
*/ |
public static function getContenuCorps() { |
$sortie = self::$parametres['sortie']['corps']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne le contenu de la tête de l'application. |
*/ |
public static function getContenuTete() { |
$sortie = self::$parametres['sortie']['tete']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne le contenu des styles de l'application. |
*/ |
public static function getContenuStyle() { |
$sortie = self::$parametres['sortie']['tete']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne le contenu des script de l'application. |
*/ |
public static function getContenuScript() { |
$sortie = self::$parametres['sortie']['script']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne le contenu du pied de l'application. |
*/ |
public static function getContenuPied() { |
$sortie = self::$parametres['sortie']['pied']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne les éléments de navigation de l'application. |
*/ |
public static function getContenuNavigation() { |
$sortie = self::$parametres['sortie']['navigation']; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne les chronos pris dans l'appli |
*/ |
public static function getChrono() { |
$sortie = ''; |
if (Config::get('chronometrage')) { |
$chrono = Chronometre::afficherChrono(); |
$sortie = mb_convert_encoding($chrono, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
/** |
* Retourne les messages d'exceptions et d'erreurs. |
*/ |
public static function getExceptions() { |
$sortie = (Config::get('fw_debogage')) ? GestionnaireException::getExceptions() : ''; |
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) { |
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage')); |
} |
return $sortie; |
} |
} |
?> |
/trunk/applications/rendu/controleurs/Rendu.php |
---|
New file |
0,0 → 1,74 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Classe de gestion des epeces. |
* |
* @package Collection |
* @category Php 5.2 |
* @author Aurélien PERONNET <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id: Espece.php 152 2010-09-06 16:19:12Z jpm $ |
*/ |
class Rendu extends aControleur { |
public function __construct() { |
parent::__construct(); |
$this->initialiser(); |
} |
public function executerActionParDefaut() { |
return $this->afficherCarte(); |
} |
private function initialiser() { |
} |
private function afficherCarte() { |
$espece_dao = new EspeceDao(); |
$especes = $espece_dao->getListeEspecesParType(); |
$evenements_dao = new EvenementDao(); |
$evenements = $evenements_dao->getListeEvenements(); |
$chaine_variables_script = '<script type="text/javascript" language="javascript">'; |
$chaine_variables_script .= ' var tableau_especes = new Array(); '; |
$chaine_variables_script .= ' var tableau_evenements_especes = new Array(); '; |
$chaine_variables_script .= ' var tableau_evenements = new Array(); '; |
foreach($especes as $id_type_espece => $type_espece) { |
$chaine_variables_script .= 'tableau_especes['.$id_type_espece.'] = new Array();'; |
foreach($type_espece['especes'] as $id_espece => $espece) { |
$chaine_variables_script .= 'tableau_especes['.$id_type_espece.']['.$id_espece.'] = "'.$espece['nom_vernaculaire'].'";'; |
$chaine_variables_script .= 'tableau_evenements_especes['.$id_espece.'] = "'.$espece['evenements'].'";'; |
} |
} |
foreach($evenements as $id_evenement => $evenement) { |
$nom_evenement = $evenement['nom']; |
if(trim($evenement['nom']) != '') { |
$nom_evenement .= ' stade '.$evenement['code']; |
} |
$chaine_variables_script .= 'tableau_evenements['.$id_evenement.'] = "'.$nom_evenement.'";'; |
} |
$chaine_variables_script .= '</script> '; |
$donnees = array(); |
$donnees['url'] = Liens::getUrlBaseComplete().'rendu_widget.php'; |
$donnees['script'] = $chaine_variables_script; |
$donnees['especes'] = $especes; |
$donnees['evenements'] = $evenements; |
$formulaire = $this->getVue('cartes/observations',$donnees); |
$this->setSortie(self::RENDU_CORPS, $formulaire); |
} |
} |
/trunk/applications/rendu/controleurs/aControleur.php |
---|
New file |
0,0 → 1,232 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Classe Controleur générale de l'application saisie. |
* |
* @category php5.2 |
* @package saisie |
* @author Aurélien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id: aControleur.php 152 2010-09-06 16:19:12Z aurelien $ |
*/ |
abstract class aControleur extends Controleur { |
const FMT_DATE = '%d/%m/%Y';// Supporte les formats de dates non valides (1989-00-00) |
const FMT_DATE_TXT = '%A %d %B %Y'; |
const FMT_DATE_HEURE = '%d/%m/%Y %H:%i:%s';// Supporte les formats de dates non valides (1989-00-00 00:00:00) |
const FMT_DATE_HEURE_TXT = '%A %d %B %Yà%H:%M'; |
const META_TITRE = 'titre'; |
const META_DESCRIPTION = 'description'; |
const META_TAGS = 'tags'; |
const RENDU_TETE = 'tete'; |
const RENDU_CORPS = 'corps'; |
const RENDU_PIED = 'pied'; |
const RENDU_NAVIGATION = 'navigation'; |
const TYPE_AUTRE = 'AUTRE'; |
const TYPE_TOTAL = 'TOTAL'; |
const SEPARATEUR_TYPE_VALEUR = '##'; |
const SEPARATEUR_VALEURS = ';;'; |
const SEPARATEUR_DONNEES = '||'; |
const VALEUR_NULL = 'NC'; |
private $sortie = array(); |
private $parametres = array(); |
protected static $hierarchie_appels = array(); |
// FIXME : voir s'il est plus intéressant d'utiliser une méthode dans les classes filles |
protected $url = null; |
public function __construct() { |
$registre = Registre::getInstance(); |
$this->parametres = $registre->get('parametres'); |
$this->url = $this->parametres['url']; |
parent::__construct(); |
} |
/** |
* Attribue une position de sortie à un contenu. |
*/ |
protected function setSortie($position, $contenu, $fusionner = false) { |
if ($this->verifierExistenceTypeSortie($position)) { |
if ($fusionner) { |
$this->sortie[$position] .= $contenu; |
} else { |
$this->sortie[$position] = $contenu; |
} |
} |
} |
/** |
* Vérifie l'existence du type de sortie indiqué pour son utilisation dans le tableau de sortie. |
* @param string le type de sortie à tester. |
* @return bool true si le type de sortie est valide, sinon false. |
*/ |
private function verifierExistenceTypeSortie($type) { |
$existe = true; |
if ($type != self::RENDU_TETE && |
$type != self::RENDU_NAVIGATION && |
$type != self::RENDU_CORPS && |
$type != self::RENDU_PIED && |
$type != self::META_TITRE && |
$type != self::META_DESCRIPTION && |
$type != self::META_TAGS && |
$type != self::STYLES && |
$type != self::SCRIPTS |
) { |
trigger_error("Le type de sortie '$type' n'est pas une valeur prédéfinie.", E_USER_WARNING); |
$existe = false; |
} |
return $existe; |
} |
/** |
* Retourne le tableau de sortie à utiliser dans le controleur principal de l'application. |
*/ |
public function getSortie() { |
return $this->sortie; |
} |
/** |
* Execute l'action d'un module donnée et fusionne le résultat avec le tableau de sortie. |
*/ |
protected function executerAction($ClasseModule, $action) { |
$module = new $ClasseModule(); |
$module->$action(); |
$this->fusionnerSortie($module->getSortie()); |
} |
/** |
* Fusionne un tableau de sortie par défaut avec le tableau passé en paramètre. |
* @param array le tableau à fusionner |
*/ |
private function fusionnerSortie($sortie) { |
$this->sortie = array_merge($this->sortie, $sortie); |
} |
protected function formaterParenthese($chaine_a_afficher) { |
if ($chaine_a_afficher != '') { |
$chaine_a_afficher = '('.$chaine_a_afficher.')'; |
} |
return $chaine_a_afficher; |
} |
protected function formaterSautDeLigne($chaine_a_formater) { |
$txt_a_retourner = preg_replace('/\n/', '<br />', $chaine_a_formater); |
return $txt_a_retourner; |
} |
protected function formaterTableauDeTxt($tableau_de_txt, $majuscule = true, $point_final = true) { |
$chaine_a_afficher = ''; |
$taille_du_tableau = count($tableau_de_txt); |
if ($taille_du_tableau > 0) { |
$index_avt_dernier = $taille_du_tableau - 1; |
for ($i = 0; $i < $taille_du_tableau; $i++) { |
$mot = $tableau_de_txt[$i]; |
if ($i != $index_avt_dernier) { |
$chaine_a_afficher .= $mot.', '; |
} else { |
$chaine_a_afficher .= $this->nettoyerPointFinal($mot); |
if ($point_final) { |
$chaine_a_afficher .= '.'; |
} |
} |
} |
} |
if ($majuscule) { |
$chaine_a_afficher = ucfirst($chaine_a_afficher); |
} |
return $chaine_a_afficher; |
} |
protected function formaterOuiNon($chaine_a_formater) { |
$txt_a_retourner = ''; |
if ($chaine_a_formater == '0') { |
$txt_a_retourner = 'non'; |
} else if ($chaine_a_formater == '1') { |
$txt_a_retourner = 'oui'; |
} |
return $txt_a_retourner; |
} |
protected function formaterDate($date, $format = self::FMT_DATE_HEURE) { |
if ($date == '' || $date == '0000-00-00' || $date == '0000-00-00 00:00:00') { |
$date = 'Inconnue'; |
} else { |
if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})(?: ([0-9]{2}):([0-9]{2}):([0-9]{2})|)$/', $date, $match)) {// Date Heure |
$annee = $match[1]; |
$mois = $match[2]; |
$jour = $match[3]; |
$heure = (isset($match[4])) ? $match[4] : '00'; |
$minute = (isset($match[5])) ? $match[5] : '00'; |
$seconde = (isset($match[6])) ? $match[6] : '00'; |
if ($format == self::FMT_DATE && $jour == '00' && $mois == '00') { |
$date = $annee; |
} else if ($format == self::FMT_DATE && $jour == '00') { |
$date = strftime('%b', mktime(0, 0, 0, $mois, 1)).' '.$annee; |
} else { |
$timestamp = strtotime($date); |
if ($timestamp !== false) { |
$date = strftime($format, $timestamp); |
} |
} |
} else { |
$e = "La chaine '$date' n'est pas reconnue."; |
trigger_error($e, E_USER_WARNING); |
} |
} |
return $date; |
} |
protected function formaterCourriels($courriels) { |
$fmt_courriels = ''; |
if (!empty($courriels)) { |
$courriels = (is_array($courriels)) ? $courriels : array($courriels); |
foreach ($courriels as $cle => $courriel) { |
$courriel = preg_replace('/@/', ' [arrobase] ', $courriel); |
$courriel = preg_replace('/[.]([^.]+)$/', " [point] $1", $courriel); |
$fmt_courriels[] = $this->getVue('courriel', array('courriel' => $courriel)); |
} |
$fmt_courriels = implode(', ', $fmt_courriels); |
} |
return $fmt_courriels; |
} |
protected function nettoyerPointFinal($mot) { |
$mot = preg_replace('/[.]$/', '', $mot); |
return $mot; |
} |
protected function postraiterDonnees(&$tableau) { |
if (count($tableau) > 0) { |
foreach ($tableau as $cle => &$valeur) { |
if ($valeur == '') { |
$valeur = ' '; |
} else if (is_string($valeur)) { |
$valeur = $this->remplacerEsperluette($valeur); |
} else if (is_array($valeur)) { |
$this->postraiterDonnees($valeur); |
} |
} |
} |
} |
private function remplacerEsperluette($txt) { |
$txt = preg_replace('/&(?!([a-z]+|#[0-9]+|#x[0-9a-f]+);)/i', '&', $txt, -1); |
return $txt; |
} |
public static function formaterChaineVersClasseCss($chaine) { |
return trim(str_replace(' ','_',$chaine)); |
} |
protected function chargerPiedDePage() { |
$donnees['appli'] = Application::getInfo(); |
$this->setSortie(self::RENDU_PIED, $this->getVue('pied', $donnees)); |
} |
} |
?> |
/trunk/applications/rendu/rendu.php |
---|
New file |
0,0 → 1,53 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Application de saisie d'ODS. |
* Fichier principal d'initialisation. |
* |
* @category PHP5 |
* @package Saisie |
* @author Aur�lien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license GPL-v3 et CECILL-v2 |
* @version $Id: collection.php 142 2010-08-30 12:41:00Z aurelien $ |
*/ |
// Autoload pour cette application |
function __autoload($nom_classe) { |
// Tableau des chemins à inclure pour trouver une classe relatif à ce fichier |
$chemins = array( |
'bibliotheque'.DS.'dao', |
'bibliotheque'.DS.'pear', |
'bibliotheque'.DS.'utilitaires', |
'composants', |
'composants'.DS.'cartographie'); |
foreach ($chemins as $chemin) { |
$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php'; |
if (file_exists($fichier_a_inclure)) { |
include_once $fichier_a_inclure; |
return null; |
} |
} |
} |
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application. |
// Sinon, rien ne sera chargé. |
// Chemin du fichier chargeant le framework requis |
$framework = dirname(__FILE__).'/framework.php'; |
if (!file_exists($framework)) { |
$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework"; |
trigger_error($e, E_USER_ERROR); |
} else { |
// Inclusion du Framework |
require_once $framework; |
// Ajout d'information concernant cette application |
Application::setChemin(__FILE__);// Obligatoire |
Application::setInfo(Config::get('info')); |
// Lancement du débogage si nécessaire |
if (Config::get('chronometrage')) { |
Chronometre::chrono('Saisie.php - début'); |
} |
// Lancement de l'application |
AppControleur::initialiser(); |
} |
?> |
/trunk/applications/rendu/rendu_widget.php |
---|
New file |
0,0 → 1,18 |
<?php |
// declare(encoding='UTF-8'); |
/** Inclusion du fichier principal de l'application*/ |
require_once 'rendu.php'; |
?> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
<meta http-equiv="Content-language" content="fr" /> |
<?= Liens::renvoyerStylesInclus() ?> |
<?= Liens::renvoyerScriptsInclus() ?> |
</head> |
<body> |
<?= AppControleur::getContenuCorps(); ?> |
</body> |
</html> |
/trunk/applications/rendu/configurations/config.defaut.ini |
---|
New file |
0,0 → 1,56 |
; +------------------------------------------------------------------------------------------------------+ |
; Général |
; Séparateur de dossier |
ds = DIRECTORY_SEPARATOR |
; +------------------------------------------------------------------------------------------------------+ |
; Info sur l'application |
info.nom = Saisie des observations |
; Abréviation de l'application |
info.abr = SODS |
; Code numérique de la version de l'application |
info.version.code.num = "0.1" |
; Code alphabétique de la version de l'application |
info.version.code.alpha = "" |
; Nom de la version de l'application |
info.version.nom = "" |
; Version du Framework nécessaire au fonctionnement de cette application |
info.framework.version = 0.2 |
;Encodage de l'application |
appli_encodage = "UTF-8" |
; Nom de domaine pour l'URL de base de l'application : 162.38.234.9 |
domaine = "www.obs-saisons.fr" |
; URL de base de l'application, si elle est laissée vide, l'application fonctionnera en Stand-alone |
url_base = "" |
; URL de base de l'application avec l'indication du fichier de départ |
url_base_index = "{ref:url_base}index.php" |
; URL de base où se situe le .htacces réalisant la réecriture d'URL pour les permaliens de l'application |
url_base_permalien = "{ref:url_base}" |
; Mettre à true si l'application nécessite de s'identifier. |
identification = true |
; Nom de la classe à utiliser pour gérer les utilisateurs |
objet_utilisateur = DrupalUtilisateur |
; +------------------------------------------------------------------------------------------------------+ |
; Paramétrage de la session |
; Devons nous démarrer une session : oui (true) ou non (false) |
session_demarrage = "php:true" |
; Définition du nom de la session à utiliser |
session_nom = "ods_saisie" |
; +------------------------------------------------------------------------------------------------------+ |
; Débogage |
; Indique si oui ou non on veut afficher le débogage. |
fw_debogage = true |
; Indique si oui ou non on veut lancer le chronométrage |
chronometrage = false |
; +------------------------------------------------------------------------------------------------------+ |
; Spécifique à l'application |
; Url du Jrest utilisé pour les services web fournissant les données à l'application |
url_jrest = "/applications/jrest/" |
; Emplacement du dossier de base des images pour illustrer les espèces |
dossier_images_especes = "/images_especes/" |
url_images_especes = "/images_especes/" |
/trunk/applications/rendu/configurations |
---|
New file |
Property changes: |
Added: svn:ignore |
+config.ini |
/trunk/applications/rendu/framework.defaut.php |
---|
New file |
0,0 → 1,5 |
<?php |
// Inclusion du Framework |
// Indiquer ci-dessous le chemin vers le fichier autoload.inc.php de la bonne version du Framework |
require_once '/framework/autoload.inc.php'; |
?> |
/trunk/applications/rendu/bibliotheque/dao/Dao.php |
---|
New file |
0,0 → 1,225 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Classe modèle spécifique à l'application, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur. |
* Elle est abstraite donc doit obligatoirement être étendue. |
* |
* @category Php5 |
* @package ODS_saisie |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id$ |
*/ |
abstract class Dao { |
const ORDRE_ASCENDANT = 'ASC'; |
const ORDRE_DESCENDANT = 'DESC'; |
const HTTP_REQUETE_SEPARATEUR = '&'; |
protected $distinction = '0'; |
protected $limite_debut = null; |
protected $limite_nbre = null; |
protected $ordre = null; |
protected $url_jrest = null; |
public function __construct() { |
$this->url_jrest = Config::get('url_jrest'); |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
// ACCESSEURS |
public function setDistinction($distinct) { |
$this->distinction = $distinct; |
} |
public function getDistinction() { |
return $this->distinction; |
} |
public function viderDistinction() { |
$this->distinction = null; |
} |
public function avoirLimitation() { |
$limitation = false; |
if (!is_null($this->limite_debut) && !is_null($this->limite_nbre)) { |
$limitation = true; |
} |
return $limitation; |
} |
public function setLimitation($limite_debut, $limite_nbre) { |
$this->limite_debut = $limite_debut; |
$this->limite_nbre = $limite_nbre; |
} |
public function getLimiteDebut() { |
return $this->limite_debut; |
} |
public function getLimiteNbre() { |
return $this->limite_nbre; |
} |
public function viderLimite() { |
$this->limite_debut = null; |
$this->limite_nbre = null; |
} |
public function addOrdre($champ, $trie = self::ORDRE_ASCENDANT) { |
if (!isset($this->ordre[$champ])) { |
if (self::ORDRE_ASCENDANT == $trie || self::ORDRE_DESCENDANT == $trie) { |
$this->ordre[$champ] = $trie; |
} else { |
$e = "La valeur pour le tri doit être : {self::ORDRE_ASCENDANT} ou {self::ORDRE_DESCENDANT}."; |
trigger_error($e, E_USER_WARNING); |
} |
} else { |
$e = "Le champ $champ existe déjà dans le tableau des ordres."; |
trigger_error($e, E_USER_WARNING); |
} |
} |
public function getOrdre() { |
$champs = array(); |
foreach ($this->ordre as $champ => $trie) { |
$champs[] = "$champ $trie"; |
} |
return implode(', ', $champs); |
} |
public function viderOrdre() { |
$this->ordre = null; |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
// MÉTHODES |
protected function envoyerRequeteConsultation($url) { |
$url = $this->traiterUrlParametres($url); |
$retour = $this->envoyerRequete($url, 'GET'); |
return $retour; |
} |
protected function envoyerRequeteAjout($url, Array $donnees) { |
$retour = $this->envoyerRequete($url, 'PUT', $donnees); |
return $retour; |
} |
protected function envoyerRequeteModif($url, Array $donnees) { |
$retour = $this->envoyerRequete($url, 'POST', $donnees); |
return $retour; |
} |
protected function envoyerRequeteSuppression($url) { |
$retour = $this->envoyerRequete($url, 'DELETE'); |
return $retour; |
} |
private function envoyerRequete($url, $mode, Array $donnees = array()) { |
$contenu = false; |
if ($mode != 'GET' && $mode != 'PUT' && $mode != 'POST' && $mode != 'DELETE') { |
$e = "Le mode de requête '$mode' n'est pas accepté!"; |
trigger_error($e, E_USER_WARNING); |
} else { |
$contexte = stream_context_create(array( |
'http' => array( |
'method' => $mode, |
'header' => "Content-type: application/x-www-form-urlencoded\r\n", |
'content' => http_build_query($donnees, null, self::HTTP_REQUETE_SEPARATEUR)))); |
/*if($url == 'http://162.38.234.9/obs_saisons/applications/jrest/OdsObservation/13') { |
Debug::printr(http_build_query($donnees, null, self::HTTP_REQUETE_SEPARATEUR)); |
exit; |
}*/ |
$flux = @fopen($url, 'r', false, $contexte); |
if (!$flux) { |
$this->traiterEntete($http_response_header, $url); |
$e = "L'ouverture de l'url '$url' par la méthode HTTP '$mode' a échoué!"; |
trigger_error($e, E_USER_WARNING); |
} else { |
// Informations sur les en-têtes et métadonnées du flux |
$entetes = stream_get_meta_data($flux); |
$this->traiterEntete($entetes, $url); |
// Contenu actuel de $url |
$contenu = stream_get_contents($flux); |
fclose($flux); |
} |
} |
$this->reinitialiser(); |
return $contenu; |
} |
private function traiterUrlParametres($url) { |
$parametres = array(); |
if (! is_null($this->getLimiteDebut())) { |
$parametres[] = 'start='.$this->getLimiteDebut(); |
} |
if (! is_null($this->getLimiteNbre())) { |
$parametres[] = 'limit='.$this->getLimiteNbre(); |
} |
if (! is_null($this->ordre)) { |
$parametres[] = 'orderby='.urlencode($this->getOrdre()); |
} |
if ($this->getDistinction() != 0) { |
$parametres[] = 'distinct='.$this->getDistinction(); |
} |
if (count($parametres) > 0) { |
$url_parametres = implode('&', $parametres); |
$url = $url.'?'.$url_parametres; |
} |
return $url; |
} |
private function traiterEntete($entetes, $uri) { |
$infos = $this->analyserEntete($entetes, $uri); |
$this->traiterEnteteDebug($infos); |
$this->traiterEnteteMessage($infos); |
} |
private function analyserEntete($entetes, $uri) { |
$infos = array('date' => null, 'uri' => $uri, 'debugs' => null, 'messages' => null); |
if (isset($entetes['wrapper_data'])) { |
$entetes = $entetes['wrapper_data']; |
} |
foreach ($entetes as $entete) { |
if (preg_match('/^X-DebugJrest-Data: (.+)$/', $entete, $match)) { |
$infos['debugs'] = json_decode($match[1]); |
} |
if (preg_match('/^X-MessageJrest-Data: (.+)$/', $entete, $match)) { |
$infos['messages'] = json_decode($match[1]); |
} |
if (preg_match('/^Date: .+ ([012][0-9]:[012345][0-9]:[012345][0-9]) .*$/', $entete, $match)) { |
$infos['date'] = $match[1]; |
} |
} |
return $infos; |
} |
private function traiterEnteteDebug($entetes) { |
if (isset($entetes['debugs'])) { |
$date = $entetes['date']; |
$uri = $entetes['uri']; |
$debugs = $entetes['debugs']; |
foreach ($debugs as $debug) { |
Debug::printr("DEBUG : $date - $uri :\n$debug"); |
} |
} |
} |
private function traiterEnteteMessage($entetes) { |
if (isset($entetes['messages'])) { |
$date = $entetes['date']; |
$uri = $entetes['uri']; |
$messages = $entetes['messages']; |
foreach ($messages as $message) { |
Debug::printr("MESSAGE : $date - $uri :\n$message"); |
} |
} |
} |
private function reinitialiser() { |
$this->viderDistinction(); |
$this->viderLimite(); |
$this->viderOrdre(); |
} |
} |
?> |
/trunk/applications/rendu/bibliotheque/dao/EspeceDao.php |
---|
New file |
0,0 → 1,33 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Modèle d'accès à la base de données de saisies pour le module espece. |
* |
* @package ODS_saisie |
* @category php 5.2 |
* @author Aurélien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id: StationDao.php 154 2010-09-13 12:15:11Z aurelien $ |
* |
*/ |
class EspeceDao extends Dao { |
const SERVICE_ESPECE = 'OdsEspece'; |
const METHODE_ESPECES_TYPE = 'EspecesParType'; |
/** |
* Retourne l'ensemble des especes présentes organisées hierarchiquement par type. |
* |
* @return array un tableau contenant les informations sur les especes. |
*/ |
public function getListeEspecesParType() { |
$url = $this->url_jrest.self::SERVICE_ESPECE.'/'.self::METHODE_ESPECES_TYPE.'/'; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
} |
?> |
/trunk/applications/rendu/bibliotheque/dao/EvenementDao.php |
---|
New file |
0,0 → 1,34 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Modèle d'accès à la base de données de saisies pour le module evenement. |
* |
* @package ODS_saisie |
* @category php 5.2 |
* @author Aurélien Peronnet <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id: StationDao.php 154 2010-09-13 12:15:11Z aurelien $ |
* |
*/ |
class EvenementDao extends Dao { |
const SERVICE_ESPECE = 'OdsEvenement'; |
const METHODE_TOUS_EVENEMENTS = 'TousEvenements'; |
/** |
* Retourne l'ensemble des évènements. |
* |
* @return array un tableau contenant les informations sur les evenements. |
*/ |
public function getListeEvenements() { |
$url = $this->url_jrest.self::SERVICE_ESPECE.'/'.self::METHODE_TOUS_EVENEMENTS.'/'; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
} |
?> |
/trunk/applications/rendu |
---|
New file |
Property changes: |
Added: svn:ignore |
+framework.php |