Upgrade to jQuery 1.10 and jQuery UI 1.10
SVN:trunk[2765]
@@ -520,7 +520,7 @@ $('#dashboard_editor').dialog({
|
||||
title: '$sDialogTitle',
|
||||
buttons: [
|
||||
{ text: "$sOkButtonLabel", click: function() {
|
||||
var oDashboard = $(':itop-dashboard').data('dashboard');
|
||||
var oDashboard = $(':itop-dashboard').data('itopDashboard');
|
||||
if (oDashboard.is_dirty())
|
||||
{
|
||||
if (!confirm('$sAutoApplyConfirmationMessage'))
|
||||
@@ -536,7 +536,7 @@ $('#dashboard_editor').dialog({
|
||||
oDashboard.save();
|
||||
} },
|
||||
{ text: "$sCancelButtonLabel", click: function() {
|
||||
var oDashboard = $(':itop-dashboard').data('dashboard');
|
||||
var oDashboard = $(':itop-dashboard').data('itopDashboard');
|
||||
if (oDashboard.is_modified())
|
||||
{
|
||||
if (!confirm('$sCancelConfirmationMessage'))
|
||||
@@ -606,7 +606,7 @@ $('#dashboard_editor').layout({
|
||||
window.onbeforeunload = function() {
|
||||
if (!window.bLeavingOnUserAction)
|
||||
{
|
||||
var oDashboard = $(':itop-dashboard').data('dashboard');
|
||||
var oDashboard = $(':itop-dashboard').data('itopDashboard');
|
||||
if (oDashboard)
|
||||
{
|
||||
if (oDashboard.is_dirty())
|
||||
|
||||
@@ -153,7 +153,7 @@ class iTopWebPage extends NiceWebPage
|
||||
$('#left-pane').layout({ resizable: false, spacing_open: 0, south: { size: 94 }, enableCursorHotkey: false });
|
||||
|
||||
// Accordion Menu
|
||||
$("#accordion").accordion({ header: "h3", navigation: true, autoHeight: false, collapsible: false, icons: false }); // collapsible will be enabled once the item will be selected
|
||||
$("#accordion").accordion({ header: "h3", navigation: true, heightStyle: "content", collapsible: false, icons: false }); // collapsible will be enabled once the item will be selected
|
||||
|
||||
// Tabs, using JQuery BBQ to store the history
|
||||
// The "tab widgets" to handle.
|
||||
@@ -787,7 +787,7 @@ EOF
|
||||
$sHtml .= '<td style="padding-right:20px;padding-left:10px;">'.self::FilterXSS($sLogOffMenu).'</td><td><input type="hidden" name="operation" value="full_text"/></td></tr></table></form></div>';
|
||||
//echo '<td> <input type="hidden" name="operation" value="full_text"/></td></tr></table></form></div>';
|
||||
$sHtml .= ' </div>';
|
||||
$sHtml .= ' <div class="ui-layout-content">';
|
||||
$sHtml .= ' <div class="ui-layout-content" style="overflow:auto;">';
|
||||
$sHtml .= ' <!-- Beginning of page content -->';
|
||||
$sHtml .= self::FilterXSS($this->s_content);
|
||||
$sHtml .= ' <!-- End of page content -->';
|
||||
|
||||
@@ -184,8 +184,9 @@ class ApplicationMenu
|
||||
$oPage->AddToMenu('</ul>');
|
||||
if ($bActive)
|
||||
{
|
||||
$oPage->add_ready_script("$('#accordion').accordion('activate', $iAccordion);");
|
||||
$oPage->add_ready_script("$('#accordion').accordion('option', {collapsible: true});"); // Make it auto-collapsible once it has been opened properly
|
||||
//$oPage->add_ready_script("$('#accordion').accordion('activate', $iAccordion);");
|
||||
// $oPage->add_ready_script("$('#accordion').accordion('option', {collapsible: true});"); // Make it auto-collapsible once it has been opened properly
|
||||
$oPage->add_ready_script("$('#accordion').accordion('option', {collapsible: true, active: $iAccordion});"); // Make it auto-collapsible once it has been opened properly
|
||||
}
|
||||
}
|
||||
$oPage->AddToMenu('</div>');
|
||||
|
||||
@@ -37,9 +37,12 @@ class NiceWebPage extends WebPage
|
||||
{
|
||||
parent::__construct($s_title);
|
||||
$this->m_aReadyScripts = array();
|
||||
$this->add_linked_script("../js/jquery-1.7.1.min.js");
|
||||
$this->add_linked_stylesheet('../css/ui-lightness/jquery-ui-1.8.17.custom.css');
|
||||
$this->add_linked_script('../js/jquery-ui-1.8.17.custom.min.js');
|
||||
$this->add_linked_script("../js/jquery-1.10.0.min.js");
|
||||
// TODO: use the minified version once debugging is complete and the compatibility is fully tested
|
||||
$this->add_linked_script("../js/jquery-migrate-1.2.1.js"); // Provides backward compatibility and warns about the use of obsolete features...
|
||||
//$this->add_linked_script("../js/jquery-migrate-1.2.1.min.js"); // Needed since many other plugins still rely on oldies like $.browser
|
||||
$this->add_linked_stylesheet('../css/ui-lightness/jquery-ui-1.10.3.custom.min.css');
|
||||
$this->add_linked_script('../js/jquery-ui-1.10.3.custom.min.js');
|
||||
$this->add_linked_script("../js/hovertip.js");
|
||||
// table sorting
|
||||
$this->add_linked_script("../js/jquery.tablesorter.js");
|
||||
|
||||
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 90 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.2 KiB |
22
js/charts.js
@@ -114,27 +114,24 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-pie_chart');
|
||||
|
||||
$(window).unbind('resize.pie_chart');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
$(window).unbind('resize.pie_chart');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_compute_size: function()
|
||||
{
|
||||
@@ -245,25 +242,22 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-heatmap_chart');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
.removeClass('itop-heatmap_chart');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_compute_size: function()
|
||||
{
|
||||
|
||||
@@ -45,29 +45,26 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-dashboard');
|
||||
|
||||
this.ajax_div.remove();
|
||||
$(document).unbind('keyup.dashboard_editor');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
$(document).unbind('keyup.dashboard_editor');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._refresh();
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_get_state: function(oMergeInto)
|
||||
{
|
||||
@@ -76,7 +73,7 @@ $(function()
|
||||
this.element.find('.layout_cell').each(function() {
|
||||
var aList = [];
|
||||
$(this).find(':itop-dashlet').each(function() {
|
||||
var oDashlet = $(this).data('dashlet');
|
||||
var oDashlet = $(this).data('itopDashlet');
|
||||
if(oDashlet)
|
||||
{
|
||||
var oDashletParams = oDashlet.get_params();
|
||||
@@ -170,7 +167,7 @@ $(function()
|
||||
{
|
||||
var iMaxId = 0;
|
||||
this.element.find(':itop-dashlet').each(function() {
|
||||
var oDashlet = $(this).data('dashlet');
|
||||
var oDashlet = $(this).data('itopDashlet');
|
||||
if(oDashlet)
|
||||
{
|
||||
var oDashletParams = oDashlet.get_params();
|
||||
@@ -279,26 +276,23 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-dashboard_upload_dlg');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
.removeClass('itop-dashboard_upload_dlg');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._refresh();
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_onClose: function()
|
||||
{
|
||||
|
||||
@@ -50,35 +50,32 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-dashlet')
|
||||
.unbind('click.itop-dashlet');
|
||||
|
||||
this.closeBox.remove();
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
this.closeBox.remove();
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._update();
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
select: function()
|
||||
{
|
||||
this.element.addClass('dashlet-selected');
|
||||
this.closeBox.fadeIn(500);
|
||||
$('#event_bus').trigger('dashlet-selected', {'dashlet_id': this.options.dashlet_id, 'dashlet_class': this.options.dashlet_class})
|
||||
$('#event_bus').trigger('dashlet-selected', {'dashlet_id': this.options.dashlet_id, 'dashlet_class': this.options.dashlet_class});
|
||||
},
|
||||
deselect: function()
|
||||
{
|
||||
@@ -89,7 +86,7 @@ $(function()
|
||||
{
|
||||
$(':itop-dashlet').each(function(){
|
||||
var sId = $(this).attr('id');
|
||||
var oWidget = $(this).data('dashlet');
|
||||
var oWidget = $(this).data('itopDashlet');
|
||||
if (oWidget)
|
||||
{
|
||||
oWidget.deselect();
|
||||
@@ -106,7 +103,7 @@ $(function()
|
||||
var oParams = {};
|
||||
var oProperties = $('#dashlet_properties_'+this.options.dashlet_id);
|
||||
oProperties.find(':itop-property_field').each(function(){
|
||||
var oWidget = $(this).data('property_field');
|
||||
var oWidget = $(this).data('itopProperty_field');
|
||||
if (oWidget)
|
||||
{
|
||||
var oVal = oWidget._get_committed_value();
|
||||
|
||||
@@ -217,7 +217,7 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-datatable');
|
||||
@@ -225,23 +225,20 @@ $(function()
|
||||
var sId = new String(this.element.attr('id'));
|
||||
var sListId = sId.replace('datatable_', '');
|
||||
$('#sfl_'+sListId).remove();
|
||||
$('#datatable_dlg_'+sListId).remove();
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
$('#datatable_dlg_'+sListId).remove();
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._refresh();
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_saveDlgState: function()
|
||||
{
|
||||
|
||||
7
js/exclude.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# The following source files are not re-distributed with the "build" of the application
|
||||
# since they are used solely for debugging. The minified version is normally used instead.
|
||||
#
|
||||
jquery.layout.js
|
||||
jquery-migrate-1.2.1.js
|
||||
jquery.ba-bbq.js
|
||||
@@ -86,29 +86,26 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-fieldsorter');
|
||||
|
||||
this.moveup_btn.remove();
|
||||
this.movedown_btn.remove();
|
||||
this.element.sortable('destroy').html('');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
this.element.sortable('destroy').html('');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
|
||||
if (key == 'fields') this._refresh();
|
||||
},
|
||||
|
||||
@@ -78,7 +78,7 @@ $(function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element.removeClass( "itop-icon-select" );
|
||||
this.oButton.destroy();
|
||||
this.oButton._destroy();
|
||||
},
|
||||
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
@@ -86,7 +86,7 @@ $(function()
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
@@ -99,7 +99,7 @@ $(function()
|
||||
}
|
||||
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_on_icon_selection: function(data)
|
||||
{
|
||||
|
||||
6
js/jquery-1.10.0.min.js
vendored
Normal file
6240
js/jquery-1.4.2.js
vendored
154
js/jquery-1.4.2.min.js
vendored
@@ -1,154 +0,0 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.4.2
|
||||
* 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: Sat Feb 13 22:33:48 2010 -0500
|
||||
*/
|
||||
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(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 X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
|
||||
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
|
||||
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
|
||||
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
|
||||
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
|
||||
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
|
||||
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
|
||||
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
|
||||
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
|
||||
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
|
||||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
|
||||
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
|
||||
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
|
||||
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
|
||||
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
|
||||
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
|
||||
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
|
||||
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();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 e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
|
||||
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
|
||||
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
|
||||
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
|
||||
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
|
||||
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
|
||||
a,b)})},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 f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
|
||||
w)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 Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
|
||||
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(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(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
|
||||
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
|
||||
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}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(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
|
||||
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
|
||||
c.inArray(c(this).val(),u)>=0});if(!u.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,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
|
||||
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:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
|
||||
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
|
||||
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
|
||||
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
|
||||
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
|
||||
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
|
||||
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
|
||||
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===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 originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;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=s.documentElement;d=s.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&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)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,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
|
||||
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){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=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
|
||||
isImmediatePropagationStopped:Y};var Da=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){}},Ea=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?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});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)return na("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)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
|
||||
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=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(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
|
||||
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.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 fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
|
||||
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
|
||||
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}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 f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,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]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.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(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
|
||||
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}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){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",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){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
|
||||
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
||||
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
|
||||
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
|
||||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
|
||||
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
|
||||
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=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,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
|
||||
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
|
||||
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=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 h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
|
||||
g);return false}else if(n.match.POS.test(g[0])||n.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,h,l){return!!k(l[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,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
|
||||
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
|
||||
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
|
||||
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
|
||||
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
|
||||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
|
||||
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
|
||||
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
|
||||
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
|
||||
(function(){var g=s.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){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
|
||||
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
|
||||
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
|
||||
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
|
||||
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},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){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},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,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
|
||||
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===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 Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
|
||||
a:b+"></"+d+">"},F={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,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._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!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).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,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}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,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
|
||||
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);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(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):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),f=d.html();d.replaceWith(a.call(this,b,f))});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){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
|
||||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
|
||||
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
|
||||
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
|
||||
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
|
||||
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
|
||||
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
|
||||
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
|
||||
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
|
||||
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
|
||||
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
|
||||
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
|
||||
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});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||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).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,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},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,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},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:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
|
||||
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
|
||||
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
|
||||
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
|
||||
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
|
||||
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
|
||||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
|
||||
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
|
||||
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
|
||||
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
|
||||
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
|
||||
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
|
||||
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
|
||||
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
|
||||
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
|
||||
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
|
||||
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+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);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
|
||||
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},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=J(),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 f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
|
||||
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,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()},stop:function(){clearInterval(W);W=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};c.fn.offset="getBoundingClientRect"in s.documentElement?
|
||||
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
|
||||
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
|
||||
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
|
||||
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||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;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;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.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
|
||||
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
|
||||
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.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(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
|
||||
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
|
||||
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
|
||||
4
js/jquery-1.7.1.min.js
vendored
521
js/jquery-migrate-1.2.1.js
Normal file
@@ -0,0 +1,521 @@
|
||||
/*!
|
||||
* jQuery Migrate - v1.2.1 - 2013-05-08
|
||||
* https://github.com/jquery/jquery-migrate
|
||||
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to true to prevent console output; migrateWarnings still maintained
|
||||
// jQuery.migrateMute = false;
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
if ( !jQuery.migrateMute && window.console && window.console.log ) {
|
||||
window.console.log("JQMIGRATE: Logging is active");
|
||||
}
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
if ( Object.defineProperty ) {
|
||||
// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
|
||||
// allow property to be overwritten in case some other plugin wants it
|
||||
try {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
});
|
||||
return;
|
||||
} catch( err ) {
|
||||
// IE8 is a dope about Object.defineProperty, can't warn there
|
||||
}
|
||||
}
|
||||
|
||||
// Non-ES5 (or broken) browser; just set the property
|
||||
jQuery._definePropertyBroken = true;
|
||||
obj[ prop ] = value;
|
||||
}
|
||||
|
||||
if ( document.compatMode === "BackCompat" ) {
|
||||
// jQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
|
||||
|
||||
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
|
||||
oldAttr = jQuery.attr,
|
||||
valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
|
||||
function() { return null; },
|
||||
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
|
||||
function() { return undefined; },
|
||||
rnoType = /^(?:input|button)$/i,
|
||||
rnoAttrNodeType = /^[238]$/,
|
||||
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
||||
ruseDefault = /^(?:checked|selected)$/i;
|
||||
|
||||
// jQuery.attrFn
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
|
||||
|
||||
jQuery.attr = function( elem, name, value, pass ) {
|
||||
var lowerName = name.toLowerCase(),
|
||||
nType = elem && elem.nodeType;
|
||||
|
||||
if ( pass ) {
|
||||
// Since pass is used internally, we only warn for new jQuery
|
||||
// versions where there isn't a pass arg in the formal params
|
||||
if ( oldAttr.length < 4 ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
}
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) &&
|
||||
(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
|
||||
return jQuery( elem )[ name ]( value );
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
|
||||
// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
|
||||
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
|
||||
}
|
||||
|
||||
// Restore boolHook for boolean property/attribute synchronization
|
||||
if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
|
||||
jQuery.attrHooks[ lowerName ] = {
|
||||
get: function( elem, name ) {
|
||||
// Align boolean attributes with corresponding properties
|
||||
// Fall back to attribute presence where some booleans are not supported
|
||||
var attrNode,
|
||||
property = jQuery.prop( elem, name );
|
||||
return property === true || typeof property !== "boolean" &&
|
||||
( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
||||
|
||||
name.toLowerCase() :
|
||||
undefined;
|
||||
},
|
||||
set: function( elem, value, name ) {
|
||||
var propName;
|
||||
if ( value === false ) {
|
||||
// Remove boolean attributes when set to false
|
||||
jQuery.removeAttr( elem, name );
|
||||
} else {
|
||||
// value is true since we know at this point it's type boolean and not false
|
||||
// Set boolean attributes to the same name and set the DOM property
|
||||
propName = jQuery.propFix[ name ] || name;
|
||||
if ( propName in elem ) {
|
||||
// Only set the IDL specifically if it already exists on the element
|
||||
elem[ propName ] = true;
|
||||
}
|
||||
|
||||
elem.setAttribute( name, name.toLowerCase() );
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
// Warn only for attributes that can remain distinct from their properties post-1.9
|
||||
if ( ruseDefault.test( lowerName ) ) {
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
return oldAttr.call( jQuery, elem, name, value );
|
||||
};
|
||||
|
||||
// attrHooks: value
|
||||
jQuery.attrHooks.value = {
|
||||
get: function( elem, name ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrGet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value') no longer gets properties");
|
||||
}
|
||||
return name in elem ?
|
||||
elem.value :
|
||||
null;
|
||||
},
|
||||
set: function( elem, value ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrSet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
|
||||
}
|
||||
// Does not return so that setAttribute is also used
|
||||
elem.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( selector.charAt( 0 ) !== "<" ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
if ( context && context.context ) {
|
||||
// jQuery object as context; parseHTML expects a DOM object
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
|
||||
context, rootjQuery );
|
||||
}
|
||||
}
|
||||
return oldInit.apply( this, arguments );
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json && json !== null ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
return oldParseJSON.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
return new jQuerySub.fn.init( selector, context );
|
||||
}
|
||||
jQuery.extend( true, jQuerySub, this );
|
||||
jQuerySub.superclass = this;
|
||||
jQuerySub.fn = jQuerySub.prototype = this();
|
||||
jQuerySub.fn.constructor = jQuerySub;
|
||||
jQuerySub.sub = this.sub;
|
||||
jQuerySub.fn.init = function init( selector, context ) {
|
||||
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
||||
context = jQuerySub( context );
|
||||
}
|
||||
|
||||
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
migrateWarn( "jQuery.sub() is deprecated" );
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text json": jQuery.parseJSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var oldFnData = jQuery.fn.data;
|
||||
|
||||
jQuery.fn.data = function( name ) {
|
||||
var ret, evt,
|
||||
elem = this[0];
|
||||
|
||||
// Handles 1.7 which has this behavior and 1.8 which doesn't
|
||||
if ( elem && name === "events" && arguments.length === 1 ) {
|
||||
ret = jQuery.data( elem, name );
|
||||
evt = jQuery._data( elem, name );
|
||||
if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
|
||||
migrateWarn("Use of jQuery.fn.data('events') is deprecated");
|
||||
return evt;
|
||||
}
|
||||
}
|
||||
return oldFnData.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i,
|
||||
oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
|
||||
if ( !jQuery.clean ) {
|
||||
jQuery.clean = function( elems, context, fragment, scripts ) {
|
||||
// Set context per 1.8 logic
|
||||
context = context || document;
|
||||
context = !context.nodeType && context[0] || context;
|
||||
context = context.ownerDocument || context;
|
||||
|
||||
migrateWarn("jQuery.clean() is deprecated");
|
||||
|
||||
var i, elem, handleScript, jsTags,
|
||||
ret = [];
|
||||
|
||||
jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
|
||||
|
||||
// Complex logic lifted directly from jQuery 1.8
|
||||
if ( fragment ) {
|
||||
// Special handling of each script element
|
||||
handleScript = function( elem ) {
|
||||
// Check if we consider it executable
|
||||
if ( !elem.type || rscriptType.test( elem.type ) ) {
|
||||
// Detach the script and store it in the scripts array (if provided) or the fragment
|
||||
// Return truthy to indicate that it has been handled
|
||||
return scripts ?
|
||||
scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
|
||||
fragment.appendChild( elem );
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; (elem = ret[i]) != null; i++ ) {
|
||||
// Check if we're done after handling an executable script
|
||||
if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
|
||||
// Append to fragment and handle embedded scripts
|
||||
fragment.appendChild( elem );
|
||||
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
||||
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
|
||||
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
|
||||
|
||||
// Splice the scripts into ret after their former ancestor and advance our index beyond them
|
||||
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
||||
i += jsTags.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
var eventAdd = jQuery.event.add,
|
||||
eventRemove = jQuery.event.remove,
|
||||
eventTrigger = jQuery.event.trigger,
|
||||
oldToggle = jQuery.fn.toggle,
|
||||
oldLive = jQuery.fn.live,
|
||||
oldDie = jQuery.fn.die,
|
||||
ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
|
||||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
hoverHack = function( events ) {
|
||||
if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
|
||||
return events;
|
||||
}
|
||||
if ( rhoverHack.test( events ) ) {
|
||||
migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
|
||||
}
|
||||
return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
||||
};
|
||||
|
||||
// Event props removed in 1.9, put them back if needed; no practical way to warn them
|
||||
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
|
||||
jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
|
||||
}
|
||||
|
||||
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
|
||||
if ( jQuery.event.dispatch ) {
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Support for 'hover' pseudo-event and ajax event warnings
|
||||
jQuery.event.add = function( elem, types, handler, data, selector ){
|
||||
if ( elem !== document && rajaxEvent.test( types ) ) {
|
||||
migrateWarn( "AJAX events should be attached to document: " + types );
|
||||
}
|
||||
eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
|
||||
};
|
||||
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
|
||||
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
|
||||
};
|
||||
|
||||
jQuery.fn.error = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0);
|
||||
migrateWarn("jQuery.fn.error() is deprecated");
|
||||
args.splice( 0, 0, "error" );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
// error event should not bubble to window, although it does pre-1.7
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
// Don't mess with animation or css toggles
|
||||
if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
|
||||
return oldToggle.apply( this, arguments );
|
||||
}
|
||||
migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
|
||||
|
||||
// Save reference to arguments for access in closure
|
||||
var args = arguments,
|
||||
guid = fn.guid || jQuery.guid++,
|
||||
i = 0,
|
||||
toggler = 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;
|
||||
};
|
||||
|
||||
// link all the functions, so any of them can unbind this click handler
|
||||
toggler.guid = guid;
|
||||
while ( i < args.length ) {
|
||||
args[ i++ ].guid = guid;
|
||||
}
|
||||
|
||||
return this.click( toggler );
|
||||
};
|
||||
|
||||
jQuery.fn.live = function( types, data, fn ) {
|
||||
migrateWarn("jQuery.fn.live() is deprecated");
|
||||
if ( oldLive ) {
|
||||
return oldLive.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).on( types, this.selector, data, fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.die = function( types, fn ) {
|
||||
migrateWarn("jQuery.fn.die() is deprecated");
|
||||
if ( oldDie ) {
|
||||
return oldDie.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).off( types, this.selector || "**", fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
// Turn global events into document-triggered events
|
||||
jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
|
||||
if ( !elem && !rajaxEvent.test( event ) ) {
|
||||
migrateWarn( "Global events are undocumented and deprecated" );
|
||||
}
|
||||
return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
|
||||
};
|
||||
jQuery.each( ajaxEvents.split("|"),
|
||||
function( _, name ) {
|
||||
jQuery.event.special[ name ] = {
|
||||
setup: function() {
|
||||
var elem = this;
|
||||
|
||||
// The document needs no shimming; must be !== for oldIE
|
||||
if ( elem !== document ) {
|
||||
jQuery.event.add( document, name + "." + jQuery.guid, function() {
|
||||
jQuery.event.trigger( name, null, elem, true );
|
||||
});
|
||||
jQuery._data( this, name, jQuery.guid++ );
|
||||
}
|
||||
return false;
|
||||
},
|
||||
teardown: function() {
|
||||
if ( this !== document ) {
|
||||
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
})( jQuery, window );
|
||||
2
js/jquery-migrate-1.2.1.min.js
vendored
Normal file
7
js/jquery-ui-1.10.3.custom.min.js
vendored
Normal file
356
js/jquery-ui-1.8.17.custom.min.js
vendored
1012
js/jquery-ui-1.8.2.custom.min.js
vendored
1073
js/jquery.blockUI.js
2636
js/jquery.layout.js
266
js/jquery.layout.min.js
vendored
@@ -1,124 +1,142 @@
|
||||
/*
|
||||
jquery.layout 1.3.0 - Release Candidate 30.4
|
||||
$Date: 2012-03-10 08:00:00 (Sat, 10 Mar 2012) $
|
||||
$Rev: 303004 $
|
||||
|
||||
Copyright (c) 2012
|
||||
Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
Kevin Dalman (http://allpro.net)
|
||||
|
||||
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
|
||||
Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.2
|
||||
|
||||
Docs: http://layout.jquery-dev.net/documentation.html
|
||||
Tips: http://layout.jquery-dev.net/tips.html
|
||||
Help: http://groups.google.com/group/jquery-ui-layout
|
||||
*/
|
||||
(function(c){function M(a){return"string"===c.type(a)}function ca(a,e){if(c.isArray(e))for(var f=0,g=e.length;f<g;f++){var k=e[f];try{M(k)&&(k=eval(k)),c.isFunction(k)&&k(a)}catch(q){}}}var na=Math.min,J=Math.max,ga=Math.floor;c.layout={version:"1.3.rc30.4",revision:0.033004,language:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpenTip:"Not enough room to show this pane.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size",
|
||||
pane:"pane",selector:"selector",errButton:"Error Adding Button \n\nInvalid ",errContainerMissing:"UI Layout Initialization Error\n\nThe specified layout-container does not exist.",errCenterPaneMissing:"UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element.",errContainerHeight:"UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!"},browser:{mozilla:!!c.browser.mozilla,
|
||||
webkit:!!c.browser.webkit||!!c.browser.safari,msie:!!c.browser.msie,isIE6:!!c.browser.msie&&6==c.browser.version,version:c.browser.version},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},
|
||||
config:{optionRootKeys:"effects,panes,north,south,west,east,center".split(","),allPanes:["north","south","west","east","center"],borderPanes:["north","south","west","east"],oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},hidden:{visibility:"hidden"},visible:{visibility:"visible"},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",
|
||||
padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"Top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"Bottom",
|
||||
sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"Right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"Left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},plugins:{draggable:!!c.fn.draggable,effects:{core:!!c.effects,
|
||||
slide:c.effects&&c.effects.slide}},onCreate:[],onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||c.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||c.layout.getScrollbarSize("height")},getScrollbarSize:function(a){var e=c('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"),f={width:e.width()-
|
||||
e[0].clientWidth,height:e.height()-e[0].clientHeight};e.remove();window.scrollbarWidth=f.width;window.scrollbarHeight=f.height;return a.match(/^(width|height)$/)?f[a]:f},showInvisibly:function(a,e){if(!a)return{};a.jquery||(a=c(a));var f={display:a.css("display"),visibility:a.css("visibility")};return e||"none"===f.display?(a.css({display:"block",visibility:"hidden"}),f):{}},getElementDimensions:function(a){var e={},f=e.css={},g={},k,q,i=c.layout.cssNum,r=a.offset();e.offsetLeft=r.left;e.offsetTop=
|
||||
r.top;c.each(["Left","Right","Top","Bottom"],function(i,r){k=f["border"+r]=c.layout.borderWidth(a,r);q=f["padding"+r]=c.layout.cssNum(a,"padding"+r);g[r]=k+q;e["inset"+r]=q});e.offsetWidth=a.innerWidth();e.offsetHeight=a.innerHeight();e.outerWidth=a.outerWidth();e.outerHeight=a.outerHeight();e.innerWidth=J(0,e.outerWidth-g.Left-g.Right);e.innerHeight=J(0,e.outerHeight-g.Top-g.Bottom);f.width=a.width();f.height=a.height();f.top=i(a,"top",!0);f.bottom=i(a,"bottom",!0);f.left=i(a,"left",!0);f.right=
|
||||
i(a,"right",!0);return e},getElementCSS:function(c,e){var f={},g=c[0].style,k=e.split(","),q=["Top","Bottom","Left","Right"],i=["Color","Style","Width"],r,E,F,I,o,p;for(I=0;I<k.length;I++)if(r=k[I],r.match(/(border|padding|margin)$/))for(o=0;4>o;o++)if(E=q[o],"border"===r)for(p=0;3>p;p++)F=i[p],f[r+E+F]=g[r+E+F];else f[r+E]=g[r+E];else f[r]=g[r];return f},cssWidth:function(a,e){var f=c.layout.borderWidth,g=c.layout.cssNum;if(0>=e)return 0;if(!c.support.boxModel)return e;f=e-f(a,"Left")-f(a,"Right")-
|
||||
g(a,"paddingLeft")-g(a,"paddingRight");return J(0,f)},cssHeight:function(a,e){var f=c.layout.borderWidth,g=c.layout.cssNum;if(0>=e)return 0;if(!c.support.boxModel)return e;f=e-f(a,"Top")-f(a,"Bottom")-g(a,"paddingTop")-g(a,"paddingBottom");return J(0,f)},cssNum:function(a,e,f){a.jquery||(a=c(a));var g=c.layout.showInvisibly(a),e=c.curCSS(a[0],e,!0),f=f&&"auto"==e?e:parseInt(e,10)||0;a.css(g);return f},borderWidth:function(a,e){a.jquery&&(a=a[0]);var f="border"+e.substr(0,1).toUpperCase()+e.substr(1);
|
||||
return"none"===c.curCSS(a,f+"Style",!0)?0:parseInt(c.curCSS(a,f+"Width",!0),10)||0},isMouseOverElem:function(a,e){var f=c(e||this),g=f.offset(),k=g.top,g=g.left,q=g+f.outerWidth(),f=k+f.outerHeight(),i=a.pageX,r=a.pageY;return c.layout.browser.msie&&0>i&&0>r||i>=g&&i<=q&&r>=k&&r<=f},msg:function(a,e,f,g){c.isPlainObject(a)&&window.debugData?("string"===typeof e?(g=f,f=e):"object"===typeof f&&(g=f,f=null),f=f||"log( <object> )",g=c.extend({sort:!1,returnHTML:!1,display:!1},g),!0===e||g.display?debugData(a,
|
||||
f,g):window.console&&console.log(debugData(a,f,g))):e?alert(a):window.console&&console.log(a)}};var v=c.layout.language;c.layout.defaults={name:"",containerClass:"ui-layout-container",scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,autoBindCustomButtons:!1,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,
|
||||
content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",
|
||||
togglerAlign_closed:"center",togglerTip_open:v.Close,togglerTip_closed:v.Open,togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,noRoomToOpenTip:v.noRoomToOpenTip,resizerTip:v.Resize,sliderTip:v.Slide,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,
|
||||
slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:c.layout.browser.webkit,preventPrematureSlideClose:!1,showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,childOptions:null,initChildLayout:!0,destroyChildLayout:!0,resizeChildLayout:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,
|
||||
onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",
|
||||
size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};c.layout.optionsMap={layout:"stateManagement,effects,zIndexes,name,zIndex,scrollToBookmarkOnLoad,showErrorMessages,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onunload,autoBindCustomButtons".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,childOptions,initChildLayout,resizeChildLayout,destroyChildLayout,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),
|
||||
noDefault:["paneSelector","resizerCursor","customHotkey"]};c.layout.transformData=function(c){var e={panes:{},center:{}},f,g,k,q,i,r,E;if("object"!==typeof c)return e;for(g in c){f=e;i=c[g];k=g.split("__");E=k.length-1;for(r=0;r<=E;r++)q=k[r],r===E?f[q]=i:f[q]||(f[q]={}),f=f[q]}return e};c.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",resizeNestedLayout:"resizeChildLayout",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",
|
||||
maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure"},renameOptions:function(a){function e(c,e){for(var f=c.split("."),
|
||||
g=f.length-1,i={branch:a,key:f[g]},p=0,k;p<g;p++)k=f[p],i.branch=void 0==i.branch[k]?e?i.branch[k]={}:{}:i.branch[k];return i}var f=c.layout.backwardCompatibility.map,g,k,q,i;for(i in f)g=e(i),q=g.branch[g.key],void 0!==q&&(k=e(f[i],!0),k.branch[k.key]=q,delete g.branch[g.key])},renameAllOptions:function(a){var e=c.layout.backwardCompatibility.renameOptions;e(a);a.defaults&&("object"!==typeof a.panes&&(a.panes={}),c.extend(!0,a.panes,a.defaults),delete a.defaults);a.panes&&e(a.panes);c.each(c.layout.config.allPanes,
|
||||
function(c,g){a[g]&&e(a[g])});return a}};c.fn.layout=function(a){function e(b){if(!b)return!0;var l=b.keyCode;if(33>l)return!0;var z={38:"north",40:"south",37:"west",39:"east"},B=b.shiftKey,h=b.ctrlKey,a,m,j,u;h&&37<=l&&40>=l&&o[z[l]].enableCursorHotkey?u=z[l]:(h||B)&&c.each(i.borderPanes,function(b,c){a=o[c];m=a.customHotkey;j=a.customHotkeyModifier;if(B&&"SHIFT"==j||h&&"CTRL"==j||h&&B)if(m&&l===(isNaN(m)||9>=m?m.toUpperCase().charCodeAt(0):m))return u=c,!1});if(!u||!w[u]||!o[u].closable||p[u].isHidden)return!0;
|
||||
da(u);b.stopPropagation();return b.returnValue=!1}function f(b){if(A()){this&&this.tagName&&(b=this);var l;M(b)?l=w[b]:c(b).data("layoutRole")?l=c(b):c(b).parents().each(function(){if(c(this).data("layoutRole"))return l=c(this),!1});if(l&&l.length){var z=l.data("layoutEdge"),b=p[z];b.cssSaved&&g(z);if(b.isSliding||b.isResizing||b.isClosed)b.cssSaved=!1;else{var B={zIndex:o.zIndexes.resizer_normal+1},h={},a=l.css("overflow"),m=l.css("overflowX"),j=l.css("overflowY");"visible"!=a&&(h.overflow=a,B.overflow=
|
||||
"visible");m&&!m.match(/visible|auto/)&&(h.overflowX=m,B.overflowX="visible");j&&!j.match(/visible|auto/)&&(h.overflowY=m,B.overflowY="visible");b.cssSaved=h;l.css(B);c.each(i.allPanes,function(b,l){l!=z&&g(l)})}}}}function g(b){if(A()){this&&this.tagName&&(b=this);var l;M(b)?l=w[b]:c(b).data("layoutRole")?l=c(b):c(b).parents().each(function(){if(c(this).data("layoutRole"))return l=c(this),!1});if(l&&l.length){var b=l.data("layoutEdge"),b=p[b],z=b.cssSaved||{};!b.isSliding&&!b.isResizing&&l.css("zIndex",
|
||||
o.zIndexes.pane_normal);l.css(z);b.cssSaved=!1}}}var k=c.layout.browser,q=c.layout.language,i=c.layout.config,r=c.layout.cssWidth,E=c.layout.cssHeight,F=c.layout.getElementDimensions,I=c.layout.getElementCSS,o=c.extend(!0,{},c.layout.defaults);o.effects=c.extend(!0,{},c.layout.effects);var p={id:"layout"+c.now(),initialized:!1,container:{},north:{},south:{},east:{},west:{},center:{}},v={north:null,south:null,east:null,west:null,center:null},K={data:{},set:function(b,l,c){K.clear(b);K.data[b]=setTimeout(l,
|
||||
c)},clear:function(b){var l=K.data;l[b]&&(clearTimeout(l[b]),delete l[b])}},V=function(b,l){c.layout.msg(b,l&&o.showErrorMessages)},C=function(b,l){if(l){var z;try{if("function"===typeof l)z=l;else if(M(l))if(l.match(/,/)){var a=l.split(",");z=eval(a[0]);if("function"==typeof z&&1<a.length)return z(a[1])}else z=eval(l);else return;if(c.isFunction(z))return b&&w[b]?z(b,w[b],p[b],o[b],o.name):z(y,p,o,o.name)}catch(h){}}},za=function(b){if(!k.mozilla){var l=w[b];"IFRAME"===p[b].tagName?l.css(i.hidden).css(i.visible):
|
||||
l.find("IFRAME").css(i.hidden).css(i.visible)}},ha=function(b){var l=w[b];dir=i[b].dir;d={minWidth:1001-r(l,1E3),minHeight:1001-E(l,1E3)};"horz"===dir&&(d.minSize=d.minHeight);"vert"===dir&&(d.minSize=d.minWidth);return d},Ma=function(b,l,z){var a=b;M(b)?a=w[b]:b.jquery||(a=c(b));b=E(a,l);a.css({height:b,visibility:"visible"});0<b&&0<a.innerWidth()?z&&a.data("autoHidden")&&(a.show().data("autoHidden",!1),k.mozilla||a.css(i.hidden).css(i.visible)):z&&!a.data("autoHidden")&&a.hide().data("autoHidden",
|
||||
!0)},Q=function(b,l,z){z||(z=i[b].dir);M(l)&&l.match(/%/)&&(l="100%"===l?-1:parseInt(l,10)/100);if(0===l)return 0;if(1<=l)return parseInt(l,10);var a=o,h=0;"horz"==z?h=x.innerHeight-(w.north?a.north.spacing_open:0)-(w.south?a.south.spacing_open:0):"vert"==z&&(h=x.innerWidth-(w.west?a.west.spacing_open:0)-(w.east?a.east.spacing_open:0));if(-1===l)return h;if(0<l)return ga(h*l);if("center"==b)return 0;b=w[b];z="horz"===z?"height":"width";a=c.layout.showInvisibly(b);h=b.css(z);b.css(z,"auto");l="height"===
|
||||
z?b.outerHeight():b.outerWidth();b.css(z,h).css(a);return l},W=function(b,l){var c=w[b],a=o[b],h=p[b],L=l?a.spacing_open:0,a=l?a.spacing_closed:0;return!c||h.isHidden?0:h.isClosed||h.isSliding&&l?a:"horz"===i[b].dir?c.outerHeight()+L:c.outerWidth()+L},N=function(b,l){if(A()){var c=o[b],a=p[b],h=i[b],L=h.dir;h.side.toLowerCase();h.sizeType.toLowerCase();var h=void 0!=l?l:a.isSliding,m=c.spacing_open,j=i.oppositeEdge[b],u=p[j],e=w[j],f=!e||!1===u.isVisible||u.isSliding?0:"horz"==L?e.outerHeight():e.outerWidth(),
|
||||
j=(!e||u.isHidden?0:o[j][!1!==u.isClosed?"spacing_closed":"spacing_open"])||0,u="horz"==L?x.innerHeight:x.innerWidth,e=ha("center"),e="horz"==L?J(o.center.minHeight,e.minHeight):J(o.center.minWidth,e.minWidth),h=u-m-(h?0:Q("center",e,L)+f+j),L=a.minSize=J(Q(b,c.minSize),ha(b).minSize),h=a.maxSize=na(c.maxSize?Q(b,c.maxSize):1E5,h),a=a.resizerPosition={},m=x.insetTop,f=x.insetLeft,j=x.innerWidth,u=x.innerHeight,c=c.spacing_open;switch(b){case "north":a.min=m+L;a.max=m+h;break;case "west":a.min=f+L;
|
||||
a.max=f+h;break;case "south":a.min=m+u-h-c;a.max=m+u-L-c;break;case "east":a.min=f+j-h-c,a.max=f+j-L-c}}},oa=function(b,l){var a=c(b),B=a.data("layoutRole"),h=a.data("layoutEdge"),e=o[h][B+"Class"],h="-"+h,m=a.hasClass(e+"-closed")?"-closed":"-open",j="-closed"===m?"-open":"-closed",m=e+"-hover "+(e+h+"-hover ")+(e+m+"-hover ")+(e+h+m+"-hover ");l&&(m+=e+j+"-hover "+(e+h+j+"-hover "));"resizer"==B&&a.hasClass(e+"-sliding")&&(m+=e+"-sliding-hover "+(e+h+"-sliding-hover "));return c.trim(m)},pa=function(b,
|
||||
l){var a=c(l||this);b&&"toggler"===a.data("layoutRole")&&b.stopPropagation();a.addClass(oa(a))},P=function(b,l){var a=c(l||this);a.removeClass(oa(a,!0))},Aa=function(){c.fn.disableSelection&&c("body").disableSelection()},Ba=function(b,l){var a=l||this,B=c(a).data("layoutEdge"),h=B+"ResizerLeave";K.clear(B+"_openSlider");K.clear(h);l?!p[B].isResizing&&c.fn.enableSelection&&c("body").enableSelection():K.set(h,function(){Ba(b,a)},200)},A=function(){return p.initialized||p.creatingLayout?!0:ia()},ia=
|
||||
function(b){var l=o;if(!t.is(":visible"))return!b&&k.webkit&&"BODY"===t[0].tagName&&setTimeout(function(){ia(!0)},50),!1;if(!Ca("center").length)return V(q.errCenterPaneMissing,!0),!1;p.creatingLayout=!0;c.extend(x,F(t));"pane"===t.data("layoutRole")&&(l.resizeWithWindow=!1);Na();l.scrollToBookmarkOnLoad&&(b=self.location,b.hash&&b.replace(b.hash));l.resizeWithWindow&&c(window).bind("resize."+H,Oa);delete p.creatingLayout;p.initialized=!0;ca(y,c.layout.onReady);C(null,l.onload_end||l.onload);return!0},
|
||||
qa=function(b,l){var c=w[b],a=l||o[b].childOptions,h=c?v[b]=c.data("layout")||null:!1;!h&&c&&a&&(h=v[b]=c.layout(a)||null);h&&(h.hasParentLayout=!0);y[b].child=v[b]},Oa=function(){var b=Number(o.resizeWithWindowDelay);10>b&&(b=100);K.clear("winResize");K.set("winResize",function(){K.clear("winResize");K.clear("winResizeRepeater");var b=F(t);(b.innerWidth!==x.innerWidth||b.innerHeight!==x.innerHeight)&&$()},b);K.data.winResizeRepeater||Da()},Da=function(){var b=Number(o.resizeWithWindowMaxDelay);0<
|
||||
b&&K.set("winResizeRepeater",function(){Da();$()},b)},Ea=function(){var b=o;C(null,b.onunload_start);ca(y,c.layout.onUnload);C(null,b.onunload_end||b.onunload)},Fa=function(b){b=b?b.split(","):i.borderPanes;c.each(b,function(b,a){var B=o[a];if(B.enableCursorHotkey||B.customHotkey)return c(document).bind("keydown."+H,e),!1})},Pa=function(){function b(b){var l=o[b],a=o.panes;l.fxSettings||(l.fxSettings={});a.fxSettings||(a.fxSettings={});c.each(["_open","_close","_size"],function(h,z){var m="fxName"+
|
||||
z,j="fxSpeed"+z,B="fxSettings"+z,e=l[m]=l[m]||a[m]||l.fxName||a.fxName||"none";if(e==="none"||!c.effects||!c.effects[e]||!o.effects[e])e=l[m]="none";e=o.effects[e]||{};m=e.all||null;e=e[b]||null;l[j]=l[j]||a[j]||l.fxSpeed||a.fxSpeed||null;l[B]=c.extend({},m,e,a.fxSettings,l.fxSettings,a[B],l[B])});delete l.fxName;delete l.fxSpeed;delete l.fxSettings}var l,z,B,h,e,m;a=c.layout.transformData(a);a=c.layout.backwardCompatibility.renameAllOptions(a);if(!c.isEmptyObject(a.panes)){l=c.layout.optionsMap.noDefault;
|
||||
h=0;for(e=l.length;h<e;h++)B=l[h],delete a.panes[B];l=c.layout.optionsMap.layout;h=0;for(e=l.length;h<e;h++)B=l[h],delete a.panes[B]}l=c.layout.optionsMap.layout;var j=c.layout.config.optionRootKeys;for(B in a)h=a[B],0>c.inArray(B,j)&&0>c.inArray(B,l)&&(a.panes[B]||(a.panes[B]=c.isPlainObject(h)?c.extend(!0,{},h):h),delete a[B]);c.extend(!0,o,a);c.each(i.allPanes,function(h,j){i[j]=c.extend(!0,{},i.panes,i[j]);z=o.panes;m=o[j];if("center"===j){l=c.layout.optionsMap.center;h=0;for(e=l.length;h<e;h++)if(B=
|
||||
l[h],!a.center[B]&&(a.panes[B]||!m[B]))m[B]=z[B]}else if(m=o[j]=c.extend({},z,m),b(j),m.resizerClass||(m.resizerClass="ui-layout-resizer"),!m.togglerClass)m.togglerClass="ui-layout-toggler";m.paneClass||(m.paneClass="ui-layout-pane")});h=a.zIndex;j=o.zIndexes;0<h&&(j.pane_normal=h,j.content_mask=J(h+1,j.content_mask),j.resizer_normal=J(h+2,j.resizer_normal));delete o.panes},Ca=function(b){b=o[b].paneSelector;if("#"===b.substr(0,1))return t.find(b).eq(0);var l=t.children(b).eq(0);return l.length?l:
|
||||
t.children("form:first").children(b).eq(0)},Na=function(){c.each(i.allPanes,function(b,l){Ha(l,!0)});ra();c.each(i.borderPanes,function(b,l){w[l]&&p[l].isVisible&&(N(l),R(l))});S("center");c.each(i.allPanes,function(b,l){var a=o[l];w[l]&&(p[l].isVisible&&(aa(l),a.triggerEventsOnLoad&&C(l,a.onresize_end||a.onresize),X(l)),a.initChildLayout&&a.childOptions&&qa(l))})},Ha=function(b,l){if(l||A()){var a=o[b],c=p[b],h=i[b],e=h.dir,m="center"===b,j={},u=w[b],k;u?sa(b,!1,!0,!1):O[b]=!1;u=w[b]=Ca(b);if(u.length){u.data("layoutCSS")||
|
||||
u.data("layoutCSS",I(u,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));u.data("parentLayout",y).data("layoutRole","pane").data("layoutEdge",b).css(h.cssReq).css("zIndex",o.zIndexes.pane_normal).css(a.applyDemoStyles?h.cssDemo:{}).addClass(a.paneClass+" "+a.paneClass+"-"+b).bind("mouseenter."+H,pa).bind("mouseleave."+H,P);y[b]={name:b,pane:w[b],options:o[b],state:p[b],child:v[b]};Ia(b,!1);m||(k=c.size=Q(b,a.size),h=Q(b,a.minSize)||1,m=Q(b,
|
||||
a.maxSize)||1E5,0<k&&(k=J(na(k,m),h)),c.isClosed=!1,c.isSliding=!1,c.isResizing=!1,c.isHidden=!1,c.pins||(c.pins=[]));c.tagName=u[0].tagName;c.edge=b;c.noRoom=!1;c.isVisible=!0;switch(b){case "north":j.top=x.insetTop;j.left=x.insetLeft;j.right=x.insetRight;break;case "south":j.bottom=x.insetBottom;j.left=x.insetLeft;j.right=x.insetRight;break;case "west":j.left=x.insetLeft;break;case "east":j.right=x.insetRight}"horz"===e?j.height=E(u,k):"vert"===e&&(j.width=r(u,k));u.css(j);"horz"!=e&&S(b,!0);a.initClosed&&
|
||||
a.closable&&!a.initHidden?T(b,!0,!0):a.initHidden||a.initClosed?ta(b):c.noRoom||u.css("display","block");u.css("visibility","visible");a.showOverflowOnHover&&u.hover(f,g);p.initialized&&(ra(b),Fa(b),$(),c.isVisible&&(a.triggerEventsOnLoad&&C(b,a.onresize_end||a.onresize),X(b)),a.initChildLayout&&a.childOptions&&qa(b))}else w[b]=!1}},ra=function(b){b=b?b.split(","):i.borderPanes;c.each(b,function(b,a){var e=w[a];D[a]=!1;G[a]=!1;if(e){var e=o[a],h=p[a],f=e.resizerClass,m=e.togglerClass;i[a].side.toLowerCase();
|
||||
var j="-"+a,u=y[a],g=u.resizer=D[a]=c("<div></div>"),u=u.toggler=e.closable?G[a]=c("<div></div>"):!1;!h.isVisible&&e.slidable&&g.attr("title",e.sliderTip).css("cursor",e.sliderCursor);g.attr("id","#"==e.paneSelector.substr(0,1)?e.paneSelector.substr(1)+"-resizer":"").data("parentLayout",y).data("layoutRole","resizer").data("layoutEdge",a).css(i.resizers.cssReq).css("zIndex",o.zIndexes.resizer_normal).css(e.applyDemoStyles?i.resizers.cssDemo:{}).addClass(f+" "+f+j).hover(pa,P).hover(Aa,Ba).appendTo(t);
|
||||
u&&(u.attr("id","#"==e.paneSelector.substr(0,1)?e.paneSelector.substr(1)+"-toggler":"").data("parentLayout",y).data("layoutRole","toggler").data("layoutEdge",a).css(i.togglers.cssReq).css(e.applyDemoStyles?i.togglers.cssDemo:{}).addClass(m+" "+m+j).hover(pa,P).bind("mouseenter",Aa).appendTo(g),e.togglerContent_open&&c("<span>"+e.togglerContent_open+"</span>").data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display","none").appendTo(u),e.togglerContent_closed&&
|
||||
c("<span>"+e.togglerContent_closed+"</span>").data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-closed").css("display","none").appendTo(u),Ja(a));Qa(a);h.isVisible?ua(a):(va(a),Y(a,!0))}});ea()},Ia=function(b,a){if(A()){var c=o[b],e=c.contentSelector,h=y[b],f=w[b],m;e&&(m=h.content=O[b]=c.findNestedContent?f.find(e).eq(0):f.children(e).eq(0));m&&m.length?(m.data("layoutRole","content"),m.data("layoutCSS")||m.data("layoutCSS",I(m,"height")),m.css(i.content.cssReq),
|
||||
c.applyDemoStyles&&(m.css(i.content.cssDemo),f.css(i.content.cssDemoPane)),p[b].content={},!1!==a&&aa(b)):h.content=O[b]=!1}},Qa=function(b){var a=c.layout.plugins.draggable,b=b?b.split(","):i.borderPanes;c.each(b,function(b,h){var f=o[h];if(!a||!w[h]||!f.resizable)return f.resizable=!1,!0;var m=p[h],j=o.zIndexes,u=i[h],g="horz"==u.dir?"top":"left",k=h+",center,"+i.oppositeEdge[h]+("horz"==u.dir?",west,east":""),r=D[h],x=f.resizerClass,E=0,v,A,F=x+"-drag",y=x+"-"+h+"-drag",I=x+"-dragging",J=x+"-"+
|
||||
h+"-dragging",H=x+"-dragging-limit",G=x+"-"+h+"-dragging-limit",M=!1;m.isClosed||r.attr("title",f.resizerTip).css("cursor",f.resizerCursor);r.draggable({containment:t[0],axis:"horz"==u.dir?"y":"x",delay:0,distance:1,grid:f.resizingGrid,helper:"clone",opacity:f.resizerDragOpacity,addClasses:!1,zIndex:j.resizer_drag,start:function(b,a){f=o[h];m=p[h];A=f.livePaneResizing;if(!1===C(h,f.ondrag_start))return!1;m.isResizing=!0;K.clear(h+"_closeSlider");N(h);v=m.resizerPosition;E=a.position[g];r.addClass(F+
|
||||
" "+y);M=!1;c("body").disableSelection();ja(k)},drag:function(b,a){M||(a.helper.addClass(I+" "+J).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),M=!0,m.isSliding&&w[h].css("zIndex",j.pane_sliding));var c=0;a.position[g]<v.min?(a.position[g]=v.min,c=-1):a.position[g]>v.max&&(a.position[g]=v.max,c=1);c?(a.helper.addClass(H+" "+G),window.defaultStatus=0<c&&h.match(/north|west/)||0>c&&h.match(/south|east/)?q.maxSizeWarning:q.minSizeWarning):(a.helper.removeClass(H+" "+G),window.defaultStatus=
|
||||
"");A&&Math.abs(a.position[g]-E)>=f.liveResizingTolerance&&(E=a.position[g],e(b,a,h))},stop:function(b,a){c("body").enableSelection();window.defaultStatus="";r.removeClass(F+" "+y);m.isResizing=!1;e(b,a,h,!0,k)}})});var e=function(b,a,c,l,e){var f=a.position,z=i[c],b=o[c],a=p[c],g;switch(c){case "north":g=f.top;break;case "west":g=f.left;break;case "south":g=x.offsetHeight-f.top-b.spacing_open;break;case "east":g=x.offsetWidth-f.left-b.spacing_open}g-=x["inset"+z.side];l?(!1!==C(c,b.ondrag_end||b.ondrag)&&
|
||||
ka(c,g,!1,!0),wa(),a.isSliding&&e&&ja(e,!0)):Math.abs(g-a.size)<b.liveResizingTolerance||(ka(c,g,!1,!0),Z.each(Ka))}},Ka=function(){var b=c(this),a=b.data("layoutMask"),a=p[a];"IFRAME"==a.tagName&&a.isVisible&&b.css({top:a.offsetTop,left:a.offsetLeft,width:a.outerWidth,height:a.outerHeight})},ja=function(b,a){var e=b?b.split(","):c.layout.config.allPanes,f=o.zIndexes,h,g;c.each(e,function(b,c){g=p[c];h=o[c];g.isVisible&&(!a&&h.maskContents||h.maskObjects)&&Ra(c).each(function(){Ka.apply(this);this.style.zIndex=
|
||||
g.isSliding?f.pane_sliding+1:f.pane_normal+1;this.style.display="block"})})},wa=function(){var b;c.each(c.layout.config.borderPanes,function(a,c){if(p[c].isResizing)return b=!0,!1});b||Z.hide()},Ra=function(b){for(var a=c([]),e,f=0,h=Z.length;f<h;f++)e=Z.eq(f),e.data("layoutMask")===b&&(a=a.add(e));if(a.length)return a;a=w[b];e=p[b];var f=o[b],h=o.zIndexes,g=c([]),m,j,u,i,k;if(f.maskContents||f.maskObjects)for(k=0;k<(f.maskObjects?2:1);k++)m=f.maskObjects&&0==k,j=document.createElement(m?"iframe":
|
||||
"div"),u=c(j).data("layoutMask",b),j.className="ui-layout-mask ui-layout-mask-"+b,i=j.style,i.display="block",i.position="absolute",m&&(j.frameborder=0,j.src="about:blank",i.opacity=0,i.filter="Alpha(Opacity='0')",i.border=0),"IFRAME"==e.tagName?(i.zIndex=h.pane_normal+1,t.append(j)):(u.addClass("ui-layout-mask-inside-pane"),i.zIndex=f.maskZindex||h.content_mask,i.top=0,i.left=0,i.width="100%",i.height="100%",a.append(j)),g=g.add(j),Z=Z.add(j);return g},sa=function(b,a,e,f){if(A()){var h=w[b],g=O[b],
|
||||
m=D[b],j=G[b];h&&c.isEmptyObject(h.data())&&(h=!1);g&&c.isEmptyObject(g.data())&&(g=!1);m&&c.isEmptyObject(m.data())&&(m=!1);j&&c.isEmptyObject(j.data())&&(j=!1);h&&h.stop(!0,!0);var u=o[b],i=v[b]||(h?h.data("layout"):0)||(g?g.data("layout"):0)||null;if((void 0!==f?f:u.destroyChildLayout)&&i&&!i.destroyed)i.destroy(!0),i.destroyed&&(i=null);h&&a&&!i?h.remove():h&&(a=u.paneClass,f=a+"-"+b,a=[a,a+"-open",a+"-closed",a+"-sliding",f,f+"-open",f+"-closed",f+"-sliding"],c.merge(a,oa(h,!0)),h.removeClass(a.join(" ")).removeData("layoutParent").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+
|
||||
H),g&&g.data("layout")?(g.width(g.width()),i.resizeAll()):g&&g.css(g.data("layoutCSS")).removeData("layoutCSS").removeData("layoutRole"),h.data("layout")||h.css(h.data("layoutCSS")).removeData("layoutCSS"));j&&j.remove();m&&m.remove();y[b]=w[b]=O[b]=D[b]=G[b]=v[b]=!1;e||$()}},ta=function(b,a){if(A()){var c=o[b],e=p[b],h=w[b],f=D[b];if(h&&!e.isHidden&&!(p.initialized&&!1===C(b,c.onhide_start)))if(e.isSliding=!1,f&&f.hide(),!p.initialized||e.isClosed){if(e.isClosed=!0,e.isHidden=!0,e.isVisible=!1,h.hide(),
|
||||
S("horz"===i[b].dir?"":"center"),p.initialized||c.triggerEventsOnLoad)C(b,c.onhide_end||c.onhide)}else e.isHiding=!0,T(b,!1,a)}},la=function(b,a,c,e){if(A()){var h=o[b],f=p[b];w[b]&&f.isHidden&&!1!==C(b,h.onshow_start)&&(f.isSliding=!1,f.isShowing=!0,!1===a?T(b,!0):ba(b,!1,c,e))}},da=function(b,a){if(A()){M(b)||(b.stopImmediatePropagation(),b=c(this).data("layoutEdge"));var e=p[b];e.isHidden?la(b):e.isClosed?ba(b,!!a):T(b)}},Sa=function(b){var a=p[b];w[b].hide();a.isClosed=!0;a.isVisible=!1},T=function(b,
|
||||
a,c,e){function h(){j.isMoving=!1;Y(b,!0);var a=i.oppositeEdge[b];p[a].noRoom&&(N(a),R(a));wa();if(!e&&(p.initialized||m.triggerEventsOnLoad))r||C(b,m.onclose_end||m.onclose),r&&C(b,m.onshow_end||m.onshow),q&&C(b,m.onhide_end||m.onhide)}if(!p.initialized&&w[b])Sa(b);else if(A()){var f=w[b],m=o[b],j=p[b],g=i[b],k,r,q;t.queue(function(e){if(!f||!m.closable&&!j.isShowing&&!j.isHiding||!a&&j.isClosed&&!j.isShowing)return e();var B=!j.isShowing&&!1===C(b,m.onclose_start);r=j.isShowing;q=j.isHiding;delete j.isShowing;
|
||||
delete j.isHiding;if(B)return e();k=!c&&!j.isClosed&&"none"!=m.fxName_close;j.isMoving=!0;j.isClosed=!0;j.isVisible=!1;q?j.isHidden=!0:r&&(j.isHidden=!1);j.isSliding?fa(b,!1):S("horz"===i[b].dir?"":"center",!1);va(b);k?(ja("center"+("horz"==g.dir?",west,east":""),!0),ma(b,!0),f.hide(m.fxName_close,m.fxSettings_close,m.fxSpeed_close,function(){ma(b,false);j.isClosed&&h();e()})):(f.hide(),h(),e())})}},va=function(b){var a=D[b],e=G[b],f=o[b],h=i[b].side.toLowerCase(),g=f.resizerClass,m=f.togglerClass,
|
||||
j="-"+b;a.css(h,x["inset"+i[b].side]).removeClass(g+"-open "+g+j+"-open").removeClass(g+"-sliding "+g+j+"-sliding").addClass(g+"-closed "+g+j+"-closed").unbind("dblclick."+H);f.resizable&&c.layout.plugins.draggable&&a.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");e&&(e.removeClass(m+"-open "+m+j+"-open").addClass(m+"-closed "+m+j+"-closed").attr("title",f.togglerTip_closed),e.children(".content-open").hide(),e.children(".content-closed").css("display",
|
||||
"block"));xa(b,!1);p.initialized&&ea()},ba=function(b,a,c,e){function h(){j.isMoving=!1;za(b);j.isSliding||(wa(),S("vert"==i[b].dir?"center":"",!1));ua(b)}if(A()){var f=w[b],m=o[b],j=p[b],g=i[b],k,r;t.queue(function(o){if(!f||!m.resizable&&!m.closable&&!j.isShowing||j.isVisible&&!j.isSliding)return o();if(j.isHidden&&!j.isShowing)la(b,!0);else if(m.autoResize&&j.size!=m.size?U(b,m.size,!0,!0,!0):N(b,a),!1!==C(b,m.onopen_start)){N(b,a);if(j.minSize>j.maxSize)return xa(b,!1),!e&&m.noRoomToOpenTip&&
|
||||
alert(m.noRoomToOpenTip),o();a?fa(b,!0):j.isSliding?fa(b,!1):m.slidable&&Y(b,!1);j.noRoom=!1;R(b);r=j.isShowing;delete j.isShowing;k=!c&&j.isClosed&&"none"!=m.fxName_open;j.isMoving=!0;j.isVisible=!0;j.isClosed=!1;r&&(j.isHidden=!1);if(k){var p="center"+("horz"==g.dir?",west,east":"");j.isSliding&&(p+=","+i.oppositeEdge[b]);ja(p,!0);ma(b,!0);f.show(m.fxName_open,m.fxSettings_open,m.fxSpeed_open,function(){ma(b,false);j.isVisible&&h();o()})}else f.show(),h(),o()}})}},ua=function(b,a){var e=w[b],f=
|
||||
D[b],h=G[b],g=o[b],m=p[b],j=i[b].side.toLowerCase(),u=g.resizerClass,k=g.togglerClass,r="-"+b;f.css(j,x["inset"+i[b].side]+W(b)).removeClass(u+"-closed "+u+r+"-closed").addClass(u+"-open "+u+r+"-open");m.isSliding?f.addClass(u+"-sliding "+u+r+"-sliding"):f.removeClass(u+"-sliding "+u+r+"-sliding");g.resizerDblClickToggle&&f.bind("dblclick",da);P(0,f);g.resizable&&c.layout.plugins.draggable?f.draggable("enable").css("cursor",g.resizerCursor).attr("title",g.resizerTip):m.isSliding||f.css("cursor","default");
|
||||
h&&(h.removeClass(k+"-closed "+k+r+"-closed").addClass(k+"-open "+k+r+"-open").attr("title",g.togglerTip_open),P(0,h),h.children(".content-closed").hide(),h.children(".content-open").css("display","block"));xa(b,!m.isSliding);c.extend(m,F(e));p.initialized&&(ea(),aa(b,!0));if(!a&&(p.initialized||g.triggerEventsOnLoad)&&e.is(":visible"))C(b,g.onopen_end||g.onopen),m.isShowing&&C(b,g.onshow_end||g.onshow),p.initialized&&(C(b,g.onresize_end||g.onresize),X(b))},La=function(b){function a(){h.isClosed?
|
||||
h.isMoving||ba(f,!0):fa(f,!0)}if(A()){var e=M(b)?null:b,f=e?c(this).data("layoutEdge"):b,h=p[f],b=o[f].slideDelay_open;e&&e.stopImmediatePropagation();h.isClosed&&e&&"mouseenter"===e.type&&0<b?K.set(f+"_openSlider",a,b):a()}},ya=function(b){function a(){h.isClosed?fa(f,!1):h.isMoving||T(f)}if(A()){var e=M(b)?null:b,f=e?c(this).data("layoutEdge"):b,b=o[f],h=p[f],g=h.isMoving?1E3:300;!h.isClosed&&!h.isResizing&&("click"===b.slideTrigger_close?a():b.preventQuickSlideClose&&h.isMoving||b.preventPrematureSlideClose&&
|
||||
e&&c.layout.isMouseOverElem(e,w[f])||(e?K.set(f+"_closeSlider",a,J(b.slideDelay_close,g)):a()))}},ma=function(b,a){var c=w[b],e=p[b],h=o[b],f=o.zIndexes;a?(c.css({zIndex:f.pane_animate}),"south"==b?c.css({top:x.insetTop+x.innerHeight-c.outerHeight()}):"east"==b&&c.css({left:x.insetLeft+x.innerWidth-c.outerWidth()})):(c.css({zIndex:e.isSliding?f.pane_sliding:f.pane_normal}),"south"==b?c.css({top:"auto"}):"east"==b&&c.css({left:"auto"}),k.msie&&h.fxOpacityFix&&"slide"!=h.fxName_open&&c.css("filter")&&
|
||||
1==c.css("opacity")&&c[0].style.removeAttribute("filter"))},Y=function(b,a){var c=o[b],e=D[b],h=c.slideTrigger_open.toLowerCase();if(e&&(!a||c.slidable))h.match(/mouseover/)?h=c.slideTrigger_open="mouseenter":h.match(/click|dblclick|mouseenter/)||(h=c.slideTrigger_open="click"),e[a?"bind":"unbind"](h+"."+H,La).css("cursor",a?c.sliderCursor:"default").attr("title",a?c.sliderTip:"")},fa=function(b,a){function c(a){K.clear(b+"_closeSlider");a.stopPropagation()}var e=o[b],h=p[b],f=o.zIndexes,g=e.slideTrigger_close.toLowerCase(),
|
||||
j=a?"bind":"unbind",i=w[b],k=D[b];h.isSliding=a;K.clear(b+"_closeSlider");a&&Y(b,!1);i.css("zIndex",a?f.pane_sliding:f.pane_normal);k.css("zIndex",a?f.pane_sliding+2:f.resizer_normal);g.match(/click|mouseleave/)||(g=e.slideTrigger_close="mouseleave");k[j](g,ya);"mouseleave"===g&&(i[j]("mouseleave."+H,ya),k[j]("mouseenter."+H,c),i[j]("mouseenter."+H,c));a?"click"===g&&!e.resizable&&(k.css("cursor",a?e.sliderCursor:"default"),k.attr("title",a?e.togglerTip_open:"")):K.clear(b+"_closeSlider")},R=function(b,
|
||||
a,e,f){var a=o[b],h=p[b],g=i[b],m=w[b],j=D[b],u="vert"===g.dir,k=!1;if("center"===b||u&&h.noVerticalRoom)(k=0<=h.maxHeight)&&h.noRoom?(m.show(),j&&j.show(),h.isVisible=!0,h.noRoom=!1,u&&(h.noVerticalRoom=!1),za(b)):!k&&!h.noRoom&&(m.hide(),j&&j.hide(),h.isVisible=!1,h.noRoom=!0);if("center"!==b)if(h.minSize<=h.maxSize){if(h.size>h.maxSize?U(b,h.maxSize,e,f,!0):h.size<h.minSize?U(b,h.minSize,e,f,!0):j&&m.is(":visible")&&(e=g.side.toLowerCase(),f=h.size+x["inset"+g.side],c.layout.cssNum(j,e)!=f&&j.css(e,
|
||||
f)),h.noRoom)h.wasOpen&&a.closable?a.autoReopen?ba(b,!1,!0,!0):h.noRoom=!1:la(b,h.wasOpen,!0,!0)}else h.noRoom||(h.noRoom=!0,h.wasOpen=!h.isClosed&&!h.isSliding,h.isClosed||(a.closable?T(b,!0,!0):ta(b,!0)))},ka=function(b,a,c,e){if(A()){var h=o[b],f=p[b],f=h.livePaneResizing&&!f.isResizing;h.autoResize=!1;U(b,a,c,f,e)}},U=function(b,a,e,f,h){function g(){for(var h="width"===v?u.outerWidth():u.outerHeight(),h=[{pane:b,count:1,target:a,actual:h,correct:a===h,attempt:a,cssSize:G}],t=h[0],L="Inaccurate size after resizing the "+
|
||||
b+"-pane.";!t.correct;){thisTry={pane:b,count:t.count+1,target:a};thisTry.attempt=t.actual>a?J(0,t.attempt-(t.actual-a)):J(0,t.attempt+(a-t.actual));thisTry.cssSize=("horz"==i[b].dir?E:r)(w[b],thisTry.attempt);u.css(v,thisTry.cssSize);thisTry.actual="width"==v?u.outerWidth():u.outerHeight();thisTry.correct=a===thisTry.actual;o.showDebugMessages&&(1===h.length&&(V(L,!1),V(t,!1)),V(thisTry,!1));if(3<h.length)break;h.push(thisTry);t=h[h.length-1]}j.size=a;c.extend(j,F(u));k&&u.is(":visible")&&k.css(q,
|
||||
a+x[y]);aa(b);!e&&!Ga&&p.initialized&&j.isVisible&&(C(b,m.onresize_end||m.onresize),X(b));e||(j.isSliding||S("horz"==i[b].dir?"":"center",Ga,f),ea());t=i.oppositeEdge[b];a<H&&p[t].noRoom&&(N(t),R(t,!1,e));o.showDebugMessages&&1<h.length&&V(L+"\nSee the Error Console for details.",!0)}if(A()){var m=o[b],j=p[b],u=w[b],k=D[b],q=i[b].side.toLowerCase(),v=i[b].sizeType.toLowerCase(),y="inset"+i[b].side,Ga=j.isResizing&&!m.triggerEventsDuringLiveResize,I=!0!==h&&m.animatePaneSizing,H,G;t.queue(function(h){N(b);
|
||||
H=j.size;a=Q(b,a);a=J(a,Q(b,m.minSize));a=na(a,j.maxSize);if(a<j.minSize)return R(b,!1,e),h();if(!f&&a===H)return h();!e&&p.initialized&&j.isVisible&&C(b,m.onresize_start);G=("horz"==i[b].dir?E:r)(w[b],a);if(I&&u.is(":visible")){var k=c.layout.effects.size[b]||c.layout.effects.size.all,k=m.fxSettings_size.easing||k.easing,q=o.zIndexes,t={};t[v]=G+"px";j.isMoving=!0;u.css({zIndex:q.pane_animate}).show().animate(t,m.fxSpeed_size,k,function(){u.css({zIndex:j.isSliding?q.pane_sliding:q.pane_normal});
|
||||
j.isMoving=!1;g();h()})}else u.css(v,G),u.is(":visible")?g():(j.size=a,c.extend(j,F(u))),h()})}},S=function(b,a,e){b=(b?b:"east,west,center").split(",");c.each(b,function(b,h){if(w[h]){var f=o[h],g=p[h],j=w[h],i=!0,k={},i={top:W("north",!0),bottom:W("south",!0),left:W("west",!0),right:W("east",!0),width:0,height:0};i.width=x.innerWidth-i.left-i.right;i.height=x.innerHeight-i.bottom-i.top;i.top+=x.insetTop;i.bottom+=x.insetBottom;i.left+=x.insetLeft;i.right+=x.insetRight;c.extend(g,F(j));if("center"===
|
||||
h){if(!e&&g.isVisible&&i.width===g.outerWidth&&i.height===g.outerHeight)return!0;c.extend(g,ha(h),{maxWidth:i.width,maxHeight:i.height});k=i;k.width=r(j,k.width);k.height=E(j,k.height);i=0<=k.width&&0<=k.height;if(!p.initialized&&f.minWidth>g.outerWidth){var q=f.minWidth-g.outerWidth,t=o.east.minSize||0,v=o.west.minSize||0,y=p.east.size,A=p.west.size,I=y,D=A;0<q&&p.east.isVisible&&y>t&&(I=J(y-t,y-q),q-=y-I);0<q&&p.west.isVisible&&A>v&&(D=J(A-v,A-q),q-=A-D);if(0===q){y!=t&&U("east",I,!0,e,!0);A!=v&&
|
||||
U("west",D,!0,e,!0);S("center",a,e);return}}}else{g.isVisible&&!g.noVerticalRoom&&c.extend(g,F(j),ha(h));if(!e&&!g.noVerticalRoom&&i.height===g.outerHeight)return!0;k.top=i.top;k.bottom=i.bottom;k.height=E(j,i.height);g.maxHeight=k.height;i=0<=g.maxHeight;i||(g.noVerticalRoom=!0)}i?(!a&&p.initialized&&C(h,f.onresize_start),j.css(k),g.noRoom&&!g.isClosed&&!g.isHidden&&R(h),g.isVisible&&(c.extend(g,F(j)),p.initialized&&aa(h))):!g.noRoom&&g.isVisible&&R(h);if(!g.isVisible)return!0;"center"===h&&(g=c.layout.browser,
|
||||
g=g.isIE6||g.msie&&!c.support.boxModel,w.north&&(g||"IFRAME"==p.north.tagName)&&w.north.css("width",r(w.north,x.innerWidth)),w.south&&(g||"IFRAME"==p.south.tagName)&&w.south.css("width",r(w.south,x.innerWidth)));!a&&p.initialized&&(C(h,f.onresize_end||f.onresize),X(h))}})},$=function(){if(p.initialized){if(t.is(":visible:")&&(c.extend(p.container,F(t)),x.outerHeight)){if(!1===C(null,o.onresizeall_start))return!1;var b,a,e;c.each(["south","north","east","west"],function(b,c){w[c]&&(e=p[c],a=o[c],a.autoResize&&
|
||||
e.size!=a.size?U(c,a.size,!0,!0,!0):(N(c),R(c,!1,!0,!0)))});S("",!0,!0);ea();a=o;c.each(i.allPanes,function(c,e){if((b=w[e])&&p[e].isVisible)C(e,a[e].onresize_end||a[e].onresize),X(e)});C(null,a.onresizeall_end||a.onresizeall)}}else ia()},X=function(b){if(o[b].resizeChildLayout){var a=w[b],c=O[b],e=y[b],f=v[b];e.child&&!f&&(f=e.child.container,f=v[b]=(f?f.data("layout"):0)||null);f&&f.destroyed&&(f=v[b]=null);f||(f=v[b]=a.data("layout")||(c?c.data("layout"):0)||null);e.child=v[b];f&&f.resizeAll()}},
|
||||
aa=function(b,a){A()&&(b=b?b.split(","):i.allPanes,c.each(b,function(b,c){function e(b){return J(k.css.paddingBottom,parseInt(b.css("marginBottom"),10)||0)}function f(){var b=o[c].contentIgnoreSelector,b=j.nextAll().not(b||":lt(0)"),a=b.filter(":visible"),g=a.filter(":last");q={top:j[0].offsetTop,height:j.outerHeight(),numFooters:b.length,hiddenFooters:b.length-a.length,spaceBelow:0};q.spaceAbove=q.top;q.bottom=q.top+q.height;q.spaceBelow=g.length?g[0].offsetTop+g.outerHeight()-q.bottom+e(g):e(j)}
|
||||
var g=w[c],j=O[c],i=o[c],k=p[c],q=k.content;if(!g||!j||!g.is(":visible"))return!0;if(!1!==C(null,i.onsizecontent_start)){if(!k.isMoving&&!k.isResizing||i.liveContentResizing||a||void 0==q.top)f(),0<q.hiddenFooters&&"hidden"===g.css("overflow")&&(g.css("overflow","visible"),f(),g.css("overflow","hidden"));g=k.innerHeight-(q.spaceAbove-k.css.paddingTop)-(q.spaceBelow-k.css.paddingBottom);if(!j.is(":visible")||q.height!=g)Ma(j,g,!0),q.height=g;p.initialized&&(C(c,i.onsizecontent_end||i.onsizecontent),
|
||||
X(c))}}))},ea=function(b){b=b?b.split(","):i.borderPanes;c.each(b,function(b,a){var e=o[a],f=p[a],g=w[a],k=D[a],j=G[a],u;if(g&&k){var q=i[a].dir,t=f.isClosed?"_closed":"_open",v=e["spacing"+t],y=e["togglerAlign"+t],t=e["togglerLength"+t],A;if(0===v)k.hide();else{!f.noRoom&&!f.isHidden&&k.show();"horz"===q?(A=g.outerWidth(),f.resizerLength=A,k.css({width:r(k,A),height:E(k,v),left:c.layout.cssNum(g,"left")})):(A=g.outerHeight(),f.resizerLength=A,k.css({height:E(k,A),width:r(k,v),top:x.insetTop+W("north",
|
||||
!0)}));P(e,k);if(j){if(0===t||f.isSliding&&e.hideTogglerOnSlide){j.hide();return}j.show();if(!(0<t)||"100%"===t||t>A)t=A,y=0;else if(M(y))switch(y){case "top":case "left":y=0;break;case "bottom":case "right":y=A-t;break;default:y=ga((A-t)/2)}else g=parseInt(y,10),y=0<=y?g:A-t+g;if("horz"===q){var C=r(j,t);j.css({width:C,height:E(j,v),left:y,top:0});j.children(".content").each(function(){u=c(this);u.css("marginLeft",ga((C-u.outerWidth())/2))})}else{var I=E(j,t);j.css({height:I,width:r(j,v),top:y,left:0});
|
||||
j.children(".content").each(function(){u=c(this);u.css("marginTop",ga((I-u.outerHeight())/2))})}P(0,j)}if(!p.initialized&&(e.initHidden||f.noRoom))k.hide(),j&&j.hide()}}})},Ja=function(b){if(A()){var a=G[b],c=o[b];a&&(c.closable=!0,a.bind("click."+H,function(a){a.stopPropagation();da(b)}).css("visibility","visible").css("cursor","pointer").attr("title",p[b].isClosed?c.togglerTip_closed:c.togglerTip_open).show())}},xa=function(a,e){c.layout.plugins.buttons&&c.each(p[a].pins,function(f,g){c.layout.buttons.setPinState(y,
|
||||
c(g),a,e)})},t=c(this).eq(0);if(!t.length)return o.showErrorMessages&&V(q.errContainerMissing,!0),null;if(t.data("layoutContainer")&&t.data("layout"))return t.data("layout");var w={},O={},D={},G={},Z=c([]),x=p.container,H=p.id,y={options:o,state:p,container:t,panes:w,contents:O,resizers:D,togglers:G,hide:ta,show:la,toggle:da,open:ba,close:T,slideOpen:La,slideClose:ya,slideToggle:function(a){da(a,!0)},setSizeLimits:N,_sizePane:U,sizePane:ka,sizeContent:aa,swapPanes:function(a,e){function f(a){var b=
|
||||
w[a],e=O[a];return!b?!1:{pane:a,P:b?b[0]:!1,C:e?e[0]:!1,state:c.extend(!0,{},p[a]),options:c.extend(!0,{},o[a])}}function g(a,b){if(a){var e=a.P,f=a.C,h=a.pane,k=i[b],l=k.side.toLowerCase(),q="inset"+k.side,t=c.extend({},p[b]),r=o[b],z={resizerCursor:r.resizerCursor};c.each(["fxName","fxSpeed","fxSettings"],function(a,b){z[b+"_open"]=r[b+"_open"];z[b+"_close"]=r[b+"_close"];z[b+"_size"]=r[b+"_size"]});w[b]=c(e).data("layoutEdge",b).css(i.hidden).css(k.cssReq);O[b]=f?c(f):!1;o[b]=c.extend({},a.options,
|
||||
z);p[b]=c.extend({},a.state);e.className=e.className.replace(RegExp(r.paneClass+"-"+h,"g"),r.paneClass+"-"+b);ra(b);k.dir!=i[h].dir?(e=m[b]||0,N(b),e=J(e,p[b].minSize),ka(b,e,!0,!0)):D[b].css(l,x[q]+(p[b].isVisible?W(b):0));a.state.isVisible&&!t.isVisible?ua(b,!0):(va(b),Y(b,!0));a=null}}if(A()){p[a].edge=e;p[e].edge=a;var h=!1;!1===C(a,o[a].onswap_start)&&(h=!0);!h&&!1===C(e,o[e].onswap_start)&&(h=!0);if(h)p[a].edge=a,p[e].edge=e;else{var h=f(a),k=f(e),m={};m[a]=h?h.state.size:0;m[e]=k?k.state.size:
|
||||
0;w[a]=!1;w[e]=!1;p[a]={};p[e]={};G[a]&&G[a].remove();G[e]&&G[e].remove();D[a]&&D[a].remove();D[e]&&D[e].remove();D[a]=D[e]=G[a]=G[e]=!1;g(h,e);g(k,a);h=k=m=null;w[a]&&w[a].css(i.visible);w[e]&&w[e].css(i.visible);$();C(a,o[a].onswap_end||o[a].onswap);C(e,o[e].onswap_end||o[e].onswap)}}},createChildLayout:qa,destroy:function(a){c(window).unbind("."+H);c(document).unbind("."+H);t.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(o.containerClass);Z.remove();c.each(i.allPanes,
|
||||
function(c,e){sa(e,!1,!0,a)});t.data("layoutCSS")&&!t.data("layoutRole")&&t.css(t.data("layoutCSS")).removeData("layoutCSS");"BODY"===x.tagName&&(t=c("html")).data("layoutCSS")&&t.css(t.data("layoutCSS")).removeData("layoutCSS");ca(y,c.layout.onDestroy);Ea();for(n in y)n.match(/^(container|options)$/)||delete y[n];y.destroyed=!0},addPane:Ha,removePane:sa,initPanes:A,initContent:Ia,resizeAll:$,allowOverflow:f,resetOverflow:g,enableClosable:Ja,disableClosable:function(a,c){if(A()){var e=G[a];e&&(o[a].closable=
|
||||
!1,p[a].isClosed&&ba(a,!1,!0),e.unbind("."+H).css("visibility",c?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable:function(a){if(A()){var c=D[a];c&&c.data("draggable")&&(o[a].slidable=!0,s.isClosed&&Y(a,!0))}},disableSlidable:function(a){if(A()){var c=D[a];c&&(o[a].slidable=!1,p[a].isSliding?T(a,!1,!0):(Y(a,!1),c.css("cursor","default").attr("title",""),P(null,c[0])))}},enableResizable:function(a){if(A()){var c=D[a],e=o[a];c&&c.data("draggable")&&(e.resizable=!0,c.draggable("enable"),
|
||||
p[a].isClosed||c.css("cursor",e.resizerCursor).attr("title",e.resizerTip))}},disableResizable:function(a){if(A()){var c=D[a];c&&c.data("draggable")&&(o[a].resizable=!1,c.draggable("disable").css("cursor","default").attr("title",""),P(null,c[0]))}},trigger:function(a,c){var e=o;(e=c&&e[c]?e[c][a]:e[a])&&C(c||null,e)},hasParentLayout:!1,children:v,north:!1,south:!1,west:!1,east:!1,center:!1};return"cancel"===function(){Pa();var a=o;p.creatingLayout=!0;ca(y,c.layout.onCreate);if(!1===C(null,a.onload_start))return"cancel";
|
||||
var e=t[0],f=x.tagName=e.tagName,g=x.id=e.id,h=x.className=e.className,e=o,k="BODY"===f,i={};x.selector=t.selector.split(".slice")[0];x.ref=(e.name?e.name+" layout / ":"")+f+(g?"#"+g:h?".["+h+"]":"");t.data("layout",y).data("layoutContainer",H).addClass(e.containerClass);t.data("layoutCSS")||(k?(i=c.extend(I(t,"overflow,position,margin,padding,border"),{height:t.css("height"),overflow:t.css("overflow"),overflowX:t.css("overflowX"),overflowY:t.css("overflowY")}),f=c("html"),f.data("layoutCSS",{height:"auto",
|
||||
overflow:f.css("overflow"),overflowX:f.css("overflowX"),overflowY:f.css("overflowY")})):i=I(t,"overflow,position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY"),t.data("layoutCSS",i));try{if(k)c("html").css({height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}),c("body").css({position:"relative",height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden",margin:0,padding:0,border:"none"}),c.extend(x,F(t));else{var i={overflow:"hidden",
|
||||
overflowX:"hidden",overflowY:"hidden"},j=t.css("position");t.css("height");if(!t.data("layoutRole")&&(!j||!j.match(/fixed|absolute|relative/)))i.position="relative";t.css(i);t.is(":visible")&&(c.extend(x,F(t)),e.showErrorMessages&&1>x.innerHeight&&V(q.errContainerHeight.replace(/CONTAINER/,x.ref),!0))}}catch(r){}Fa();c(window).bind("unload."+H,Ea);ca(y,c.layout.onLoad);if(j=t.data("parentLayout"))y.hasParentLayout=!0,f=t.data("layoutEdge"),j[f].child=j.children[f]=y;a.initPanes&&ia();delete p.creatingLayout;
|
||||
return p.initialized}()?null:y};c.ui||(c.ui={});c.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(a){for(var e=document.cookie,e=e?e.split(";"):[],f,g=0,k=e.length;g<k;g++){f=c.trim(e[g]).split("=");if(f[0]==a)return decodeURIComponent(f[1])}return null},write:function(a,c,f){var g="",k="",q=false,f=f||{},i=f.expires;if(i&&i.toUTCString)k=i;else if(i===null||typeof i==="number"){k=new Date;if(i>0)k.setDate(k.getDate()+i);else{k.setFullYear(1970);q=true}}k&&(g=g+(";expires="+k.toUTCString()));
|
||||
f.path&&(g=g+(";path="+f.path));f.domain&&(g=g+(";domain="+f.domain));f.secure&&(g=g+";secure");document.cookie=a+"="+(q?"":encodeURIComponent(c))+g},clear:function(a){c.ui.cookie.write(a,"",{expires:-1})}};c.cookie||(c.cookie=function(a,e,f){var g=c.ui.cookie;if(e===null)g.clear(a);else{if(e===void 0)return g.read(a);g.write(a,e,f)}});c.layout.plugins.stateManagement=!0;c.layout.config.optionRootKeys.push("stateManagement");c.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",
|
||||
cookie:{name:"",domain:"",path:"",expires:"",secure:!1}};c.layout.optionsMap.layout.push("stateManagement");c.layout.state={saveCookie:function(a,e,f){var g=a.options,k=g.stateManagement,f=c.extend(true,{},k.cookie,f||null),a=a.state.stateData=a.readState(e||k.stateKeys);c.ui.cookie.write(f.name||g.name||"Layout",c.layout.state.encodeJSON(a),f);return c.extend(true,{},a)},deleteCookie:function(a){a=a.options;c.ui.cookie.clear(a.stateManagement.cookie.name||a.name||"Layout")},readCookie:function(a){a=
|
||||
a.options;return(a=c.ui.cookie.read(a.stateManagement.cookie.name||a.name||"Layout"))?c.layout.state.decodeJSON(a):{}},loadCookie:function(a){var e=c.layout.state.readCookie(a);if(e){a.state.stateData=c.extend(true,{},e);a.loadState(e)}return e},loadState:function(a,e,f){e=c.layout.transformData(e);if(!c.isEmptyObject(e)){c.extend(true,a.options,e);if(a.state.initialized){var g,k,q,i,r,v=f===false;c.each(c.layout.config.borderPanes,function(c,f){state=a.state[f];k=e[f];if(typeof k=="object"){q=k.size;
|
||||
r=k.initClosed;i=k.initHidden;(g=state.isVisible)||a.sizePane(f,q,false,false);i===true?a.hide(f,v):r===false?a.open(f,false,v):r===true?a.close(f,false,v):i===false&&a.show(f,false,v);g&&a.sizePane(f,q,false,v)}})}}},readState:function(a,e){var f={},g={isClosed:"initClosed",isHidden:"initHidden"},k=a.state,q=c.layout.config.allPanes,i,r,v;if(!e)e=a.options.stateManagement.stateKeys;c.isArray(e)&&(e=e.join(","));for(var e=e.replace(/__/g,".").split(","),F=0,I=e.length;F<I;F++){i=e[F].split(".");r=
|
||||
i[0];i=i[1];if(!(c.inArray(r,q)<0)){v=k[r][i];if(v!=void 0){i=="isClosed"&&k[r].isSliding&&(v=true);(f[r]||(f[r]={}))[g[i]?g[i]:i]=v}}}return f},encodeJSON:function(a){function c(a){var g=[],k=0,q,i,r;for(q in a){i=a[q];r=typeof i;r=="string"?i='"'+i+'"':r=="object"&&(i=c(i));g[k++]='"'+q+'":'+i}return"{"+g.join(",")+"}"}return c(a)},decodeJSON:function(a){try{return c.parseJSON?c.parseJSON(a):window.eval("("+a+")")||{}}catch(e){return{}}},_create:function(a){var e=c.layout.state;c.extend(a,{readCookie:function(){return e.readCookie(a)},
|
||||
deleteCookie:function(){e.deleteCookie(a)},saveCookie:function(c,f){return e.saveCookie(a,c,f)},loadCookie:function(){return e.loadCookie(a)},loadState:function(c,f){e.loadState(a,c,f)},readState:function(c){return e.readState(a,c)},encodeJSON:e.encodeJSON,decodeJSON:e.decodeJSON});a.state.stateData={};var f=a.options.stateManagement;if(f.enabled)f.autoLoad?a.loadCookie():a.state.stateData=a.readCookie()},_unload:function(a){var c=a.options.stateManagement;if(c.enabled)c.autoSave?a.saveCookie():a.state.stateData=
|
||||
a.readState()}};c.layout.onCreate.push(c.layout.state._create);c.layout.onUnload.push(c.layout.state._unload);c.layout.plugins.buttons=!0;c.layout.defaults.autoBindCustomButtons=!1;c.layout.optionsMap.layout.push("autoBindCustomButtons");v=c.layout.language;c.layout.buttons={init:function(a){var e=a.options.name||"",f;c.each(["toggle","open","close","pin","toggle-slide","open-slide"],function(g,k){c.each(c.layout.config.borderPanes,function(g,i){c(".ui-layout-button-"+k+"-"+i).each(function(){f=c(this).data("layoutName")||
|
||||
c(this).attr("layoutName");(f==void 0||f===e)&&a.bindButton(this,k,i)})})})},get:function(a,e,f,g){var k=c(e),a=a.options,q=a.showErrorMessages;if(k.length)if(c.inArray(f,c.layout.config.borderPanes)<0){q&&c.layout.msg(v.errButton+v.pane+": "+f,true);k=c("")}else{e=a[f].buttonClass+"-"+g;k.addClass(e+" "+e+"-"+f).data("layoutName",a.name)}else q&&c.layout.msg(v.errButton+v.selector+": "+e,true);return k},bind:function(a,e,f,g){var k=c.layout.buttons;switch(f.toLowerCase()){case "toggle":k.addToggle(a,
|
||||
e,g);break;case "open":k.addOpen(a,e,g);break;case "close":k.addClose(a,e,g);break;case "pin":k.addPin(a,e,g);break;case "toggle-slide":k.addToggle(a,e,g,true);break;case "open-slide":k.addOpen(a,e,g,true)}return a},addToggle:function(a,e,f,g){c.layout.buttons.get(a,e,f,"toggle").click(function(c){a.toggle(f,!!g);c.stopPropagation()});return a},addOpen:function(a,e,f,g){c.layout.buttons.get(a,e,f,"open").attr("title",v.Open).click(function(c){a.open(f,!!g);c.stopPropagation()});return a},addClose:function(a,
|
||||
e,f){c.layout.buttons.get(a,e,f,"close").attr("title",v.Close).click(function(c){a.close(f);c.stopPropagation()});return a},addPin:function(a,e,f){var g=c.layout.buttons,k=g.get(a,e,f,"pin");if(k.length){var q=a.state[f];k.click(function(e){g.setPinState(a,c(this),f,q.isSliding||q.isClosed);q.isSliding||q.isClosed?a.open(f):a.close(f);e.stopPropagation()});g.setPinState(a,k,f,!q.isClosed&&!q.isSliding);q.pins.push(e)}return a},setPinState:function(a,c,f,g){var k=c.attr("pin");if(!(k&&g===(k=="down"))){a=
|
||||
a.options[f].buttonClass+"-pin";k=a+"-"+f;f=a+"-up "+k+"-up";a=a+"-down "+k+"-down";c.attr("pin",g?"down":"up").attr("title",g?v.Unpin:v.Pin).removeClass(g?f:a).addClass(g?a:f)}},syncPinBtns:function(a,e,f){c.each(state[e].pins,function(g,k){c.layout.buttons.setPinState(a,c(k),e,f)})},_load:function(a){var e=c.layout.buttons;c.extend(a,{bindButton:function(c,f,q){return e.bind(a,c,f,q)},addToggleBtn:function(c,f,q){return e.addToggle(a,c,f,q)},addOpenBtn:function(c,f,q){return e.addOpen(a,c,f,q)},
|
||||
addCloseBtn:function(c,f){return e.addClose(a,c,f)},addPinBtn:function(c,f){return e.addPin(a,c,f)}});for(var f=0;f<4;f++)a.state[c.layout.config.borderPanes[f]].pins=[];a.options.autoBindCustomButtons&&e.init(a)},_unload:function(){}};c.layout.onLoad.push(c.layout.buttons._load);c.layout.plugins.browserZoom=!0;c.layout.defaults.browserZoomCheckInterval=1E3;c.layout.optionsMap.layout.push("browserZoomCheckInterval");c.layout.browserZoom={_init:function(a){c.layout.browserZoom._setTimer(a)},_setTimer:function(a){if(!a.destroyed){var e=
|
||||
a.options,f=a.state,g=f.browserZoom=c.layout.browserZoom.ratio();e.resizeWithWindow&&g!==false&&setTimeout(function(){if(!a.destroyed){var e=c.layout.browserZoom.ratio();if(e!==f.browserZoom){f.browserZoom=e;a.resizeAll()}c.layout.browserZoom._setTimer(a)}},Math.max(e.browserZoomCheckInterval,100))}},ratio:function(){function a(a,c){return(parseInt(a,10)/parseInt(c,10)*100).toFixed()}var e=window,f=screen,g=document,k=g.documentElement||g.body,q=c.layout.browser,i=q.version,r,v,F;return q.msie&&i>
|
||||
8||!q.msie?false:f.deviceXDPI?a(f.deviceXDPI,f.systemXDPI):q.webkit&&(r=g.body.getBoundingClientRect)?a(r.left-r.right,g.body.offsetWidth):q.webkit&&(v=e.outerWidth)?a(v,e.innerWidth):(v=f.width)&&(F=k.clientWidth)?a(v,F):false}};c.layout.onReady.push(c.layout.browserZoom._init)})(jQuery);
|
||||
/*
|
||||
jquery.layout 1.3.0 - Release Candidate 30.79
|
||||
$Date: 2013-01-01 08:00:00 (Tue, 1 Jan 2013) $
|
||||
$Rev: 303007 $
|
||||
|
||||
Copyright (c) 2013 Kevin Dalman (http://allpro.net)
|
||||
Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
|
||||
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
|
||||
SEE: http://layout.jquery-dev.net/LICENSE.txt
|
||||
|
||||
Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79
|
||||
|
||||
Docs: http://layout.jquery-dev.net/documentation.html
|
||||
Tips: http://layout.jquery-dev.net/tips.html
|
||||
Help: http://groups.google.com/group/jquery-ui-layout
|
||||
*/
|
||||
(function(b){var a=Math.min,d=Math.max,c=Math.floor,f=function(a){return"string"===b.type(a)},j=function(a,d){if(b.isArray(d))for(var c=0,j=d.length;c<j;c++){var h=d[c];try{f(h)&&(h=eval(h)),b.isFunction(h)&&h(a)}catch(k){}}};b.layout={version:"1.3.rc30.79",revision:0.033007,browser:{},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},
|
||||
west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},config:{optionRootKeys:"effects panes north south west east center".split(" "),allPanes:["north","south","west","east","center"],borderPanes:["north","south","west","east"],oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},offscreenCSS:{left:"-99999px",right:"auto"},offscreenReset:"offscreenReset",hidden:{visibility:"hidden"},visible:{visibility:"visible"},
|
||||
resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",
|
||||
background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},
|
||||
center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},getParentPaneElem:function(a){a=b(a);if(a=a.data("layout")||a.data("parentLayout")){a=a.container;if(a.data("layoutPane"))return a;a=a.closest("."+b.layout.defaults.panes.paneClass);if(a.data("layoutPane"))return a}return null},getParentPaneInstance:function(a){return(a=b.layout.getParentPaneElem(a))?a.data("layoutPane"):null},getParentLayoutInstance:function(a){return(a=b.layout.getParentPaneElem(a))?
|
||||
a.data("parentLayout"):null},getEventObject:function(b){return"object"===typeof b&&b.stopPropagation?b:null},parsePaneName:function(a){var d=b.layout.getEventObject(a);d&&(d.stopPropagation(),a=b(this).data("layoutEdge"));a&&!/^(west|east|north|south|center)$/.test(a)&&(b.layout.msg('LAYOUT ERROR - Invalid pane-name: "'+a+'"'),a="error");return a},plugins:{draggable:!!b.fn.draggable,effects:{core:!!b.effects,slide:b.effects&&(b.effects.slide||b.effects.effect&&b.effects.effect.slide)}},onCreate:[],
|
||||
onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||b.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||b.layout.getScrollbarSize("height")},getScrollbarSize:function(a){var d=b('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"),c={width:d.css("width")-d[0].clientWidth,height:d.height()-d[0].clientHeight};
|
||||
d.remove();window.scrollbarWidth=c.width;window.scrollbarHeight=c.height;return a.match(/^(width|height)$/)?c[a]:c},showInvisibly:function(b,a){if(b&&b.length&&(a||"none"===b.css("display"))){var d=b[0].style,d={display:d.display||"",visibility:d.visibility||""};b.css({display:"block",visibility:"hidden"});return d}return{}},getElementDimensions:function(a,c){var f={css:{},inset:{}},j=f.css,h={bottom:0},k=b.layout.cssNum,p=a.offset(),O,R,D;f.offsetLeft=p.left;f.offsetTop=p.top;c||(c={});b.each(["Left",
|
||||
"Right","Top","Bottom"],function(d,k){O=j["border"+k]=b.layout.borderWidth(a,k);R=j["padding"+k]=b.layout.cssNum(a,"padding"+k);D=k.toLowerCase();f.inset[D]=0<=c[D]?c[D]:R;h[D]=f.inset[D]+O});j.width=a.width();j.height=a.height();j.top=k(a,"top",!0);j.bottom=k(a,"bottom",!0);j.left=k(a,"left",!0);j.right=k(a,"right",!0);f.outerWidth=a.outerWidth();f.outerHeight=a.outerHeight();f.innerWidth=d(0,f.outerWidth-h.left-h.right);f.innerHeight=d(0,f.outerHeight-h.top-h.bottom);f.layoutWidth=a.innerWidth();
|
||||
f.layoutHeight=a.innerHeight();return f},getElementStyles:function(b,a){var d={},c=b[0].style,f=a.split(","),k=["Top","Bottom","Left","Right"],j=["Color","Style","Width"],h,p,D,x,A,r;for(x=0;x<f.length;x++)if(h=f[x],h.match(/(border|padding|margin)$/))for(A=0;4>A;A++)if(p=k[A],"border"===h)for(r=0;3>r;r++)D=j[r],d[h+p+D]=c[h+p+D];else d[h+p]=c[h+p];else d[h]=c[h];return d},cssWidth:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):
|
||||
"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Left")+j(a,"Right"));"content-box"===f&&(k-=h(a,"paddingLeft")+h(a,"paddingRight"));return d(0,k)},cssHeight:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Top")+j(a,"Bottom"));"content-box"===f&&(k-=h(a,"paddingTop")+h(a,"paddingBottom"));return d(0,k)},cssNum:function(a,
|
||||
d,c){a.jquery||(a=b(a));var f=b.layout.showInvisibly(a);d=b.css(a[0],d,!0);c=c&&"auto"==d?d:Math.round(parseFloat(d)||0);a.css(f);return c},borderWidth:function(a,d){a.jquery&&(a=a[0]);var c="border"+d.substr(0,1).toUpperCase()+d.substr(1);return"none"===b.css(a,c+"Style",!0)?0:Math.round(parseFloat(b.css(a,c+"Width",!0))||0)},isMouseOverElem:function(a,d){var c=b(d||this),f=c.offset(),j=f.top,f=f.left,k=f+c.outerWidth(),c=j+c.outerHeight(),h=a.pageX,p=a.pageY;return b.layout.browser.msie&&0>h&&0>
|
||||
p||h>=f&&h<=k&&p>=j&&p<=c},msg:function(a,d,c,f){b.isPlainObject(a)&&window.debugData?("string"===typeof d?(f=c,c=d):"object"===typeof c&&(f=c,c=null),c=c||"log( <object> )",f=b.extend({sort:!1,returnHTML:!1,display:!1},f),!0===d||f.display?debugData(a,c,f):window.console&&console.log(debugData(a,c,f))):d?alert(a):window.console?console.log(a):(d=b("#layoutLogger"),d.length||(d=b('<div id="layoutLogger" style="position: '+(b.support.fixedPosition?"fixed":"absolute")+'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);"><div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;"><span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div><ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul></div>').appendTo("body"),
|
||||
d.css("left",b(window).width()-d.outerWidth()-5),b.ui.draggable&&d.draggable({handle:":first-child"})),d.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+a.replace(/\</g,"<").replace(/\>/g,">")+"</li>"))}};var h=navigator.userAgent.toLowerCase(),p=/(chrome)[ \/]([\w.]+)/.exec(h)||/(webkit)[ \/]([\w.]+)/.exec(h)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(h)||/(msie) ([\w.]+)/.exec(h)||0>h.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(h)||
|
||||
[],h=p[1]||"",p=p[2]||0,x="msie"===h;b.layout.browser={version:p,safari:"webkit"===h,webkit:"chrome"===h,msie:x,isIE6:x&&6==p,boxModel:!x||!1!==b.support.boxModel};h&&(b.layout.browser[h]=!0);x&&b(function(){b.layout.browser.boxModel=b.support.boxModel});b.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,
|
||||
onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",
|
||||
noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",
|
||||
buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",
|
||||
slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:b.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},
|
||||
fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",
|
||||
size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};b.layout.optionsMap={layout:"name instanceKey stateManagement effects inset zIndexes errors zIndex scrollToBookmarkOnLoad showErrorMessages maskPanesEarly outset resizeWithWindow resizeWithWindowDelay resizeWithWindowMaxDelay onresizeall onresizeall_start onresizeall_end onload onload_start onload_end onunload onunload_start onunload_end".split(" "),
|
||||
center:"paneClass contentSelector contentIgnoreSelector findNestedContent applyDemoStyles triggerEventsOnLoad showOverflowOnHover maskContents maskObjects liveContentResizing containerSelector children initChildren resizeChildren destroyChildren onresize onresize_start onresize_end onsizecontent onsizecontent_start onsizecontent_end".split(" "),noDefault:["paneSelector","resizerCursor","customHotkey"]};b.layout.transformData=function(a,d){var c=d?{panes:{},center:{}}:{},f,j,k,h,p,x,D;if("object"!==
|
||||
typeof a)return c;for(j in a){f=c;p=a[j];k=j.split("__");D=k.length-1;for(x=0;x<=D;x++)h=k[x],x===D?f[h]=b.isPlainObject(p)?b.layout.transformData(p):p:(f[h]||(f[h]={}),f=f[h])}return c};b.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",
|
||||
triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",
|
||||
noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(a){function d(b,c){for(var f=b.split("."),k=f.length-1,j={branch:a,key:f[k]},r=0,q;r<k;r++)q=f[r],j.branch=void 0==j.branch[q]?c?j.branch[q]={}:{}:j.branch[q];return j}var c=b.layout.backwardCompatibility.map,f,j,k,h;for(h in c)f=d(h),k=f.branch[f.key],void 0!==k&&(j=d(c[h],!0),j.branch[j.key]=k,delete f.branch[f.key])},renameAllOptions:function(a){var d=
|
||||
b.layout.backwardCompatibility.renameOptions;d(a);a.defaults&&("object"!==typeof a.panes&&(a.panes={}),b.extend(!0,a.panes,a.defaults),delete a.defaults);a.panes&&d(a.panes);b.each(b.layout.config.allPanes,function(b,c){a[c]&&d(a[c])});return a}};b.fn.layout=function(h){function p(e){if(!e)return!0;var w=e.keyCode;if(33>w)return!0;var m={38:"north",40:"south",37:"west",39:"east"},a=e.shiftKey,g=e.ctrlKey,t,n,d,c;g&&(37<=w&&40>=w)&&r[m[w]].enableCursorHotkey?c=m[w]:(g||a)&&b.each(k.borderPanes,function(e,
|
||||
b){t=r[b];n=t.customHotkey;d=t.customHotkeyModifier;if(a&&"SHIFT"==d||g&&"CTRL"==d||g&&a)if(n&&w===(isNaN(n)||9>=n?n.toUpperCase().charCodeAt(0):n))return c=b,!1});if(!c||!y[c]||!r[c].closable||q[c].isHidden)return!0;na(c);e.stopPropagation();return e.returnValue=!1}function x(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){var m=w.data("layoutEdge");e=q[m];e.cssSaved&&
|
||||
X(m);if(e.isSliding||e.isResizing||e.isClosed)e.cssSaved=!1;else{var a={zIndex:r.zIndexes.resizer_normal+1},g={},t=w.css("overflow"),n=w.css("overflowX"),d=w.css("overflowY");"visible"!=t&&(g.overflow=t,a.overflow="visible");n&&!n.match(/(visible|auto)/)&&(g.overflowX=n,a.overflowX="visible");d&&!d.match(/(visible|auto)/)&&(g.overflowY=n,a.overflowY="visible");e.cssSaved=g;w.css(a);b.each(k.allPanes,function(e,b){b!=m&&X(b)})}}}}function X(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:
|
||||
b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){e=w.data("layoutEdge");e=q[e];var m=e.cssSaved||{};!e.isSliding&&!e.isResizing&&w.css("zIndex",r.zIndexes.pane_normal);w.css(m);e.cssSaved=!1}}}var G=b.layout.browser,k=b.layout.config,Q=b.layout.cssWidth,O=b.layout.cssHeight,R=b.layout.getElementDimensions,D=b.layout.getElementStyles,Ma=b.layout.getEventObject,A=b.layout.parsePaneName,r=b.extend(!0,{},b.layout.defaults);
|
||||
r.effects=b.extend(!0,{},b.layout.effects);var q={id:"layout"+b.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},ba={north:null,south:null,east:null,west:null,center:null},M={data:{},set:function(e,b,m){M.clear(e);M.data[e]=setTimeout(b,m)},clear:function(e){var b=M.data;b[e]&&(clearTimeout(b[e]),delete b[e])}},
|
||||
ca=function(e,w,m){var a=r;(a.showErrorMessages&&!m||m&&a.showDebugMessages)&&b.layout.msg(a.name+" / "+e,!1!==w);return!1},C=function(e,w,m){var a=w&&f(w),g=a?q[w]:q,t=a?r[w]:r,n=r.name,d=e+(e.match(/_/)?"":"_end"),c=d.match(/_end$/)?d.substr(0,d.length-4):"",l=t[d]||t[c],h="NC",k=[];!a&&"boolean"===b.type(w)&&(m=w,w="");if(l)try{f(l)&&(l.match(/,/)?(k=l.split(","),l=eval(k[0])):l=eval(l)),b.isFunction(l)&&(h=k.length?l(k[1]):a?l(w,y[w],g,t,n):l(z,g,t,n))}catch(j){ca(r.errors.callbackError.replace(/EVENT/,
|
||||
b.trim((w||"")+" "+d)),!1),"string"===b.type(j)&&string.length&&ca("Exception: "+j,!1)}!m&&!1!==h&&(a?(m=y[w],t=r[w],g=q[w],m.triggerHandler("layoutpane"+d,[w,m,g,t,n]),c&&m.triggerHandler("layoutpane"+c,[w,m,g,t,n])):(u.triggerHandler("layout"+d,[z,g,t,n]),c&&u.triggerHandler("layout"+c,[z,g,t,n])));a&&"onresize_end"===e&&db(w+"",!0);return h},eb=function(e){if(!G.mozilla){var b=y[e];"IFRAME"===q[e].tagName?b.css(k.hidden).css(k.visible):b.find("IFRAME").css(k.hidden).css(k.visible)}},ya=function(e){var b=
|
||||
y[e];e=k[e].dir;b={minWidth:1001-Q(b,1E3),minHeight:1001-O(b,1E3)};"horz"===e&&(b.minSize=b.minHeight);"vert"===e&&(b.minSize=b.minWidth);return b},fa=function(e,w,m){m||(m=k[e].dir);f(w)&&w.match(/%/)&&(w="100%"===w?-1:parseInt(w,10)/100);if(0===w)return 0;if(1<=w)return parseInt(w,10);var a=r,g=0;"horz"==m?g=v.innerHeight-(y.north?a.north.spacing_open:0)-(y.south?a.south.spacing_open:0):"vert"==m&&(g=v.innerWidth-(y.west?a.west.spacing_open:0)-(y.east?a.east.spacing_open:0));if(-1===w)return g;
|
||||
if(0<w)return c(g*w);if("center"==e)return 0;m="horz"===m?"height":"width";a=y[e];e="height"===m?U[e]:!1;var g=b.layout.showInvisibly(a),t=a.css(m),n=e?e.css(m):0;a.css(m,"auto");e&&e.css(m,"auto");w="height"===m?a.outerHeight():a.outerWidth();a.css(m,t).css(g);e&&e.css(m,n);return w},ga=function(e,b){var a=y[e],E=r[e],g=q[e],t=b?E.spacing_open:0,E=b?E.spacing_closed:0;return!a||g.isHidden?0:g.isClosed||g.isSliding&&b?E:"horz"===k[e].dir?a.outerHeight()+t:a.outerWidth()+t},Y=function(e,b){if(H()){var m=
|
||||
r[e],E=q[e],g=k[e],t=g.dir;g.sizeType.toLowerCase();var g=void 0!=b?b:E.isSliding,n=m.spacing_open,c=k.oppositeEdge[e],f=q[c],l=y[c],h=!l||!1===f.isVisible||f.isSliding?0:"horz"==t?l.outerHeight():l.outerWidth(),c=(!l||f.isHidden?0:r[c][!1!==f.isClosed?"spacing_closed":"spacing_open"])||0,f="horz"==t?v.innerHeight:v.innerWidth,l=ya("center"),l="horz"==t?d(r.center.minHeight,l.minHeight):d(r.center.minWidth,l.minWidth),g=f-n-(g?0:fa("center",l,t)+h+c),t=E.minSize=d(fa(e,m.minSize),ya(e).minSize),g=
|
||||
E.maxSize=a(m.maxSize?fa(e,m.maxSize):1E5,g),E=E.resizerPosition={},n=v.inset.top,h=v.inset.left,c=v.innerWidth,f=v.innerHeight,m=m.spacing_open;switch(e){case "north":E.min=n+t;E.max=n+g;break;case "west":E.min=h+t;E.max=h+g;break;case "south":E.min=n+f-g-m;E.max=n+f-t-m;break;case "east":E.min=h+c-g-m,E.max=h+c-t-m}}},Na=function(e,a){var m=b(e),E=m.data("layoutRole"),g=m.data("layoutEdge"),t=r[g][E+"Class"],g="-"+g,n=m.hasClass(t+"-closed")?"-closed":"-open",d="-closed"===n?"-open":"-closed",n=
|
||||
t+"-hover "+(t+g+"-hover ")+(t+n+"-hover ")+(t+g+n+"-hover ");a&&(n+=t+d+"-hover "+(t+g+d+"-hover "));"resizer"==E&&m.hasClass(t+"-sliding")&&(n+=t+"-sliding-hover "+(t+g+"-sliding-hover "));return b.trim(n)},Oa=function(e,a){var m=b(a||this);e&&"toggler"===m.data("layoutRole")&&e.stopPropagation();m.addClass(Na(m))},da=function(e,a){var m=b(a||this);m.removeClass(Na(m,!0))},fb=function(){var e=b(this).data("layoutEdge"),a=q[e];!a.isClosed&&(!a.isResizing&&!q.paneResizing)&&(b.fn.disableSelection&&
|
||||
b("body").disableSelection(),r.maskPanesEarly&&va(e,{resizing:!0}))},gb=function(e,a){var m=a||this,E=b(m).data("layoutEdge"),g=E+"ResizerLeave";M.clear(E+"_openSlider");M.clear(g);a?q.paneResizing||(b.fn.enableSelection&&b("body").enableSelection(),r.maskPanesEarly&&za()):M.set(g,function(){gb(e,m)},200)},H=function(){return q.initialized||q.creatingLayout?!0:Aa()},Aa=function(e){var a=r;if(!u.is(":visible"))return!e&&(G.webkit&&"BODY"===u[0].tagName)&&setTimeout(function(){Aa(!0)},50),!1;if(!hb("center").length)return ca(a.errors.centerPaneMissing);
|
||||
q.creatingLayout=!0;b.extend(v,R(u,a.inset));A(void 0);b.each(k.allPanes,function(e,b){ib(b,!0)});Pa();b.each(k.borderPanes,function(e,b){y[b]&&q[b].isVisible&&(Y(b),ha(b))});ia("center");b.each(k.allPanes,function(e,b){jb(b)});a.scrollToBookmarkOnLoad&&(e=self.location,e.hash&&e.replace(e.hash));z.hasParentLayout?a.resizeWithWindow=!1:a.resizeWithWindow&&b(window).bind("resize."+K,Ab);delete q.creatingLayout;q.initialized=!0;j(z,b.layout.onReady);C("onload_end");return!0},Qa=function(e,a){var m=
|
||||
A.call(this,e),d=y[m];if(d){var g=U[m],t=q[m],n=r[m],c=r.stateManagement||{},n=a?n.children=a:n.children;if(b.isPlainObject(n))n=[n];else if(!n||!b.isArray(n))return;b.each(n,function(e,a){b.isPlainObject(a)&&(a.containerSelector?d.find(a.containerSelector):g||d).each(function(){var e=b(this),g=e.data("layout");if(!g){kb({container:e,options:a},t);if(c.includeChildren&&q.stateData[m]){var g=(q.stateData[m].children||{})[a.instanceKey],w=a.stateManagement||(a.stateManagement={autoLoad:!0});!0===w.autoLoad&&
|
||||
g&&(w.autoSave=!1,w.includeChildren=!0,w.autoLoad=b.extend(!0,{},g))}(g=e.layout(a))&&Ba(m,g)}})})}},kb=function(e,b){var a=e.container,d=e.options,g=d.stateManagement,t=d.instanceKey||a.data("layoutInstanceKey");t||(t=(g&&g.cookie?g.cookie.name:"")||d.name);t=t?t.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++b.childIdx;d.instanceKey=t;a.data("layoutInstanceKey",t);return t},Ba=function(e,a){var m=y[e],d=ba[e],g=q[e];b.isPlainObject(d)&&(b.each(d,function(e,b){b.destroyed&&delete d[e]}),
|
||||
b.isEmptyObject(d)&&(d=ba[e]=null));!a&&!d&&(a=m.data("layout"));a&&(a.hasParentLayout=!0,m=a.options,kb(a,g),d||(d=ba[e]={}),d[m.instanceKey]=a.container.data("layout"));z[e].children=ba[e];a||Qa(e)},Ab=function(){var e=r,b=Number(e.resizeWithWindowDelay);10>b&&(b=100);M.clear("winResize");M.set("winResize",function(){M.clear("winResize");M.clear("winResizeRepeater");var b=R(u,e.inset);(b.innerWidth!==v.innerWidth||b.innerHeight!==v.innerHeight)&&oa()},b);M.data.winResizeRepeater||lb()},lb=function(){var e=
|
||||
Number(r.resizeWithWindowMaxDelay);0<e&&M.set("winResizeRepeater",function(){lb();oa()},e)},mb=function(){C("onunload_start");j(z,b.layout.onUnload);C("onunload_end")},nb=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=r[a];if(d.enableCursorHotkey||d.customHotkey)return b(document).bind("keydown."+K,p),!1})},hb=function(e){e=r[e].paneSelector;if("#"===e.substr(0,1))return u.find(e).eq(0);var b=u.children(e).eq(0);return b.length?b:u.children("form:first").children(e).eq(0)},
|
||||
ib=function(e,b){if(b||H()){var m=r[e],c=q[e],g=k[e],t=g.dir,n="center"===e,f={},h=y[e],l,j;h?Ra(e,!1,!0,!1):U[e]=!1;h=y[e]=hb(e);if(h.length){h.data("layoutCSS")||h.data("layoutCSS",D(h,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));z[e]={name:e,pane:y[e],content:U[e],options:r[e],state:q[e],children:ba[e]};h.data({parentLayout:z,layoutPane:z[e],layoutEdge:e,layoutRole:"pane"}).css(g.cssReq).css("zIndex",r.zIndexes.pane_normal).css(m.applyDemoStyles?
|
||||
g.cssDemo:{}).addClass(m.paneClass+" "+m.paneClass+"-"+e).bind("mouseenter."+K,Oa).bind("mouseleave."+K,da);g={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",
|
||||
resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(j in g)h.bind("layoutpane"+j.toLowerCase()+"."+K,z[g[j]||j]);Sa(e,!1);n||(l=c.size=fa(e,m.size),n=fa(e,m.minSize)||1,j=fa(e,m.maxSize)||1E5,0<l&&(l=d(a(l,j),n)),c.autoResize=m.autoResize,c.isClosed=!1,c.isSliding=!1,c.isResizing=!1,c.isHidden=!1,c.pins||(c.pins=[]));c.tagName=h[0].tagName;c.edge=e;c.noRoom=!1;c.isVisible=!0;ob(e);"horz"===t?f.height=O(h,l):"vert"===t&&(f.width=Q(h,l));h.css(f);"horz"!=t&&ia(e,!0);q.initialized&&(Pa(e),nb(e));m.initClosed&&
|
||||
m.closable&&!m.initHidden?ja(e,!0,!0):m.initHidden||m.initClosed?Ta(e):c.noRoom||h.css("display","block");h.css("visibility","visible");m.showOverflowOnHover&&h.hover(x,X);q.initialized&&jb(e)}else y[e]=!1}},jb=function(e){var b=y[e],a=q[e],d=r[e];b&&(b.data("layout")&&Ba(e,b.data("layout")),a.isVisible&&(q.initialized?oa():pa(e),d.triggerEventsOnLoad?C("onresize_end",e):db(e,!0)),d.initChildren&&d.children&&Qa(e))},ob=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,b){var a=y[b],g=
|
||||
F[b],d=q[b],c=k[b].side,f={};if(a){switch(b){case "north":f.top=v.inset.top;f.left=v.inset.left;f.right=v.inset.right;break;case "south":f.bottom=v.inset.bottom;f.left=v.inset.left;f.right=v.inset.right;break;case "west":f.left=v.inset.left;break;case "east":f.right=v.inset.right}a.css(f);g&&d.isClosed?g.css(c,v.inset[c]):g&&!d.isHidden&&g.css(c,v.inset[c]+ga(b))}})},Pa=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=y[a];F[a]=!1;P[a]=!1;if(d){var g=r[a],d=q[a],c="#"===g.paneSelector.substr(0,
|
||||
1)?g.paneSelector.substr(1):"",n=g.resizerClass,f=g.togglerClass,h="-"+a,l=z[a],j=l.resizer=F[a]=b("<div></div>"),l=l.toggler=g.closable?P[a]=b("<div></div>"):!1;!d.isVisible&&g.slidable&&j.attr("title",g.tips.Slide).css("cursor",g.sliderCursor);j.attr("id",c?c+"-resizer":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"resizer"}).css(k.resizers.cssReq).css("zIndex",r.zIndexes.resizer_normal).css(g.applyDemoStyles?k.resizers.cssDemo:{}).addClass(n+" "+n+h).hover(Oa,da).hover(fb,gb).appendTo(u);
|
||||
g.resizerDblClickToggle&&j.bind("dblclick."+K,na);l&&(l.attr("id",c?c+"-toggler":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"toggler"}).css(k.togglers.cssReq).css(g.applyDemoStyles?k.togglers.cssDemo:{}).addClass(f+" "+f+h).hover(Oa,da).bind("mouseenter",fb).appendTo(j),g.togglerContent_open&&b("<span>"+g.togglerContent_open+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display",
|
||||
"none").appendTo(l),g.togglerContent_closed&&b("<span>"+g.togglerContent_closed+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(l),pb(a));var g=a,B=b.layout.plugins.draggable,g=g?g.split(","):k.borderPanes;b.each(g,function(e,a){var g=r[a];if(!B||!y[a]||!g.resizable)return g.resizable=!1,!0;var m=q[a],w=r.zIndexes,d=k[a],c="horz"==d.dir?"top":"left",t=F[a],n=g.resizerClass,f=0,l,h,E=n+"-drag",j=n+"-"+a+"-drag",J=n+"-dragging",
|
||||
zb=n+"-"+a+"-dragging",cb=n+"-dragging-limit",v=n+"-"+a+"-dragging-limit",x=!1;m.isClosed||t.attr("title",g.tips.Resize).css("cursor",g.resizerCursor);t.draggable({containment:u[0],axis:"horz"==d.dir?"y":"x",delay:0,distance:1,grid:g.resizingGrid,helper:"clone",opacity:g.resizerDragOpacity,addClasses:!1,zIndex:w.resizer_drag,start:function(e,w){g=r[a];m=q[a];h=g.livePaneResizing;if(!1===C("ondrag_start",a))return!1;m.isResizing=!0;q.paneResizing=a;M.clear(a+"_closeSlider");Y(a);l=m.resizerPosition;
|
||||
f=w.position[c];t.addClass(E+" "+j);x=!1;b("body").disableSelection();va(a,{resizing:!0})},drag:function(e,b){x||(b.helper.addClass(J+" "+zb).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),x=!0,m.isSliding&&y[a].css("zIndex",w.pane_sliding));var d=0;b.position[c]<l.min?(b.position[c]=l.min,d=-1):b.position[c]>l.max&&(b.position[c]=l.max,d=1);d?(b.helper.addClass(cb+" "+v),window.defaultStatus=0<d&&a.match(/(north|west)/)||0>d&&a.match(/(south|east)/)?g.tips.maxSizeWarning:
|
||||
g.tips.minSizeWarning):(b.helper.removeClass(cb+" "+v),window.defaultStatus="");h&&Math.abs(b.position[c]-f)>=g.liveResizingTolerance&&(f=b.position[c],p(e,b,a))},stop:function(e,g){b("body").enableSelection();window.defaultStatus="";t.removeClass(E+" "+j);m.isResizing=!1;q.paneResizing=!1;p(e,g,a,!0)}})});var p=function(b,e,a,g){var m=e.position,w=k[a];b=r[a];e=q[a];var d;switch(a){case "north":d=m.top;break;case "west":d=m.left;break;case "south":d=v.layoutHeight-m.top-b.spacing_open;break;case "east":d=
|
||||
v.layoutWidth-m.left-b.spacing_open}d-=v.inset[w.side];g?(!1!==C("ondrag_end",a)&&Ca(a,d,!1,!0),za(!0),e.isSliding&&va(a,{resizing:!0})):Math.abs(d-e.size)<b.liveResizingTolerance||(Ca(a,d,!1,!0),ea.each(qb))};d.isVisible?Ua(a):(Da(a),ma(a,!0))}});qa()},Sa=function(b,a){if(H()){var m=r[b],d=m.contentSelector,g=z[b],c=y[b],n;d&&(n=g.content=U[b]=m.findNestedContent?c.find(d).eq(0):c.children(d).eq(0));n&&n.length?(n.data("layoutRole","content"),n.data("layoutCSS")||n.data("layoutCSS",D(n,"height")),
|
||||
n.css(k.content.cssReq),m.applyDemoStyles&&(n.css(k.content.cssDemo),c.css(k.content.cssDemoPane)),c.css("overflowX").match(/(scroll|auto)/)&&c.css("overflow","hidden"),q[b].content={},!1!==a&&pa(b)):g.content=U[b]=!1}},qb=function(){var e=b(this),a=e.data("layoutMask"),a=q[a];"IFRAME"==a.tagName&&a.isVisible&&e.css({top:a.offsetTop,left:a.offsetLeft,width:a.outerWidth,height:a.outerHeight})},va=function(e,a){var m=k[e],d=["center"],g=r.zIndexes,c=b.extend({objectsOnly:!1,animation:!1,resizing:!0,
|
||||
sliding:q[e].isSliding},a),n,f;c.resizing&&d.push(e);c.sliding&&d.push(k.oppositeEdge[e]);"horz"===m.dir&&(d.push("west"),d.push("east"));b.each(d,function(e,a){f=q[a];n=r[a];if(f.isVisible&&(n.maskObjects||!c.objectsOnly&&n.maskContents)){for(var m=b([]),d,w=0,h=ea.length;w<h;w++)d=ea.eq(w),d.data("layoutMask")===a&&(m=m.add(d));if(!m.length){m=y[a];d=q[a];var w=r[a],h=r.zIndexes,j=b([]),E,k,v,p,x;if(w.maskContents||w.maskObjects)for(x=0;x<(w.maskObjects?2:1);x++)E=w.maskObjects&&0==x,k=document.createElement(E?
|
||||
"iframe":"div"),v=b(k).data("layoutMask",a),k.className="ui-layout-mask ui-layout-mask-"+a,p=k.style,p.display="block",p.position="absolute",p.background="#FFF",E&&(k.frameborder=0,k.src="about:blank",p.opacity=0,p.filter="Alpha(Opacity='0')",p.border=0),"IFRAME"==d.tagName?(p.zIndex=h.pane_normal+1,u.append(k)):(v.addClass("ui-layout-mask-inside-pane"),p.zIndex=w.maskZindex||h.content_mask,p.top=0,p.left=0,p.width="100%",p.height="100%",m.append(k)),j=j.add(k),ea=ea.add(k);m=j}m.each(function(){qb.call(this);
|
||||
this.style.zIndex=f.isSliding?g.pane_sliding+1:g.pane_normal+1;this.style.display="block"})}})},za=function(a){if(a||!q.paneResizing)ea.hide();else if(!a&&!b.isEmptyObject(q.panesSliding)){a=ea.length-1;for(var d,m;0<=a;a--)m=ea.eq(a),d=m.data("layoutMask"),r[d].maskObjects||m.hide()}},Ra=function(a,d,m,c){if(H()){a=A.call(this,a);var g=y[a],t=U[a],n=F[a],f=P[a];g&&b.isEmptyObject(g.data())&&(g=!1);t&&b.isEmptyObject(t.data())&&(t=!1);n&&b.isEmptyObject(n.data())&&(n=!1);f&&b.isEmptyObject(f.data())&&
|
||||
(f=!1);g&&g.stop(!0,!0);var h=r[a],l=ba[a],j=b.isPlainObject(l)&&!b.isEmptyObject(l);c=void 0!==c?c:h.destroyChildren;j&&c&&(b.each(l,function(a,b){b.destroyed||b.destroy(!0);b.destroyed&&delete l[a]}),b.isEmptyObject(l)&&(l=ba[a]=null,j=!1));g&&d&&!j?g.remove():g&&g[0]&&(d=h.paneClass,c=d+"-"+a,d=[d,d+"-open",d+"-closed",d+"-sliding",c,c+"-open",c+"-closed",c+"-sliding"],b.merge(d,Na(g,!0)),g.removeClass(d.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+
|
||||
K),j&&t?(t.width(t.width()),b.each(l,function(a,b){b.resizeAll()})):t&&t.css(t.data("layoutCSS")).removeData("layoutCSS").removeData("layoutRole"),g.data("layout")||g.css(g.data("layoutCSS")).removeData("layoutCSS"));f&&f.remove();n&&n.remove();z[a]=y[a]=U[a]=F[a]=P[a]=!1;m||oa()}},Ea=function(a){var b=y[a],d=b[0].style;r[a].useOffscreenClose?(b.data(k.offscreenReset)||b.data(k.offscreenReset,{left:d.left,right:d.right}),b.css(k.offscreenCSS)):b.hide().removeData(k.offscreenReset)},rb=function(a){var b=
|
||||
y[a];a=r[a];var d=k.offscreenCSS,c=b.data(k.offscreenReset),g=b[0].style;b.show().removeData(k.offscreenReset);a.useOffscreenClose&&c&&(g.left==d.left&&(g.left=c.left),g.right==d.right&&(g.right=c.right))},Ta=function(a,b){if(H()){var d=A.call(this,a),c=r[d],g=q[d],t=F[d];y[d]&&!g.isHidden&&!(q.initialized&&!1===C("onhide_start",d))&&(g.isSliding=!1,delete q.panesSliding[d],t&&t.hide(),!q.initialized||g.isClosed?(g.isClosed=!0,g.isHidden=!0,g.isVisible=!1,q.initialized||Ea(d),ia("horz"===k[d].dir?
|
||||
"":"center"),(q.initialized||c.triggerEventsOnLoad)&&C("onhide_end",d)):(g.isHiding=!0,ja(d,!1,b)))}},Fa=function(a,b,d,c){if(H()){a=A.call(this,a);var g=q[a];y[a]&&g.isHidden&&!1!==C("onshow_start",a)&&(g.isShowing=!0,g.isSliding=!1,delete q.panesSliding[a],!1===b?ja(a,!0):ra(a,!1,d,c))}},na=function(a,b){if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];d&&d.stopImmediatePropagation();g.isHidden?Fa(c):g.isClosed?ra(c,!!b):ja(c)}},ja=function(a,b,d,c){function g(){l.isMoving=!1;ma(t,!0);var a=k.oppositeEdge[t];
|
||||
q[a].noRoom&&(Y(a),ha(a));if(!c&&(q.initialized||h.triggerEventsOnLoad))p||C("onclose_end",t),p&&C("onshow_end",t),v&&C("onhide_end",t)}var t=A.call(this,a);if(!q.initialized&&y[t]){a=t;var n=q[a];Ea(a);n.isClosed=!0;n.isVisible=!1;Da(a)}else if(H()){var f=y[t],h=r[t],l=q[t],j,p,v;u.queue(function(a){if(!f||!h.closable&&!l.isShowing&&!l.isHiding||!b&&l.isClosed&&!l.isShowing)return a();var e=!l.isShowing&&!1===C("onclose_start",t);p=l.isShowing;v=l.isHiding;delete l.isShowing;delete l.isHiding;if(e)return a();
|
||||
j=!d&&!l.isClosed&&"none"!=h.fxName_close;l.isMoving=!0;l.isClosed=!0;l.isVisible=!1;v?l.isHidden=!0:p&&(l.isHidden=!1);l.isSliding?wa(t,!1):ia("horz"===k[t].dir?"":"center",!1);Da(t);j?(Ga(t,!0),f.hide(h.fxName_close,h.fxSettings_close,h.fxSpeed_close,function(){Ga(t,!1);l.isClosed&&g();a()})):(Ea(t),g(),a())})}},Da=function(a){if(F[a]){var d=F[a],c=P[a],f=r[a],g=k[a].side,t=f.resizerClass,n=f.togglerClass,h="-"+a;d.css(g,v.inset[g]).removeClass(t+"-open "+t+h+"-open").removeClass(t+"-sliding "+
|
||||
t+h+"-sliding").addClass(t+"-closed "+t+h+"-closed");f.resizable&&b.layout.plugins.draggable&&d.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");c&&(c.removeClass(n+"-open "+n+h+"-open").addClass(n+"-closed "+n+h+"-closed").attr("title",f.tips.Open),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));Va(a,!1);q.initialized&&qa()}},ra=function(a,b,d,c){function g(){j.isMoving=!1;eb(f);j.isSliding||ia("vert"==k[f].dir?
|
||||
"center":"",!1);Ua(f)}if(H()){var f=A.call(this,a),n=y[f],h=r[f],j=q[f],l,p;u.queue(function(a){if(!n||!h.resizable&&!h.closable&&!j.isShowing||j.isVisible&&!j.isSliding)return a();if(j.isHidden&&!j.isShowing)a(),Fa(f,!0);else{j.autoResize&&j.size!=h.size?ka(f,h.size,!0,!0,!0):Y(f,b);var e=C("onopen_start",f);if("abort"===e)return a();"NC"!==e&&Y(f,b);if(j.minSize>j.maxSize)return Va(f,!1),!c&&h.tips.noRoomToOpen&&alert(h.tips.noRoomToOpen),a();b?wa(f,!0):j.isSliding?wa(f,!1):h.slidable&&ma(f,!1);
|
||||
j.noRoom=!1;ha(f);p=j.isShowing;delete j.isShowing;l=!d&&j.isClosed&&"none"!=h.fxName_open;j.isMoving=!0;j.isVisible=!0;j.isClosed=!1;p&&(j.isHidden=!1);l?(Ga(f,!0),n.show(h.fxName_open,h.fxSettings_open,h.fxSpeed_open,function(){Ga(f,!1);j.isVisible&&g();a()})):(rb(f),g(),a())}})}},Ua=function(a,d){var c=y[a],f=F[a],g=P[a],h=r[a],n=q[a],j=k[a].side,p=h.resizerClass,l=h.togglerClass,u="-"+a;f.css(j,v.inset[j]+ga(a)).removeClass(p+"-closed "+p+u+"-closed").addClass(p+"-open "+p+u+"-open");n.isSliding?
|
||||
f.addClass(p+"-sliding "+p+u+"-sliding"):f.removeClass(p+"-sliding "+p+u+"-sliding");da(0,f);h.resizable&&b.layout.plugins.draggable?f.draggable("enable").css("cursor",h.resizerCursor).attr("title",h.tips.Resize):n.isSliding||f.css("cursor","default");g&&(g.removeClass(l+"-closed "+l+u+"-closed").addClass(l+"-open "+l+u+"-open").attr("title",h.tips.Close),da(0,g),g.children(".content-closed").hide(),g.children(".content-open").css("display","block"));Va(a,!n.isSliding);b.extend(n,R(c));q.initialized&&
|
||||
(qa(),pa(a,!0));if(!d&&(q.initialized||h.triggerEventsOnLoad)&&c.is(":visible"))C("onopen_end",a),n.isShowing&&C("onshow_end",a),q.initialized&&C("onresize_end",a)},sb=function(a){function b(){g.isClosed?g.isMoving||ra(c,!0):wa(c,!0)}if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];a=r[c].slideDelay_open;d&&d.stopImmediatePropagation();g.isClosed&&d&&"mouseenter"===d.type&&0<a?M.set(c+"_openSlider",b,a):b()}},Wa=function(a){function c(){g.isClosed?wa(f,!1):g.isMoving||ja(f)}if(H()){var m=Ma(a),f=A.call(this,
|
||||
a);a=r[f];var g=q[f],h=g.isMoving?1E3:300;!g.isClosed&&!g.isResizing&&("click"===a.slideTrigger_close?c():a.preventQuickSlideClose&&g.isMoving||a.preventPrematureSlideClose&&m&&b.layout.isMouseOverElem(m,y[f])||(m?M.set(f+"_closeSlider",c,d(a.slideDelay_close,h)):c()))}},Ga=function(a,b){var d=y[a],c=q[a],g=r[a],f=r.zIndexes;b?(va(a,{animation:!0,objectsOnly:!0}),d.css({zIndex:f.pane_animate}),"south"==a?d.css({top:v.inset.top+v.innerHeight-d.outerHeight()}):"east"==a&&d.css({left:v.inset.left+v.innerWidth-
|
||||
d.outerWidth()})):(za(),d.css({zIndex:c.isSliding?f.pane_sliding:f.pane_normal}),"south"==a?d.css({top:"auto"}):"east"==a&&!d.css("left").match(/\-99999/)&&d.css({left:"auto"}),G.msie&&(g.fxOpacityFix&&"slide"!=g.fxName_open&&d.css("filter")&&1==d.css("opacity"))&&d[0].style.removeAttribute("filter"))},ma=function(a,b){var d=r[a],c=F[a],g=d.slideTrigger_open.toLowerCase();if(c&&(!b||d.slidable)){g.match(/mouseover/)?g=d.slideTrigger_open="mouseenter":g.match(/(click|dblclick|mouseenter)/)||(g=d.slideTrigger_open=
|
||||
"click");if(d.resizerDblClickToggle&&g.match(/click/))c[b?"unbind":"bind"]("dblclick."+K,na);c[b?"bind":"unbind"](g+"."+K,sb).css("cursor",b?d.sliderCursor:"default").attr("title",b?d.tips.Slide:"")}},wa=function(a,b){function d(b){M.clear(a+"_closeSlider");b.stopPropagation()}var c=r[a],g=q[a],f=r.zIndexes,h=c.slideTrigger_close.toLowerCase(),j=b?"bind":"unbind",k=y[a],l=F[a];M.clear(a+"_closeSlider");b?(g.isSliding=!0,q.panesSliding[a]=!0,ma(a,!1)):(g.isSliding=!1,delete q.panesSliding[a]);k.css("zIndex",
|
||||
b?f.pane_sliding:f.pane_normal);l.css("zIndex",b?f.pane_sliding+2:f.resizer_normal);h.match(/(click|mouseleave)/)||(h=c.slideTrigger_close="mouseleave");l[j](h,Wa);"mouseleave"===h&&(k[j]("mouseleave."+K,Wa),l[j]("mouseenter."+K,d),k[j]("mouseenter."+K,d));b?"click"===h&&!c.resizable&&(l.css("cursor",b?c.sliderCursor:"default"),l.attr("title",b?c.tips.Close:"")):M.clear(a+"_closeSlider")},ha=function(a,d,c,f){d=r[a];var g=q[a],h=k[a],n=y[a],j=F[a],p="vert"===h.dir,l=!1;if("center"===a||p&&g.noVerticalRoom)(l=
|
||||
0<=g.maxHeight)&&g.noRoom?(rb(a),j&&j.show(),g.isVisible=!0,g.noRoom=!1,p&&(g.noVerticalRoom=!1),eb(a)):!l&&!g.noRoom&&(Ea(a),j&&j.hide(),g.isVisible=!1,g.noRoom=!0);"center"!==a&&(g.minSize<=g.maxSize?(g.size>g.maxSize?ka(a,g.maxSize,c,!0,f):g.size<g.minSize?ka(a,g.minSize,c,!0,f):j&&(g.isVisible&&n.is(":visible"))&&(c=g.size+v.inset[h.side],b.layout.cssNum(j,h.side)!=c&&j.css(h.side,c)),g.noRoom&&(g.wasOpen&&d.closable?d.autoReopen?ra(a,!1,!0,!0):g.noRoom=!1:Fa(a,g.wasOpen,!0,!0))):g.noRoom||(g.noRoom=
|
||||
!0,g.wasOpen=!g.isClosed&&!g.isSliding,g.isClosed||(d.closable?ja(a,!0,!0):Ta(a,!0))))},Ca=function(a,b,d,c,g){if(H()){a=A.call(this,a);var f=r[a],h=q[a];g=g||f.livePaneResizing&&!h.isResizing;h.autoResize=!1;ka(a,b,d,c,g)}},ka=function(e,c,f,h,g){function j(){for(var a="width"===ua?l.outerWidth():l.outerHeight(),a=[{pane:n,count:1,target:c,actual:a,correct:c===a,attempt:c,cssSize:D}],e=a[0],h={},t="Inaccurate size after resizing the "+n+"-pane.";!e.correct;){h={pane:n,count:e.count+1,target:c};h.attempt=
|
||||
e.actual>c?d(0,e.attempt-(e.actual-c)):d(0,e.attempt+(c-e.actual));h.cssSize=("horz"==k[n].dir?O:Q)(y[n],h.attempt);l.css(ua,h.cssSize);h.actual="width"==ua?l.outerWidth():l.outerHeight();h.correct=c===h.actual;1===a.length&&(ca(t,!1,!0),ca(e,!1,!0));ca(h,!1,!0);if(3<a.length)break;a.push(h);e=a[a.length-1]}J.size=c;b.extend(J,R(l));J.isVisible&&l.is(":visible")&&(x&&x.css(B,c+v.inset[B]),pa(n));!f&&(!Z&&q.initialized&&J.isVisible)&&C("onresize_end",n);f||(J.isSliding||ia("horz"==k[n].dir?"":"center",
|
||||
Z,g),qa());e=k.oppositeEdge[n];c<G&&q[e].noRoom&&(Y(e),ha(e,!1,f));1<a.length&&ca(t+"\nSee the Error Console for details.",!0,!0)}if(H()){var n=A.call(this,e),p=r[n],J=q[n],l=y[n],x=F[n],B=k[n].side,ua=k[n].sizeType.toLowerCase(),Z=J.isResizing&&!p.triggerEventsDuringLiveResize,z=!0!==h&&p.animatePaneSizing,G,D;u.queue(function(e){Y(n);G=J.size;c=fa(n,c);c=d(c,fa(n,p.minSize));c=a(c,J.maxSize);if(c<J.minSize)e(),ha(n,!1,f);else{if(!g&&c===G)return e();J.newSize=c;!f&&(q.initialized&&J.isVisible)&&
|
||||
C("onresize_start",n);D=("horz"==k[n].dir?O:Q)(y[n],c);if(z&&l.is(":visible")){var h=b.layout.effects.size[n]||b.layout.effects.size.all,h=p.fxSettings_size.easing||h.easing,v=r.zIndexes,u={};u[ua]=D+"px";J.isMoving=!0;l.css({zIndex:v.pane_animate}).show().animate(u,p.fxSpeed_size,h,function(){l.css({zIndex:J.isSliding?v.pane_sliding:v.pane_normal});J.isMoving=!1;delete J.newSize;j();e()})}else l.css(ua,D),delete J.newSize,l.is(":visible")?j():(J.size=c,b.extend(J,R(l))),e()}})}},ia=function(a,c,
|
||||
f){a=(a?a:"east,west,center").split(",");b.each(a,function(a,e){if(y[e]){var h=r[e],j=q[e],k=y[e],p=!0,l={},u=b.layout.showInvisibly(k),B={top:ga("north",!0),bottom:ga("south",!0),left:ga("west",!0),right:ga("east",!0),width:0,height:0};B.width=v.innerWidth-B.left-B.right;B.height=v.innerHeight-B.bottom-B.top;B.top+=v.inset.top;B.bottom+=v.inset.bottom;B.left+=v.inset.left;B.right+=v.inset.right;b.extend(j,R(k));if("center"===e){if(!f&&j.isVisible&&B.width===j.outerWidth&&B.height===j.outerHeight)return k.css(u),
|
||||
!0;b.extend(j,ya(e),{maxWidth:B.width,maxHeight:B.height});l=B;j.newWidth=l.width;j.newHeight=l.height;l.width=Q(k,l.width);l.height=O(k,l.height);p=0<=l.width&&0<=l.height;if(!q.initialized&&h.minWidth>B.width){var h=h.minWidth-j.outerWidth,B=r.east.minSize||0,x=r.west.minSize||0,Z=q.east.size,z=q.west.size,A=Z,D=z;0<h&&(q.east.isVisible&&Z>B)&&(A=d(Z-B,Z-h),h-=Z-A);0<h&&(q.west.isVisible&&z>x)&&(D=d(z-x,z-h),h-=z-D);if(0===h){Z&&Z!=B&&ka("east",A,!0,!0,f);z&&z!=x&&ka("west",D,!0,!0,f);ia("center",
|
||||
c,f);k.css(u);return}}}else{j.isVisible&&!j.noVerticalRoom&&b.extend(j,R(k),ya(e));if(!f&&!j.noVerticalRoom&&B.height===j.outerHeight)return k.css(u),!0;l.top=B.top;l.bottom=B.bottom;j.newSize=B.height;l.height=O(k,B.height);j.maxHeight=l.height;p=0<=j.maxHeight;p||(j.noVerticalRoom=!0)}p?(!c&&q.initialized&&C("onresize_start",e),k.css(l),"center"!==e&&qa(e),j.noRoom&&(!j.isClosed&&!j.isHidden)&&ha(e),j.isVisible&&(b.extend(j,R(k)),q.initialized&&pa(e))):!j.noRoom&&j.isVisible&&ha(e);k.css(u);delete j.newSize;
|
||||
delete j.newWidth;delete j.newHeight;if(!j.isVisible)return!0;"center"===e&&(j=G.isIE6||!G.boxModel,y.north&&(j||"IFRAME"==q.north.tagName)&&y.north.css("width",Q(y.north,v.innerWidth)),y.south&&(j||"IFRAME"==q.south.tagName)&&y.south.css("width",Q(y.south,v.innerWidth)));!c&&q.initialized&&C("onresize_end",e)}})},oa=function(a){A(a);if(u.is(":visible"))if(q.initialized){if(!0===a&&b.isPlainObject(r.outset)&&u.css(r.outset),b.extend(v,R(u,r.inset)),v.outerHeight){!0===a&&ob();if(!1===C("onresizeall_start"))return!1;
|
||||
var d,c,f;b.each(["south","north","east","west"],function(a,b){y[b]&&(c=r[b],f=q[b],f.autoResize&&f.size!=c.size?ka(b,c.size,!0,!0,!0):(Y(b),ha(b,!1,!0,!0)))});ia("",!0,!0);qa();b.each(k.allPanes,function(a,b){(d=y[b])&&q[b].isVisible&&C("onresize_end",b)});C("onresizeall_end")}}else Aa()},db=function(a,d){var c=A.call(this,a);r[c].resizeChildren&&(d||Ba(c),c=ba[c],b.isPlainObject(c)&&b.each(c,function(a,b){b.destroyed||b.resizeAll()}))},pa=function(a,c){if(H()){var h=A.call(this,a),h=h?h.split(","):
|
||||
k.allPanes;b.each(h,function(a,e){function h(a){return d(u.css.paddingBottom,parseInt(a.css("marginBottom"),10)||0)}function j(){var a=r[e].contentIgnoreSelector,a=p.nextAll().not(".ui-layout-mask").not(a||":lt(0)"),b=a.filter(":visible"),d=b.filter(":last");v={top:p[0].offsetTop,height:p.outerHeight(),numFooters:a.length,hiddenFooters:a.length-b.length,spaceBelow:0};v.spaceAbove=v.top;v.bottom=v.top+v.height;v.spaceBelow=d.length?d[0].offsetTop+d.outerHeight()-v.bottom+h(d):h(p)}var m=y[e],p=U[e],
|
||||
l=r[e],u=q[e],v=u.content;if(!m||!p||!m.is(":visible"))return!0;if(!p.length&&(Sa(e,!1),!p))return;if(!1!==C("onsizecontent_start",e)){if(!u.isMoving&&!u.isResizing||l.liveContentResizing||c||void 0==v.top)j(),0<v.hiddenFooters&&"hidden"===m.css("overflow")&&(m.css("overflow","visible"),j(),m.css("overflow","hidden"));m=u.innerHeight-(v.spaceAbove-u.css.paddingTop)-(v.spaceBelow-u.css.paddingBottom);if(!p.is(":visible")||v.height!=m){var x=p,l=x;f(x)?l=y[x]:x.jquery||(l=b(x));x=O(l,m);l.css({height:x,
|
||||
visibility:"visible"});0<x&&0<l.innerWidth()?l.data("autoHidden")&&(l.show().data("autoHidden",!1),G.mozilla||l.css(k.hidden).css(k.visible)):l.data("autoHidden")||l.hide().data("autoHidden",!0);v.height=m}q.initialized&&C("onsizecontent_end",e)}})}},qa=function(a){a=(a=A.call(this,a))?a.split(","):k.borderPanes;b.each(a,function(a,d){var e=r[d],g=q[d],h=y[d],j=F[d],p=P[d],u;if(h&&j){var l=k[d].dir,x=g.isClosed?"_closed":"_open",B=e["spacing"+x],z=e["togglerAlign"+x],x=e["togglerLength"+x],A;if(0===
|
||||
B)j.hide();else{!g.noRoom&&!g.isHidden&&j.show();"horz"===l?(A=v.innerWidth,g.resizerLength=A,h=b.layout.cssNum(h,"left"),j.css({width:Q(j,A),height:O(j,B),left:-9999<h?h:v.inset.left})):(A=h.outerHeight(),g.resizerLength=A,j.css({height:O(j,A),width:Q(j,B),top:v.inset.top+ga("north",!0)}));da(e,j);if(p){if(0===x||g.isSliding&&e.hideTogglerOnSlide){p.hide();return}p.show();if(!(0<x)||"100%"===x||x>A)x=A,z=0;else if(f(z))switch(z){case "top":case "left":z=0;break;case "bottom":case "right":z=A-x;break;
|
||||
default:z=c((A-x)/2)}else h=parseInt(z,10),z=0<=z?h:A-x+h;if("horz"===l){var D=Q(p,x);p.css({width:D,height:O(p,B),left:z,top:0});p.children(".content").each(function(){u=b(this);u.css("marginLeft",c((D-u.outerWidth())/2))})}else{var C=O(p,x);p.css({height:C,width:Q(p,B),top:z,left:0});p.children(".content").each(function(){u=b(this);u.css("marginTop",c((C-u.outerHeight())/2))})}da(0,p)}if(!q.initialized&&(e.initHidden||g.isHidden))j.hide(),p&&p.hide()}}})},pb=function(a){if(H()){var b=A.call(this,
|
||||
a);a=P[b];var d=r[b];a&&(d.closable=!0,a.bind("click."+K,function(a){a.stopPropagation();na(b)}).css("visibility","visible").css("cursor","pointer").attr("title",q[b].isClosed?d.tips.Open:d.tips.Close).show())}},Va=function(a,d){b.layout.plugins.buttons&&b.each(q[a].pins,function(c,f){b.layout.buttons.setPinState(z,b(f),a,d)})},u=b(this).eq(0);if(!u.length)return ca(r.errors.containerMissing);if(u.data("layoutContainer")&&u.data("layout"))return u.data("layout");var y={},U={},F={},P={},ea=b([]),v=
|
||||
q.container,K=q.id,z={options:r,state:q,container:u,panes:y,contents:U,resizers:F,togglers:P,hide:Ta,show:Fa,toggle:na,open:ra,close:ja,slideOpen:sb,slideClose:Wa,slideToggle:function(a){a=A.call(this,a);na(a,!0)},setSizeLimits:Y,_sizePane:ka,sizePane:Ca,sizeContent:pa,swapPanes:function(a,c){function f(a){var d=y[a],c=U[a];return!d?!1:{pane:a,P:d?d[0]:!1,C:c?c[0]:!1,state:b.extend(!0,{},q[a]),options:b.extend(!0,{},r[a])}}function h(a,c){if(a){var e=a.P,f=a.C,g=a.pane,j=k[c],m=b.extend(!0,{},q[c]),
|
||||
n=r[c],w={resizerCursor:n.resizerCursor};b.each(["fxName","fxSpeed","fxSettings"],function(a,b){w[b+"_open"]=n[b+"_open"];w[b+"_close"]=n[b+"_close"];w[b+"_size"]=n[b+"_size"]});y[c]=b(e).data({layoutPane:z[c],layoutEdge:c}).css(k.hidden).css(j.cssReq);U[c]=f?b(f):!1;r[c]=b.extend(!0,{},a.options,w);q[c]=b.extend(!0,{},a.state);e.className=e.className.replace(RegExp(n.paneClass+"-"+g,"g"),n.paneClass+"-"+c);Pa(c);j.dir!=k[g].dir?(e=p[c]||0,Y(c),e=d(e,q[c].minSize),Ca(c,e,!0,!0)):F[c].css(j.side,v.inset[j.side]+
|
||||
(q[c].isVisible?ga(c):0));a.state.isVisible&&!m.isVisible?Ua(c,!0):(Da(c),ma(c,!0));a=null}}if(H()){var g=A.call(this,a);q[g].edge=c;q[c].edge=g;if(!1===C("onswap_start",g)||!1===C("onswap_start",c))q[g].edge=g,q[c].edge=c;else{var j=f(g),n=f(c),p={};p[g]=j?j.state.size:0;p[c]=n?n.state.size:0;y[g]=!1;y[c]=!1;q[g]={};q[c]={};P[g]&&P[g].remove();P[c]&&P[c].remove();F[g]&&F[g].remove();F[c]&&F[c].remove();F[g]=F[c]=P[g]=P[c]=!1;h(j,c);h(n,g);j=n=p=null;y[g]&&y[g].css(k.visible);y[c]&&y[c].css(k.visible);
|
||||
oa();C("onswap_end",g);C("onswap_end",c)}}},showMasks:va,hideMasks:za,initContent:Sa,addPane:ib,removePane:Ra,createChildren:Qa,refreshChildren:Ba,enableClosable:pb,disableClosable:function(a,b){if(H()){var c=A.call(this,a),d=P[c];d&&(r[c].closable=!1,q[c].isClosed&&ra(c,!1,!0),d.unbind("."+K).css("visibility",b?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].slidable=!0,q[a].isClosed&&ma(a,
|
||||
!0))}},disableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&(r[a].slidable=!1,q[a].isSliding?ja(a,!1,!0):(ma(a,!1),b.css("cursor","default").attr("title",""),da(null,b[0])))}},enableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a],c=r[a];b&&b.data("draggable")&&(c.resizable=!0,b.draggable("enable"),q[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.tips.Resize))}},disableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].resizable=
|
||||
!1,b.draggable("disable").css("cursor","default").attr("title",""),da(null,b[0]))}},allowOverflow:x,resetOverflow:X,destroy:function(a,c){b(window).unbind("."+K);b(document).unbind("."+K);"object"===typeof a?A(a):c=a;u.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(r.containerClass).unbind("."+K);ea.remove();b.each(k.allPanes,function(a,b){Ra(b,!1,!0,c)});u.data("layoutCSS")&&!u.data("layoutRole")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");"BODY"===v.tagName&&
|
||||
(u=b("html")).data("layoutCSS")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");j(z,b.layout.onDestroy);mb();for(var d in z)d.match(/^(container|options)$/)||delete z[d];z.destroyed=!0;return z},initPanes:H,resizeAll:oa,runCallbacks:C,hasParentLayout:!1,children:ba,north:!1,south:!1,west:!1,east:!1,center:!1},Xa;var V,Ya,N,Ha,la,sa,W;h=b.layout.transformData(h,!0);h=b.layout.backwardCompatibility.renameAllOptions(h);if(!b.isEmptyObject(h.panes)){V=b.layout.optionsMap.noDefault;la=0;for(sa=V.length;la<
|
||||
sa;la++)N=V[la],delete h.panes[N];V=b.layout.optionsMap.layout;la=0;for(sa=V.length;la<sa;la++)N=V[la],delete h.panes[N]}V=b.layout.optionsMap.layout;var Bb=b.layout.config.optionRootKeys;for(N in h)Ha=h[N],0>b.inArray(N,Bb)&&0>b.inArray(N,V)&&(h.panes[N]||(h.panes[N]=b.isPlainObject(Ha)?b.extend(!0,{},Ha):Ha),delete h[N]);b.extend(!0,r,h);b.each(k.allPanes,function(a,c){k[c]=b.extend(!0,{},k.panes,k[c]);Ya=r.panes;W=r[c];if("center"===c){V=b.layout.optionsMap.center;a=0;for(sa=V.length;a<sa;a++)if(N=
|
||||
V[a],!h.center[N]&&(h.panes[N]||!W[N]))W[N]=Ya[N]}else{W=r[c]=b.extend(!0,{},Ya,W);var d=r[c],f=r.panes;d.fxSettings||(d.fxSettings={});f.fxSettings||(f.fxSettings={});b.each(["_open","_close","_size"],function(a,e){var h="fxName"+e,j="fxSpeed"+e,k="fxSettings"+e,l=d[h]=d[h]||f[h]||d.fxName||f.fxName||"none",p=b.effects&&(b.effects[l]||b.effects.effect&&b.effects.effect[l]);if("none"===l||!r.effects[l]||!p)l=d[h]="none";l=r.effects[l]||{};h=l.all||null;l=l[c]||null;d[j]=d[j]||f[j]||d.fxSpeed||f.fxSpeed||
|
||||
null;d[k]=b.extend(!0,{},h,l,f.fxSettings,d.fxSettings,f[k],d[k])});delete d.fxName;delete d.fxSpeed;delete d.fxSettings;W.resizerClass||(W.resizerClass="ui-layout-resizer");W.togglerClass||(W.togglerClass="ui-layout-toggler")}W.paneClass||(W.paneClass="ui-layout-pane")});var Ia=h.zIndex,xa=r.zIndexes;0<Ia&&(xa.pane_normal=Ia,xa.content_mask=d(Ia+1,xa.content_mask),xa.resizer_normal=d(Ia+2,xa.resizer_normal));delete r.panes;var Cb=r,tb=q;tb.creatingLayout=!0;j(z,b.layout.onCreate);if(!1===C("onload_start"))Xa=
|
||||
"cancel";else{var Za=u[0],$=b("html"),ub=v.tagName=Za.tagName,vb=v.id=Za.id,wb=v.className=Za.className,L=r,Ja=L.name,$a={},Ka=u.data("parentLayout"),La=u.data("layoutEdge"),ab=Ka&&La,ta=b.layout.cssNum,bb,aa;v.selector=u.selector.split(".slice")[0];v.ref=(L.name?L.name+" layout / ":"")+ub+(vb?"#"+vb:wb?".["+wb+"]":"");v.isBody="BODY"===ub;!ab&&!v.isBody&&(bb=u.closest("."+b.layout.defaults.panes.paneClass),Ka=bb.data("parentLayout"),La=bb.data("layoutEdge"),ab=Ka&&La);u.data({layout:z,layoutContainer:K}).addClass(L.containerClass);
|
||||
var xb={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(Ja in xb)u.bind("layout"+Ja.toLowerCase()+"."+K,z[xb[Ja]||Ja]);ab&&(z.hasParentLayout=!0,Ka.refreshChildren(La,z));u.data("layoutCSS")||(v.isBody?(u.data("layoutCSS",b.extend(D(u,"position,margin,padding,border"),{height:u.css("height"),overflow:u.css("overflow"),overflowX:u.css("overflowX"),overflowY:u.css("overflowY")})),$.data("layoutCSS",b.extend(D($,"padding"),{height:"auto",overflow:$.css("overflow"),overflowX:$.css("overflowX"),
|
||||
overflowY:$.css("overflowY")}))):u.data("layoutCSS",D(u,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{$a={overflow:"hidden",overflowX:"hidden",overflowY:"hidden"};u.css($a);L.inset&&!b.isPlainObject(L.inset)&&(aa=parseInt(L.inset,10)||0,L.inset={top:aa,bottom:aa,left:aa,right:aa});if(v.isBody)L.outset?b.isPlainObject(L.outset)||(aa=parseInt(L.outset,10)||0,L.outset={top:aa,bottom:aa,left:aa,right:aa}):L.outset={top:ta($,"paddingTop"),bottom:ta($,
|
||||
"paddingBottom"),left:ta($,"paddingLeft"),right:ta($,"paddingRight")},$.css($a).css({height:"100%",border:"none",padding:0,margin:0}),G.isIE6?(u.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),L.inset||(L.inset=R(u).inset)):(u.css({width:"auto",height:"auto",margin:0,position:"absolute"}),u.css(L.outset)),b.extend(v,R(u,L.inset));else{var yb=u.css("position");(!yb||!yb.match(/(fixed|absolute|relative)/))&&u.css("position","relative");u.is(":visible")&&(b.extend(v,
|
||||
R(u,L.inset)),1>v.innerHeight&&ca(L.errors.noContainerHeight.replace(/CONTAINER/,v.ref)))}ta(u,"minWidth")&&u.parent().css("overflowX","auto");ta(u,"minHeight")&&u.parent().css("overflowY","auto")}catch(Db){}nb();b(window).bind("unload."+K,mb);j(z,b.layout.onLoad);Cb.initPanes&&Aa();delete tb.creatingLayout;Xa=q.initialized}return"cancel"===Xa?null:z}})(jQuery);
|
||||
(function(b){b.ui||(b.ui={});b.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(a){for(var d=document.cookie,d=d?d.split(";"):[],c,f=0,j=d.length;f<j;f++)if(c=b.trim(d[f]).split("="),c[0]==a)return decodeURIComponent(c[1]);return null},write:function(a,d,c){var f="",j="",h=!1;c=c||{};var p=c.expires||null,x=b.type(p);"date"===x?j=p:"string"===x&&0<p&&(p=parseInt(p,10),x="number");"number"===x&&(j=new Date,0<p?j.setDate(j.getDate()+p):(j.setFullYear(1970),h=!0));j&&(f+=";expires="+
|
||||
j.toUTCString());c.path&&(f+=";path="+c.path);c.domain&&(f+=";domain="+c.domain);c.secure&&(f+=";secure");document.cookie=a+"="+(h?"":encodeURIComponent(d))+f},clear:function(a){b.ui.cookie.write(a,"",{expires:-1})}};b.cookie||(b.cookie=function(a,d,c){var f=b.ui.cookie;if(null===d)f.clear(a);else{if(void 0===d)return f.read(a);f.write(a,d,c)}});b.layout.plugins.stateManagement=!0;b.layout.config.optionRootKeys.push("stateManagement");b.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,
|
||||
animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}};b.layout.optionsMap.layout.push("stateManagement");b.layout.state={saveCookie:function(a,d,c){var f=a.options,j=f.stateManagement;c=b.extend(!0,{},j.cookie,c||null);a=a.state.stateData=a.readState(d||j.stateKeys);b.ui.cookie.write(c.name||f.name||
|
||||
"Layout",b.layout.state.encodeJSON(a),c);return b.extend(!0,{},a)},deleteCookie:function(a){a=a.options;b.ui.cookie.clear(a.stateManagement.cookie.name||a.name||"Layout")},readCookie:function(a){a=a.options;return(a=b.ui.cookie.read(a.stateManagement.cookie.name||a.name||"Layout"))?b.layout.state.decodeJSON(a):{}},loadCookie:function(a){var d=b.layout.state.readCookie(a);d&&(a.state.stateData=b.extend(!0,{},d),a.loadState(d));return d},loadState:function(a,d,c){if(b.isPlainObject(d)&&!b.isEmptyObject(d))if(d=
|
||||
a.state.stateData=b.layout.transformData(d),c=b.extend({animateLoad:!1,includeChildren:a.options.stateManagement.includeChildren},c),a.state.initialized){var f=!c.animateLoad,j,h,p,x;b.each(b.layout.config.borderPanes,function(c,G){S=d[G];b.isPlainObject(S)&&(s=S.size,j=S.initClosed,h=S.initHidden,ar=S.autoResize,p=a.state[G],x=p.isVisible,ar&&(p.autoResize=ar),x||a._sizePane(G,s,!1,!1,!1),!0===h?a.hide(G,f):!0===j?a.close(G,!1,f):!1===j?a.open(G,!1,f):!1===h&&a.show(G,!1,f),x&&a._sizePane(G,s,!1,
|
||||
!1,f))});if(c.includeChildren){var I,T;b.each(a.children,function(a,c){(I=d[a]?d[a].children:0)&&c&&b.each(c,function(a,b){T=I[a];b&&T&&b.loadState(T)})})}}else{var S=b.extend(!0,{},d);b.each(b.layout.config.allPanes,function(a,b){S[b]&&delete S[b].children});b.extend(!0,a.options,S)}},readState:function(a,d){"string"===b.type(d)&&(d={keys:d});d||(d={});var c=a.options.stateManagement,f=d.includeChildren,f=void 0!==f?f:c.includeChildren,c=d.stateKeys||c.stateKeys,j={isClosed:"initClosed",isHidden:"initHidden"},
|
||||
h=a.state,p=b.layout.config.allPanes,x={},I,T,S,X,G,k;b.isArray(c)&&(c=c.join(","));for(var c=c.replace(/__/g,".").split(","),Q=0,O=c.length;Q<O;Q++)I=c[Q].split("."),T=I[0],I=I[1],0>b.inArray(T,p)||(S=h[T][I],void 0!=S&&("isClosed"==I&&h[T].isSliding&&(S=!0),(x[T]||(x[T]={}))[j[I]?j[I]:I]=S));f&&b.each(p,function(c,d){G=a.children[d];X=h.stateData[d];b.isPlainObject(G)&&!b.isEmptyObject(G)&&(k=x[d]||(x[d]={}),k.children||(k.children={}),b.each(G,function(a,c){c.state.initialized?k.children[a]=b.layout.state.readState(c):
|
||||
X&&(X.children&&X.children[a])&&(k.children[a]=b.extend(!0,{},X.children[a]))}))});return x},encodeJSON:function(a){function d(a){var f=[],j=0,h,p,x,I=b.isArray(a);for(h in a)p=a[h],x=typeof p,"string"==x?p='"'+p+'"':"object"==x&&(p=d(p)),f[j++]=(!I?'"'+h+'":':"")+p;return(I?"[":"{")+f.join(",")+(I?"]":"}")}return d(a)},decodeJSON:function(a){try{return b.parseJSON?b.parseJSON(a):window.eval("("+a+")")||{}}catch(d){return{}}},_create:function(a){var d=b.layout.state,c=a.options.stateManagement;b.extend(a,
|
||||
{readCookie:function(){return d.readCookie(a)},deleteCookie:function(){d.deleteCookie(a)},saveCookie:function(b,c){return d.saveCookie(a,b,c)},loadCookie:function(){return d.loadCookie(a)},loadState:function(b,c){d.loadState(a,b,c)},readState:function(b){return d.readState(a,b)},encodeJSON:d.encodeJSON,decodeJSON:d.decodeJSON});a.state.stateData={};if(c.autoLoad)if(b.isPlainObject(c.autoLoad))b.isEmptyObject(c.autoLoad)||a.loadState(c.autoLoad);else if(c.enabled)if(b.isFunction(c.autoLoad)){var f=
|
||||
{};try{f=c.autoLoad(a,a.state,a.options,a.options.name||"")}catch(j){}f&&(b.isPlainObject(f)&&!b.isEmptyObject(f))&&a.loadState(f)}else a.loadCookie()},_unload:function(a){var d=a.options.stateManagement;if(d.enabled&&d.autoSave)if(b.isFunction(d.autoSave))try{d.autoSave(a,a.state,a.options,a.options.name||"")}catch(c){}else a.saveCookie()}};b.layout.onCreate.push(b.layout.state._create);b.layout.onUnload.push(b.layout.state._unload);b.layout.plugins.buttons=!0;b.layout.defaults.autoBindCustomButtons=
|
||||
!1;b.layout.optionsMap.layout.push("autoBindCustomButtons");b.layout.buttons={init:function(a){var d=a.options.name||"",c;b.each("toggle open close pin toggle-slide open-slide".split(" "),function(f,j){b.each(b.layout.config.borderPanes,function(f,p){b(".ui-layout-button-"+j+"-"+p).each(function(){c=b(this).data("layoutName")||b(this).attr("layoutName");(void 0==c||c===d)&&a.bindButton(this,j,p)})})})},get:function(a,d,c,f){var j=b(d);a=a.options;var h=a.errors.addButtonError;j.length?0>b.inArray(c,
|
||||
b.layout.config.borderPanes)?(b.layout.msg(h+" "+a.errors.pane+": "+c,!0),j=b("")):(d=a[c].buttonClass+"-"+f,j.addClass(d+" "+d+"-"+c).data("layoutName",a.name)):b.layout.msg(h+" "+a.errors.selector+": "+d,!0);return j},bind:function(a,d,c,f){var j=b.layout.buttons;switch(c.toLowerCase()){case "toggle":j.addToggle(a,d,f);break;case "open":j.addOpen(a,d,f);break;case "close":j.addClose(a,d,f);break;case "pin":j.addPin(a,d,f);break;case "toggle-slide":j.addToggle(a,d,f,!0);break;case "open-slide":j.addOpen(a,
|
||||
d,f,!0)}return a},addToggle:function(a,d,c,f){b.layout.buttons.get(a,d,c,"toggle").click(function(b){a.toggle(c,!!f);b.stopPropagation()});return a},addOpen:function(a,d,c,f){b.layout.buttons.get(a,d,c,"open").attr("title",a.options[c].tips.Open).click(function(b){a.open(c,!!f);b.stopPropagation()});return a},addClose:function(a,d,c){b.layout.buttons.get(a,d,c,"close").attr("title",a.options[c].tips.Close).click(function(b){a.close(c);b.stopPropagation()});return a},addPin:function(a,d,c){var f=b.layout.buttons,
|
||||
j=f.get(a,d,c,"pin");if(j.length){var h=a.state[c];j.click(function(d){f.setPinState(a,b(this),c,h.isSliding||h.isClosed);h.isSliding||h.isClosed?a.open(c):a.close(c);d.stopPropagation()});f.setPinState(a,j,c,!h.isClosed&&!h.isSliding);h.pins.push(d)}return a},setPinState:function(a,b,c,f){var j=b.attr("pin");if(!(j&&f===("down"==j))){a=a.options[c];var j=a.buttonClass+"-pin",h=j+"-"+c;c=j+"-up "+h+"-up";j=j+"-down "+h+"-down";b.attr("pin",f?"down":"up").attr("title",f?a.tips.Unpin:a.tips.Pin).removeClass(f?
|
||||
c:j).addClass(f?j:c)}},syncPinBtns:function(a,d,c){b.each(a.state[d].pins,function(f,j){b.layout.buttons.setPinState(a,b(j),d,c)})},_load:function(a){var d=b.layout.buttons;b.extend(a,{bindButton:function(b,c,h){return d.bind(a,b,c,h)},addToggleBtn:function(b,c,h){return d.addToggle(a,b,c,h)},addOpenBtn:function(b,c,h){return d.addOpen(a,b,c,h)},addCloseBtn:function(b,c){return d.addClose(a,b,c)},addPinBtn:function(b,c){return d.addPin(a,b,c)}});for(var c=0;4>c;c++)a.state[b.layout.config.borderPanes[c]].pins=
|
||||
[];a.options.autoBindCustomButtons&&d.init(a)},_unload:function(){}};b.layout.onLoad.push(b.layout.buttons._load);b.layout.plugins.browserZoom=!0;b.layout.defaults.browserZoomCheckInterval=1E3;b.layout.optionsMap.layout.push("browserZoomCheckInterval");b.layout.browserZoom={_init:function(a){!1!==b.layout.browserZoom.ratio()&&b.layout.browserZoom._setTimer(a)},_setTimer:function(a){if(!a.destroyed){var d=a.options,c=a.state,f=a.hasParentLayout?5E3:Math.max(d.browserZoomCheckInterval,100);setTimeout(function(){if(!a.destroyed&&
|
||||
d.resizeWithWindow){var f=b.layout.browserZoom.ratio();f!==c.browserZoom&&(c.browserZoom=f,a.resizeAll());b.layout.browserZoom._setTimer(a)}},f)}},ratio:function(){function a(a,b){return(100*(parseInt(a,10)/parseInt(b,10))).toFixed()}var d=window,c=screen,f=document,j=f.documentElement||f.body,h=b.layout.browser,p=h.version,x,I,T;return h.msie&&8<p||!h.msie?!1:c.deviceXDPI&&c.systemXDPI?a(c.deviceXDPI,c.systemXDPI):h.webkit&&(x=f.body.getBoundingClientRect)?a(x.left-x.right,f.body.offsetWidth):h.webkit&&
|
||||
(I=d.outerWidth)?a(I,d.innerWidth):(I=c.width)&&(T=j.clientWidth)?a(I,T):!1}};b.layout.onReady.push(b.layout.browserZoom._init)})(jQuery);
|
||||
@@ -69,25 +69,22 @@ $(function()
|
||||
},
|
||||
// events bound via _bind are removed automatically
|
||||
// revert other modifications here
|
||||
destroy: function()
|
||||
_destroy: function()
|
||||
{
|
||||
this.element
|
||||
.removeClass('itop-directlinks');
|
||||
|
||||
// call the original destroy method since we overwrote it
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
.removeClass('itop-directlinks');
|
||||
},
|
||||
// _setOptions is called with a hash of all options that are changing
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
// _setOption is called for each individual option that is changing
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
|
||||
if (key == 'fields') this._refresh();
|
||||
},
|
||||
|
||||
@@ -70,7 +70,7 @@ $(function()
|
||||
_setOptions: function()
|
||||
{
|
||||
// in 1.9 would use _superApply
|
||||
$.Widget.prototype._setOptions.apply( this, arguments );
|
||||
this._superApply(arguments);
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
@@ -78,7 +78,7 @@ $(function()
|
||||
_setOption: function( key, value )
|
||||
{
|
||||
// in 1.9 would use _super
|
||||
$.Widget.prototype._setOption.call( this, key, value );
|
||||
this._superApply(arguments);
|
||||
},
|
||||
_on_change: function()
|
||||
{
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Accordion 1.5 - jQuery menu widget
|
||||
*
|
||||
* Copyright (c) 2007 Jörn Zaefferer, Frank Marcia
|
||||
*
|
||||
* http://bassistance.de/jquery-plugins/jquery-plugin-accordion/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id: jquery.accordion.js 2951 2007-08-28 07:21:13Z joern.zaefferer $
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.ui = $.ui || {}
|
||||
|
||||
$.ui.accordion = {};
|
||||
$.extend($.ui.accordion, {
|
||||
defaults: {
|
||||
selectedClass: "selected",
|
||||
alwaysOpen: true,
|
||||
animated: 'slide',
|
||||
event: "click",
|
||||
header: "a"
|
||||
},
|
||||
animations: {
|
||||
slide: function(settings, additions) {
|
||||
settings = $.extend({
|
||||
easing: "swing",
|
||||
duration: 300
|
||||
}, settings, additions);
|
||||
if ( !settings.toHide.size() ) {
|
||||
settings.toShow.animate({height: "show"}, {
|
||||
duration: settings.duration,
|
||||
easing: settings.easing,
|
||||
complete: settings.finished
|
||||
});
|
||||
return;
|
||||
}
|
||||
var hideHeight = settings.toHide.height(),
|
||||
showHeight = settings.toShow.height(),
|
||||
difference = showHeight / hideHeight;
|
||||
settings.toShow.css({ height: 0, overflow: 'hidden' }).show();
|
||||
settings.toHide.filter(":hidden").each(settings.finished).end().filter(":visible").animate({height:"hide"},{
|
||||
step: function(n){
|
||||
settings.toShow.height(Math.ceil( (hideHeight - (n)) * difference ));
|
||||
},
|
||||
duration: settings.duration,
|
||||
easing: settings.easing,
|
||||
complete: settings.finished
|
||||
});
|
||||
},
|
||||
bounceslide: function(settings) {
|
||||
this.slide(settings, {
|
||||
easing: settings.down ? "bounceout" : "swing",
|
||||
duration: settings.down ? 1000 : 200
|
||||
});
|
||||
},
|
||||
easeslide: function(settings) {
|
||||
this.slide(settings, {
|
||||
easing: "easeinout",
|
||||
duration: 700
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.extend({
|
||||
nextUntil: function(expr) {
|
||||
var match = [];
|
||||
|
||||
// We need to figure out which elements to push onto the array
|
||||
this.each(function(){
|
||||
// Traverse through the sibling nodes
|
||||
for( var i = this.nextSibling; i; i = i.nextSibling ) {
|
||||
// Make sure that we're only dealing with elements
|
||||
if ( i.nodeType != 1 ) continue;
|
||||
|
||||
// If we find a match then we need to stop
|
||||
if ( $.filter( expr, [i] ).r.length ) break;
|
||||
|
||||
// Otherwise, add it on to the stack
|
||||
match.push( i );
|
||||
}
|
||||
});
|
||||
|
||||
return this.pushStack( match );
|
||||
},
|
||||
// the plugin method itself
|
||||
accordion: function(settings) {
|
||||
if ( !this.length )
|
||||
return this;
|
||||
|
||||
// setup configuration
|
||||
settings = $.extend({}, $.ui.accordion.defaults, settings);
|
||||
|
||||
if ( settings.navigation ) {
|
||||
var current = this.find("a").filter(function() { return this.href == location.href; });
|
||||
if ( current.length ) {
|
||||
if ( current.filter(settings.header).length ) {
|
||||
settings.active = current;
|
||||
} else {
|
||||
settings.active = current.parent().parent().prev();
|
||||
current.addClass("current");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// calculate active if not specified, using the first header
|
||||
var container = this,
|
||||
headers = container.find(settings.header),
|
||||
active = findActive(settings.active),
|
||||
running = 0;
|
||||
|
||||
if ( settings.fillSpace ) {
|
||||
var maxHeight = this.parent().height();
|
||||
headers.each(function() {
|
||||
maxHeight -= $(this).outerHeight();
|
||||
});
|
||||
var maxPadding = 0;
|
||||
headers.nextUntil(settings.header).each(function() {
|
||||
maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
|
||||
}).height(maxHeight - maxPadding);
|
||||
} else if ( settings.autoheight ) {
|
||||
var maxHeight = 0;
|
||||
headers.nextUntil(settings.header).each(function() {
|
||||
maxHeight = Math.max(maxHeight, $(this).height());
|
||||
}).height(maxHeight);
|
||||
}
|
||||
|
||||
headers
|
||||
.not(active || "")
|
||||
.nextUntil(settings.header)
|
||||
.hide();
|
||||
active.parent().andSelf().addClass(settings.selectedClass);
|
||||
|
||||
|
||||
function findActive(selector) {
|
||||
return selector != undefined
|
||||
? typeof selector == "number"
|
||||
? headers.filter(":eq(" + selector + ")")
|
||||
: headers.not(headers.not(selector))
|
||||
: selector === false
|
||||
? $("<div>")
|
||||
: headers.filter(":eq(0)");
|
||||
}
|
||||
|
||||
function toggle(toShow, toHide, data, clickedActive, down) {
|
||||
var finished = function(cancel) {
|
||||
running = cancel ? 0 : --running;
|
||||
if ( running )
|
||||
return;
|
||||
// trigger custom change event
|
||||
container.trigger("change", data);
|
||||
};
|
||||
|
||||
// count elements to animate
|
||||
running = toHide.size() == 0 ? toShow.size() : toHide.size();
|
||||
|
||||
if ( settings.animated ) {
|
||||
if ( !settings.alwaysOpen && clickedActive ) {
|
||||
toShow.slideToggle(settings.animated);
|
||||
finished(true);
|
||||
} else {
|
||||
$.ui.accordion.animations[settings.animated]({
|
||||
toShow: toShow,
|
||||
toHide: toHide,
|
||||
finished: finished,
|
||||
down: down
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if ( !settings.alwaysOpen && clickedActive ) {
|
||||
toShow.toggle();
|
||||
} else {
|
||||
toHide.hide();
|
||||
toShow.show();
|
||||
}
|
||||
finished(true);
|
||||
}
|
||||
}
|
||||
|
||||
function clickHandler(event) {
|
||||
// called only when using activate(false) to close all parts programmatically
|
||||
if ( !event.target && !settings.alwaysOpen ) {
|
||||
active.toggleClass(settings.selectedClass);
|
||||
var toHide = active.nextUntil(settings.header);
|
||||
var toShow = active = $([]);
|
||||
toggle( toShow, toHide );
|
||||
return;
|
||||
}
|
||||
// get the click target
|
||||
var clicked = $(event.target);
|
||||
|
||||
// due to the event delegation model, we have to check if one
|
||||
// of the parent elements is our actual header, and find that
|
||||
if ( clicked.parents(settings.header).length )
|
||||
while ( !clicked.is(settings.header) )
|
||||
clicked = clicked.parent();
|
||||
|
||||
var clickedActive = clicked[0] == active[0];
|
||||
|
||||
// if animations are still active, or the active header is the target, ignore click
|
||||
if(running || (settings.alwaysOpen && clickedActive) || !clicked.is(settings.header))
|
||||
return;
|
||||
|
||||
// switch classes
|
||||
active.parent().andSelf().toggleClass(settings.selectedClass);
|
||||
if ( !clickedActive ) {
|
||||
clicked.parent().andSelf().addClass(settings.selectedClass);
|
||||
}
|
||||
|
||||
// find elements to show and hide
|
||||
var toShow = clicked.nextUntil(settings.header),
|
||||
toHide = active.nextUntil(settings.header),
|
||||
data = [clicked, active, toShow, toHide],
|
||||
down = headers.index( active[0] ) > headers.index( clicked[0] );
|
||||
|
||||
active = clickedActive ? $([]) : clicked;
|
||||
toggle( toShow, toHide, data, clickedActive, down );
|
||||
|
||||
return !toShow.length;
|
||||
};
|
||||
function activateHandler(event, index) {
|
||||
// IE manages to call activateHandler on normal clicks
|
||||
if ( arguments.length == 1 )
|
||||
return;
|
||||
// call clickHandler with custom event
|
||||
clickHandler({
|
||||
target: findActive(index)[0]
|
||||
});
|
||||
};
|
||||
|
||||
return container
|
||||
.bind(settings.event, clickHandler)
|
||||
.bind("activate", activateHandler);
|
||||
},
|
||||
activate: function(index) {
|
||||
return this.trigger('activate', [index]);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,871 +0,0 @@
|
||||
/* jQuery Calendar v2.7
|
||||
Written by Marc Grabanski (m@marcgrabanski.com) and enhanced by Keith Wood (kbwood@iprimus.com.au).
|
||||
|
||||
Copyright (c) 2007 Marc Grabanski (http://marcgrabanski.com/code/jquery-calendar)
|
||||
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl-3.0.txt) and
|
||||
CC (http://creativecommons.org/licenses/by/3.0/) licenses. "Share or Remix it but please Attribute the authors."
|
||||
Date: 09-03-2007 */
|
||||
|
||||
/* PopUp Calendar manager.
|
||||
Use the singleton instance of this class, popUpCal, to interact with the calendar.
|
||||
Settings for (groups of) calendars are maintained in an instance object
|
||||
(PopUpCalInstance), allowing multiple different settings on the same page. */
|
||||
function PopUpCal() {
|
||||
this._nextId = 0; // Next ID for a calendar instance
|
||||
this._inst = []; // List of instances indexed by ID
|
||||
this._curInst = null; // The current instance in use
|
||||
this._disabledInputs = []; // List of calendar inputs that have been disabled
|
||||
this._popUpShowing = false; // True if the popup calendar is showing , false if not
|
||||
this._inDialog = false; // True if showing within a "dialog", false if not
|
||||
this.regional = []; // Available regional settings, indexed by language code
|
||||
this.regional[''] = { // Default regional settings
|
||||
clearText: 'Clear', // Display text for clear link
|
||||
closeText: 'Close', // Display text for close link
|
||||
prevText: '<Prev', // Display text for previous month link
|
||||
nextText: 'Next>', // Display text for next month link
|
||||
currentText: 'Today', // Display text for current month link
|
||||
dayNames: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Names of days starting at Sunday
|
||||
monthNames: ['January','February','March','April','May','June',
|
||||
'July','August','September','October','November','December'], // Names of months
|
||||
dateFormat: 'DMY/' // First three are day, month, year in the required order,
|
||||
// fourth (optional) is the separator, e.g. US would be 'MDY/', ISO would be 'YMD-'
|
||||
};
|
||||
this._defaults = { // Global defaults for all the calendar instances
|
||||
autoPopUp: 'focus', // 'focus' for popup on focus,
|
||||
// 'button' for trigger button, or 'both' for either
|
||||
defaultDate: null, // Used when field is blank: actual date,
|
||||
// +/-number for offset from today, null for today
|
||||
appendText: '', // Display text following the input box, e.g. showing the format
|
||||
buttonText: '...', // Text for trigger button
|
||||
buttonImage: '', // URL for trigger button image
|
||||
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
|
||||
closeAtTop: true, // True to have the clear/close at the top,
|
||||
// false to have them at the bottom
|
||||
hideIfNoPrevNext: false, // True to hide next/previous month links
|
||||
// if not applicable, false to just disable them
|
||||
changeMonth: true, // True if month can be selected directly, false if only prev/next
|
||||
changeYear: true, // True if year can be selected directly, false if only prev/next
|
||||
yearRange: '-10:+10', // Range of years to display in drop-down,
|
||||
// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
|
||||
firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
|
||||
changeFirstDay: true, // True to click on day name to change, false to remain as set
|
||||
showOtherMonths: false, // True to show dates in other months, false to leave blank
|
||||
minDate: null, // The earliest selectable date, or null for no limit
|
||||
maxDate: null, // The latest selectable date, or null for no limit
|
||||
speed: 'medium', // Speed of display/closure
|
||||
customDate: null, // Function that takes a date and returns an array with
|
||||
// [0] = true if selectable, false if not,
|
||||
// [1] = custom CSS class name(s) or '', e.g. popUpCal.noWeekends
|
||||
fieldSettings: null, // Function that takes an input field and
|
||||
// returns a set of custom settings for the calendar
|
||||
onSelect: null // Define a callback function when a date is selected
|
||||
};
|
||||
$.extend(this._defaults, this.regional['']);
|
||||
this._calendarDiv = $('<div id="calendar_div"></div>');
|
||||
$(document.body).append(this._calendarDiv);
|
||||
$(document.body).mousedown(this._checkExternalClick);
|
||||
}
|
||||
|
||||
$.extend(PopUpCal.prototype, {
|
||||
/* Class name added to elements to indicate already configured with a calendar. */
|
||||
markerClassName: 'hasCalendar',
|
||||
|
||||
/* Register a new calendar instance - with custom settings. */
|
||||
_register: function(inst) {
|
||||
var id = this._nextId++;
|
||||
this._inst[id] = inst;
|
||||
return id;
|
||||
},
|
||||
|
||||
/* Retrieve a particular calendar instance based on its ID. */
|
||||
_getInst: function(id) {
|
||||
return this._inst[id] || id;
|
||||
},
|
||||
|
||||
/* Override the default settings for all instances of the calendar.
|
||||
@param settings object - the new settings to use as defaults (anonymous object)
|
||||
@return void */
|
||||
setDefaults: function(settings) {
|
||||
extendRemove(this._defaults, settings || {});
|
||||
},
|
||||
|
||||
/* Handle keystrokes. */
|
||||
_doKeyDown: function(e) {
|
||||
var inst = popUpCal._getInst(this._calId);
|
||||
if (popUpCal._popUpShowing) {
|
||||
switch (e.keyCode) {
|
||||
case 9: popUpCal.hideCalendar(inst, '');
|
||||
break; // hide on tab out
|
||||
case 13: popUpCal._selectDate(inst);
|
||||
break; // select the value on enter
|
||||
case 27: popUpCal.hideCalendar(inst, inst._get('speed'));
|
||||
break; // hide on escape
|
||||
case 33: popUpCal._adjustDate(inst, -1, (e.ctrlKey ? 'Y' : 'M'));
|
||||
break; // previous month/year on page up/+ ctrl
|
||||
case 34: popUpCal._adjustDate(inst, +1, (e.ctrlKey ? 'Y' : 'M'));
|
||||
break; // next month/year on page down/+ ctrl
|
||||
case 35: if (e.ctrlKey) popUpCal._clearDate(inst);
|
||||
break; // clear on ctrl+end
|
||||
case 36: if (e.ctrlKey) popUpCal._gotoToday(inst);
|
||||
break; // current on ctrl+home
|
||||
case 37: if (e.ctrlKey) popUpCal._adjustDate(inst, -1, 'D');
|
||||
break; // -1 day on ctrl+left
|
||||
case 38: if (e.ctrlKey) popUpCal._adjustDate(inst, -7, 'D');
|
||||
break; // -1 week on ctrl+up
|
||||
case 39: if (e.ctrlKey) popUpCal._adjustDate(inst, +1, 'D');
|
||||
break; // +1 day on ctrl+right
|
||||
case 40: if (e.ctrlKey) popUpCal._adjustDate(inst, +7, 'D');
|
||||
break; // +1 week on ctrl+down
|
||||
}
|
||||
}
|
||||
else if (e.keyCode == 36 && e.ctrlKey) { // display the calendar on ctrl+home
|
||||
popUpCal.showFor(this);
|
||||
}
|
||||
},
|
||||
|
||||
/* Filter entered characters. */
|
||||
_doKeyPress: function(e) {
|
||||
var inst = popUpCal._getInst(this._calId);
|
||||
var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
|
||||
return (chr < ' ' || chr == inst._get('dateFormat').charAt(3) ||
|
||||
(chr >= '0' && chr <= '9')); // only allow numbers and separator
|
||||
},
|
||||
|
||||
/* Attach the calendar to an input field. */
|
||||
_connectCalendar: function(target, inst) {
|
||||
var input = $(target);
|
||||
if (this._hasClass(input, this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
var appendText = inst._get('appendText');
|
||||
if (appendText) {
|
||||
input.after('<span class="calendar_append">' + appendText + '</span>');
|
||||
}
|
||||
var autoPopUp = inst._get('autoPopUp');
|
||||
if (autoPopUp == 'focus' || autoPopUp == 'both') { // pop-up calendar when in the marked field
|
||||
input.focus(this.showFor);
|
||||
}
|
||||
if (autoPopUp == 'button' || autoPopUp == 'both') { // pop-up calendar when button clicked
|
||||
var buttonText = inst._get('buttonText');
|
||||
var buttonImage = inst._get('buttonImage');
|
||||
var buttonImageOnly = inst._get('buttonImageOnly');
|
||||
var trigger = $(buttonImageOnly ? '<img class="calendar_trigger" src="' +
|
||||
buttonImage + '" alt="' + buttonText + '" title="' + buttonText + '"/>' :
|
||||
'<button type="button" class="calendar_trigger">' + (buttonImage != '' ?
|
||||
'<img src="' + buttonImage + '" alt="' + buttonText + '" title="' + buttonText + '"/>' :
|
||||
buttonText) + '</button>');
|
||||
input.wrap('<span class="calendar_wrap"></span>').after(trigger);
|
||||
trigger.click(this.showFor);
|
||||
}
|
||||
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);
|
||||
input[0]._calId = inst._id;
|
||||
},
|
||||
|
||||
/* Attach an inline calendar to a div. */
|
||||
_inlineCalendar: function(target, inst) {
|
||||
var input = $(target);
|
||||
if (this._hasClass(input, this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
input.addClass(this.markerClassName).append(inst._calendarDiv);
|
||||
input[0]._calId = inst._id;
|
||||
},
|
||||
|
||||
/* Does this element have a particular class? */
|
||||
_hasClass: function(element, className) {
|
||||
var classes = element.attr('class');
|
||||
return (classes && classes.indexOf(className) > -1);
|
||||
},
|
||||
|
||||
/* Pop-up the calendar in a "dialog" box.
|
||||
@param dateText string - the initial date to display (in the current format)
|
||||
@param onSelect function - the function(dateText) to call when a date is selected
|
||||
@param settings object - update the dialog calendar instance's settings (anonymous object)
|
||||
@param pos int[2] - coordinates for the dialog's position within the screen
|
||||
leave empty for default (screen centre)
|
||||
@return void */
|
||||
dialogCalendar: function(dateText, onSelect, settings, pos) {
|
||||
var inst = this._dialogInst; // internal instance
|
||||
if (!inst) {
|
||||
inst = this._dialogInst = new PopUpCalInstance({}, false);
|
||||
this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>');
|
||||
this._dialogInput.keydown(this._doKeyDown);
|
||||
$('body').append(this._dialogInput);
|
||||
this._dialogInput[0]._calId = inst._id;
|
||||
}
|
||||
extendRemove(inst._settings, settings || {});
|
||||
this._dialogInput.val(dateText);
|
||||
|
||||
/* Cross Browser Positioning */
|
||||
if (self.innerHeight) { // all except Explorer
|
||||
windowWidth = self.innerWidth;
|
||||
windowHeight = self.innerHeight;
|
||||
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
|
||||
windowWidth = document.documentElement.clientWidth;
|
||||
windowHeight = document.documentElement.clientHeight;
|
||||
} else if (document.body) { // other Explorers
|
||||
windowWidth = document.body.clientWidth;
|
||||
windowHeight = document.body.clientHeight;
|
||||
}
|
||||
this._pos = pos || // should use actual width/height below
|
||||
[(windowWidth / 2) - 100, (windowHeight / 2) - 100];
|
||||
|
||||
// move input on screen for focus, but hidden behind dialog
|
||||
this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
|
||||
inst._settings.onSelect = onSelect;
|
||||
this._inDialog = true;
|
||||
this._calendarDiv.addClass('calendar_dialog');
|
||||
this.showFor(this._dialogInput[0]);
|
||||
if ($.blockUI) {
|
||||
$.blockUI(this._calendarDiv);
|
||||
}
|
||||
},
|
||||
|
||||
/* Enable the input field(s) for entry.
|
||||
@param inputs element/object - single input field or jQuery collection of input fields
|
||||
@return void */
|
||||
enableFor: function(inputs) {
|
||||
inputs = (inputs.jquery ? inputs : $(inputs));
|
||||
inputs.each(function() {
|
||||
this.disabled = false;
|
||||
$('../button.calendar_trigger', this).each(function() { this.disabled = false; });
|
||||
$('../img.calendar_trigger', this).css({opacity:'1.0',cursor:''});
|
||||
var $this = this;
|
||||
popUpCal._disabledInputs = $.map(popUpCal._disabledInputs,
|
||||
function(value) { return (value == $this ? null : value); }); // delete entry
|
||||
});
|
||||
},
|
||||
|
||||
/* Disable the input field(s) from entry.
|
||||
@param inputs element/object - single input field or jQuery collection of input fields
|
||||
@return void */
|
||||
disableFor: function(inputs) {
|
||||
inputs = (inputs.jquery ? inputs : $(inputs));
|
||||
inputs.each(function() {
|
||||
this.disabled = true;
|
||||
$('../button.calendar_trigger', this).each(function() { this.disabled = true; });
|
||||
$('../img.calendar_trigger', this).css({opacity:'0.5',cursor:'default'});
|
||||
var $this = this;
|
||||
popUpCal._disabledInputs = $.map(popUpCal._disabledInputs,
|
||||
function(value) { return (value == $this ? null : value); }); // delete entry
|
||||
popUpCal._disabledInputs[popUpCal._disabledInputs.length] = this;
|
||||
});
|
||||
},
|
||||
|
||||
/* Update the settings for a calendar attached to an input field or division.
|
||||
@param control element - the input field or div/span attached to the calendar or
|
||||
string - the ID or other jQuery selector of the input field
|
||||
@param settings object - the new settings to update
|
||||
@return void */
|
||||
reconfigureFor: function(control, settings) {
|
||||
control = (typeof control == 'string' ? $(control)[0] : control);
|
||||
var inst = this._getInst(control._calId);
|
||||
if (inst) {
|
||||
extendRemove(inst._settings, settings || {});
|
||||
this._updateCalendar(inst);
|
||||
}
|
||||
},
|
||||
|
||||
/* Set the date for a calendar attached to an input field or division.
|
||||
@param control element - the input field or div/span attached to the calendar
|
||||
@param date Date - the new date
|
||||
@return void */
|
||||
setDateFor: function(control, date) {
|
||||
var inst = this._getInst(control._calId);
|
||||
if (inst) {
|
||||
inst._setDate(date);
|
||||
}
|
||||
},
|
||||
|
||||
/* Retrieve the date for a calendar attached to an input field or division.
|
||||
@param control element - the input field or div/span attached to the calendar
|
||||
@return Date - the current date */
|
||||
getDateFor: function(control) {
|
||||
var inst = this._getInst(control._calId);
|
||||
return (inst ? inst._getDate() : null);
|
||||
},
|
||||
|
||||
/* Pop-up the calendar for a given input field.
|
||||
@param target element - the input field attached to the calendar
|
||||
@return void */
|
||||
showFor: function(target) {
|
||||
var input = (target.nodeName && target.nodeName.toLowerCase() == 'input' ? target : this);
|
||||
if (input.nodeName.toLowerCase() != 'input') { // find from button/image trigger
|
||||
input = $('input', input.parentNode)[0];
|
||||
}
|
||||
if (popUpCal._lastInput == input) { // already here
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < popUpCal._disabledInputs.length; i++) { // check not disabled
|
||||
if (popUpCal._disabledInputs[i] == input) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var inst = popUpCal._getInst(input._calId);
|
||||
var fieldSettings = inst._get('fieldSettings');
|
||||
extendRemove(inst._settings, (fieldSettings ? fieldSettings(input) : {}));
|
||||
popUpCal.hideCalendar(inst, '');
|
||||
popUpCal._lastInput = input;
|
||||
inst._setDateFromField(input);
|
||||
if (popUpCal._inDialog) { // hide cursor
|
||||
input.value = '';
|
||||
}
|
||||
if (!popUpCal._pos) { // position below input
|
||||
popUpCal._pos = popUpCal._findPos(input);
|
||||
popUpCal._pos[1] += input.offsetHeight;
|
||||
}
|
||||
inst._calendarDiv.css('position', (popUpCal._inDialog && $.blockUI ? 'static' : 'absolute')).
|
||||
css('left', popUpCal._pos[0] + 'px').css('top', popUpCal._pos[1] + 'px');
|
||||
popUpCal._pos = null;
|
||||
popUpCal._showCalendar(inst);
|
||||
},
|
||||
|
||||
/* Construct and display the calendar. */
|
||||
_showCalendar: function(id) {
|
||||
var inst = this._getInst(id);
|
||||
popUpCal._updateCalendar(inst);
|
||||
if (!inst._inline) {
|
||||
var speed = inst._get('speed');
|
||||
inst._calendarDiv.show(speed, function() {
|
||||
popUpCal._popUpShowing = true;
|
||||
popUpCal._afterShow(inst);
|
||||
});
|
||||
if (speed == '') {
|
||||
popUpCal._popUpShowing = true;
|
||||
popUpCal._afterShow(inst);
|
||||
}
|
||||
if (inst._input[0].type != 'hidden') {
|
||||
inst._input[0].focus();
|
||||
}
|
||||
this._curInst = inst;
|
||||
}
|
||||
},
|
||||
|
||||
/* Generate the calendar content. */
|
||||
_updateCalendar: function(inst) {
|
||||
inst._calendarDiv.empty().append(inst._generateCalendar());
|
||||
if (inst._input && inst._input[0].type != 'hidden') {
|
||||
inst._input[0].focus();
|
||||
}
|
||||
},
|
||||
|
||||
/* Tidy up after displaying the calendar. */
|
||||
_afterShow: function(inst) {
|
||||
if ($.browser.msie) { // fix IE < 7 select problems
|
||||
$('#calendar_cover').css({width: inst._calendarDiv[0].offsetWidth + 4,
|
||||
height: inst._calendarDiv[0].offsetHeight + 4});
|
||||
}
|
||||
// re-position on screen if necessary
|
||||
var calDiv = inst._calendarDiv[0];
|
||||
var pos = popUpCal._findPos(inst._input[0]);
|
||||
// Get browser width and X value (IE6+, FF, Safari, Opera)
|
||||
if( typeof( window.innerWidth ) == 'number' ) {
|
||||
browserWidth = window.innerWidth;
|
||||
} else {
|
||||
browserWidth = document.documentElement.clientWidth;
|
||||
}
|
||||
if ( document.documentElement && (document.documentElement.scrollLeft)) {
|
||||
browserX = document.documentElement.scrollLeft;
|
||||
} else {
|
||||
browserX = document.body.scrollLeft;
|
||||
}
|
||||
// Reposition calendar if outside the browser window.
|
||||
if ((calDiv.offsetLeft + calDiv.offsetWidth) >
|
||||
(browserWidth + browserX) ) {
|
||||
inst._calendarDiv.css('left', (pos[0] + inst._input[0].offsetWidth - calDiv.offsetWidth) + 'px');
|
||||
}
|
||||
// Get browser height and Y value (IE6+, FF, Safari, Opera)
|
||||
if( typeof( window.innerHeight ) == 'number' ) {
|
||||
browserHeight = window.innerHeight;
|
||||
} else {
|
||||
browserHeight = document.documentElement.clientHeight;
|
||||
}
|
||||
if ( document.documentElement && (document.documentElement.scrollTop)) {
|
||||
browserTopY = document.documentElement.scrollTop;
|
||||
} else {
|
||||
browserTopY = document.body.scrollTop;
|
||||
}
|
||||
// Reposition calendar if outside the browser window.
|
||||
if ((calDiv.offsetTop + calDiv.offsetHeight) >
|
||||
(browserTopY + browserHeight) ) {
|
||||
inst._calendarDiv.css('top', (pos[1] - calDiv.offsetHeight) + 'px');
|
||||
}
|
||||
},
|
||||
|
||||
/* Hide the calendar from view.
|
||||
@param id string/object - the ID of the current calendar instance,
|
||||
or the instance itself
|
||||
@param speed string - the speed at which to close the calendar
|
||||
@return void */
|
||||
hideCalendar: function(id, speed) {
|
||||
var inst = this._getInst(id);
|
||||
if (popUpCal._popUpShowing) {
|
||||
speed = (speed != null ? speed : inst._get('speed'));
|
||||
inst._calendarDiv.hide(speed, function() {
|
||||
popUpCal._tidyDialog(inst);
|
||||
});
|
||||
if (speed == '') {
|
||||
popUpCal._tidyDialog(inst);
|
||||
}
|
||||
popUpCal._popUpShowing = false;
|
||||
popUpCal._lastInput = null;
|
||||
inst._settings.prompt = null;
|
||||
if (popUpCal._inDialog) {
|
||||
popUpCal._dialogInput.css('position', 'absolute').
|
||||
css('left', '0px').css('top', '-100px');
|
||||
if ($.blockUI) {
|
||||
$.unblockUI();
|
||||
$('body').append(this._calendarDiv);
|
||||
}
|
||||
}
|
||||
popUpCal._inDialog = false;
|
||||
}
|
||||
popUpCal._curInst = null;
|
||||
},
|
||||
|
||||
/* Tidy up after a dialog display. */
|
||||
_tidyDialog: function(inst) {
|
||||
inst._calendarDiv.removeClass('calendar_dialog');
|
||||
$('.calendar_prompt', inst._calendarDiv).remove();
|
||||
},
|
||||
|
||||
/* Close calendar if clicked elsewhere. */
|
||||
_checkExternalClick: function(event) {
|
||||
if (!popUpCal._curInst) {
|
||||
return;
|
||||
}
|
||||
var target = $(event.target);
|
||||
if( (target.parents("#calendar_div").length == 0)
|
||||
&& (target.attr('class') != 'calendar_trigger')
|
||||
&& popUpCal._popUpShowing
|
||||
&& !(popUpCal._inDialog && $.blockUI) )
|
||||
{
|
||||
popUpCal.hideCalendar(popUpCal._curInst, '');
|
||||
}
|
||||
},
|
||||
|
||||
/* Adjust one of the date sub-fields. */
|
||||
_adjustDate: function(id, offset, period) {
|
||||
var inst = this._getInst(id);
|
||||
inst._adjustDate(offset, period);
|
||||
this._updateCalendar(inst);
|
||||
},
|
||||
|
||||
/* Action for current link. */
|
||||
_gotoToday: function(id) {
|
||||
var date = new Date();
|
||||
var inst = this._getInst(id);
|
||||
inst._selectedDay = date.getDate();
|
||||
inst._selectedMonth = date.getMonth();
|
||||
inst._selectedYear = date.getFullYear();
|
||||
this._adjustDate(inst);
|
||||
},
|
||||
|
||||
/* Action for selecting a new month/year. */
|
||||
_selectMonthYear: function(id, select, period) {
|
||||
var inst = this._getInst(id);
|
||||
inst._selectingMonthYear = false;
|
||||
inst[period == 'M' ? '_selectedMonth' : '_selectedYear'] =
|
||||
select.options[select.selectedIndex].value - 0;
|
||||
this._adjustDate(inst);
|
||||
},
|
||||
|
||||
/* Restore input focus after not changing month/year. */
|
||||
_clickMonthYear: function(id) {
|
||||
var inst = this._getInst(id);
|
||||
if (inst._input && inst._selectingMonthYear && !$.browser.msie) {
|
||||
inst._input[0].focus();
|
||||
}
|
||||
inst._selectingMonthYear = !inst._selectingMonthYear;
|
||||
},
|
||||
|
||||
/* Action for changing the first week day. */
|
||||
_changeFirstDay: function(id, a) {
|
||||
var inst = this._getInst(id);
|
||||
var dayNames = inst._get('dayNames');
|
||||
var value = a.firstChild.nodeValue;
|
||||
for (var i = 0; i < 7; i++) {
|
||||
if (dayNames[i] == value) {
|
||||
inst._settings.firstDay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this._updateCalendar(inst);
|
||||
},
|
||||
|
||||
/* Action for selecting a day. */
|
||||
_selectDay: function(id, td) {
|
||||
var inst = this._getInst(id);
|
||||
inst._selectedDay = $("a", td).html();
|
||||
this._selectDate(id);
|
||||
},
|
||||
|
||||
/* Erase the input field and hide the calendar. */
|
||||
_clearDate: function(id) {
|
||||
this._selectDate(id, '');
|
||||
},
|
||||
|
||||
/* Update the input field with the selected date. */
|
||||
_selectDate: function(id, dateStr) {
|
||||
var inst = this._getInst(id);
|
||||
dateStr = (dateStr != null ? dateStr : inst._formatDate());
|
||||
if (inst._input) {
|
||||
inst._input.val(dateStr);
|
||||
}
|
||||
var onSelect = inst._get('onSelect');
|
||||
if (onSelect) {
|
||||
onSelect(dateStr, inst); // trigger custom callback
|
||||
}
|
||||
else {
|
||||
inst._input.trigger('change'); // fire the change event
|
||||
}
|
||||
if (inst._inline) {
|
||||
this._updateCalendar(inst);
|
||||
}
|
||||
else {
|
||||
this.hideCalendar(inst, inst._get('speed'));
|
||||
}
|
||||
},
|
||||
|
||||
/* Set as customDate function to prevent selection of weekends.
|
||||
@param date Date - the date to customise
|
||||
@return [boolean, string] - is this date selectable?, what is its CSS class? */
|
||||
noWeekends: function(date) {
|
||||
var day = date.getDay();
|
||||
return [(day > 0 && day < 6), ''];
|
||||
},
|
||||
|
||||
/* Find an object's position on the screen. */
|
||||
_findPos: function(obj) {
|
||||
while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
|
||||
obj = obj.nextSibling;
|
||||
}
|
||||
var curleft = curtop = 0;
|
||||
if (obj && obj.offsetParent) {
|
||||
curleft = obj.offsetLeft;
|
||||
curtop = obj.offsetTop;
|
||||
while (obj = obj.offsetParent) {
|
||||
var origcurleft = curleft;
|
||||
curleft += obj.offsetLeft;
|
||||
if (curleft < 0) {
|
||||
curleft = origcurleft;
|
||||
}
|
||||
curtop += obj.offsetTop;
|
||||
}
|
||||
}
|
||||
return [curleft,curtop];
|
||||
}
|
||||
});
|
||||
|
||||
/* Individualised settings for calendars applied to one or more related inputs.
|
||||
Instances are managed and manipulated through the PopUpCal manager. */
|
||||
function PopUpCalInstance(settings, inline) {
|
||||
this._id = popUpCal._register(this);
|
||||
this._selectedDay = 0;
|
||||
this._selectedMonth = 0; // 0-11
|
||||
this._selectedYear = 0; // 4-digit year
|
||||
this._input = null; // The attached input field
|
||||
this._inline = inline; // True if showing inline, false if used in a popup
|
||||
this._calendarDiv = (!inline ? popUpCal._calendarDiv :
|
||||
$('<div id="calendar_div_' + this._id + '" class="calendar_inline"></div>'));
|
||||
// customise the calendar object - uses manager defaults if not overridden
|
||||
this._settings = extendRemove({}, settings || {}); // clone
|
||||
if (inline) {
|
||||
this._setDate(this._getDefaultDate());
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(PopUpCalInstance.prototype, {
|
||||
/* Get a setting value, defaulting if necessary. */
|
||||
_get: function(name) {
|
||||
return (this._settings[name] != null ? this._settings[name] : popUpCal._defaults[name]);
|
||||
},
|
||||
|
||||
/* Parse existing date and initialise calendar. */
|
||||
_setDateFromField: function(input) {
|
||||
this._input = $(input);
|
||||
var dateFormat = this._get('dateFormat');
|
||||
var currentDate = this._input.val().split(dateFormat.charAt(3));
|
||||
if (currentDate.length == 3) {
|
||||
this._currentDay = parseInt(currentDate[dateFormat.indexOf('D')], 10);
|
||||
this._currentMonth = parseInt(currentDate[dateFormat.indexOf('M')], 10) - 1;
|
||||
this._currentYear = parseInt(currentDate[dateFormat.indexOf('Y')], 10);
|
||||
}
|
||||
else {
|
||||
var date = this._getDefaultDate();
|
||||
this._currentDay = date.getDate();
|
||||
this._currentMonth = date.getMonth();
|
||||
this._currentYear = date.getFullYear();
|
||||
}
|
||||
this._selectedDay = this._currentDay;
|
||||
this._selectedMonth = this._currentMonth;
|
||||
this._selectedYear = this._currentYear;
|
||||
this._adjustDate();
|
||||
},
|
||||
|
||||
/* Retrieve the default date shown on opening. */
|
||||
_getDefaultDate: function() {
|
||||
var offsetDate = function(offset) {
|
||||
var date = new Date();
|
||||
date.setDate(date.getDate() + offset);
|
||||
return date;
|
||||
};
|
||||
var defaultDate = this._get('defaultDate');
|
||||
return (defaultDate == null ? new Date() :
|
||||
(typeof defaultDate == 'number' ? offsetDate(defaultDate) : defaultDate));
|
||||
},
|
||||
|
||||
/* Set the date directly. */
|
||||
_setDate: function(date) {
|
||||
this._selectedDay = this._currentDay = date.getDate();
|
||||
this._selectedMonth = this._currentMonth = date.getMonth();
|
||||
this._selectedYear = this._currentYear = date.getFullYear();
|
||||
this._adjustDate();
|
||||
},
|
||||
|
||||
/* Retrieve the date directly. */
|
||||
_getDate: function() {
|
||||
return new Date(this._currentYear, this._currentMonth, this._currentDay);
|
||||
},
|
||||
|
||||
/* Generate the HTML for the current state of the calendar. */
|
||||
_generateCalendar: function() {
|
||||
var today = new Date();
|
||||
today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time
|
||||
// build the calendar HTML
|
||||
var controls = '<div class="calendar_control">' +
|
||||
'<a class="calendar_clear" onclick="popUpCal._clearDate(' + this._id + ');">' +
|
||||
this._get('clearText') + '</a>' +
|
||||
'<a class="calendar_close" onclick="popUpCal.hideCalendar(' + this._id + ');">' +
|
||||
this._get('closeText') + '</a></div>';
|
||||
var prompt = this._get('prompt');
|
||||
var closeAtTop = this._get('closeAtTop');
|
||||
var hideIfNoPrevNext = this._get('hideIfNoPrevNext');
|
||||
// controls and links
|
||||
var html = (prompt ? '<div class="calendar_prompt">' + prompt + '</div>' : '') +
|
||||
(closeAtTop && !this._inline ? controls : '') + '<div class="calendar_links">' +
|
||||
(this._canAdjustMonth(-1) ? '<a class="calendar_prev" ' +
|
||||
'onclick="popUpCal._adjustDate(' + this._id + ', -1, \'M\');">' + this._get('prevText') + '</a>' :
|
||||
(hideIfNoPrevNext ? '' : '<label class="calendar_prev">' + this._get('prevText') + '</label>')) +
|
||||
(this._isInRange(today) ? '<a class="calendar_current" ' +
|
||||
'onclick="popUpCal._gotoToday(' + this._id + ');">' + this._get('currentText') + '</a>' : '') +
|
||||
(this._canAdjustMonth(+1) ? '<a class="calendar_next" ' +
|
||||
'onclick="popUpCal._adjustDate(' + this._id + ', +1, \'M\');">' + this._get('nextText') + '</a>' :
|
||||
(hideIfNoPrevNext ? '' : '<label class="calendar_next">' + this._get('nextText') + '</label>')) +
|
||||
'</div><div class="calendar_header">';
|
||||
var minDate = this._get('minDate');
|
||||
var maxDate = this._get('maxDate');
|
||||
// month selection
|
||||
var monthNames = this._get('monthNames');
|
||||
if (!this._get('changeMonth')) {
|
||||
html += monthNames[this._selectedMonth] + ' ';
|
||||
}
|
||||
else {
|
||||
var inMinYear = (minDate && minDate.getFullYear() == this._selectedYear);
|
||||
var inMaxYear = (maxDate && maxDate.getFullYear() == this._selectedYear);
|
||||
html += '<select class="calendar_newMonth" ' +
|
||||
'onchange="popUpCal._selectMonthYear(' + this._id + ', this, \'M\');" ' +
|
||||
'onclick="popUpCal._clickMonthYear(' + this._id + ');">';
|
||||
for (var month = 0; month < 12; month++) {
|
||||
if ((!inMinYear || month >= minDate.getMonth()) &&
|
||||
(!inMaxYear || month <= maxDate.getMonth())) {
|
||||
html += '<option value="' + month + '"' +
|
||||
(month == this._selectedMonth ? ' selected="selected"' : '') +
|
||||
'>' + monthNames[month] + '</option>';
|
||||
}
|
||||
}
|
||||
html += '</select>';
|
||||
}
|
||||
// year selection
|
||||
if (!this._get('changeYear')) {
|
||||
html += this._selectedYear;
|
||||
}
|
||||
else {
|
||||
// determine range of years to display
|
||||
var years = this._get('yearRange').split(':');
|
||||
var year = 0;
|
||||
var endYear = 0;
|
||||
if (years.length != 2) {
|
||||
year = this._selectedYear - 10;
|
||||
endYear = this._selectedYear + 10;
|
||||
}
|
||||
else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
|
||||
year = this._selectedYear + parseInt(years[0], 10);
|
||||
endYear = this._selectedYear + parseInt(years[1], 10);
|
||||
}
|
||||
else {
|
||||
year = parseInt(years[0], 10);
|
||||
endYear = parseInt(years[1], 10);
|
||||
}
|
||||
year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
|
||||
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
|
||||
html += '<select class="calendar_newYear" onchange="popUpCal._selectMonthYear(' +
|
||||
this._id + ', this, \'Y\');" ' + 'onclick="popUpCal._clickMonthYear(' +
|
||||
this._id + ');">';
|
||||
for (; year <= endYear; year++) {
|
||||
html += '<option value="' + year + '"' +
|
||||
(year == this._selectedYear ? ' selected="selected"' : '') +
|
||||
'>' + year + '</option>';
|
||||
}
|
||||
html += '</select>';
|
||||
}
|
||||
html += '</div><table class="calendar" cellpadding="0" cellspacing="0"><thead>' +
|
||||
'<tr class="calendar_titleRow">';
|
||||
var firstDay = this._get('firstDay');
|
||||
var changeFirstDay = this._get('changeFirstDay');
|
||||
var dayNames = this._get('dayNames');
|
||||
for (var dow = 0; dow < 7; dow++) { // days of the week
|
||||
html += '<td>' + (!changeFirstDay ? '' : '<a onclick="popUpCal._changeFirstDay(' +
|
||||
this._id + ', this);">') + dayNames[(dow + firstDay) % 7] +
|
||||
(changeFirstDay ? '</a>' : '') + '</td>';
|
||||
}
|
||||
html += '</tr></thead><tbody>';
|
||||
var daysInMonth = this._getDaysInMonth(this._selectedYear, this._selectedMonth);
|
||||
this._selectedDay = Math.min(this._selectedDay, daysInMonth);
|
||||
var leadDays = (this._getFirstDayOfMonth(this._selectedYear, this._selectedMonth) - firstDay + 7) % 7;
|
||||
var currentDate = new Date(this._currentYear, this._currentMonth, this._currentDay);
|
||||
var selectedDate = new Date(this._selectedYear, this._selectedMonth, this._selectedDay);
|
||||
var printDate = new Date(this._selectedYear, this._selectedMonth, 1 - leadDays);
|
||||
var numRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
|
||||
var customDate = this._get('customDate');
|
||||
var showOtherMonths = this._get('showOtherMonths');
|
||||
for (var row = 0; row < numRows; row++) { // create calendar rows
|
||||
html += '<tr class="calendar_daysRow">';
|
||||
for (var dow = 0; dow < 7; dow++) { // create calendar days
|
||||
var customSettings = (customDate ? customDate(printDate) : [true, '']);
|
||||
var otherMonth = (printDate.getMonth() != this._selectedMonth);
|
||||
var unselectable = otherMonth || !customSettings[0] ||
|
||||
(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
|
||||
html += '<td class="calendar_daysCell' +
|
||||
((dow + firstDay + 6) % 7 >= 5 ? ' calendar_weekEndCell' : '') + // highlight weekends
|
||||
(otherMonth ? ' calendar_otherMonth' : '') + // highlight days from other months
|
||||
(printDate.getTime() == selectedDate.getTime() ? ' calendar_daysCellOver' : '') + // highlight selected day
|
||||
(unselectable ? ' calendar_unselectable' : '') + // highlight unselectable days
|
||||
(otherMonth && !showOtherMonths ? '' : ' ' + customSettings[1] + // highlight custom dates
|
||||
(printDate.getTime() == currentDate.getTime() ? ' calendar_currentDay' : // highlight current day
|
||||
(printDate.getTime() == today.getTime() ? ' calendar_today' : ''))) + '"' + // highlight today (if different)
|
||||
(unselectable ? '' : ' onmouseover="$(this).addClass(\'calendar_daysCellOver\');"' +
|
||||
' onmouseout="$(this).removeClass(\'calendar_daysCellOver\');"' +
|
||||
' onclick="popUpCal._selectDay(' + this._id + ', this);"') + '>' + // actions
|
||||
(otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months
|
||||
(unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
|
||||
printDate.setDate(printDate.getDate() + 1);
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
html += '</tbody></table>' + (!closeAtTop && !this._inline ? controls : '') +
|
||||
'<div style="clear: both;"></div>' + (!$.browser.msie ? '' :
|
||||
'<!--[if lte IE 6.5]><iframe src="javascript:false;" class="calendar_cover"></iframe><![endif]-->');
|
||||
return html;
|
||||
},
|
||||
|
||||
/* Adjust one of the date sub-fields. */
|
||||
_adjustDate: function(offset, period) {
|
||||
var date = new Date(this._selectedYear + (period == 'Y' ? offset : 0),
|
||||
this._selectedMonth + (period == 'M' ? offset : 0),
|
||||
this._selectedDay + (period == 'D' ? offset : 0));
|
||||
// ensure it is within the bounds set
|
||||
var minDate = this._get('minDate');
|
||||
var maxDate = this._get('maxDate');
|
||||
date = (minDate && date < minDate ? minDate : date);
|
||||
date = (maxDate && date > maxDate ? maxDate : date);
|
||||
this._selectedDay = date.getDate();
|
||||
this._selectedMonth = date.getMonth();
|
||||
this._selectedYear = date.getFullYear();
|
||||
},
|
||||
|
||||
/* Find the number of days in a given month. */
|
||||
_getDaysInMonth: function(year, month) {
|
||||
return 32 - new Date(year, month, 32).getDate();
|
||||
},
|
||||
|
||||
/* Find the day of the week of the first of a month. */
|
||||
_getFirstDayOfMonth: function(year, month) {
|
||||
return new Date(year, month, 1).getDay();
|
||||
},
|
||||
|
||||
/* Determines if we should allow a "next/prev" month display change. */
|
||||
_canAdjustMonth: function(offset) {
|
||||
var date = new Date(this._selectedYear, this._selectedMonth + offset, 1);
|
||||
if (offset < 0) {
|
||||
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
|
||||
}
|
||||
return this._isInRange(date);
|
||||
},
|
||||
|
||||
/* Is the given date in the accepted range? */
|
||||
_isInRange: function(date) {
|
||||
var minDate = this._get('minDate');
|
||||
var maxDate = this._get('maxDate');
|
||||
return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
|
||||
},
|
||||
|
||||
/* Format the given date for display. */
|
||||
_formatDate: function() {
|
||||
var day = this._currentDay = this._selectedDay;
|
||||
var month = this._currentMonth = this._selectedMonth;
|
||||
var year = this._currentYear = this._selectedYear;
|
||||
month++; // adjust javascript month
|
||||
var dateFormat = this._get('dateFormat');
|
||||
var dateString = '';
|
||||
for (var i = 0; i < 3; i++) {
|
||||
dateString += dateFormat.charAt(3) +
|
||||
(dateFormat.charAt(i) == 'D' ? (day < 10 ? '0' : '') + day :
|
||||
(dateFormat.charAt(i) == 'M' ? (month < 10 ? '0' : '') + month :
|
||||
(dateFormat.charAt(i) == 'Y' ? year : '?')));
|
||||
}
|
||||
return dateString.substring(dateFormat.charAt(3) ? 1 : 0);
|
||||
}
|
||||
});
|
||||
|
||||
/* jQuery extend now ignores nulls! */
|
||||
function extendRemove(target, props) {
|
||||
$.extend(target, props);
|
||||
for (var name in props) {
|
||||
if (props[name] == null) {
|
||||
target[name] = null;
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/* Attach the calendar to a jQuery selection.
|
||||
@param settings object - the new settings to use for this calendar instance (anonymous)
|
||||
@return jQuery object - for chaining further calls */
|
||||
$.fn.calendar = function(settings) {
|
||||
return this.each(function() {
|
||||
// check for settings on the control itself - in namespace 'cal:'
|
||||
var inlineSettings = null;
|
||||
for (attrName in popUpCal._defaults) {
|
||||
var attrValue = this.getAttribute('cal:' + attrName);
|
||||
if (attrValue) {
|
||||
inlineSettings = inlineSettings || {};
|
||||
try {
|
||||
inlineSettings[attrName] = eval(attrValue);
|
||||
}
|
||||
catch (err) {
|
||||
inlineSettings[attrName] = attrValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
var nodeName = this.nodeName.toLowerCase();
|
||||
if (nodeName == 'input') {
|
||||
var instSettings = (inlineSettings ? $.extend($.extend({}, settings || {}),
|
||||
inlineSettings || {}) : settings); // clone and customise
|
||||
var inst = (inst && !inlineSettings ? inst :
|
||||
new PopUpCalInstance(instSettings, false));
|
||||
popUpCal._connectCalendar(this, inst);
|
||||
}
|
||||
else if (nodeName == 'div' || nodeName == 'span') {
|
||||
var instSettings = $.extend($.extend({}, settings || {}),
|
||||
inlineSettings || {}); // clone and customise
|
||||
var inst = new PopUpCalInstance(instSettings, true);
|
||||
popUpCal._inlineCalendar(this, inst);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* Initialise the calendar. */
|
||||
$(document).ready(function() {
|
||||
popUpCal = new PopUpCal(); // singleton instance
|
||||
});
|
||||
133
js/ui.dialog.js
@@ -1,133 +0,0 @@
|
||||
(function($)
|
||||
{
|
||||
//If the UI scope is not availalable, add it
|
||||
$.ui = $.ui || {};
|
||||
|
||||
$.fn.dialog = function(o) {
|
||||
return this.each(function() {
|
||||
if (!$(this).is(".ui-dialog")) new $.ui.dialog(this, o);
|
||||
});
|
||||
}
|
||||
$.fn.dialogOpen = function() {
|
||||
return this.each(function() {
|
||||
var contentEl;
|
||||
if ($(this).parents(".ui-dialog").length) contentEl = this;
|
||||
if (!contentEl && $(this).is(".ui-dialog")) contentEl = $('.ui-dialog-content', this)[0];
|
||||
$.ui.dialogOpen(contentEl)
|
||||
});
|
||||
}
|
||||
$.fn.dialogClose = function() {
|
||||
return this.each(function() {
|
||||
var contentEl;
|
||||
if ($(this).parents(".ui-dialog").length) contentEl = this;
|
||||
if (!contentEl && $(this).is(".ui-dialog")) contentEl = $('.ui-dialog-content', this)[0];
|
||||
$.ui.dialogClose(contentEl);
|
||||
});
|
||||
}
|
||||
|
||||
$.ui.dialog = function(el, o) {
|
||||
|
||||
var options = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
position: 'center',
|
||||
buttons: [],
|
||||
modal: false,
|
||||
drag: true,
|
||||
resize: true,
|
||||
shadow: false // It's quite slow
|
||||
};
|
||||
var o = o || {}; $.extend(options, o); //Extend and copy options
|
||||
this.element = el; var self = this; //Do bindings
|
||||
$.data(this.element, "ui-dialog", this);
|
||||
|
||||
var uiDialogContent = $(el).addClass('ui-dialog-content')
|
||||
.wrap(document.createElement('div'))
|
||||
.wrap(document.createElement('div'));
|
||||
var uiDialogContainer = uiDialogContent.parent().addClass('ui-dialog-container').css({position: 'relative'});
|
||||
var uiDialog = uiDialogContainer.parent()
|
||||
.addClass('ui-dialog').addClass(uiDialogContent.attr('className'))
|
||||
.css({position: 'absolute', width: options.width, height: options.height});
|
||||
|
||||
if (options.modal == false && options.resize == true) {
|
||||
uiDialog.append("<div class='ui-resizable-n ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-s ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-e ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-w ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-ne ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-se ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-sw ui-resizable-handle'></div>")
|
||||
.append("<div class='ui-resizable-nw ui-resizable-handle'></div>");
|
||||
|
||||
uiDialog.resizable();
|
||||
}
|
||||
|
||||
uiDialogContainer.prepend('<div class="ui-dialog-titlebar"></div>');
|
||||
var uiDialogTitlebar = $('.ui-dialog-titlebar', uiDialogContainer);
|
||||
var title = (options.title) ? options.title : (uiDialogContent.attr('title')) ? uiDialogContent.attr('title') : '';
|
||||
uiDialogTitlebar.append('<span class="ui-dialog-title">' + title + '</span>');
|
||||
uiDialogTitlebar.append('<div class="ui-dialog-titlebar-close"></div>');
|
||||
$('.ui-dialog-titlebar-close', uiDialogTitlebar)
|
||||
.hover(function() { $(this).addClass('ui-dialog-titlebar-close-hover'); },
|
||||
function() { $(this).removeClass('ui-dialog-titlebar-close-hover'); })
|
||||
.mousedown(function(ev) {
|
||||
ev.stopPropagation();
|
||||
})
|
||||
.click(function() {
|
||||
self.close();
|
||||
});
|
||||
var l = 0;
|
||||
$.each(options.buttons, function() { l = 1; return false; });
|
||||
if (l == 1) {
|
||||
uiDialog.append('<div class="ui-dialog-buttonpane"></div>');
|
||||
var uiDialogButtonPane = $('.ui-dialog-buttonpane', uiDialog);
|
||||
$.each(options.buttons, function(name, value) {
|
||||
var btn = $(document.createElement('button')).text(name).click(value);
|
||||
uiDialogButtonPane.append(btn);
|
||||
});
|
||||
}
|
||||
|
||||
if (options.modal == false && options.drag == true) {
|
||||
uiDialog.draggable({ handle: '.ui-dialog-titlebar' });
|
||||
}
|
||||
|
||||
this.open = function() {
|
||||
var wnd = $(window), top = 0, left = 0;
|
||||
switch (options.position) {
|
||||
case 'center':
|
||||
top = (wnd.height() / 2) - (uiDialog.height() / 2);
|
||||
left = (wnd.width() / 2) - (uiDialog.width() / 2);
|
||||
break;
|
||||
case 'left':
|
||||
top = (wnd.height() / 2) - (uiDialog.height() / 2);
|
||||
left = 0;
|
||||
break;
|
||||
case 'top':
|
||||
top = 0;
|
||||
left = (wnd.width() / 2) - (uiDialog.width() / 2);
|
||||
break;
|
||||
}
|
||||
uiDialog.css({top: top, left: left});
|
||||
uiDialog.appendTo('body').show();
|
||||
};
|
||||
|
||||
this.close = function() {
|
||||
uiDialog.hide();
|
||||
};
|
||||
|
||||
uiDialog.show();
|
||||
this.open();
|
||||
if (options.shadow && $.fn.shadow != undefined) {
|
||||
uiDialog.shadow();
|
||||
}
|
||||
}
|
||||
|
||||
$.ui.dialogOpen = function(el) {
|
||||
$.data(el, "ui-dialog").open();
|
||||
}
|
||||
|
||||
$.ui.dialogClose = function(el) {
|
||||
$.data(el, "ui-dialog").close();
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
* 'this' -> original element
|
||||
* 1. argument: browser event
|
||||
* 2.argument: ui object
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.ui.plugin.add("draggable", "stop", "effect", function(e,ui) {
|
||||
var t = ui.helper;
|
||||
if(ui.options.effect[1]) {
|
||||
if(t != this) {
|
||||
ui.options.beQuietAtEnd = true;
|
||||
switch(ui.options.effect[1]) {
|
||||
case 'fade':
|
||||
$(t).fadeOut(300, function() { $(this).remove(); });
|
||||
break;
|
||||
default:
|
||||
$(t).remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "effect", function(e,ui) {
|
||||
if(ui.options.effect[0]) {
|
||||
switch(ui.options.effect[0]) {
|
||||
case 'fade':
|
||||
$(ui.helper).hide().fadeIn(300);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "cursor", function(e,ui) {
|
||||
var t = $('body');
|
||||
if (t.css("cursor")) ui.options.ocursor = t.css("cursor");
|
||||
t.css("cursor", ui.options.cursor);
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable", "stop", "cursor", function(e,ui) {
|
||||
if (ui.options.ocursor) $('body').css("cursor", ui.options.ocursor);
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "zIndex", function(e,ui) {
|
||||
var t = $(ui.helper);
|
||||
if(t.css("zIndex")) ui.options.ozIndex = t.css("zIndex");
|
||||
t.css('zIndex', ui.options.zIndex);
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable", "stop", "zIndex", function(e,ui) {
|
||||
if(ui.options.ozIndex) $(ui.helper).css('zIndex', ui.options.ozIndex);
|
||||
});
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "opacity", function(e,ui) {
|
||||
var t = $(ui.helper);
|
||||
if(t.css("opacity")) ui.options.oopacity = t.css("opacity");
|
||||
t.css('opacity', ui.options.opacity);
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable", "stop", "opacity", function(e,ui) {
|
||||
if(ui.options.oopacity) $(ui.helper).css('opacity', ui.options.oopacity);
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "stop", "revert", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
var rpos = { left: 0, top: 0 };
|
||||
o.beQuietAtEnd = true;
|
||||
|
||||
if(ui.helper != this) {
|
||||
|
||||
rpos = $(ui.draggable.sorthelper || this).offset({ border: false });
|
||||
|
||||
var nl = rpos.left-o.po.left-o.margins.left;
|
||||
var nt = rpos.top-o.po.top-o.margins.top;
|
||||
|
||||
} else {
|
||||
var nl = o.co.left - (o.po ? o.po.left : 0);
|
||||
var nt = o.co.top - (o.po ? o.po.top : 0);
|
||||
}
|
||||
|
||||
var self = ui.draggable;
|
||||
|
||||
$(ui.helper).animate({
|
||||
left: nl,
|
||||
top: nt
|
||||
}, 500, function() {
|
||||
|
||||
if(o.wasPositioned) $(self.element).css('position', o.wasPositioned);
|
||||
if(o.stop) o.stop.apply(self.element, [self.helper, self.pos, [o.co.left - o.po.left,o.co.top - o.po.top],self]);
|
||||
|
||||
if(self.helper != self.element) window.setTimeout(function() { $(self.helper).remove(); }, 0); //Using setTimeout because of strange flickering in Firefox
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "iframeFix", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
if(!ui.draggable.slowMode) { // Make clones on top of iframes (only if we are not in slowMode)
|
||||
if(o.iframeFix.constructor == Array) {
|
||||
for(var i=0;i<o.iframeFix.length;i++) {
|
||||
var co = $(o.iframeFix[i]).offset({ border: false });
|
||||
$("<div class='DragDropIframeFix' style='background: #fff;'></div>").css("width", $(o.iframeFix[i])[0].offsetWidth+"px").css("height", $(o.iframeFix[i])[0].offsetHeight+"px").css("position", "absolute").css("opacity", "0.001").css("z-index", "1000").css("top", co.top+"px").css("left", co.left+"px").appendTo("body");
|
||||
}
|
||||
} else {
|
||||
$("iframe").each(function() {
|
||||
var co = $(this).offset({ border: false });
|
||||
$("<div class='DragDropIframeFix' style='background: #fff;'></div>").css("width", this.offsetWidth+"px").css("height", this.offsetHeight+"px").css("position", "absolute").css("opacity", "0.001").css("z-index", "1000").css("top", co.top+"px").css("left", co.left+"px").appendTo("body");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable","stop", "iframeFix", function(e,ui) {
|
||||
if(ui.options.iframeFix) $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "start", "containment", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
|
||||
if(!o.cursorAtIgnore || o.containment.left != undefined || o.containment.constructor == Array) return;
|
||||
if(o.containment == 'parent') o.containment = this.parentNode;
|
||||
|
||||
|
||||
if(o.containment == 'document') {
|
||||
o.containment = [
|
||||
0-o.margins.left,
|
||||
0-o.margins.top,
|
||||
$(document).width()-o.margins.right,
|
||||
($(document).height() || document.body.parentNode.scrollHeight)-o.margins.bottom
|
||||
];
|
||||
} else { //I'm a node, so compute top/left/right/bottom
|
||||
var ce = $(o.containment)[0];
|
||||
var co = $(o.containment).offset({ border: false });
|
||||
|
||||
o.containment = [
|
||||
co.left-o.margins.left,
|
||||
co.top-o.margins.top,
|
||||
co.left+(ce.offsetWidth || ce.scrollWidth)-o.margins.right,
|
||||
co.top+(ce.offsetHeight || ce.scrollHeight)-o.margins.bottom
|
||||
];
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.ui.plugin.add("draggable", "drag", "containment", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
if(!o.cursorAtIgnore) return;
|
||||
|
||||
var h = $(ui.helper);
|
||||
var c = o.containment;
|
||||
if(c.constructor == Array) {
|
||||
|
||||
if((ui.draggable.pos[0] < c[0]-o.po.left)) ui.draggable.pos[0] = c[0]-o.po.left;
|
||||
if((ui.draggable.pos[1] < c[1]-o.po.top)) ui.draggable.pos[1] = c[1]-o.po.top;
|
||||
if(ui.draggable.pos[0]+h[0].offsetWidth > c[2]-o.po.left) ui.draggable.pos[0] = c[2]-o.po.left-h[0].offsetWidth;
|
||||
if(ui.draggable.pos[1]+h[0].offsetHeight > c[3]-o.po.top) ui.draggable.pos[1] = c[3]-o.po.top-h[0].offsetHeight;
|
||||
|
||||
} else {
|
||||
|
||||
if(c.left && (ui.draggable.pos[0] < c.left)) ui.draggable.pos[0] = c.left;
|
||||
if(c.top && (ui.draggable.pos[1] < c.top)) ui.draggable.pos[1] = c.top;
|
||||
|
||||
var p = $(o.pp);
|
||||
if(c.right && ui.draggable.pos[0]+h[0].offsetWidth > p[0].offsetWidth-c.right) ui.draggable.pos[0] = (p[0].offsetWidth-c.right)-h[0].offsetWidth;
|
||||
if(c.bottom && ui.draggable.pos[1]+h[0].offsetHeight > p[0].offsetHeight-c.bottom) ui.draggable.pos[1] = (p[0].offsetHeight-c.bottom)-h[0].offsetHeight;
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "drag", "grid", function(e,ui) {
|
||||
var o = ui.options;
|
||||
if(!o.cursorAtIgnore) return;
|
||||
ui.draggable.pos[0] = o.co.left + o.margins.left - o.po.left + Math.round((ui.draggable.pos[0] - o.co.left - o.margins.left + o.po.left) / o.grid[0]) * o.grid[0];
|
||||
ui.draggable.pos[1] = o.co.top + o.margins.top - o.po.top + Math.round((ui.draggable.pos[1] - o.co.top - o.margins.top + o.po.top) / o.grid[1]) * o.grid[1];
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "drag", "axis", function(e,ui) {
|
||||
var o = ui.options;
|
||||
if(!o.cursorAtIgnore) return;
|
||||
if(o.constraint) o.axis = o.constraint; //Legacy check
|
||||
o.axis ? ( o.axis == 'x' ? ui.draggable.pos[1] = o.co.top - o.margins.top - o.po.top : ui.draggable.pos[0] = o.co.left - o.margins.left - o.po.left ) : null;
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "drag", "scroll", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
o.scrollSensitivity = o.scrollSensitivity || 20;
|
||||
o.scrollSpeed = o.scrollSpeed || 20;
|
||||
|
||||
if(o.pp && o.ppOverflow) { // If we have a positioned parent, we only scroll in this one
|
||||
// TODO: Extremely strange issues are waiting here..handle with care
|
||||
} else {
|
||||
if((ui.draggable.rpos[1] - $(window).height()) - $(document).scrollTop() > -o.scrollSensitivity) window.scrollBy(0,o.scrollSpeed);
|
||||
if(ui.draggable.rpos[1] - $(document).scrollTop() < o.scrollSensitivity) window.scrollBy(0,-o.scrollSpeed);
|
||||
if((ui.draggable.rpos[0] - $(window).width()) - $(document).scrollLeft() > -o.scrollSensitivity) window.scrollBy(o.scrollSpeed,0);
|
||||
if(ui.draggable.rpos[0] - $(document).scrollLeft() < o.scrollSensitivity) window.scrollBy(-o.scrollSpeed,0);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
$.ui.plugin.add("draggable", "drag", "wrapHelper", function(e,ui) {
|
||||
|
||||
var o = ui.options;
|
||||
if(o.cursorAtIgnore) return;
|
||||
var t = ui.helper;
|
||||
|
||||
if(!o.pp || !o.ppOverflow) {
|
||||
var wx = $(window).width() - ($.browser.mozilla ? 20 : 0);
|
||||
var sx = $(document).scrollLeft();
|
||||
|
||||
var wy = $(window).height();
|
||||
var sy = $(document).scrollTop();
|
||||
} else {
|
||||
var wx = o.pp.offsetWidth + o.po.left - 20;
|
||||
var sx = o.pp.scrollLeft;
|
||||
|
||||
var wy = o.pp.offsetHeight + o.po.top - 20;
|
||||
var sy = o.pp.scrollTop;
|
||||
}
|
||||
|
||||
ui.draggable.pos[0] -= ((ui.draggable.rpos[0]-o.cursorAt.left - wx + t.offsetWidth+o.margins.right) - sx > 0 || (ui.draggable.rpos[0]-o.cursorAt.left+o.margins.left) - sx < 0) ? (t.offsetWidth+o.margins.left+o.margins.right - o.cursorAt.left * 2) : 0;
|
||||
|
||||
ui.draggable.pos[1] -= ((ui.draggable.rpos[1]-o.cursorAt.top - wy + t.offsetHeight+o.margins.bottom) - sy > 0 || (ui.draggable.rpos[1]-o.cursorAt.top+o.margins.top) - sy < 0) ? (t.offsetHeight+o.margins.top+o.margins.bottom - o.cursorAt.top * 2) : 0;
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { draggable: "(' '+a.className+' ').indexOf(' ui-draggable ')" });
|
||||
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-draggable")) jQuery.data(this, "ui-draggable")["'+cur+'"](a); }); }');
|
||||
$.fn["draggable"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.draggableInstance = function() {
|
||||
if($(this[0]).is(".ui-draggable")) return $.data(this[0], "ui-draggable");
|
||||
return false;
|
||||
};
|
||||
|
||||
$.fn.draggable = function(o) {
|
||||
return this.each(function() {
|
||||
new $.ui.draggable(this, o);
|
||||
});
|
||||
}
|
||||
|
||||
$.ui.ddmanager = {
|
||||
current: null,
|
||||
droppables: [],
|
||||
prepareOffsets: function(t, e) {
|
||||
var dropTop = $.ui.ddmanager.dropTop = [];
|
||||
var dropLeft = $.ui.ddmanager.dropLeft;
|
||||
var m = $.ui.ddmanager.droppables;
|
||||
for (var i = 0; i < m.length; i++) {
|
||||
if(m[i].item.disabled) continue;
|
||||
m[i].offset = $(m[i].item.element).offset();
|
||||
if (t && m[i].item.options.accept(t.element)) //Activate the droppable if used directly from draggables
|
||||
m[i].item.activate.call(m[i].item, e);
|
||||
}
|
||||
},
|
||||
fire: function(oDrag, e) {
|
||||
|
||||
var oDrops = $.ui.ddmanager.droppables;
|
||||
var oOvers = $.grep(oDrops, function(oDrop) {
|
||||
|
||||
if (!oDrop.item.disabled && $.ui.intersect(oDrag, oDrop, oDrop.item.options.tolerance))
|
||||
oDrop.item.drop.call(oDrop.item, e);
|
||||
});
|
||||
$.each(oDrops, function(i, oDrop) {
|
||||
if (!oDrop.item.disabled && oDrop.item.options.accept(oDrag.element)) {
|
||||
oDrop.out = 1; oDrop.over = 0;
|
||||
oDrop.item.deactivate.call(oDrop.item, e);
|
||||
}
|
||||
});
|
||||
},
|
||||
update: function(oDrag, e) {
|
||||
|
||||
if(oDrag.options.refreshPositions) $.ui.ddmanager.prepareOffsets();
|
||||
|
||||
var oDrops = $.ui.ddmanager.droppables;
|
||||
var oOvers = $.grep(oDrops, function(oDrop) {
|
||||
if(oDrop.item.disabled) return false;
|
||||
var isOver = $.ui.intersect(oDrag, oDrop, oDrop.item.options.tolerance)
|
||||
if (!isOver && oDrop.over == 1) {
|
||||
oDrop.out = 1; oDrop.over = 0;
|
||||
oDrop.item.out.call(oDrop.item, e);
|
||||
}
|
||||
return isOver;
|
||||
});
|
||||
$.each(oOvers, function(i, oOver) {
|
||||
if (oOver.over == 0) {
|
||||
oOver.out = 0; oOver.over = 1;
|
||||
oOver.item.over.call(oOver.item, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.ui.draggable = function(el, o) {
|
||||
|
||||
var options = {};
|
||||
$.extend(options, o);
|
||||
var self = this;
|
||||
$.extend(options, {
|
||||
_start: function(h, p, c, t, e) {
|
||||
self.start.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_beforeStop: function(h, p, c, t, e) {
|
||||
self.stop.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_drag: function(h, p, c, t, e) {
|
||||
self.drag.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
startCondition: function(e) {
|
||||
return !(e.target.className.indexOf("ui-resizable-handle") != -1 || self.disabled);
|
||||
}
|
||||
});
|
||||
|
||||
$.data(el, "ui-draggable", this);
|
||||
|
||||
if (options.ghosting == true) options.helper = 'clone'; //legacy option check
|
||||
$(el).addClass("ui-draggable");
|
||||
this.interaction = new $.ui.mouseInteraction(el, options);
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.draggable.prototype, {
|
||||
plugins: {},
|
||||
currentTarget: null,
|
||||
lastTarget: null,
|
||||
destroy: function() {
|
||||
$(this.interaction.element).removeClass("ui-draggable").removeClass("ui-draggable-disabled");
|
||||
this.interaction.destroy();
|
||||
},
|
||||
enable: function() {
|
||||
$(this.interaction.element).removeClass("ui-draggable-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.interaction.element).addClass("ui-draggable-disabled");
|
||||
this.disabled = true;
|
||||
},
|
||||
prepareCallbackObj: function(self) {
|
||||
return {
|
||||
helper: self.helper,
|
||||
position: { left: self.pos[0], top: self.pos[1] },
|
||||
offset: self.options.cursorAt,
|
||||
draggable: self,
|
||||
options: self.options
|
||||
}
|
||||
},
|
||||
start: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
$.ui.ddmanager.current = this;
|
||||
|
||||
$.ui.plugin.call(that, 'start', [e, that.prepareCallbackObj(this)]);
|
||||
$(this.element).triggerHandler("dragstart", [e, that.prepareCallbackObj(this)], o.start);
|
||||
|
||||
if (this.slowMode && $.ui.droppable && !o.dropBehaviour)
|
||||
$.ui.ddmanager.prepareOffsets(this, e);
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
stop: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
$.ui.plugin.call(that, 'stop', [e, that.prepareCallbackObj(this)]);
|
||||
$(this.element).triggerHandler("dragstop", [e, that.prepareCallbackObj(this)], o.stop);
|
||||
|
||||
if (this.slowMode && $.ui.droppable && !o.dropBehaviour) //If cursorAt is within the helper, we must use our drop manager
|
||||
$.ui.ddmanager.fire(this, e);
|
||||
|
||||
$.ui.ddmanager.current = null;
|
||||
$.ui.ddmanager.last = this;
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
drag: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
$.ui.ddmanager.update(this, e);
|
||||
|
||||
this.pos = [this.pos[0]-o.cursorAt.left, this.pos[1]-o.cursorAt.top];
|
||||
|
||||
$.ui.plugin.call(that, 'drag', [e, that.prepareCallbackObj(this)]);
|
||||
var nv = $(this.element).triggerHandler("drag", [e, that.prepareCallbackObj(this)], o.drag);
|
||||
|
||||
var nl = (nv && nv.left) ? nv.left : this.pos[0];
|
||||
var nt = (nv && nv.top) ? nv.top : this.pos[1];
|
||||
|
||||
$(this.helper).css('left', nl+'px').css('top', nt+'px'); // Stick the helper to the cursor
|
||||
return false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})($);
|
||||
@@ -1,25 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
// options.activeClass
|
||||
$.ui.plugin.add("droppable", "activate", "activeClass", function(e,ui) {
|
||||
$(this).addClass(ui.options.activeClass);
|
||||
});
|
||||
$.ui.plugin.add("droppable", "deactivate", "activeClass", function(e,ui) {
|
||||
$(this).removeClass(ui.options.activeClass);
|
||||
});
|
||||
$.ui.plugin.add("droppable", "drop", "activeClass", function(e,ui) {
|
||||
$(this).removeClass(ui.options.activeClass);
|
||||
});
|
||||
|
||||
// options.hoverClass
|
||||
$.ui.plugin.add("droppable", "over", "hoverClass", function(e,ui) {
|
||||
$(this).addClass(ui.options.hoverClass);
|
||||
});
|
||||
$.ui.plugin.add("droppable", "out", "hoverClass", function(e,ui) {
|
||||
$(this).removeClass(ui.options.hoverClass);
|
||||
});
|
||||
$.ui.plugin.add("droppable", "drop", "hoverClass", function(e,ui) {
|
||||
$(this).removeClass(ui.options.hoverClass);
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,201 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { droppable: "(' '+a.className+' ').indexOf(' ui-droppable ')" });
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-droppable")) jQuery.data(this, "ui-droppable")["'+cur+'"](a); }); }');
|
||||
$.fn["droppable"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.droppableInstance = function() {
|
||||
if($(this[0]).is(".ui-droppable")) return $.data(this[0], "ui-droppable");
|
||||
return false;
|
||||
};
|
||||
|
||||
$.fn.droppable = function(o) {
|
||||
return this.each(function() {
|
||||
new $.ui.droppable(this,o);
|
||||
});
|
||||
}
|
||||
|
||||
$.ui.droppable = function(el,o) {
|
||||
|
||||
if(!o) var o = {};
|
||||
this.element = el; if($.browser.msie) el.droppable = 1;
|
||||
$.data(el, "ui-droppable", this);
|
||||
|
||||
this.options = {};
|
||||
$.extend(this.options, o);
|
||||
|
||||
var accept = o.accept;
|
||||
$.extend(this.options, {
|
||||
accept: o.accept && o.accept.constructor == Function ? o.accept : function(d) {
|
||||
return $(d).is(accept);
|
||||
},
|
||||
tolerance: o.tolerance || 'intersect'
|
||||
});
|
||||
o = this.options;
|
||||
var self = this;
|
||||
|
||||
this.mouseBindings = [function(e) { return self.move.apply(self, [e]); },function(e) { return self.drop.apply(self, [e]); }];
|
||||
$(this.element).bind("mousemove", this.mouseBindings[0]);
|
||||
$(this.element).bind("mouseup", this.mouseBindings[1]);
|
||||
|
||||
$.ui.ddmanager.droppables.push({ item: this, over: 0, out: 1 }); // Add the reference and positions to the manager
|
||||
$(this.element).addClass("ui-droppable");
|
||||
|
||||
};
|
||||
|
||||
$.extend($.ui.droppable.prototype, {
|
||||
plugins: {},
|
||||
prepareCallbackObj: function(c) {
|
||||
return {
|
||||
draggable: c,
|
||||
droppable: this,
|
||||
element: c.element,
|
||||
helper: c.helper,
|
||||
options: this.options
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
$(this.element).removeClass("ui-droppable").removeClass("ui-droppable-disabled");
|
||||
$(this.element).unbind("mousemove", this.mouseBindings[0]);
|
||||
$(this.element).unbind("mouseup", this.mouseBindings[1]);
|
||||
|
||||
for(var i=0;i<$.ui.ddmanager.droppables.length;i++) {
|
||||
if($.ui.ddmanager.droppables[i].item == this) $.ui.ddmanager.droppables.splice(i,1);
|
||||
}
|
||||
},
|
||||
enable: function() {
|
||||
$(this.element).removeClass("ui-droppable-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.element).addClass("ui-droppable-disabled");
|
||||
this.disabled = true;
|
||||
},
|
||||
move: function(e) {
|
||||
|
||||
if(!$.ui.ddmanager.current) return;
|
||||
|
||||
var o = this.options;
|
||||
var c = $.ui.ddmanager.current;
|
||||
|
||||
/* Save current target, if no last target given */
|
||||
var findCurrentTarget = function(e) {
|
||||
if(e.currentTarget) return e.currentTarget;
|
||||
var el = e.srcElement;
|
||||
do { if(el.droppable) return el; el = el.parentNode; } while (el); //This is only used in IE! references in DOM are evil!
|
||||
}
|
||||
if(c && o.accept(c.element)) c.currentTarget = findCurrentTarget(e);
|
||||
|
||||
c.drag.apply(c, [e]);
|
||||
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
|
||||
|
||||
},
|
||||
over: function(e) {
|
||||
|
||||
var c = $.ui.ddmanager.current;
|
||||
if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element
|
||||
|
||||
var o = this.options;
|
||||
if (o.accept(c.element)) {
|
||||
$.ui.plugin.call(this, 'over', [e, this.prepareCallbackObj(c)]);
|
||||
$(this.element).triggerHandler("dropover", [e, this.prepareCallbackObj(c)], o.over);
|
||||
}
|
||||
|
||||
},
|
||||
out: function(e) {
|
||||
|
||||
var c = $.ui.ddmanager.current;
|
||||
if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element
|
||||
|
||||
var o = this.options;
|
||||
if (o.accept(c.element)) {
|
||||
$.ui.plugin.call(this, 'out', [e, this.prepareCallbackObj(c)]);
|
||||
$(this.element).triggerHandler("dropout", [e, this.prepareCallbackObj(c)], o.out);
|
||||
}
|
||||
|
||||
},
|
||||
drop: function(e) {
|
||||
|
||||
var c = $.ui.ddmanager.current;
|
||||
if (!c || c.element == this.element) return; // Bail if draggable and droppable are same element
|
||||
|
||||
var o = this.options;
|
||||
if(o.accept(c.element)) { // Fire callback
|
||||
if(o.greedy && !c.slowMode) {
|
||||
if(c.currentTarget == this.element) {
|
||||
$.ui.plugin.call(this, 'drop', [e, {
|
||||
draggable: c,
|
||||
droppable: this,
|
||||
element: c.element,
|
||||
helper: c.helper
|
||||
}]);
|
||||
$(this.element).triggerHandler("drop", [e, {
|
||||
draggable: c,
|
||||
droppable: this,
|
||||
element: c.element,
|
||||
helper: c.helper
|
||||
}], o.drop);
|
||||
}
|
||||
} else {
|
||||
$.ui.plugin.call(this, 'drop', [e, this.prepareCallbackObj(c)]);
|
||||
$(this.element).triggerHandler("drop", [e, this.prepareCallbackObj(c)], o.drop);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
activate: function(e) {
|
||||
var c = $.ui.ddmanager.current;
|
||||
$.ui.plugin.call(this, 'activate', [e, this.prepareCallbackObj(c)]);
|
||||
if(c) $(this.element).triggerHandler("dropactivate", [e, this.prepareCallbackObj(c)], this.options.activate);
|
||||
},
|
||||
deactivate: function(e) {
|
||||
var c = $.ui.ddmanager.current;
|
||||
$.ui.plugin.call(this, 'deactivate', [e, this.prepareCallbackObj(c)]);
|
||||
if(c) $(this.element).triggerHandler("dropdeactivate", [e, this.prepareCallbackObj(c)], this.options.deactivate);
|
||||
}
|
||||
});
|
||||
|
||||
$.ui.intersect = function(oDrag, oDrop, toleranceMode) {
|
||||
if (!oDrop.offset)
|
||||
return false;
|
||||
var x1 = oDrag.rpos[0] - oDrag.options.cursorAt.left + oDrag.options.margins.left, x2 = x1 + oDrag.helperSize.width,
|
||||
y1 = oDrag.rpos[1] - oDrag.options.cursorAt.top + oDrag.options.margins.top, y2 = y1 + oDrag.helperSize.height;
|
||||
var l = oDrop.offset.left, r = l + oDrop.item.element.offsetWidth,
|
||||
t = oDrop.offset.top, b = t + oDrop.item.element.offsetHeight;
|
||||
switch (toleranceMode) {
|
||||
case 'fit':
|
||||
return ( l < x1 && x2 < r
|
||||
&& t < y1 && y2 < b);
|
||||
break;
|
||||
case 'intersect':
|
||||
return ( l < x1 + (oDrag.helperSize.width / 2) // Right Half
|
||||
&& x2 - (oDrag.helperSize.width / 2) < r // Left Half
|
||||
&& t < y1 + (oDrag.helperSize.height / 2) // Bottom Half
|
||||
&& y2 - (oDrag.helperSize.height / 2) < b ); // Top Half
|
||||
break;
|
||||
case 'pointer':
|
||||
return ( l < oDrag.rpos[0] && oDrag.rpos[0] < r
|
||||
&& t < oDrag.rpos[1] && oDrag.rpos[1] < b);
|
||||
break;
|
||||
case 'touch':
|
||||
return ( (l < x1 && x1 < r && t < y1 && y1 < b) // Top-Left Corner
|
||||
|| (l < x1 && x1 < r && t < y2 && y2 < b) // Bottom-Left Corner
|
||||
|| (l < x2 && x2 < r && t < y1 && y1 < b) // Top-Right Corner
|
||||
|| (l < x2 && x2 < r && t < y2 && y2 < b) ); // Bottom-Right Corner
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
})($);
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//If the UI scope is not availalable, add it
|
||||
$.ui = $.ui || {};
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { magnifier: "(' '+a.className+' ').indexOf(' ui-magnifier ')" });
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable,reset".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-magnifier")) jQuery.data(this, "ui-magnifier")["'+cur+'"](a); }); }');
|
||||
$.fn["magnifier"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.magnifierInstance = function() {
|
||||
if($(this[0]).is(".ui-magnifier")) return $.data(this[0], "ui-magnifier");
|
||||
return false;
|
||||
};
|
||||
|
||||
$.fn.magnifier = function(options) {
|
||||
return this.each(function() {
|
||||
new $.ui.magnifier(this,options);
|
||||
});
|
||||
};
|
||||
|
||||
$.ui.magnifier = function(el,options) {
|
||||
|
||||
var self = this; this.items = []; this.element = el;
|
||||
this.options = options || {}; var o = this.options;
|
||||
$.data(el, "ui-magnifier", this);
|
||||
$(el).addClass("ui-magnifier");
|
||||
|
||||
o.distance = o.distance || 150;
|
||||
o.magnification = o.magnification || 2;
|
||||
o.baseline = o.baseline || 0;
|
||||
o.verticalLine = o.verticalLine != undefined ? o.verticalLine : -0.5;
|
||||
|
||||
this.pp = $(el).offset({ border: false });
|
||||
|
||||
$('> *', el).each(function() {
|
||||
var co = $(this).offset({ border: false });
|
||||
if(self.options.overlap) var cp = $(this).position();
|
||||
self.items.push([this, co, [$(this).width(),$(this).height()], (cp || null)]);
|
||||
|
||||
if(o.opacity)
|
||||
$(this).css('opacity', o.opacity.min);
|
||||
});
|
||||
|
||||
if(o.overlap) {
|
||||
for(var i=0;i<this.items.length;i++) {
|
||||
//Absolute stuff
|
||||
$(this.items[i][0]).css({
|
||||
position: "absolute",
|
||||
top: this.items[i][3].top,
|
||||
left: this.items[i][3].left
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
this.moveEvent = function(e) { if(!self.disabled) self.magnify.apply(self, [e]); }
|
||||
$(document).bind("mousemove", this.moveEvent);
|
||||
|
||||
if(o.click) { //If onclick callback is available
|
||||
|
||||
this.clickEvent = function(e) { if(!self.disabled) o.click.apply(this, [e, { options: self.options, current: self.current[0], currentOffset: self.current[1] }]); }
|
||||
$(el).bind('click', this.clickEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.magnifier.prototype, {
|
||||
destroy: function() {
|
||||
$(this.element).removeClass("ui-magnifier").removeClass("ui-magnifier-disabled");
|
||||
$(document).unbind("mousemove", this.moveEvent);
|
||||
if(this.clickEvent) $(this.element).unbind("click", this.clickEvent);
|
||||
},
|
||||
enable: function() {
|
||||
$(this.element).removeClass("ui-magnifier-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.element).addClass("ui-magnifier-disabled");
|
||||
this.reset();
|
||||
this.disabled = true;
|
||||
},
|
||||
reset: function(e) {
|
||||
|
||||
var o = this.options;
|
||||
var c;
|
||||
var distance = 1;
|
||||
|
||||
for(var i=0;i<this.items.length;i++) {
|
||||
|
||||
c = this.items[i];
|
||||
|
||||
$(c[0]).css({
|
||||
width: c[2][0],
|
||||
height: c[2][1],
|
||||
top: (c[3] ? c[3].top : 0),
|
||||
left: (c[3] ? c[3].left : 0)
|
||||
});
|
||||
|
||||
if(o.opacity)
|
||||
$(c[0]).css('opacity', o.opacity.min);
|
||||
|
||||
if(o.zIndex)
|
||||
$(c[0]).css("z-index", "");
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
magnify: function(e) {
|
||||
var p = [e.pageX,e.pageY];
|
||||
var o = this.options;
|
||||
var c;
|
||||
this.current = this.items[0];
|
||||
var distance = 1;
|
||||
|
||||
//Compute the parents distance, because we don't need to fire anything if we are not near the parent
|
||||
|
||||
var overlap = ((p[0] > this.pp.left-o.distance && p[0] < this.pp.left + this.element.offsetWidth + o.distance) && (p[1] > this.pp.top-o.distance && p[1] < this.pp.top + this.element.offsetHeight + o.distance));
|
||||
if(!overlap) return false;
|
||||
|
||||
|
||||
for(var i=0;i<this.items.length;i++) {
|
||||
c = this.items[i];
|
||||
|
||||
var olddistance = distance;
|
||||
if(!o.axis) {
|
||||
distance = Math.sqrt(
|
||||
Math.pow(p[0] - ((c[3] ? this.pp.left : c[1].left) + parseInt(c[0].style.left)) - (c[0].offsetWidth/2), 2)
|
||||
+ Math.pow(p[1] - ((c[3] ? this.pp.top : c[1].top ) + parseInt(c[0].style.top )) - (c[0].offsetHeight/2), 2)
|
||||
);
|
||||
} else {
|
||||
if(o.axis == "y") {
|
||||
distance = Math.abs(p[1] - ((c[3] ? this.pp.top : c[1].top ) + parseInt(c[0].style.top )) - (c[0].offsetHeight/2));
|
||||
} else {
|
||||
distance = Math.abs(p[0] - ((c[3] ? this.pp.left : c[1].left) + parseInt(c[0].style.left)) - (c[0].offsetWidth/2));
|
||||
}
|
||||
}
|
||||
|
||||
if(distance < o.distance) {
|
||||
|
||||
this.current = distance < olddistance ? this.items[i] : this.current;
|
||||
|
||||
if(!o.axis || o.axis != "y") {
|
||||
$(c[0]).css({
|
||||
width: c[2][0]+ (c[2][0] * (o.magnification-1)) - (((distance/o.distance)*c[2][0]) * (o.magnification-1)),
|
||||
left: (c[3] ? (c[3].left + o.verticalLine * ((c[2][1] * (o.magnification-1)) - (((distance/o.distance)*c[2][1]) * (o.magnification-1)))) : 0)
|
||||
});
|
||||
}
|
||||
|
||||
if(!o.axis || o.axis != "x") {
|
||||
$(c[0]).css({
|
||||
height: c[2][1]+ (c[2][1] * (o.magnification-1)) - (((distance/o.distance)*c[2][1]) * (o.magnification-1)),
|
||||
top: (c[3] ? c[3].top : 0) + (o.baseline-0.5) * ((c[2][0] * (o.magnification-1)) - (((distance/o.distance)*c[2][0]) * (o.magnification-1)))
|
||||
});
|
||||
}
|
||||
|
||||
if(o.opacity)
|
||||
$(c[0]).css('opacity', o.opacity.max-(distance/o.distance) < o.opacity.min ? o.opacity.min : o.opacity.max-(distance/o.distance));
|
||||
|
||||
} else {
|
||||
|
||||
$(c[0]).css({
|
||||
width: c[2][0],
|
||||
height: c[2][1],
|
||||
top: (c[3] ? c[3].top : 0),
|
||||
left: (c[3] ? c[3].left : 0)
|
||||
});
|
||||
|
||||
if(o.opacity)
|
||||
$(c[0]).css('opacity', o.opacity.min);
|
||||
|
||||
}
|
||||
|
||||
if(o.zIndex)
|
||||
$(c[0]).css("z-index", "");
|
||||
|
||||
}
|
||||
|
||||
if(this.options.zIndex)
|
||||
$(this.current[0]).css("z-index", this.options.zIndex);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})($);
|
||||
253
js/ui.mouse.js
@@ -1,253 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//If the UI scope is not availalable, add it
|
||||
$.ui = $.ui || {};
|
||||
|
||||
//Add methods that are vital for all mouse interaction stuff (plugin registering)
|
||||
$.extend($.ui, {
|
||||
plugin: {
|
||||
add: function(w, c, o, p) {
|
||||
var a = $.ui[w].prototype; if(!a.plugins[c]) a.plugins[c] = [];
|
||||
a.plugins[c].push([o,p]);
|
||||
},
|
||||
call: function(instance, name, arguments) {
|
||||
var c = instance.plugins[name]; if(!c) return;
|
||||
var o = instance.interaction ? instance.interaction.options : instance.options;
|
||||
var e = instance.interaction ? instance.interaction.element : instance.element;
|
||||
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
if (o[c[i][0]]) c[i][1].apply(e, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.mouseInteractionDestroy = function() {
|
||||
this.each(function() {
|
||||
if($.data(this, "ui-mouse")) $.data(this, "ui-mouse").destroy();
|
||||
});
|
||||
}
|
||||
|
||||
$.ui.mouseInteraction = function(el,o) {
|
||||
|
||||
if(!o) var o = {};
|
||||
this.element = el;
|
||||
$.data(this.element, "ui-mouse", this);
|
||||
|
||||
this.options = {};
|
||||
$.extend(this.options, o);
|
||||
$.extend(this.options, {
|
||||
handle : o.handle ? ($(o.handle, el)[0] ? $(o.handle, el) : $(el)) : $(el),
|
||||
helper: o.helper || 'original',
|
||||
preventionDistance: o.preventionDistance || 0,
|
||||
dragPrevention: o.dragPrevention ? o.dragPrevention.toLowerCase().split(',') : ['input','textarea','button','select','option'],
|
||||
cursorAt: { top: ((o.cursorAt && o.cursorAt.top) ? o.cursorAt.top : 0), left: ((o.cursorAt && o.cursorAt.left) ? o.cursorAt.left : 0), bottom: ((o.cursorAt && o.cursorAt.bottom) ? o.cursorAt.bottom : 0), right: ((o.cursorAt && o.cursorAt.right) ? o.cursorAt.right : 0) },
|
||||
cursorAtIgnore: (!o.cursorAt) ? true : false, //Internal property
|
||||
appendTo: o.appendTo || 'parent'
|
||||
})
|
||||
o = this.options; //Just Lazyness
|
||||
|
||||
if(!this.options.nonDestructive && (o.helper == 'clone' || o.helper == 'original')) {
|
||||
|
||||
// Let's save the margins for better reference
|
||||
o.margins = {
|
||||
top: parseInt($(el).css('marginTop')) || 0,
|
||||
left: parseInt($(el).css('marginLeft')) || 0,
|
||||
bottom: parseInt($(el).css('marginBottom')) || 0,
|
||||
right: parseInt($(el).css('marginRight')) || 0
|
||||
};
|
||||
|
||||
// We have to add margins to our cursorAt
|
||||
if(o.cursorAt.top != 0) o.cursorAt.top = o.margins.top;
|
||||
if(o.cursorAt.left != 0) o.cursorAt.left += o.margins.left;
|
||||
if(o.cursorAt.bottom != 0) o.cursorAt.bottom += o.margins.bottom;
|
||||
if(o.cursorAt.right != 0) o.cursorAt.right += o.margins.right;
|
||||
|
||||
|
||||
if(o.helper == 'original')
|
||||
o.wasPositioned = $(el).css('position');
|
||||
|
||||
} else {
|
||||
o.margins = { top: 0, left: 0, right: 0, bottom: 0 };
|
||||
}
|
||||
|
||||
var self = this;
|
||||
this.mousedownfunc = function(e) { // Bind the mousedown event
|
||||
return self.click.apply(self, [e]);
|
||||
}
|
||||
o.handle.bind('mousedown', this.mousedownfunc);
|
||||
|
||||
//Prevent selection of text when starting the drag in IE
|
||||
if($.browser.msie) $(this.element).attr('unselectable', 'on');
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.mouseInteraction.prototype, {
|
||||
plugins: {},
|
||||
currentTarget: null,
|
||||
lastTarget: null,
|
||||
timer: null,
|
||||
slowMode: false,
|
||||
init: false,
|
||||
destroy: function() {
|
||||
this.options.handle.unbind('mousedown', this.mousedownfunc);
|
||||
},
|
||||
trigger: function(e) {
|
||||
return this.click.apply(this, arguments);
|
||||
},
|
||||
click: function(e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
window.focus();
|
||||
if(e.which != 1) return true; //only left click starts dragging
|
||||
|
||||
// Prevent execution on defined elements
|
||||
var targetName = (e.target) ? e.target.nodeName.toLowerCase() : e.srcElement.nodeName.toLowerCase();
|
||||
for(var i=0;i<o.dragPrevention.length;i++) {
|
||||
if(targetName == o.dragPrevention[i]) return true;
|
||||
}
|
||||
|
||||
//Prevent execution on condition
|
||||
if(o.startCondition && !o.startCondition.apply(this, [e])) return true;
|
||||
|
||||
var self = this;
|
||||
this.mouseup = function(e) { return self.stop.apply(self, [e]); }
|
||||
this.mousemove = function(e) { return self.drag.apply(self, [e]); }
|
||||
|
||||
var initFunc = function() { //This function get's called at bottom or after timeout
|
||||
$(document).bind('mouseup', self.mouseup);
|
||||
$(document).bind('mousemove', self.mousemove);
|
||||
self.opos = [e.pageX,e.pageY]; // Get the original mouse position
|
||||
}
|
||||
|
||||
if(o.preventionTimeout) { //use prevention timeout
|
||||
if(this.timer) clearInterval(this.timer);
|
||||
this.timer = setTimeout(function() { initFunc(); }, o.preventionTimeout);
|
||||
return false;
|
||||
}
|
||||
|
||||
initFunc();
|
||||
return false;
|
||||
|
||||
},
|
||||
start: function(e) {
|
||||
|
||||
var o = this.options; var a = this.element;
|
||||
o.co = $(a).offset(); //get the current offset
|
||||
|
||||
this.helper = typeof o.helper == 'function' ? $(o.helper.apply(a, [e,this]))[0] : (o.helper == 'clone' ? $(a).clone()[0] : a);
|
||||
|
||||
if(o.appendTo == 'parent') { // Let's see if we have a positioned parent
|
||||
var cp = a.parentNode;
|
||||
while (cp) {
|
||||
if(cp.style && ($(cp).css('position') == 'relative' || $(cp).css('position') == 'absolute')) {
|
||||
o.pp = cp;
|
||||
o.po = $(cp).offset();
|
||||
o.ppOverflow = !!($(o.pp).css('overflow') == 'auto' || $(o.pp).css('overflow') == 'scroll'); //TODO!
|
||||
break;
|
||||
}
|
||||
cp = cp.parentNode ? cp.parentNode : null;
|
||||
};
|
||||
|
||||
if(!o.pp) o.po = { top: 0, left: 0 };
|
||||
}
|
||||
|
||||
this.pos = [this.opos[0],this.opos[1]]; //Use the relative position
|
||||
this.rpos = [this.pos[0],this.pos[1]]; //Save the absolute position
|
||||
|
||||
if(o.cursorAtIgnore) { // If we want to pick the element where we clicked, we borrow cursorAt and add margins
|
||||
o.cursorAt.left = this.pos[0] - o.co.left + o.margins.left;
|
||||
o.cursorAt.top = this.pos[1] - o.co.top + o.margins.top;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(o.pp) { // If we have a positioned parent, we pick the draggable relative to it
|
||||
this.pos[0] -= o.po.left;
|
||||
this.pos[1] -= o.po.top;
|
||||
}
|
||||
|
||||
this.slowMode = (o.cursorAt && (o.cursorAt.top-o.margins.top > 0 || o.cursorAt.bottom-o.margins.bottom > 0) && (o.cursorAt.left-o.margins.left > 0 || o.cursorAt.right-o.margins.right > 0)) ? true : false; //If cursorAt is within the helper, set slowMode to true
|
||||
|
||||
if(!o.nonDestructive) $(this.helper).css('position', 'absolute');
|
||||
if(o.helper != 'original') $(this.helper).appendTo((o.appendTo == 'parent' ? a.parentNode : o.appendTo)).show();
|
||||
|
||||
// Remap right/bottom properties for cursorAt to left/top
|
||||
if(o.cursorAt.right && !o.cursorAt.left) o.cursorAt.left = this.helper.offsetWidth+o.margins.right+o.margins.left - o.cursorAt.right;
|
||||
if(o.cursorAt.bottom && !o.cursorAt.top) o.cursorAt.top = this.helper.offsetHeight+o.margins.top+o.margins.bottom - o.cursorAt.bottom;
|
||||
|
||||
this.init = true;
|
||||
|
||||
if(o._start) o._start.apply(a, [this.helper, this.pos, o.cursorAt, this, e]); // Trigger the start callback
|
||||
this.helperSize = { width: outerWidth(this.helper), height: outerHeight(this.helper) }; //Set helper size property
|
||||
return false;
|
||||
|
||||
},
|
||||
stop: function(e) {
|
||||
|
||||
var o = this.options; var a = this.element; var self = this;
|
||||
|
||||
$(document).unbind('mouseup', self.mouseup);
|
||||
$(document).unbind('mousemove', self.mousemove);
|
||||
|
||||
if(this.init == false) return this.opos = this.pos = null;
|
||||
if(o._beforeStop) o._beforeStop.apply(a, [this.helper, this.pos, o.cursorAt, this, e]);
|
||||
|
||||
if(this.helper != a && !o.beQuietAtEnd) { // Remove helper, if it's not the original node
|
||||
$(this.helper).remove(); this.helper = null;
|
||||
}
|
||||
|
||||
if(!o.beQuietAtEnd) {
|
||||
//if(o.wasPositioned) $(a).css('position', o.wasPositioned);
|
||||
if(o._stop) o._stop.apply(a, [this.helper, this.pos, o.cursorAt, this, e]);
|
||||
}
|
||||
|
||||
this.init = false;
|
||||
this.opos = this.pos = null;
|
||||
return false;
|
||||
|
||||
},
|
||||
drag: function(e) {
|
||||
|
||||
if (!this.opos || ($.browser.msie && !e.button)) return this.stop.apply(this, [e]); // check for IE mouseup when moving into the document again
|
||||
var o = this.options;
|
||||
|
||||
this.pos = [e.pageX,e.pageY]; //relative mouse position
|
||||
if(this.rpos && this.rpos[0] == this.pos[0] && this.rpos[1] == this.pos[1]) return false;
|
||||
this.rpos = [this.pos[0],this.pos[1]]; //absolute mouse position
|
||||
|
||||
if(o.pp) { //If we have a positioned parent, use a relative position
|
||||
this.pos[0] -= o.po.left;
|
||||
this.pos[1] -= o.po.top;
|
||||
}
|
||||
|
||||
if( (Math.abs(this.rpos[0]-this.opos[0]) > o.preventionDistance || Math.abs(this.rpos[1]-this.opos[1]) > o.preventionDistance) && this.init == false) //If position is more than x pixels from original position, start dragging
|
||||
this.start.apply(this,[e]);
|
||||
else {
|
||||
if(this.init == false) return false;
|
||||
}
|
||||
|
||||
if(o._drag) o._drag.apply(this.element, [this.helper, this.pos, o.cursorAt, this, e]);
|
||||
return false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var num = function(el, prop) {
|
||||
return parseInt($.css(el.jquery?el[0]:el,prop))||0;
|
||||
};
|
||||
function outerWidth(el) {
|
||||
var $el = $(el), ow = $el.width();
|
||||
for (var i = 0, props = ['borderLeftWidth', 'paddingLeft', 'paddingRight', 'borderRightWidth']; i < props.length; i++)
|
||||
ow += num($el, props[i]);
|
||||
return ow;
|
||||
}
|
||||
function outerHeight(el) {
|
||||
var $el = $(el), oh = $el.width();
|
||||
for (var i = 0, props = ['borderTopWidth', 'paddingTop', 'paddingBottom', 'borderBottomWidth']; i < props.length; i++)
|
||||
oh += num($el, props[i]);
|
||||
return oh;
|
||||
}
|
||||
|
||||
})($);
|
||||
@@ -1,304 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { resizable: "(' '+a.className+' ').indexOf(' ui-resizable ')" });
|
||||
|
||||
|
||||
$.fn.resizable = function(o) {
|
||||
return this.each(function() {
|
||||
if(!$(this).is(".ui-resizable")) new $.ui.resizable(this,o);
|
||||
});
|
||||
}
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-resizable")) jQuery.data(this, "ui-resizable")["'+cur+'"](a); if(jQuery(this.parentNode).is(".ui-resizable")) jQuery.data(this, "ui-resizable")["'+cur+'"](a); }); }');
|
||||
$.fn["resizable"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.resizableInstance = function() {
|
||||
if($(this[0]).is(".ui-resizable") || $(this[0].parentNode).is(".ui-resizable")) return $.data(this[0], "ui-resizable");
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
$.ui.resizable = function(el,o) {
|
||||
|
||||
var options = {}; o = o || {}; $.extend(options, o); //Extend and copy options
|
||||
this.element = el; var self = this; //Do bindings
|
||||
$.data(this.element, "ui-resizable", this);
|
||||
|
||||
if(options.proxy) {
|
||||
var helper = function(e,that) {
|
||||
var helper = $('<div></div>').css({
|
||||
width: $(this).width(),
|
||||
height: $(this).height(),
|
||||
position: 'absolute',
|
||||
left: that.options.co.left,
|
||||
top: that.options.co.top
|
||||
}).addClass(that.options.proxy);
|
||||
return helper;
|
||||
}
|
||||
} else {
|
||||
var helper = "original";
|
||||
}
|
||||
|
||||
//Destructive mode wraps the original element
|
||||
if(el.nodeName.match(/textarea|input|select|button|img/i)) options.destructive = true;
|
||||
if(options.destructive) {
|
||||
|
||||
$(el).wrap('<div class="ui-wrapper" style="position: relative; width: '+$(el).outerWidth()+'px; height: '+$(el).outerHeight()+';"></div>');
|
||||
var oel = el;
|
||||
el = el.parentNode; this.element = el;
|
||||
|
||||
//Move margins to the wrapper
|
||||
$(el).css({ marginLeft: $(oel).css("marginLeft"), marginTop: $(oel).css("marginTop"), marginRight: $(oel).css("marginRight"), marginBottom: $(oel).css("marginBottom")});
|
||||
$(oel).css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
|
||||
|
||||
o.proportionallyResize = o.proportionallyResize || [];
|
||||
o.proportionallyResize.push(oel);
|
||||
|
||||
var b = [parseInt($(oel).css('borderTopWidth')),parseInt($(oel).css('borderRightWidth')),parseInt($(oel).css('borderBottomWidth')),parseInt($(oel).css('borderLeftWidth'))];
|
||||
} else {
|
||||
var b = [0,0,0,0];
|
||||
}
|
||||
|
||||
if(options.destructive || !$(".ui-resizable-handle",el).length) {
|
||||
//Adding handles (disabled not so common ones)
|
||||
var t = function(a,b) { $(el).append("<div class='ui-resizable-"+a+" ui-resizable-handle' style='"+b+"'></div>"); };
|
||||
//t('n','top: '+b[0]+'px;');
|
||||
t('e','right: '+b[1]+'px;'+(options.zIndex ? 'z-index: '+options.zIndex+';' : ''));
|
||||
t('s','bottom: '+b[1]+'px;'+(options.zIndex ? 'z-index: '+options.zIndex+';' : ''));
|
||||
//t('w','left: '+b[3]+'px;');
|
||||
t('se','bottom: '+b[2]+'px; right: '+b[1]+'px;'+(options.zIndex ? 'z-index: '+options.zIndex+';' : ''));
|
||||
//t('sw','bottom: '+b[2]+'px; left: '+b[3]+'px;');
|
||||
//t('ne','top: '+b[0]+'px; right: '+b[1]+'px;');
|
||||
//t('nw','top: '+b[0]+'px; left: '+b[3]+'px;');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//If other elements should be modified, we have to copy that array
|
||||
options.modifyThese = [];
|
||||
if(o.proportionallyResize) {
|
||||
options.proportionallyResize = o.proportionallyResize.slice(0);
|
||||
var propRes = options.proportionallyResize;
|
||||
|
||||
for(var i in propRes) {
|
||||
|
||||
if(propRes[i].constructor == String)
|
||||
propRes[i] = $(propRes[i], el);
|
||||
|
||||
if(!$(propRes[i]).length) continue;
|
||||
|
||||
|
||||
var x = $(propRes[i]).width() - $(el).width();
|
||||
var y = $(propRes[i]).height() - $(el).height();
|
||||
options.modifyThese.push([$(propRes[i]),x,y]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
options.handles = {};
|
||||
if(!o.handles) o.handles = { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' };
|
||||
|
||||
for(var i in o.handles) { options.handles[i] = o.handles[i]; } //Copying the object
|
||||
|
||||
for(var i in options.handles) {
|
||||
|
||||
if(options.handles[i].constructor == String)
|
||||
options.handles[i] = $(options.handles[i], el);
|
||||
|
||||
if(!$(options.handles[i]).length) continue;
|
||||
|
||||
$(options.handles[i]).bind('mousedown', function(e) {
|
||||
self.interaction.options.axis = this.resizeAxis;
|
||||
})[0].resizeAxis = i;
|
||||
|
||||
}
|
||||
|
||||
//If we want to auto hide the elements
|
||||
if(o.autohide)
|
||||
$(this.element).addClass("ui-resizable-autohide").hover(function() { $(this).removeClass("ui-resizable-autohide"); }, function() { if(self.interaction.options.autohide && !self.interaction.init) $(this).addClass("ui-resizable-autohide"); });
|
||||
|
||||
|
||||
$.extend(options, {
|
||||
helper: helper,
|
||||
nonDestructive: true,
|
||||
dragPrevention: 'input,button,select',
|
||||
minHeight: options.minHeight || 50,
|
||||
minWidth: options.minWidth || 100,
|
||||
startCondition: function(e) {
|
||||
if(self.disabled) return false;
|
||||
for(var i in options.handles) {
|
||||
if($(options.handles[i])[0] == e.target) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
_start: function(h,p,c,t,e) {
|
||||
self.start.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_beforeStop: function(h,p,c,t,e) {
|
||||
self.stop.apply(t, [self, e]); // Trigger the stop callback
|
||||
},
|
||||
_drag: function(h,p,c,t,e) {
|
||||
self.drag.apply(t, [self, e]); // Trigger the start callback
|
||||
}
|
||||
});
|
||||
|
||||
//Initialize mouse interaction
|
||||
this.interaction = new $.ui.mouseInteraction(el,options);
|
||||
|
||||
//Add the class for themeing
|
||||
$(this.element).addClass("ui-resizable");
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.resizable.prototype, {
|
||||
plugins: {},
|
||||
prepareCallbackObj: function(self) {
|
||||
return {
|
||||
helper: self.helper,
|
||||
resizable: self,
|
||||
axis: self.options.axis,
|
||||
options: self.options
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
$(this.element).removeClass("ui-resizable").removeClass("ui-resizable-disabled");
|
||||
this.interaction.destroy();
|
||||
},
|
||||
enable: function() {
|
||||
$(this.element).removeClass("ui-resizable-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.element).addClass("ui-resizable-disabled");
|
||||
this.disabled = true;
|
||||
},
|
||||
start: function(that, e) {
|
||||
this.options.originalSize = [$(this.element).width(),$(this.element).height()];
|
||||
this.options.originalPosition = $(this.element).css("position");
|
||||
this.options.originalPositionValues = $(this.element).position();
|
||||
|
||||
this.options.modifyThese.push([$(this.helper),0,0]);
|
||||
|
||||
$(that.element).triggerHandler("resizestart", [e, that.prepareCallbackObj(this)], this.options.start);
|
||||
return false;
|
||||
},
|
||||
stop: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
$(that.element).triggerHandler("resizestop", [e, that.prepareCallbackObj(this)], this.options.stop);
|
||||
|
||||
if(o.proxy) {
|
||||
$(this.element).css({
|
||||
width: $(this.helper).width(),
|
||||
height: $(this.helper).height()
|
||||
});
|
||||
|
||||
if(o.originalPosition == "absolute" || o.originalPosition == "fixed") {
|
||||
$(this.element).css({
|
||||
top: $(this.helper).css("top"),
|
||||
left: $(this.helper).css("left")
|
||||
});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
},
|
||||
drag: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
var rel = (o.originalPosition != "absolute" && o.originalPosition != "fixed");
|
||||
var co = rel ? o.co : this.options.originalPositionValues;
|
||||
var p = o.originalSize;
|
||||
|
||||
this.pos = rel ? [this.rpos[0]-o.cursorAt.left, this.rpos[1]-o.cursorAt.top] : [this.pos[0]-o.cursorAt.left, this.pos[1]-o.cursorAt.top];
|
||||
|
||||
var nw = p[0] + (this.pos[0] - co.left);
|
||||
var nh = p[1] + (this.pos[1] - co.top);
|
||||
|
||||
if(o.axis) {
|
||||
switch(o.axis) {
|
||||
case 'e':
|
||||
nh = p[1];
|
||||
break;
|
||||
case 's':
|
||||
nw = p[0];
|
||||
break;
|
||||
case 'n':
|
||||
case 'ne':
|
||||
|
||||
|
||||
if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed"))
|
||||
return false;
|
||||
|
||||
if(o.axis == 'n') nw = p[0];
|
||||
var mod = (this.pos[1] - co.top); nh = nh - (mod*2);
|
||||
mod = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mod);
|
||||
$(this.helper).css('top', co.top + mod);
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
case 'sw':
|
||||
|
||||
if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed"))
|
||||
return false;
|
||||
|
||||
if(o.axis == 'w') nh = p[1];
|
||||
var mod = (this.pos[0] - co.left); nw = nw - (mod*2);
|
||||
mod = nw <= o.minWidth ? p[0] - o.minWidth : (nw >= o.maxWidth ? 0-(o.maxWidth-p[0]) : mod);
|
||||
$(this.helper).css('left', co.left + mod);
|
||||
break;
|
||||
|
||||
case 'nw':
|
||||
|
||||
if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed"))
|
||||
return false;
|
||||
|
||||
var modx = (this.pos[0] - co.left); nw = nw - (modx*2);
|
||||
modx = nw <= o.minWidth ? p[0] - o.minWidth : (nw >= o.maxWidth ? 0-(o.maxWidth-p[0]) : modx);
|
||||
|
||||
var mody = (this.pos[1] - co.top); nh = nh - (mody*2);
|
||||
mody = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mody);
|
||||
|
||||
$(this.helper).css({
|
||||
left: co.left + modx,
|
||||
top: co.top + mody
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(e.shiftKey) nh = nw * (p[1]/p[0]);
|
||||
|
||||
if(o.minWidth) nw = nw <= o.minWidth ? o.minWidth : nw;
|
||||
if(o.minHeight) nh = nh <= o.minHeight ? o.minHeight : nh;
|
||||
|
||||
if(o.maxWidth) nw = nw >= o.maxWidth ? o.maxWidth : nw;
|
||||
if(o.maxHeight) nh = nh >= o.maxHeight ? o.maxHeight : nh;
|
||||
|
||||
if(e.shiftKey) nh = nw * (p[1]/p[0]);
|
||||
|
||||
var modifier = $(that.element).triggerHandler("resize", [e, that.prepareCallbackObj(this)], o.resize);
|
||||
if(!modifier) modifier = {};
|
||||
|
||||
for(var i in this.options.modifyThese) {
|
||||
var c = this.options.modifyThese[i];
|
||||
c[0].css({
|
||||
width: modifier.width ? modifier.width+c[1] : nw+c[1],
|
||||
height: modifier.height ? modifier.height+c[2] : nh+c[2]
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})($);
|
||||
@@ -1,116 +0,0 @@
|
||||
(function($)
|
||||
{
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { selectable: "(' '+a.className+' ').indexOf(' ui-selectable ')" });
|
||||
$.extend($.expr[':'], { selectee: "(' '+a.className+' ').indexOf(' ui-selectee ')" });
|
||||
|
||||
$.fn.selectable = function(o) {
|
||||
return this.each(function() {
|
||||
if (!$(this).is(".ui-selectable")) new $.ui.selectable(this, o);
|
||||
});
|
||||
}
|
||||
|
||||
$.ui.selectable = function(el, o) {
|
||||
|
||||
var options = {
|
||||
filter: '*'
|
||||
};
|
||||
var o = o || {}; $.extend(options, o); //Extend and copy options
|
||||
this.element = el; var self = this; //Do bindings
|
||||
self.dragged = false;
|
||||
|
||||
$.extend(options, {
|
||||
helper: function() { return $(document.createElement('div')).css({border:'1px dotted black'}); },
|
||||
_start: function(h,p,c,t,e) {
|
||||
self.start.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_drag: function(h,p,c,t,e) {
|
||||
self.dragged = true;
|
||||
self.drag.apply(t, [self, e]); // Trigger the drag callback
|
||||
},
|
||||
_stop: function(h,p,c,t,e) {
|
||||
self.stop.apply(t, [self, e]); // Trigger the end callback
|
||||
self.dragged = false;
|
||||
}
|
||||
});
|
||||
|
||||
//Initialize mouse interaction
|
||||
this.mouse = new $.ui.mouseInteraction(el, options);
|
||||
|
||||
//Add the class for themeing
|
||||
$(this.element).addClass("ui-selectable");
|
||||
$(this.element).children(options.filter).addClass("ui-selectee");
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.selectable.prototype, {
|
||||
plugins: {},
|
||||
start: function(self, ev) {
|
||||
$(self.mouse.helper).css({'z-index': 100, position: 'absolute', left: ev.clientX, top: ev.clientY, width:0, height: 0});
|
||||
if (ev.ctrlKey) {
|
||||
if ($(ev.target).is('.ui-selected')) {
|
||||
$(ev.target).removeClass('ui-selected').addClass('ui-unselecting');
|
||||
$(self.element).triggerHandler("selectableunselecting", [ev, {
|
||||
selectable: self.element,
|
||||
unselecting: ev.target,
|
||||
options: this.options
|
||||
}], this.options.unselecting);
|
||||
}
|
||||
} else {
|
||||
self.unselecting(self, ev, this.options);
|
||||
self.selectingTarget(self, ev, this.options);
|
||||
}
|
||||
},
|
||||
drag: function(self, ev) {
|
||||
var x1 = self.mouse.opos[0], y1 = self.mouse.opos[1], x2 = ev.pageX, y2 = ev.pageY;
|
||||
if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
|
||||
if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
|
||||
$(self.mouse.helper).css({left: x1, top: y1, width: x2-x1, height: y2-y1});
|
||||
self.selectingTarget(self, ev, this.options);
|
||||
},
|
||||
stop: function(self, ev) {
|
||||
var options = this.options;
|
||||
$('.ui-selecting', self.element).each(function() {
|
||||
$(this).removeClass('ui-selecting').addClass('ui-selected');
|
||||
$(self.element).triggerHandler("selectableselected", [ev, {
|
||||
selectable: self.element,
|
||||
selected: this,
|
||||
options: options
|
||||
}], options.selected);
|
||||
});
|
||||
$('.ui-unselecting', self.element).each(function() {
|
||||
$(this).removeClass('ui-unselecting');
|
||||
$(self.element).triggerHandler("selectableunselected", [ev, {
|
||||
selectable: self.element,
|
||||
unselected: this,
|
||||
options: options
|
||||
}], options.unselected);
|
||||
});
|
||||
},
|
||||
unselecting: function(self, ev, options) {
|
||||
$('.ui-selected', self.element).each(function() {
|
||||
if (this != ev.target) {
|
||||
$(this).removeClass('ui-selected').addClass('ui-unselecting');
|
||||
$(self.element).triggerHandler("selectableunselecting", [ev, {
|
||||
selectable: self.element,
|
||||
unselecting: this,
|
||||
options: options
|
||||
}], options.unselecting);
|
||||
}
|
||||
});
|
||||
},
|
||||
selectingTarget: function(self, ev, options) {
|
||||
var target = $(ev.target);
|
||||
if (target.is('.ui-selectee:not(.ui-selecting)')) {
|
||||
target.removeClass('ui-selected').removeClass('ui-unselecting').addClass('ui-selecting');
|
||||
$(self.element).triggerHandler("selectableselecting", [ev, {
|
||||
selectable: self.element,
|
||||
selecting: ev.target,
|
||||
options: options
|
||||
}], options.selecting);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,87 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
//If the UI scope is not available, add it
|
||||
$.ui = $.ui || {};
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { shadowed: "(' '+a.className+' ').indexOf(' ui-shadowed ')" });
|
||||
|
||||
$.fn.shadowEnable = function() { if($(this[0]).next().is(".ui-shadow")) $(this[0]).next().show(); }
|
||||
$.fn.shadowDisable = function() { if($(this[0]).next().is(".ui-shadow")) $(this[0]).next().hide(); }
|
||||
|
||||
$.fn.shadow = function(options) {
|
||||
|
||||
options = options || {};
|
||||
options.offset = options.offset ? options.offset : 0;
|
||||
options.opacity = options.opacity ? options.opacity : 0.2;
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
var cur = $(this);
|
||||
|
||||
//Create a shadow element
|
||||
var shadow = $("<div class='ui-shadow'></div>"); cur.after(shadow);
|
||||
|
||||
//Figure the base height and width
|
||||
var baseWidth = cur.outerWidth();
|
||||
var baseHeight = cur.outerHeight();
|
||||
|
||||
//get the offset
|
||||
var position = cur.position();
|
||||
|
||||
//Append smooth corners
|
||||
$('<div class="ui-shadow-color ui-shadow-layer-1"></div>').css({ opacity: options.opacity-0.05, left: 5+options.offset, top: 5+options.offset, width: baseWidth+1, height: baseHeight+1 }).appendTo(shadow);
|
||||
$('<div class="ui-shadow-color ui-shadow-layer-2"></div>').css({ opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth, height: baseHeight-3 }).appendTo(shadow);
|
||||
$('<div class="ui-shadow-color ui-shadow-layer-3"></div>').css({ opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth-3, height: baseHeight }).appendTo(shadow);
|
||||
$('<div class="ui-shadow-color ui-shadow-layer-4"></div>').css({ opacity: options.opacity, left: 6+options.offset, top: 6+options.offset, width: baseWidth-1, height: baseHeight-1 }).appendTo(shadow);
|
||||
|
||||
//If we have a color, use it
|
||||
if(options.color)
|
||||
$("div.ui-shadow-color", shadow).css("background-color", options.color);
|
||||
|
||||
//Determine the stack order (attention: the zIndex will get one higher!)
|
||||
if(!cur.css("zIndex") || cur.css("zIndex") == "auto") {
|
||||
var stack = 0;
|
||||
cur.css("position", (cur.css("position") == "static" ? "relative" : cur.css("position"))).css("z-index", "1");
|
||||
} else {
|
||||
var stack = parseInt(cur.css("zIndex"));
|
||||
cur.css("zIndex", stack+1);
|
||||
}
|
||||
|
||||
//Copy the original z-index and position to the clone
|
||||
//alert(shadow); If you insert this alert, opera will time correctly!!
|
||||
shadow.css({
|
||||
position: "absolute",
|
||||
zIndex: stack,
|
||||
left: position.left,
|
||||
top: position.top,
|
||||
width: baseWidth,
|
||||
height: baseHeight,
|
||||
marginLeft: cur.css("marginLeft"),
|
||||
marginRight: cur.css("marginRight"),
|
||||
marginBottom: cur.css("marginBottom"),
|
||||
marginTop: cur.css("marginTop")
|
||||
});
|
||||
|
||||
|
||||
function rearrangeShadow(el,sh) {
|
||||
var $el = $(el);
|
||||
$(sh).css($el.position());
|
||||
$(sh).children().css({ height: $el.outerHeight()+"px", width: $el.outerWidth()+"px" });
|
||||
}
|
||||
|
||||
if($.browser.msie) {
|
||||
//Add dynamic css expressions
|
||||
shadow[0].style.setExpression("left","parseInt(jQuery(this.previousSibling).css('left'))+'px' || jQuery(this.previousSibling).position().left");
|
||||
shadow[0].style.setExpression("top","parseInt(jQuery(this.previousSibling).css('top'))+'px' || jQuery(this.previousSibling).position().top");
|
||||
} else {
|
||||
//Bind events for good browsers
|
||||
this.addEventListener("DOMAttrModified",function() { rearrangeShadow(this,shadow); },false);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
})($);
|
||||
294
js/ui.slider.js
@@ -1,294 +0,0 @@
|
||||
(function($) {
|
||||
|
||||
|
||||
//Web Forms 2.0
|
||||
window.webforms = 1;
|
||||
if(window['webforms']) {
|
||||
$(document).ready(function() {
|
||||
|
||||
$("input").each(function() {
|
||||
if(this.getAttribute("type") == "range") {
|
||||
var cur = $(this);
|
||||
var slider = $("<div class='ui-slider'></div>").css({ width: cur.innerWidth()+"px", height: cur.innerHeight()+"px" }).insertAfter(cur);
|
||||
var handle = $("<div class='ui-slider-handle'></div>").appendTo(slider);
|
||||
|
||||
|
||||
slider.css({
|
||||
"position": cur.css("position") == "absolute" ? "absolute" : "relative",
|
||||
"left": cur.css("left"),
|
||||
"right": cur.css("right"),
|
||||
"zIndex": cur.css("zIndex"),
|
||||
"float": cur.css("float"),
|
||||
"clear": cur.css("clear")
|
||||
});
|
||||
cur.css({ position: "absolute", opacity: 0, top: "-1000px", left: "-1000px" });
|
||||
|
||||
slider.slider({
|
||||
maxValue: cur.attr("max"),
|
||||
minValue: cur.attr("min"),
|
||||
startValue: this.getAttribute("value"),
|
||||
stepping: cur.attr("step"),
|
||||
change: function(e, ui) { cur[0].value = ui.value; cur[0].setAttribute("value", ui.value); },
|
||||
});
|
||||
|
||||
slider = slider.sliderInstance();
|
||||
|
||||
cur.bind("keydown", function(e) {
|
||||
var o = slider.interaction.options;
|
||||
switch(e.keyCode) {
|
||||
case 37:
|
||||
slider.moveTo(slider.interaction.curValue+o.minValue-(o.stepping || 1));
|
||||
break;
|
||||
case 39:
|
||||
slider.moveTo(slider.interaction.curValue+o.minValue+(o.stepping || 1));
|
||||
break;
|
||||
}
|
||||
if(e.keyCode != 9) return false;
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { slider: "(' '+a.className+' ').indexOf(' ui-slider ')" });
|
||||
|
||||
$.fn.slider = function(o) {
|
||||
return this.each(function() {
|
||||
new $.ui.slider(this, o);
|
||||
});
|
||||
}
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable,moveTo".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-slider")) jQuery.data(this, "ui-slider")["'+cur+'"](a); }); }');
|
||||
$.fn["slider"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.sliderInstance = function() {
|
||||
if($(this[0]).is(".ui-slider")) return $.data(this[0], "ui-slider");
|
||||
return false;
|
||||
};
|
||||
|
||||
$.ui.slider = function(el, o) {
|
||||
|
||||
var options = {};
|
||||
o = o || {};
|
||||
$.extend(options, o);
|
||||
$.extend(options, {
|
||||
axis: o.axis || (el.offsetWidth < el.offsetHeight ? 'vertical' : 'horizontal'),
|
||||
maxValue: parseInt(o.maxValue) || 100,
|
||||
minValue: parseInt(o.minValue) || 0,
|
||||
startValue: parseInt(o.startValue) || 0,
|
||||
_start: function(h, p, c, t, e) {
|
||||
self.start.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_beforeStop: function(h, p, c, t, e) {
|
||||
self.stop.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
_drag: function(h, p, c, t, e) {
|
||||
self.drag.apply(t, [self, e]); // Trigger the start callback
|
||||
},
|
||||
startCondition: function() {
|
||||
return !self.disabled;
|
||||
}
|
||||
});
|
||||
|
||||
var self = this;
|
||||
var o = options;
|
||||
$.data(el, "ui-slider", this);
|
||||
o.stepping = parseInt(o.stepping) || (o.steps ? o.maxValue/o.steps : 0);
|
||||
o.realValue = (o.maxValue - o.minValue);
|
||||
|
||||
|
||||
this.handle = options.handle ? $(options.handle, el) : $('.ui-slider-handle', el);
|
||||
if(this.handle.length == 1) {
|
||||
this.interaction = new $.ui.mouseInteraction(this.handle[0], options);
|
||||
this.multipleHandles = false;
|
||||
} else {
|
||||
this.interactions = [];
|
||||
this.handle.each(function() {
|
||||
self.interactions.push(new $.ui.mouseInteraction(this, options));
|
||||
});
|
||||
this.multipleHandles = true;
|
||||
}
|
||||
|
||||
this.element = el;
|
||||
$(this.element).addClass("ui-slider");
|
||||
|
||||
|
||||
if(o.axis == 'horizontal') {
|
||||
this.parentSize = $(this.element).outerWidth() - this.handle.outerWidth();
|
||||
this.prop = 'left';
|
||||
}
|
||||
|
||||
if(o.axis == 'vertical') {
|
||||
this.parentSize = $(this.element).outerHeight() - this.handle.outerHeight();
|
||||
this.prop = 'top';
|
||||
}
|
||||
|
||||
if(!this.multipleHandles) {
|
||||
$(el).bind('click', function(e) { self.click.apply(self, [e]); });
|
||||
if(!isNaN(o.startValue)) this.moveTo(o.startValue,options.realValue, null, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$.extend($.ui.slider.prototype, {
|
||||
currentTarget: null,
|
||||
lastTarget: null,
|
||||
destroy: function() {
|
||||
$(this.element).removeClass("ui-slider").removeClass("ui-slider-disabled");
|
||||
this.interaction.destroy();
|
||||
},
|
||||
enable: function() {
|
||||
$(this.element).removeClass("ui-slider-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.element).addClass("ui-slider-disabled");
|
||||
this.disabled = true;
|
||||
},
|
||||
nonvalidRange: function(self) {
|
||||
|
||||
for(var i=0;i<this.interactions.length;i++) {
|
||||
if(self == this.interactions[i]) {
|
||||
if(this.interactions[i-1]) {
|
||||
if(this.interactions[i-1].curValue > this.interactions[i].curValue) return this.interactions[i-1].curValue;
|
||||
}
|
||||
|
||||
if(this.interactions[i+1]) {
|
||||
if(this.interactions[i+1].curValue < this.interactions[i].curValue) return this.interactions[i+1].curValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
prepareCallbackObj: function(self,m) {
|
||||
|
||||
var cur = this;
|
||||
var func = function() {
|
||||
var retVal = [];
|
||||
for(var i=0;i<cur.interactions.length;i++) {
|
||||
retVal.push((cur.interactions[i].curValue || 0)+self.options.minValue);
|
||||
}
|
||||
return retVal;
|
||||
};
|
||||
|
||||
return {
|
||||
handle: self.helper,
|
||||
pixel: m,
|
||||
value: self.curValue+self.options.minValue,
|
||||
values: this.multipleHandles ? func() : self.curValue+self.options.minValue,
|
||||
slider: self
|
||||
}
|
||||
},
|
||||
click: function(e) {
|
||||
var o = this.interaction.options;
|
||||
var pointer = [e.pageX,e.pageY];
|
||||
var offset = $(this.interaction.element).offsetParent().offset({ border: false });
|
||||
if(this.interaction.element == e.target || this.disabled) return;
|
||||
|
||||
this.interaction.pickValue = this.interaction.curValue;
|
||||
this.drag.apply(this.interaction, [this, e, [pointer[0]-offset.left-this.handle[0].offsetWidth/2,pointer[1]-offset.top-this.handle[0].offsetHeight/2]]);
|
||||
|
||||
if(this.interaction.pickValue != this.interaction.curValue)
|
||||
$(this.element).triggerHandler("slidechange", [e, this.prepareCallbackObj(this.interaction)], o.change);
|
||||
|
||||
},
|
||||
start: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
$(that.element).triggerHandler("slidestart", [e, that.prepareCallbackObj(this)], o.start);
|
||||
this.pickValue = this.curValue;
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
stop: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
$(that.element).triggerHandler("slidestop", [e, that.prepareCallbackObj(this)], o.stop);
|
||||
if(this.pickValue != this.curValue) $(that.element).triggerHandler("slidechange", [e, that.prepareCallbackObj(this)], o.change);
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
drag: function(that, e, pos) {
|
||||
|
||||
var o = this.options;
|
||||
this.pos = pos || [this.pos[0]-this.element.offsetWidth/2, this.pos[1]-this.element.offsetHeight/2];
|
||||
|
||||
if(o.axis == 'horizontal') var m = this.pos[0];
|
||||
if(o.axis == 'vertical') var m = this.pos[1];
|
||||
|
||||
|
||||
var p = that.parentSize;
|
||||
var prop = that.prop;
|
||||
|
||||
if(m < 0) m = 0;
|
||||
if(m > p) m = p;
|
||||
|
||||
this.curValue = (Math.round((m/p)*o.realValue));
|
||||
if(o.stepping) {
|
||||
this.curValue = Math.round(this.curValue/o.stepping)*o.stepping;
|
||||
m = ((this.curValue)/o.realValue) * p;
|
||||
}
|
||||
|
||||
if(that.interactions) {
|
||||
nonvalidRange = that.nonvalidRange(this);
|
||||
if(nonvalidRange) {
|
||||
this.curValue = nonvalidRange;
|
||||
m = ((this.curValue)/o.realValue) * p;
|
||||
}
|
||||
}
|
||||
|
||||
$(this.element).css(prop, m+'px');
|
||||
$(that.element).triggerHandler("slide", [e, that.prepareCallbackObj(this,m)], o.slide);
|
||||
return false;
|
||||
|
||||
},
|
||||
moveTo: function(value,scale,changeslide,p) { // renamed from goto to moveTo as goto is reserved javascript word
|
||||
|
||||
if(this.multipleHandles) return false; //TODO: Multiple handle moveTo function
|
||||
|
||||
var o = this.interaction.options;
|
||||
var offset = $(this.interaction.element).offsetParent().offset({ border: false });
|
||||
this.interaction.pickValue = this.interaction.curValue;
|
||||
value = value-o.minValue;
|
||||
|
||||
var modifier = scale || o.realValue;
|
||||
|
||||
var p = this.parentSize;
|
||||
var prop = this.prop;
|
||||
|
||||
m = Math.round(((value)/modifier) * p);
|
||||
|
||||
if(m < 0) m = 0;
|
||||
if(m > p) m = p;
|
||||
|
||||
this.interaction.curValue = (Math.round((m/p)*o.realValue));
|
||||
if(o.stepping) {
|
||||
this.interaction.curValue = Math.round(this.interaction.curValue/o.stepping)*o.stepping;
|
||||
m = ((this.interaction.curValue)/o.realValue) * p;
|
||||
}
|
||||
|
||||
$(this.interaction.element).css(prop, m+'px');
|
||||
|
||||
if(!changeslide && this.interaction.pickValue != this.interaction.curValue && !p)
|
||||
$(this.element).triggerHandler("slidechange", [e, this.prepareCallbackObj(this.interaction)], o.change);
|
||||
|
||||
if(changeslide)
|
||||
$(this.element).triggerHandler("slide", [e, this.prepareCallbackObj(this.interaction)], o.slide);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})($);
|
||||
@@ -1,262 +0,0 @@
|
||||
if (window.Node && Node.prototype && !Node.prototype.contains) {
|
||||
Node.prototype.contains = function (arg) {
|
||||
return !!(this.compareDocumentPosition(arg) & 16)
|
||||
}
|
||||
}
|
||||
|
||||
(function($) {
|
||||
|
||||
//Make nodes selectable by expression
|
||||
$.extend($.expr[':'], { sortable: "(' '+a.className+' ').indexOf(' ui-sortable ')" });
|
||||
|
||||
$.fn.sortable = function(o) {
|
||||
return this.each(function() {
|
||||
new $.ui.sortable(this,o);
|
||||
});
|
||||
}
|
||||
|
||||
//Macros for external methods that support chaining
|
||||
var methods = "destroy,enable,disable,refresh".split(",");
|
||||
for(var i=0;i<methods.length;i++) {
|
||||
var cur = methods[i], f;
|
||||
eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-sortable")) jQuery.data(this, "ui-sortable")["'+cur+'"](a); }); }');
|
||||
$.fn["sortable"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f;
|
||||
};
|
||||
|
||||
//get instance method
|
||||
$.fn.sortableInstance = function() {
|
||||
if($(this[0]).is(".ui-sortable")) return $.data(this[0], "ui-sortable");
|
||||
return false;
|
||||
};
|
||||
|
||||
$.ui.sortable = function(el,o) {
|
||||
|
||||
this.element = el;
|
||||
this.set = [];
|
||||
var options = {};
|
||||
var self = this;
|
||||
$.data(this.element, "ui-sortable", this);
|
||||
$(el).addClass("ui-sortable");
|
||||
|
||||
$.extend(options, o);
|
||||
$.extend(options, {
|
||||
items: options.items || '> li',
|
||||
smooth: options.smooth != undefined ? options.smooth : true,
|
||||
helper: 'clone',
|
||||
containment: options.containment ? (options.containment == 'sortable' ? el : options.containment) : null,
|
||||
zIndex: options.zIndex || 1000,
|
||||
_start: function(h,p,c,t,e) {
|
||||
self.start.apply(t, [self, e]); // Trigger the onStart callback
|
||||
},
|
||||
_beforeStop: function(h,p,c,t,e) {
|
||||
self.stop.apply(t, [self, e]); // Trigger the onStart callback
|
||||
},
|
||||
_drag: function(h,p,c,t,e) {
|
||||
self.drag.apply(t, [self, e]); // Trigger the onStart callback
|
||||
},
|
||||
startCondition: function() {
|
||||
return !self.disabled;
|
||||
}
|
||||
});
|
||||
|
||||
//Get the items
|
||||
var items = $(options.items, el);
|
||||
|
||||
//Let's determine the floating mode
|
||||
options.floating = /left|right/.test(items.css('float'));
|
||||
|
||||
//Let's determine the parent's offset
|
||||
if($(el).css('position') == 'static') $(el).css('position', 'relative');
|
||||
options.offset = $(el).offset({ border: false });
|
||||
|
||||
items.each(function() {
|
||||
new $.ui.mouseInteraction(this,options);
|
||||
});
|
||||
|
||||
//Add current items to the set
|
||||
items.each(function() {
|
||||
self.set.push([this,null]);
|
||||
});
|
||||
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
$.extend($.ui.sortable.prototype, {
|
||||
plugins: {},
|
||||
currentTarget: null,
|
||||
lastTarget: null,
|
||||
prepareCallbackObj: function(self, that) {
|
||||
return {
|
||||
helper: self.helper,
|
||||
position: { left: self.pos[0], top: self.pos[1] },
|
||||
offset: self.options.cursorAt,
|
||||
draggable: self,
|
||||
current: that,
|
||||
options: self.options
|
||||
}
|
||||
},
|
||||
refresh: function() {
|
||||
|
||||
//Get the items
|
||||
var self = this;
|
||||
var items = $(this.options.items, this.element);
|
||||
|
||||
var unique = [];
|
||||
items.each(function() {
|
||||
old = false;
|
||||
for(var i=0;i<self.set.length;i++) { if(self.set[i][0] == this) old = true; }
|
||||
if(!old) unique.push(this);
|
||||
});
|
||||
|
||||
for(var i=0;i<unique.length;i++) {
|
||||
new $.ui.mouseInteraction(unique[i],self.options);
|
||||
}
|
||||
|
||||
//Add current items to the set
|
||||
this.set = [];
|
||||
items.each(function() {
|
||||
self.set.push([this,null]);
|
||||
});
|
||||
|
||||
},
|
||||
destroy: function() {
|
||||
$(this.element).removeClass("ui-sortable").removeClass("ui-sortable-disabled");
|
||||
$(this.options.items, this.element).mouseInteractionDestroy();
|
||||
|
||||
},
|
||||
enable: function() {
|
||||
$(this.element).removeClass("ui-sortable-disabled");
|
||||
this.disabled = false;
|
||||
},
|
||||
disable: function() {
|
||||
$(this.element).addClass("ui-sortable-disabled");
|
||||
this.disabled = true;
|
||||
},
|
||||
start: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
if(o.hoverClass) {
|
||||
that.helper = $('<div class="'+o.hoverClass+'"></div>').appendTo('body').css({
|
||||
height: this.element.offsetHeight+'px',
|
||||
width: this.element.offsetWidth+'px',
|
||||
position: 'absolute'
|
||||
});
|
||||
}
|
||||
|
||||
if(o.zIndex) {
|
||||
if($(this.helper).css("zIndex")) o.ozIndex = $(this.helper).css("zIndex");
|
||||
$(this.helper).css('zIndex', o.zIndex);
|
||||
}
|
||||
|
||||
that.firstSibling = $(this.element).prev()[0];
|
||||
|
||||
$(this.element).triggerHandler("sortstart", [e, that.prepareCallbackObj(this)], o.start);
|
||||
$(this.element).css('visibility', 'hidden');
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
stop: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
var self = this;
|
||||
|
||||
|
||||
if(o.smooth) {
|
||||
var os = $(this.element).offset();
|
||||
o.beQuietAtEnd = true;
|
||||
$(this.helper).animate({ left: os.left - o.po.left, top: os.top - o.po.top }, 500, stopIt);
|
||||
} else {
|
||||
stopIt();
|
||||
}
|
||||
|
||||
function stopIt() {
|
||||
|
||||
$(self.element).css('visibility', 'visible');
|
||||
if(that.helper) that.helper.remove();
|
||||
if(self.helper != self.element) $(self.helper).remove();
|
||||
|
||||
if(o.ozIndex)
|
||||
$(self.helper).css('zIndex', o.ozIndex);
|
||||
|
||||
|
||||
//Let's see if the position in DOM has changed
|
||||
if($(self.element).prev()[0] != that.firstSibling) {
|
||||
//$(self.element).triggerHandler("sortupdate", [e, that.prepareCallbackObj(self, that)], o.update);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
drag: function(that, e) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
this.pos = [this.pos[0]-(o.cursorAt.left ? o.cursorAt.left : 0), this.pos[1]-(o.cursorAt.top ? o.cursorAt.top : 0)];
|
||||
var nv = $(this.element).triggerHandler("sort", [e, that.prepareCallbackObj(this)], o.sort);
|
||||
var nl = (nv && nv.left) ? nv.left : this.pos[0];
|
||||
var nt = (nv && nv.top) ? nv.top : this.pos[1];
|
||||
|
||||
|
||||
var m = that.set;
|
||||
var p = this.pos[1];
|
||||
|
||||
for(var i=0;i<m.length;i++) {
|
||||
|
||||
var ci = $(m[i][0]); var cio = m[i][0];
|
||||
if(this.element.contains(cio)) continue;
|
||||
var cO = ci.offset(); //TODO: Caching
|
||||
cO = { top: cO.top, left: cO.left };
|
||||
|
||||
var mb = function(e) { if(true || o.lba != cio) { ci.before(e); o.lba = cio; } }
|
||||
var ma = function(e) { if(true || o.laa != cio) { ci.after(e); o.laa = cio; } }
|
||||
|
||||
if(o.floating) {
|
||||
|
||||
var overlap = ((cO.left - (this.pos[0]+(this.options.po ? this.options.po.left : 0)))/this.helper.offsetWidth);
|
||||
|
||||
if(!(cO.top < this.pos[1]+(this.options.po ? this.options.po.top : 0) + cio.offsetHeight/2 && cO.top + cio.offsetHeight > this.pos[1]+(this.options.po ? this.options.po.top : 0) + cio.offsetHeight/2)) continue;
|
||||
|
||||
} else {
|
||||
|
||||
var overlap = ((cO.top - (this.pos[1]+(this.options.po ? this.options.po.top : 0)))/this.helper.offsetHeight);
|
||||
|
||||
if(!(cO.left < this.pos[0]+(this.options.po ? this.options.po.left : 0) + cio.offsetWidth/2 && cO.left + cio.offsetWidth > this.pos[0]+(this.options.po ? this.options.po.left : 0) + cio.offsetWidth/2)) continue;
|
||||
|
||||
}
|
||||
|
||||
if(overlap >= 0 && overlap <= 0.5) { //Overlapping at top
|
||||
ci.prev().length ? ma(this.element) : mb(this.element);
|
||||
}
|
||||
|
||||
if(overlap < 0 && overlap > -0.5) { //Overlapping at bottom
|
||||
ci.next()[0] == this.element ? mb(this.element) : ma(this.element);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Let's see if the position in DOM has changed
|
||||
if($(this.element).prev()[0] != that.lastSibling) {
|
||||
$(this.element).triggerHandler("sortchange", [e, that.prepareCallbackObj(this, that)], this.options.change);
|
||||
that.lastSibling = $(this.element).prev()[0];
|
||||
}
|
||||
|
||||
if(that.helper) { //reposition helper if available
|
||||
var to = $(this.element).offset();
|
||||
that.helper.css({
|
||||
top: to.top+'px',
|
||||
left: to.left+'px'
|
||||
});
|
||||
}
|
||||
|
||||
$(this.helper).css('left', nl+'px').css('top', nt+'px'); // Stick the helper to the cursor
|
||||
return false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})($);
|
||||
@@ -1,808 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* TableSorter 2.0 - Client-side table sorting with ease!
|
||||
* Version 2.0
|
||||
* @requires jQuery v1.1.3
|
||||
*
|
||||
* Copyright (c) 2007 Christian Bach
|
||||
* Examples and docs at: http://tablesorter.com
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @description Create a sortable table with multi-column sorting capabilitys
|
||||
*
|
||||
* @example $('#table').tablesorter();
|
||||
* @desc Create a simple tablesorter interface.
|
||||
*
|
||||
* @example $('#table').tablesorter({ sortList:[[0,0],[1,0]] });
|
||||
* @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
|
||||
*
|
||||
* @example $('#table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
||||
* @desc Create a tablesorter interface and disableing the first and secound column headers.
|
||||
*
|
||||
* @example $('#table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
|
||||
* @desc Create a tablesorter interface and set a column parser for the first and secound column.
|
||||
*
|
||||
*
|
||||
* @param Object settings An object literal containing key/value pairs to provide optional settings.
|
||||
*
|
||||
* @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
|
||||
* Default value: "header"
|
||||
*
|
||||
* @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
|
||||
* Default value: "headerSortUp"
|
||||
*
|
||||
* @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
|
||||
* Default value: "headerSortDown"
|
||||
*
|
||||
* @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
|
||||
* Default value: "asc"
|
||||
*
|
||||
* @option String sortMultisortKey (optional) A string of the multi-column sort key.
|
||||
* Default value: "shiftKey"
|
||||
*
|
||||
* @option String textExtraction (optional) A string of the text-extraction method to use.
|
||||
* For complex html structures inside td cell set this option to "complex",
|
||||
* on large tables the complex option can be slow.
|
||||
* Default value: "simple"
|
||||
*
|
||||
* @option Object headers (optional) An array containing the forces sorting rules.
|
||||
* This option let's you specify a default sorting rule.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Array sortList (optional) An array containing the forces sorting rules.
|
||||
* This option let's you specify a default sorting rule.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Array sortForce (optional) An array containing the forces sorting rules.
|
||||
* This option let's you specify a default sorting rule.
|
||||
* Default value: null
|
||||
*
|
||||
*
|
||||
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
|
||||
* This is usefull when using the pager companion plugin.
|
||||
* This options requires the dimension jquery plugin.
|
||||
* Default value: false
|
||||
*
|
||||
* @option Boolean cancelSelection (optional) Boolean flag indicating if tablesorter should cancel selection of the table headers text.
|
||||
* Default value: true
|
||||
*
|
||||
* @type jQuery
|
||||
*
|
||||
* @name tablesorter
|
||||
*
|
||||
* @cat Plugins/Tablesorter
|
||||
*
|
||||
* @author Christian Bach/christian.bach@polyester.se
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.extend({
|
||||
tablesorter: new function() {
|
||||
|
||||
var parsers = [], widgets = [];
|
||||
|
||||
this.defaults = {
|
||||
cssHeader: "header",
|
||||
cssAsc: "headerSortUp",
|
||||
cssDesc: "headerSortDown",
|
||||
sortInitialOrder: "asc",
|
||||
sortMultiSortKey: "shiftKey",
|
||||
sortForce: null,
|
||||
textExtraction: "simple",
|
||||
parsers: {},
|
||||
widgets: [],
|
||||
widgetZebra: {css: ["even","odd"]},
|
||||
headers: {},
|
||||
widthFixed: false,
|
||||
cancelSelection: true,
|
||||
sortList: [],
|
||||
headerList: [],
|
||||
dateFormat: "us",
|
||||
debug: false
|
||||
};
|
||||
|
||||
/* debuging utils */
|
||||
function benchmark(label,stamp) {
|
||||
log(label + "," + (new Date().getTime() - stamp.getTime()) + "ms");
|
||||
}
|
||||
|
||||
function log(s) {
|
||||
if (typeof console != "undefined" && typeof console.debug != "undefined") {
|
||||
console.log(s);
|
||||
} else {
|
||||
alert(s);
|
||||
}
|
||||
}
|
||||
|
||||
/* parsers utils */
|
||||
function buildParserCache(table,$headers) {
|
||||
|
||||
if(table.config.debug) { var parsersDebug = ""; }
|
||||
|
||||
var list = [], cells = table.tBodies[0].rows[0].cells, l = cells.length;
|
||||
|
||||
for (var i=0;i < l; i++) {
|
||||
var p = false;
|
||||
|
||||
if($.meta && ($($headers[i]).data() && $($headers[i]).data().sorter) ) {
|
||||
|
||||
p = getParserById($($headers[i]).data().sorter);
|
||||
|
||||
} else if((table.config.headers[i] && table.config.headers[i].sorter)) {
|
||||
|
||||
p = getParserById(table.config.headers[i].sorter);
|
||||
}
|
||||
if(!p) {
|
||||
p = detectParserForColumn(table.config,cells[i]);
|
||||
}
|
||||
|
||||
if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
|
||||
|
||||
list.push(p);
|
||||
}
|
||||
|
||||
if(table.config.debug) { log(parsersDebug); }
|
||||
|
||||
return list;
|
||||
};
|
||||
|
||||
function detectParserForColumn(config,node) {
|
||||
var l = parsers.length;
|
||||
for(var i=1; i < l; i++) {
|
||||
if(parsers[i].is($.trim(getElementText(config,node)))) {
|
||||
return parsers[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 0 is always the generic parser (text)
|
||||
return parsers[0];
|
||||
}
|
||||
|
||||
function getParserById(name) {
|
||||
var l = parsers.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
|
||||
return parsers[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* utils */
|
||||
function buildCache(table) {
|
||||
|
||||
if(table.config.debug) { var cacheTime = new Date(); }
|
||||
|
||||
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
|
||||
totalCells = table.tBodies[0].rows[0].cells.length,
|
||||
parsers = table.config.parsers,
|
||||
cache = {row: [], normalized: []};
|
||||
|
||||
for (var i=0;i < totalRows; ++i) {
|
||||
|
||||
/** Add the table data to main data array */
|
||||
var c = table.tBodies[0].rows[i], cols = [];
|
||||
|
||||
cache.row.push($(c));
|
||||
|
||||
for(var j=0; j < totalCells; ++j) {
|
||||
cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));
|
||||
}
|
||||
|
||||
cols.push(i); // add position for rowCache
|
||||
cache.normalized.push(cols);
|
||||
cols = null;
|
||||
};
|
||||
|
||||
if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
|
||||
|
||||
return cache;
|
||||
};
|
||||
|
||||
function getElementText(config,node) {
|
||||
|
||||
if(!node) return "";
|
||||
|
||||
var t = "";
|
||||
|
||||
|
||||
if(typeof(config.textExtraction) == "function") {
|
||||
t = config.textExtraction(node);
|
||||
} else if(config.textExtraction == "complex") {
|
||||
t = $(node).text();
|
||||
} else {
|
||||
if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
|
||||
t = node.childNodes[0].innerHTML;
|
||||
} else {
|
||||
t = node.innerHTML;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
function appendToTable(table,cache) {
|
||||
|
||||
if(table.config.debug) {var appendTime = new Date()}
|
||||
|
||||
var c = cache,
|
||||
r = c.row,
|
||||
n= c.normalized,
|
||||
totalRows = n.length,
|
||||
checkCell = (n[0].length-1),
|
||||
tableBody = $("tbody:first",table).empty();
|
||||
rows = [];
|
||||
|
||||
for (var i=0;i < totalRows; i++) {
|
||||
rows.push(r[n[i][checkCell]]);
|
||||
if(table.config.appender == null) {
|
||||
tableBody.append(r[n[i][checkCell]]);
|
||||
}
|
||||
}
|
||||
|
||||
if(table.config.appender != null) {
|
||||
table.config.appender(table,rows);
|
||||
}
|
||||
|
||||
rows = null;
|
||||
|
||||
//apply table widgets
|
||||
applyWidget(table);
|
||||
|
||||
if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
|
||||
|
||||
};
|
||||
|
||||
function buildHeaders(table) {
|
||||
|
||||
if(table.config.debug) { var time = new Date(); }
|
||||
|
||||
var meta = ($.meta) ? true : false, tableHeadersRows = [];
|
||||
|
||||
for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
|
||||
|
||||
$tableHeaders = $(checkCellColSpan(table, tableHeadersRows, 0,table.tHead.rows[0].cells.length));
|
||||
|
||||
$tableHeaders.each(function(index) {
|
||||
|
||||
this.count = 0;
|
||||
this.column = index;
|
||||
this.order = formatSortingOrder(table.config.sortInitialOrder);
|
||||
|
||||
if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
|
||||
|
||||
if(!this.sortDisabled) {
|
||||
$(this).addClass(table.config.cssHeader);
|
||||
}
|
||||
|
||||
// add cell to headerList
|
||||
table.config.headerList[index]= this;
|
||||
});
|
||||
|
||||
if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
|
||||
|
||||
return $tableHeaders;
|
||||
|
||||
};
|
||||
|
||||
function checkCellColSpan(table, headerArr, row) {
|
||||
var arr = [], r = table.tHead.rows, c = r[row].cells;
|
||||
|
||||
for(var i=headerArr[row]; i < c.length; i++) {
|
||||
var cell = c[i];
|
||||
|
||||
if ( cell.colSpan > 1) {
|
||||
arr = arr.concat(checkCellColSpan(table, headerArr,row+cell.rowSpan));
|
||||
} else {
|
||||
if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
|
||||
arr.push(cell);
|
||||
}
|
||||
headerArr[row] = (i+row);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
function checkHeaderMetadata(cell) {
|
||||
if(($.meta) && ($(cell).data().sorter === false)) { return true; };
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkHeaderOptions(table,i) {
|
||||
if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
|
||||
return false;
|
||||
}
|
||||
|
||||
function applyWidget(table) {
|
||||
var c = table.config.widgets;
|
||||
var l = c.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
|
||||
getWidgetById(c[i]).format(table);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getWidgetById(name) {
|
||||
var l = widgets.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
|
||||
return widgets[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function formatSortingOrder(v) {
|
||||
|
||||
if(typeof(v) != "Number") {
|
||||
i = (v.toLowerCase() == "desc") ? 1 : 0;
|
||||
} else {
|
||||
i = (v == (0 || 1)) ? v : 0;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
function isValueInArray(v, a) {
|
||||
var l = a.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
if(a[i][0] == v) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setHeadersCss(table,$headers, list, css) {
|
||||
// remove all header information
|
||||
$headers.removeClass(css[0]).removeClass(css[1]);
|
||||
|
||||
var h = [];
|
||||
$headers.each(function(offset) {
|
||||
if(!this.sortDisabled) {
|
||||
h[this.column] = $(this);
|
||||
}
|
||||
});
|
||||
|
||||
var l = list.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
h[list[i][0]].addClass(css[list[i][1]]);
|
||||
}
|
||||
}
|
||||
|
||||
function fixColumnWidth(table,$headers) {
|
||||
var c = table.config;
|
||||
if(c.widthFixed) {
|
||||
var colgroup = $('<colgroup>');
|
||||
$("tbody:first tr:first td",table).each(function() {
|
||||
|
||||
colgroup.append($('<col>').css('width',$(this).width()));
|
||||
|
||||
});
|
||||
$(table).prepend(colgroup);
|
||||
};
|
||||
}
|
||||
|
||||
function updateHeaderSortCount(table,sortList) {
|
||||
var c = table.config, l = sortList.length;
|
||||
for(var i=0; i < l; i++) {
|
||||
var s = sortList[i], o = c.headerList[s[0]];
|
||||
o.count = s[1];
|
||||
o.count++;
|
||||
}
|
||||
}
|
||||
|
||||
/* sorting methods */
|
||||
function multisort(table,sortList,cache) {
|
||||
|
||||
if(table.config.debug) { var sortTime = new Date(); }
|
||||
|
||||
var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
|
||||
|
||||
for(var i=0; i < l; i++) {
|
||||
|
||||
var c = sortList[i][0];
|
||||
var order = sortList[i][1];
|
||||
var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
|
||||
|
||||
var e = "e" + i;
|
||||
|
||||
dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
|
||||
dynamicExp += "if(" + e + ") { return " + e + "; } ";
|
||||
dynamicExp += "else { ";
|
||||
}
|
||||
|
||||
for(var i=0; i < l; i++) {
|
||||
dynamicExp += "}; ";
|
||||
}
|
||||
|
||||
dynamicExp += "return 0; ";
|
||||
dynamicExp += "}; ";
|
||||
|
||||
eval(dynamicExp);
|
||||
|
||||
cache.normalized.sort(sortWrapper);
|
||||
|
||||
if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
|
||||
|
||||
return cache;
|
||||
};
|
||||
|
||||
function sortText(a,b) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
};
|
||||
|
||||
function sortTextDesc(a,b) {
|
||||
return ((b < a) ? -1 : ((b > a) ? 1 : 0));
|
||||
};
|
||||
|
||||
function sortNumeric(a,b) {
|
||||
return a-b;
|
||||
};
|
||||
|
||||
function sortNumericDesc(a,b) {
|
||||
return b-a;
|
||||
};
|
||||
|
||||
function getCachedSortType(parsers,i) {
|
||||
return parsers[i].type;
|
||||
};
|
||||
|
||||
/* public methods */
|
||||
this.construct = function(settings) {
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
|
||||
|
||||
|
||||
var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
|
||||
|
||||
this.config = {};
|
||||
|
||||
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
||||
|
||||
if(!this.tHead || !this.tBodies) return true;
|
||||
|
||||
// store common expression for speed
|
||||
$this = $(this);
|
||||
|
||||
// build headers
|
||||
$headers = buildHeaders(this);
|
||||
|
||||
// try to auto detect column type, and store in tables config
|
||||
this.config.parsers = buildParserCache(this,$headers);
|
||||
|
||||
|
||||
// build the cache for the tbody cells
|
||||
cache = buildCache(this);
|
||||
|
||||
// get the css class names, could be done else where.
|
||||
var sortCSS = [config.cssDesc,config.cssAsc];
|
||||
|
||||
// fixate columns if the users supplies the fixedWidth option
|
||||
fixColumnWidth(this);
|
||||
|
||||
// apply event handling to headers
|
||||
// this is to big, perhaps break it out?
|
||||
$headers.click(function(e) {
|
||||
if(!this.sortDisabled) {
|
||||
// store exp, for speed
|
||||
var $cell = $(this);
|
||||
|
||||
// get current column index
|
||||
var i = this.column;
|
||||
|
||||
// get current column sort order
|
||||
this.order = this.count++ % 2;
|
||||
|
||||
|
||||
|
||||
// user only whants to sort on one column
|
||||
if(!e[config.sortMultiSortKey]) {
|
||||
|
||||
// flush the sort list
|
||||
config.sortList = [];
|
||||
|
||||
if(config.sortForce != null) {
|
||||
var a = config.sortForce;
|
||||
for(var j=0; j < a.length; j++) {
|
||||
config.sortList.push(a[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// add column to sort list
|
||||
config.sortList.push([i,this.order]);
|
||||
|
||||
// multi column sorting
|
||||
} else {
|
||||
// the user has clicked on an all ready sortet column.
|
||||
if(isValueInArray(i,config.sortList)) {
|
||||
|
||||
// revers the sorting direction for all tables.
|
||||
for(var j=0; j < config.sortList.length; j++) {
|
||||
var s = config.sortList[j], o = config.headerList[s[0]];
|
||||
if(s[0] == i) {
|
||||
o.count = s[1];
|
||||
o.count++;
|
||||
s[1] = o.count % 2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// add column to sort list array
|
||||
config.sortList.push([i,this.order]);
|
||||
}
|
||||
};
|
||||
|
||||
//set css for headers
|
||||
setHeadersCss($this[0],$headers,config.sortList,sortCSS);
|
||||
|
||||
// sort the table and append it to the dom
|
||||
appendToTable($this[0],multisort($this[0],config.sortList,cache));
|
||||
|
||||
// stop normal event by returning false
|
||||
return false;
|
||||
}
|
||||
// cancel selection
|
||||
}).mousedown(function() {
|
||||
if(config.cancelSelection) {
|
||||
this.onselectstart = function() {return false};
|
||||
//alert(this.onselectstart);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// apply easy methods that trigger binded events
|
||||
$this.bind("update",function() {
|
||||
|
||||
// rebuild the cache map
|
||||
cache = buildCache(this);
|
||||
|
||||
}).bind("sorton",function(e,list) {
|
||||
|
||||
// update and store the sortlist
|
||||
var sortList = config.sortList = list;
|
||||
|
||||
// update header count index
|
||||
updateHeaderSortCount(this,sortList);
|
||||
|
||||
//set css for headers
|
||||
setHeadersCss(this,$headers,sortList,sortCSS);
|
||||
|
||||
// sort the table and append it to the dom
|
||||
appendToTable(this,multisort(this,sortList,cache));
|
||||
|
||||
}).bind("appendCache",function() {
|
||||
|
||||
appendToTable(this,cache);
|
||||
|
||||
}).bind("applyWidgetId",function(e,id) {
|
||||
|
||||
getWidgetById(id).format(this);
|
||||
|
||||
});
|
||||
|
||||
if($.meta && ($(this).data() && $(this).data().sortlist)) {
|
||||
config.sortList = $(this).data().sortlist;
|
||||
}
|
||||
// if user has supplied a sort list to constructor.
|
||||
if(config.sortList.length > 0) {
|
||||
$this.trigger("sorton",[config.sortList]);
|
||||
}
|
||||
|
||||
// apply widgets
|
||||
applyWidget(this);
|
||||
});
|
||||
};
|
||||
|
||||
this.addParser = function(parser) {
|
||||
var l = parsers.length, a = true;
|
||||
for(var i=0; i < l; i++) {
|
||||
if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
|
||||
a = false;
|
||||
}
|
||||
}
|
||||
if(a) { parsers.push(parser); };
|
||||
};
|
||||
|
||||
this.addWidget = function(widget) {
|
||||
widgets.push(widget);
|
||||
};
|
||||
|
||||
this.formatFloat = function(s) {
|
||||
|
||||
var i = parseFloat(s);
|
||||
return (isNaN(i)) ? 0 : i;
|
||||
};
|
||||
this.formatInt = function(s) {
|
||||
var i = parseInt(s);
|
||||
return (isNaN(i)) ? 0 : i;
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// extend plugin scope
|
||||
$.fn.extend({
|
||||
tablesorter: $.tablesorter.construct
|
||||
});
|
||||
|
||||
// add default parsers
|
||||
$.tablesorter.addParser({
|
||||
id: "text",
|
||||
is: function(s) {
|
||||
return true;
|
||||
},
|
||||
format: function(s) {
|
||||
return $.trim(s.toLowerCase());
|
||||
},
|
||||
type: "text"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "integer",
|
||||
is: function(s) {
|
||||
return s.match(new RegExp(/^\d+$/));
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatInt(s);
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "currency",
|
||||
is: function(s) {
|
||||
return /^[£$€?.]/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "integer",
|
||||
is: function(s) {
|
||||
return /^\d+$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(s);
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "floating",
|
||||
is: function(s) {
|
||||
return s.match(new RegExp(/^(\+|-)?[0-9]+\.[0-9]+((E|e)(\+|-)?[0-9]+)?$/));
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(s.replace(new RegExp(/,/),""));
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "ipAddress",
|
||||
is: function(s) {
|
||||
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
var a = s.split(".");
|
||||
var r = "";
|
||||
for (var i = 0, item; item = a[i]; i++) {
|
||||
if(item.length == 2) {
|
||||
r += "0" + item;
|
||||
} else {
|
||||
r += item;
|
||||
}
|
||||
}
|
||||
return $.tablesorter.formatFloat(s);
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "url",
|
||||
is: function(s) {
|
||||
return /^(https?|ftp|file):\/\/$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));
|
||||
},
|
||||
type: "text"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "isoDate",
|
||||
is: function(s) {
|
||||
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0");
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "percent",
|
||||
is: function(s) {
|
||||
return /^\d{1,3}%$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "usLongDate",
|
||||
is: function(s) {
|
||||
return /^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|\'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(new Date(s).getTime());
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "shortDate",
|
||||
is: function(s) {
|
||||
return /\d{1,2}[\/-]\d{1,2}[\/-]\d{2,4}/.test(s);
|
||||
},
|
||||
format: function(s,table) {
|
||||
var c = table.config;
|
||||
s = s.replace(new RegExp(/-/g),"/");
|
||||
if(c.dateFormat == "us") {
|
||||
/** reformat the string in ISO format */
|
||||
s = s.replace(new RegExp(/(\d{1,2})[\/-](\d{1,2})[\/-](\d{4})/), "$3/$1/$2");
|
||||
} else if(c.dateFormat == "uk") {
|
||||
/** reformat the string in ISO format */
|
||||
s = s.replace(new RegExp(/(\d{1,2})[\/-](\d{1,2})[\/-](\d{4})/), "$3/$2/$1");
|
||||
} else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
|
||||
s = s.replace(new RegExp(/(\d{1,2})[\/-](\d{1,2})[\/-](\d{2})/), "$1/$2/$3");
|
||||
}
|
||||
return $.tablesorter.formatFloat(new Date(s).getTime());
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "time",
|
||||
is: function(s) {
|
||||
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "metadata",
|
||||
is: function(s) {
|
||||
return false;
|
||||
},
|
||||
format: function(s,table,cell) {
|
||||
var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
|
||||
return $(cell).data()[p];
|
||||
},
|
||||
type: "numeric"
|
||||
});
|
||||
|
||||
// add default widgets
|
||||
$.tablesorter.addWidget({
|
||||
id: "zebra",
|
||||
format: function(table) {
|
||||
$("> tbody:first/tr:visible:even",table).removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]);
|
||||
$("> tbody:first/tr:visible:odd",table).removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
445
js/ui.tabs.js
@@ -1,445 +0,0 @@
|
||||
/*
|
||||
* Tabs 3 - New Wave Tabs
|
||||
*
|
||||
* Copyright (c) 2007 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// if the UI scope is not availalable, add it
|
||||
$.ui = $.ui || {};
|
||||
|
||||
// tabs initialization
|
||||
$.fn.tabs = function(initial, options) {
|
||||
if (initial && initial.constructor == Object) { // shift arguments
|
||||
options = initial;
|
||||
initial = null;
|
||||
}
|
||||
options = options || {};
|
||||
|
||||
initial = initial && initial.constructor == Number && --initial || 0;
|
||||
|
||||
return this.each(function() {
|
||||
new $.ui.tabs(this, $.extend(options, { initial: initial }));
|
||||
});
|
||||
};
|
||||
|
||||
// other chainable tabs methods
|
||||
$.each(['Add', 'Remove', 'Enable', 'Disable', 'Click', 'Load'], function(i, method) {
|
||||
$.fn['tabs' + method] = function() {
|
||||
var args = arguments;
|
||||
return this.each(function() {
|
||||
var instance = $.ui.tabs.getInstance(this);
|
||||
instance[method.toLowerCase()].apply(instance, args);
|
||||
});
|
||||
};
|
||||
});
|
||||
$.fn.tabsSelected = function() {
|
||||
var selected = -1;
|
||||
if (this[0]) {
|
||||
var instance = $.ui.tabs.getInstance(this[0]),
|
||||
$lis = $('li', this);
|
||||
selected = $lis.index( $lis.filter('.' + instance.options.selectedClass)[0] );
|
||||
}
|
||||
return selected >= 0 ? ++selected : -1;
|
||||
};
|
||||
|
||||
// tabs class
|
||||
$.ui.tabs = function(el, options) {
|
||||
|
||||
this.source = el;
|
||||
|
||||
this.options = $.extend({
|
||||
|
||||
// basic setup
|
||||
initial: 0,
|
||||
event: 'click',
|
||||
disabled: [],
|
||||
// TODO bookmarkable: $.ajaxHistory ? true : false,
|
||||
unselected: false,
|
||||
unselect: options.unselected ? true : false,
|
||||
|
||||
// Ajax
|
||||
spinner: 'Loading…',
|
||||
cache: false,
|
||||
idPrefix: 'tab-',
|
||||
|
||||
// animations
|
||||
/*fxFade: null,
|
||||
fxSlide: null,
|
||||
fxShow: null,
|
||||
fxHide: null,*/
|
||||
fxSpeed: 'normal',
|
||||
/*fxShowSpeed: null,
|
||||
fxHideSpeed: null,*/
|
||||
|
||||
// callbacks
|
||||
add: function() {},
|
||||
remove: function() {},
|
||||
enable: function() {},
|
||||
disable: function() {},
|
||||
click: function() {},
|
||||
hide: function() {},
|
||||
show: function() {},
|
||||
load: function() {},
|
||||
|
||||
// CSS classes
|
||||
navClass: 'ui-tabs-nav',
|
||||
selectedClass: 'ui-tabs-selected',
|
||||
disabledClass: 'ui-tabs-disabled',
|
||||
containerClass: 'ui-tabs-container',
|
||||
hideClass: 'ui-tabs-hide',
|
||||
loadingClass: 'ui-tabs-loading'
|
||||
|
||||
}, options);
|
||||
|
||||
this.tabify(true);
|
||||
|
||||
// save instance for later
|
||||
var uuid = 'tabs' + $.ui.tabs.prototype.count++;
|
||||
$.ui.tabs.instances[uuid] = this;
|
||||
$.data(el, 'tabsUUID', uuid);
|
||||
|
||||
};
|
||||
|
||||
// static
|
||||
$.ui.tabs.instances = {};
|
||||
$.ui.tabs.getInstance = function(el) {
|
||||
return $.ui.tabs.instances[$.data(el, 'tabsUUID')];
|
||||
};
|
||||
|
||||
// instance methods
|
||||
$.extend($.ui.tabs.prototype, {
|
||||
count: 0,
|
||||
tabify: function(init) {
|
||||
|
||||
this.$tabs = $('a:first-child', this.source);
|
||||
this.$containers = $([]);
|
||||
|
||||
var self = this, o = this.options;
|
||||
|
||||
this.$tabs.each(function(i, a) {
|
||||
// inline tab
|
||||
if (a.hash && a.hash.replace('#', '')) { // safari 2 reports '#' for an empty hash
|
||||
self.$containers = self.$containers.add(a.hash);
|
||||
}
|
||||
// remote tab
|
||||
else {
|
||||
$.data(a, 'href', a.href);
|
||||
var id = a.title && a.title.replace(/\s/g, '_') || o.idPrefix + (self.count + 1) + '-' + (i + 1);
|
||||
a.href = '#' + id;
|
||||
self.$containers = self.$containers.add(
|
||||
$('#' + id)[0] || $('<div id="' + id + '" class="' + o.containerClass + '"></div>')
|
||||
.insertAfter( self.$containers[i - 1] || self.source )
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (init) {
|
||||
|
||||
// Try to retrieve initial tab from fragment identifier in url if present,
|
||||
// otherwise try to find selected class attribute on <li>.
|
||||
this.$tabs.each(function(i, a) {
|
||||
if (location.hash) {
|
||||
if (a.hash == location.hash) {
|
||||
o.initial = i;
|
||||
// prevent page scroll to fragment
|
||||
//if (($.browser.msie || $.browser.opera) && !o.remote) {
|
||||
if ($.browser.msie || $.browser.opera) {
|
||||
var $toShow = $(location.hash), toShowId = $toShow.attr('id');
|
||||
$toShow.attr('id', '');
|
||||
setTimeout(function() {
|
||||
$toShow.attr('id', toShowId); // restore id
|
||||
}, 500);
|
||||
}
|
||||
scrollTo(0, 0);
|
||||
return false; // break
|
||||
}
|
||||
} else if ( $(a).parents('li:eq(0)').is('li.' + o.selectedClass) ) {
|
||||
o.initial = i;
|
||||
return false; // break
|
||||
}
|
||||
});
|
||||
|
||||
// attach necessary classes for styling if not present
|
||||
$(this.source).is('.' + o.navClass) || $(this.source).addClass(o.navClass);
|
||||
this.$containers.each(function() {
|
||||
var $this = $(this);
|
||||
$this.is('.' + o.containerClass) || $this.addClass(o.containerClass);
|
||||
});
|
||||
|
||||
// highlight tab
|
||||
var $lis = $('li', this.source);
|
||||
this.$containers.addClass(o.hideClass);
|
||||
$lis.removeClass(o.selectedClass);
|
||||
if (!o.unselected) {
|
||||
this.$containers.slice(o.initial, o.initial + 1).show();
|
||||
$lis.slice(o.initial, o.initial + 1).addClass(o.selectedClass);
|
||||
}
|
||||
|
||||
// load if remote tab
|
||||
if ($.data(this.$tabs[o.initial], 'href')) {
|
||||
this.load(o.initial + 1, $.data(this.$tabs[o.initial], 'href'));
|
||||
if (o.cache) {
|
||||
$.removeData(this.$tabs[o.initial], 'href'); // if loaded once do not load them again
|
||||
}
|
||||
}
|
||||
|
||||
// disabled tabs
|
||||
for (var i = 0, position; position = o.disabled[i]; i++) {
|
||||
this.disable(position);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// setup animations
|
||||
var showAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed,
|
||||
hideAnim = {}, hideSpeed = o.fxHideSpeed || o.fxSpeed;
|
||||
if (o.fxSlide || o.fxFade) {
|
||||
if (o.fxSlide) {
|
||||
showAnim['height'] = 'show';
|
||||
hideAnim['height'] = 'hide';
|
||||
}
|
||||
if (o.fxFade) {
|
||||
showAnim['opacity'] = 'show';
|
||||
hideAnim['opacity'] = 'hide';
|
||||
}
|
||||
} else {
|
||||
if (o.fxShow) {
|
||||
showAnim = o.fxShow;
|
||||
} else { // use some kind of animation to prevent browser scrolling to the tab
|
||||
showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
|
||||
showSpeed = 1; // as little as 1 is sufficient
|
||||
}
|
||||
if (o.fxHide) {
|
||||
hideAnim = o.fxHide;
|
||||
} else { // use some kind of animation to prevent browser scrolling to the tab
|
||||
hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
|
||||
hideSpeed = 1; // as little as 1 is sufficient
|
||||
}
|
||||
}
|
||||
|
||||
// reset some styles to maintain print style sheets etc.
|
||||
var resetCSS = { display: '', overflow: '', height: '' };
|
||||
if (!$.browser.msie) { // not in IE to prevent ClearType font issue
|
||||
resetCSS['opacity'] = '';
|
||||
}
|
||||
|
||||
// Hide a tab, animation prevents browser scrolling to fragment,
|
||||
// $show is optional.
|
||||
function hideTab(clicked, $hide, $show) {
|
||||
$hide.animate(hideAnim, hideSpeed, function() { //
|
||||
$hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
|
||||
if ($.browser.msie) {
|
||||
$hide[0].style.filter = '';
|
||||
}
|
||||
o.hide(clicked, $hide[0], $show && $show[0] || null);
|
||||
if ($show) {
|
||||
showTab(clicked, $show, $hide);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Show a tab, animation prevents browser scrolling to fragment,
|
||||
// $hide is optional
|
||||
function showTab(clicked, $show, $hide) {
|
||||
if (!(o.fxSlide || o.fxFade || o.fxShow)) {
|
||||
$show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab containers
|
||||
}
|
||||
$show.animate(showAnim, showSpeed, function() {
|
||||
$show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
|
||||
if ($.browser.msie) {
|
||||
$show[0].style.filter = '';
|
||||
}
|
||||
o.show(clicked, $show[0], $hide && $hide[0] || null);
|
||||
});
|
||||
}
|
||||
|
||||
// switch a tab
|
||||
function switchTab(clicked, $hide, $show) {
|
||||
/*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
|
||||
$.ajaxHistory.update(clicked.hash);
|
||||
}*/
|
||||
$(clicked).parents('li:eq(0)').addClass(o.selectedClass)
|
||||
.siblings().removeClass(o.selectedClass);
|
||||
hideTab(clicked, $hide, $show);
|
||||
}
|
||||
|
||||
// tab click handler
|
||||
function tabClick(e) {
|
||||
|
||||
//var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
|
||||
var $li = $(this).parents('li:eq(0)'),
|
||||
$hide = self.$containers.filter(':visible'),
|
||||
$show = $(this.hash);
|
||||
|
||||
// If tab is already selected and not unselectable or tab disabled or click callback returns false stop here.
|
||||
// Check if click handler returns false last so that it is not executed for a disabled tab!
|
||||
if (($li.is('.' + o.selectedClass) && !o.unselect) || $li.is('.' + o.disabledClass)
|
||||
|| o.click(this, $show[0], $hide[0]) === false) {
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
|
||||
// if tab may be closed
|
||||
if (o.unselect) {
|
||||
if ($li.is('.' + o.selectedClass)) {
|
||||
$li.removeClass(o.selectedClass);
|
||||
self.$containers.stop();
|
||||
hideTab(this, $hide);
|
||||
this.blur();
|
||||
return false;
|
||||
} else if (!$hide.length) {
|
||||
$li.addClass(o.selectedClass);
|
||||
self.$containers.stop();
|
||||
showTab(this, $show);
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// stop possibly running animations
|
||||
self.$containers.stop();
|
||||
|
||||
// show new tab
|
||||
if ($show.length) {
|
||||
|
||||
// prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
|
||||
/*if ($.browser.msie && o.bookmarkable) {
|
||||
var showId = this.hash.replace('#', '');
|
||||
$show.attr('id', '');
|
||||
setTimeout(function() {
|
||||
$show.attr('id', showId); // restore id
|
||||
}, 0);
|
||||
}*/
|
||||
|
||||
if ($.data(this, 'href')) { // remote tab
|
||||
var a = this;
|
||||
self.load(self.$tabs.index(this) + 1, $.data(this, 'href'), function() {
|
||||
switchTab(a, $hide, $show);
|
||||
});
|
||||
if (o.cache) {
|
||||
$.removeData(this, 'href'); // if loaded once do not load them again
|
||||
}
|
||||
} else {
|
||||
switchTab(this, $hide, $show);
|
||||
}
|
||||
|
||||
// Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
|
||||
/*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
||||
var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
setTimeout(function() {
|
||||
scrollTo(scrollX, scrollY);
|
||||
}, 0);*/
|
||||
|
||||
} else {
|
||||
throw 'jQuery UI Tabs: Mismatching fragment identifier.';
|
||||
}
|
||||
|
||||
this.blur(); // prevent IE from keeping other link focussed when using the back button
|
||||
|
||||
//return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
// attach click event, avoid duplicates from former tabifying
|
||||
this.$tabs.unbind(o.event, tabClick).bind(o.event, tabClick);
|
||||
|
||||
},
|
||||
add: function(url, text, position) {
|
||||
if (url && text) {
|
||||
var o = this.options;
|
||||
position = position || this.$tabs.length; // append by default
|
||||
if (position >= this.$tabs.length) {
|
||||
var method = 'insertAfter';
|
||||
position = this.$tabs.length;
|
||||
} else {
|
||||
var method = 'insertBefore';
|
||||
}
|
||||
if (url.indexOf('#') == 0) { // ajax container is created by tabify automatically
|
||||
var $container = $(url);
|
||||
// try to find an existing element before creating a new one
|
||||
($container.length && $container || $('<div id="' + url.replace('#', '') + '" class="' + o.containerClass + ' ' + o.hideClass + '"></div>'))
|
||||
[method](this.$containers[position - 1]);
|
||||
}
|
||||
$('<li><a href="' + url + '"><span>' + text + '</span></a></li>')
|
||||
[method](this.$tabs.slice(position - 1, position).parents('li:eq(0)'));
|
||||
this.tabify();
|
||||
o.add(this.$tabs[position - 1], this.$containers[position - 1]); // callback
|
||||
} else {
|
||||
throw 'jQuery UI Tabs: Not enough arguments to add tab.';
|
||||
}
|
||||
},
|
||||
remove: function(position) {
|
||||
if (position && position.constructor == Number) {
|
||||
var $removedTab = this.$tabs.slice(position - 1, position).parents('li:eq(0)').remove();
|
||||
var $removedContainer = this.$containers.slice(position - 1, position).remove();
|
||||
this.tabify();
|
||||
this.options.remove($removedTab[0], $removedContainer[0]); // callback
|
||||
}
|
||||
},
|
||||
enable: function(position) {
|
||||
var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;
|
||||
$li.removeClass(o.disabledClass);
|
||||
if ($.browser.safari) { // fix disappearing tab after enabling in Safari... TODO check Safari 3
|
||||
$li.animate({ opacity: 1 }, 1, function() {
|
||||
$li.css({ opacity: '' });
|
||||
});
|
||||
}
|
||||
o.enable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
|
||||
},
|
||||
disable: function(position) {
|
||||
var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;
|
||||
if ($.browser.safari) { // fix opacity of tab after disabling in Safari... TODO check Safari 3
|
||||
$li.animate({ opacity: 0 }, 1, function() {
|
||||
$li.css({ opacity: '' });
|
||||
});
|
||||
}
|
||||
$li.addClass(this.options.disabledClass);
|
||||
o.disable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
|
||||
},
|
||||
click: function(position) {
|
||||
this.$tabs.slice(position - 1, position).trigger('click');
|
||||
},
|
||||
load: function(position, url, callback) {
|
||||
var self = this,
|
||||
o = this.options,
|
||||
$a = this.$tabs.slice(position - 1, position).addClass(o.loadingClass),
|
||||
$span = $('span', $a),
|
||||
text = $span.html();
|
||||
|
||||
// shift arguments
|
||||
if (url && url.constructor == Function) {
|
||||
callback = url;
|
||||
}
|
||||
|
||||
// set new URL
|
||||
if (url) {
|
||||
$.data($a[0], 'href', url);
|
||||
}
|
||||
|
||||
// load
|
||||
if (o.spinner) {
|
||||
$span.html('<em>' + o.spinner + '</em>');
|
||||
}
|
||||
setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
|
||||
$($a[0].hash).load(url, function() {
|
||||
if (o.spinner) {
|
||||
$span.html(text);
|
||||
}
|
||||
$a.removeClass(o.loadingClass);
|
||||
// This callback is required because the switch has to take place after loading
|
||||
// has completed.
|
||||
if (callback && callback.constructor == Function) {
|
||||
callback();
|
||||
}
|
||||
o.load(self.$tabs[position - 1], self.$containers[position - 1]); // callback
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -150,7 +150,10 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext)
|
||||
{
|
||||
var oDiv = $('#ds_'+divId);
|
||||
oDiv.block();
|
||||
var oFormEvents = $('#ds_'+divId+' form').data('events');
|
||||
// deprecated in jQuery 1.8
|
||||
//var oFormEvents = $('#ds_'+divId+' form').data('events');
|
||||
var oForm = $('#ds_'+divId+' form');
|
||||
var oFormEvents = $._data(oForm[0], "events");
|
||||
|
||||
// Save the submit handlers
|
||||
aSubmit = new Array();
|
||||
|
||||