diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index 6023f4e0b..42002a1c3 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -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()) diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index ca9622f43..80b6bc2a3 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -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 .= ''.self::FilterXSS($sLogOffMenu).''; //echo '        '; $sHtml .= ' '; - $sHtml .= '
'; + $sHtml .= '
'; $sHtml .= ' '; $sHtml .= self::FilterXSS($this->s_content); $sHtml .= ' '; diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index ed75ab623..d1c59ceb1 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -184,8 +184,9 @@ class ApplicationMenu $oPage->AddToMenu(''); 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('
'); diff --git a/application/nicewebpage.class.inc.php b/application/nicewebpage.class.inc.php index 77302bc19..63a8ec3a9 100644 --- a/application/nicewebpage.class.inc.php +++ b/application/nicewebpage.class.inc.php @@ -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"); diff --git a/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png index 954e22dbd..e20472bb8 100644 Binary files a/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and b/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ diff --git a/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png index 64ece5707..1ed713580 100644 Binary files a/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and b/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png differ diff --git a/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png index abdc01082..bbabfb194 100644 Binary files a/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and b/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png differ diff --git a/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png index 9b383f4d2..9cffb675e 100644 Binary files a/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and b/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png differ diff --git a/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png index a23baad25..c227bb23b 100644 Binary files a/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and b/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png differ diff --git a/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png index 42ccba269..7d87f1504 100644 Binary files a/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and b/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png index 39d5824d6..a03be628f 100644 Binary files a/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and b/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ diff --git a/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png index f1273672d..a2a4c15b3 100644 Binary files a/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and b/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ diff --git a/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png index 359397acf..a8b49155d 100644 Binary files a/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and b/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ diff --git a/css/ui-lightness/images/ui-icons_222222_256x240.png b/css/ui-lightness/images/ui-icons_222222_256x240.png index b273ff111..c1cb1170c 100644 Binary files a/css/ui-lightness/images/ui-icons_222222_256x240.png and b/css/ui-lightness/images/ui-icons_222222_256x240.png differ diff --git a/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/css/ui-lightness/images/ui-icons_228ef1_256x240.png index a641a371a..3a0140cff 100644 Binary files a/css/ui-lightness/images/ui-icons_228ef1_256x240.png and b/css/ui-lightness/images/ui-icons_228ef1_256x240.png differ diff --git a/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/css/ui-lightness/images/ui-icons_ef8c08_256x240.png index 85e63e9f6..036ee072d 100644 Binary files a/css/ui-lightness/images/ui-icons_ef8c08_256x240.png and b/css/ui-lightness/images/ui-icons_ef8c08_256x240.png differ diff --git a/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/css/ui-lightness/images/ui-icons_ffd27a_256x240.png index e117effa3..8b6c05868 100644 Binary files a/css/ui-lightness/images/ui-icons_ffd27a_256x240.png and b/css/ui-lightness/images/ui-icons_ffd27a_256x240.png differ diff --git a/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/css/ui-lightness/images/ui-icons_ffffff_256x240.png index 42f8f992c..4f624bb2b 100644 Binary files a/css/ui-lightness/images/ui-icons_ffffff_256x240.png and b/css/ui-lightness/images/ui-icons_ffffff_256x240.png differ diff --git a/js/charts.js b/js/charts.js index 53d986525..7e4cfce6f 100644 --- a/js/charts.js +++ b/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() { diff --git a/js/dashboard.js b/js/dashboard.js index e679fb9fb..d2abfd68f 100644 --- a/js/dashboard.js +++ b/js/dashboard.js @@ -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() { diff --git a/js/dashlet.js b/js/dashlet.js index 7e3c06261..cc89f127b 100644 --- a/js/dashlet.js +++ b/js/dashlet.js @@ -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(); diff --git a/js/datatable.js b/js/datatable.js index 4d1565a5d..22e7b7085 100644 --- a/js/datatable.js +++ b/js/datatable.js @@ -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() { diff --git a/js/exclude.txt b/js/exclude.txt new file mode 100644 index 000000000..e64ecdbb1 --- /dev/null +++ b/js/exclude.txt @@ -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 diff --git a/js/field_sorter.js b/js/field_sorter.js index 2a5a5816e..9bae1d56d 100644 --- a/js/field_sorter.js +++ b/js/field_sorter.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(); }, diff --git a/js/icon_select.js b/js/icon_select.js index 1d0d33078..a41a50688 100644 --- a/js/icon_select.js +++ b/js/icon_select.js @@ -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) { diff --git a/js/jquery-1.10.0.min.js b/js/jquery-1.10.0.min.js new file mode 100644 index 000000000..01c688164 --- /dev/null +++ b/js/jquery-1.10.0.min.js @@ -0,0 +1,6 @@ +/*! jQuery v1.10.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.0.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.0",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=lt(),k=lt(),E=lt(),S=!1,A=function(){return 0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=bt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+xt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return At(e.replace(z,"$1"),t,n,i)}function st(e){return K.test(e+"")}function lt(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function ut(e){return e[b]=!0,e}function ct(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pt(e,t,n){e=e.split("|");var r,i=e.length,a=n?null:t;while(i--)(r=o.attrHandle[e[i]])&&r!==t||(o.attrHandle[e[i]]=a)}function ft(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:e[t]===!0?t.toLowerCase():null}function dt(e,t){return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function ht(e){return"input"===e.nodeName.toLowerCase()?e.defaultValue:t}function gt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function mt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function yt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function vt(e){return ut(function(t){return t=+t,ut(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),r.attributes=ct(function(e){return e.innerHTML="",pt("type|href|height|width",dt,"#"===e.firstChild.getAttribute("href")),pt(B,ft,null==e.getAttribute("disabled")),e.className="i",!e.getAttribute("className")}),r.input=ct(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}),pt("value",ht,r.attributes&&r.input),r.getElementsByTagName=ct(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ct(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ct(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=st(n.querySelectorAll))&&(ct(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ct(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=st(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ct(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=st(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},r.sortDetached=ct(function(e){return 1&e.compareDocumentPosition(n.createElement("div"))}),A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return gt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?gt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:ut,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=bt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?ut(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ut(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?ut(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ut(function(e){return function(t){return at(e,t).length>0}}),contains:ut(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:ut(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:vt(function(){return[0]}),last:vt(function(e,t){return[t-1]}),eq:vt(function(e,t,n){return[0>n?n+t:n]}),even:vt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:vt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:vt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:vt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=mt(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=yt(n);function bt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function xt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function wt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function Tt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ct(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function Nt(e,t,n,r,i,o){return r&&!r[b]&&(r=Nt(r)),i&&!i[b]&&(i=Nt(i,o)),ut(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||St(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:Ct(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=Ct(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=Ct(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function kt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=wt(function(e){return e===t},s,!0),p=wt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[wt(Tt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return Nt(l>1&&Tt(f),l>1&&xt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&kt(e.slice(l,r)),i>r&&kt(e=e.slice(r)),i>r&&xt(e))}f.push(n)}return Tt(f)}function Et(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=Ct(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?ut(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=bt(e)),n=t.length;while(n--)o=kt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Et(i,r))}return o};function St(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function At(e,t,n,i){var a,s,u,c,p,f=bt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&xt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}o.pseudos.nth=o.pseudos.eq;function jt(){}jt.prototype=o.filters=o.pseudos,o.setFilters=new jt,r.sortStable=b.split("").sort(A).join("")===b,p(),[0,0].sort(A),r.detectDuplicates=S,x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!u||(n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s; +if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=x(this),l=t,u=e.match(T)||[];while(o=u[a++])l=r?l:!s.hasClass(o),s[l?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}) +}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this -._get(a,"showMonthAfterYear"),l='
',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* - * jQuery UI Progressbar 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})})(jQuery);/* - * jQuery UI Effects 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.17",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* - * jQuery UI Effects Fade 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Fold 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* - * jQuery UI Effects Highlight 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Pulsate 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/js/jquery-ui-1.8.2.custom.min.js b/js/jquery-ui-1.8.2.custom.min.js deleted file mode 100755 index c11e844f9..000000000 --- a/js/jquery-ui-1.8.2.custom.min.js +++ /dev/null @@ -1,1012 +0,0 @@ -/*! - * jQuery UI 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=0)&&c(a).is(":focusable")}})}})(jQuery); -;/*! - * jQuery UI Widget 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Widget - */ -(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype= -b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g= -b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create(); -this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f, -h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a= -b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); -;/*! - * jQuery UI Mouse 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& -this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); -return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& -this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- -a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h= -0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+= -g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k, -elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"? --b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position= -"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, -b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& -a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), -10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): -f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; -if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= -"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>=i&& -e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(g)&&f.css({zIndex:++a.zIndex});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height; -g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", -b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top= -a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidthb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, -l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ -a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this, -arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable, -{version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)}); -else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&& -d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a= -d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing, -step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= -d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset; -var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left: -a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top- -e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition, -g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, -display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b= -d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height= -e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -; -/* - * jQuery UI Selectable 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function($) { - -$.widget("ui.selectable", $.ui.mouse, { - options: { - appendTo: 'body', - autoRefresh: true, - distance: 0, - filter: '*', - tolerance: 'touch' - }, - _create: function() { - var self = this; - - this.element.addClass("ui-selectable"); - - this.dragged = false; - - // cache selectee children based on filter - var selectees; - this.refresh = function() { - selectees = $(self.options.filter, self.element[0]); - selectees.each(function() { - var $this = $(this); - var pos = $this.offset(); - $.data(this, "selectable-item", { - element: this, - $element: $this, - left: pos.left, - top: pos.top, - right: pos.left + $this.outerWidth(), - bottom: pos.top + $this.outerHeight(), - startselected: false, - selected: $this.hasClass('ui-selected'), - selecting: $this.hasClass('ui-selecting'), - unselecting: $this.hasClass('ui-unselecting') - }); - }); - }; - this.refresh(); - - this.selectees = selectees.addClass("ui-selectee"); - - this._mouseInit(); - - this.helper = $("
"); - }, - - destroy: function() { - this.selectees - .removeClass("ui-selectee") - .removeData("selectable-item"); - this.element - .removeClass("ui-selectable ui-selectable-disabled") - .removeData("selectable") - .unbind(".selectable"); - this._mouseDestroy(); - - return this; - }, - - _mouseStart: function(event) { - var self = this; - - this.opos = [event.pageX, event.pageY]; - - if (this.options.disabled) - return; - - var options = this.options; - - this.selectees = $(options.filter, this.element[0]); - - this._trigger("start", event); - - $(options.appendTo).append(this.helper); - // position helper (lasso) - this.helper.css({ - "z-index": 100, - "position": "absolute", - "left": event.clientX, - "top": event.clientY, - "width": 0, - "height": 0 - }); - - if (options.autoRefresh) { - this.refresh(); - } - - this.selectees.filter('.ui-selected').each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.startselected = true; - if (!event.metaKey) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - }); - - $(event.target).parents().andSelf().each(function() { - var selectee = $.data(this, "selectable-item"); - if (selectee) { - var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); - selectee.$element - .removeClass(doSelect ? "ui-unselecting" : "ui-selected") - .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); - selectee.unselecting = !doSelect; - selectee.selecting = doSelect; - selectee.selected = doSelect; - // selectable (UN)SELECTING callback - if (doSelect) { - self._trigger("selecting", event, { - selecting: selectee.element - }); - } else { - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - return false; - } - }); - - }, - - _mouseDrag: function(event) { - var self = this; - this.dragged = true; - - if (this.options.disabled) - return; - - var options = this.options; - - var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; - if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } - if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } - this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); - - this.selectees.each(function() { - var selectee = $.data(this, "selectable-item"); - //prevent helper from being selected if appendTo: selectable - if (!selectee || selectee.element == self.element[0]) - return; - var hit = false; - if (options.tolerance == 'touch') { - hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); - } else if (options.tolerance == 'fit') { - hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); - } - - if (hit) { - // SELECT - if (selectee.selected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - } - if (selectee.unselecting) { - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - } - if (!selectee.selecting) { - selectee.$element.addClass('ui-selecting'); - selectee.selecting = true; - // selectable SELECTING callback - self._trigger("selecting", event, { - selecting: selectee.element - }); - } - } else { - // UNSELECT - if (selectee.selecting) { - if (event.metaKey && selectee.startselected) { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - selectee.$element.addClass('ui-selected'); - selectee.selected = true; - } else { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - if (selectee.startselected) { - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - } - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - if (selectee.selected) { - if (!event.metaKey && !selectee.startselected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - self._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - } - }); - - return false; - }, - - _mouseStop: function(event) { - var self = this; - - this.dragged = false; - - var options = this.options; - - $('.ui-unselecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - selectee.startselected = false; - self._trigger("unselected", event, { - unselected: selectee.element - }); - }); - $('.ui-selecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); - selectee.selecting = false; - selectee.selected = true; - selectee.startselected = true; - self._trigger("selected", event, { - selected: selectee.element - }); - }); - this._trigger("stop", event); - - this.helper.remove(); - - return false; - } - -}); - -$.extend($.ui.selectable, { - version: "1.8.2" -}); - -})(jQuery); -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting"); -b.unselecting=true;f._trigger("unselecting",c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f= -this;this.dragged=true;if(!this.options.disabled){var d=this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", -null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): -d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c}, -_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a= -this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)? -h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"), -b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)? -i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement, -c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height= -this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()- -parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0], -this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b= -1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update", -g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity", -this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var a=this.options,b=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset"); -this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(a.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(a.navigation){var d=this.element.find("a").filter(a.navigationFilter);if(d.length){var f=d.closest(".ui-accordion-header");this.active=f.length?f:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||a.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");this._createIcons();this.resize();this.element.attr("role","tablist");this.headers.attr("role", -"tab").bind("keydown",function(g){return b._keydown(g)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");c.browser.safari||this.headers.find("a").attr("tabIndex","-1");a.event&&this.headers.bind(a.event+".accordion",function(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var a= -this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion"); -this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(a.autoHeight||a.fillHeight)b.css("height", -"");return this},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();b&&this._createIcons()}},_keydown:function(a){var b=c.ui.keyCode;if(!(this.options.disabled||a.altKey||a.ctrlKey)){var d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target}, -a.target);a.preventDefault()}if(g){c(a.target).attr("tabIndex","-1");c(g).attr("tabIndex","0");g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0, -b-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a=="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d= -this.options;if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]==this.active[0];d.active=d.collapsible&&b?false:c(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); -a.next().addClass("ui-accordion-content-active")}e=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):e,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(e,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},e=this.active=c([]);this._toggle(e,f,g)}},_toggle:function(a,b,d,f,g){var e=this.options,k=this;this.toShow=a;this.toHide=b;this.data=d;var i=function(){if(k)return k._completed.apply(k,arguments)};this._trigger("changestart",null,this.data);this.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]), -toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var h=e.duration,j=e.animated;if(j&&!f[j]&&!c.easing[j])j="slide";f[j]||(f[j]=function(l){this.slide(l,{easing:j, -duration:h||700})});f[j](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}i(true)}b.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();a.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(a){var b=this.options;this.running=a?0:--this.running;if(!this.running){b.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion, -{version:"1.8.2",animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},e={},k;b=a.toShow;k=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(i,h){e[h]="hide";i=(""+c.css(a.toShow[0], -h)).match(/^([\d+-.]+)(.*)$/);g[h]={value:i[1],unit:i[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(e,{step:function(i,h){if(h.prop=="height")f=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);a.toShow[0].style[h.prop]=f*g[h.prop].value+g[h.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css("width",k);a.toShow.css({overflow:d});a.complete()}})}else a.toHide.animate({height:"hide"}, -a);else a.toShow.animate({height:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); -;/* - * jQuery UI Autocomplete 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function(e){e.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var a=this,c=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(d){var b=e.ui.keyCode;switch(d.keyCode){case b.PAGE_UP:a._move("previousPage",d);break;case b.PAGE_DOWN:a._move("nextPage",d);break;case b.UP:a._move("previous",d);d.preventDefault(); -break;case b.DOWN:a._move("next",d);d.preventDefault();break;case b.ENTER:case b.NUMPAD_ENTER:a.menu.active&&d.preventDefault();case b.TAB:if(!a.menu.active)return;a.menu.select(d);break;case b.ESCAPE:a.element.val(a.term);a.close(d);break;case b.LEFT:case b.RIGHT:case b.SHIFT:case b.CONTROL:case b.ALT:case b.COMMAND:case b.COMMAND_RIGHT:case b.INSERT:case b.CAPS_LOCK:case b.END:case b.HOME:break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){a.search(null,d)},a.options.delay); -break}}).bind("focus.autocomplete",function(){a.selectedItem=null;a.previous=a.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(d);a._change(d)},150)});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("
    ").addClass("ui-autocomplete").appendTo("body",c).mousedown(function(){setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(d,b){b=b.item.data("item.autocomplete"); -false!==a._trigger("focus",null,{item:b})&&/^key/.test(d.originalEvent.type)&&a.element.val(b.value)},selected:function(d,b){b=b.item.data("item.autocomplete");false!==a._trigger("select",d,{item:b})&&a.element.val(b.value);a.close(d);d=a.previous;if(a.element[0]!==c.activeElement){a.element.focus();a.previous=d}a.selectedItem=b},blur:function(){a.menu.element.is(":visible")&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()}, -destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();e.Widget.prototype.destroy.call(this)},_setOption:function(a){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource()},_initSource:function(){var a,c;if(e.isArray(this.options.source)){a=this.options.source;this.source=function(d,b){b(e.ui.autocomplete.filter(a,d.term))}}else if(typeof this.options.source=== -"string"){c=this.options.source;this.source=function(d,b){e.getJSON(c,d,b)}}else this.source=this.options.source},search:function(a,c){a=a!=null?a:this.element.val();if(a.length").data("item.autocomplete", -c).append(""+c.label+"").appendTo(a)},_move:function(a,c){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](c);else this.search(null,c)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")},filter:function(a,c){var d=new RegExp(e.ui.autocomplete.escapeRegex(c), -"i");return e.grep(a,function(b){return d.test(b.label||b.value||b)})}})})(jQuery); -(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(e(c.target).closest(".ui-menu-item a").length){c.preventDefault();a.select(c)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(c){a.activate(c,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,c){this.deactivate();if(this.hasScroll()){var d=c.offset().top-this.element.offset().top,b=this.element.attr("scrollTop"),f=this.element.height();if(d<0)this.element.attr("scrollTop",b+d);else d>f&&this.element.attr("scrollTop",b+d-f+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); -this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(a,c,d){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);a.length?this.activate(d,a):this.activate(d,this.element.children(c))}else this.activate(d,this.element.children(c))},nextPage:function(a){if(this.hasScroll())if(!this.active|| -this.last())this.activate(a,this.element.children(":first"));else{var c=this.active.offset().top,d=this.element.height(),b=this.element.children("li").filter(function(){var f=e(this).offset().top-c-d+e(this).height();return f<10&&f>-10});b.length||(b=this.element.children(":last"));this.activate(a,b)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last")); -else{var c=this.active.offset().top,d=this.element.height();result=this.element.children("li").filter(function(){var b=e(this).offset().top-c+d-e(this).height();return b<10&&b>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()
    ").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":""));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon"); -this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, -destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); -;/* - * jQuery UI Dialog 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var a=this,b=a.options,d=b.title||a.originalTitle||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), -h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", -e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== -b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index", -c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== -f[0]&&e.shiftKey){g.focus(1);return false}}});c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();a._trigger("open");a._isOpen=true;return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a, -function(g,f){g=c('').text(g).click(function(){f.apply(b.element[0],arguments)}).appendTo(e);c.fn.button&&g.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging"); -b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,position:f.position,size:f.size}}a=a===undefined?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position"); -a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop", -f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0];a=a||c.ui.dialog.prototype.options.position;if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(e,g){if(+b[e]===b[e]){d[e]=b[e];b[e]= -g}})}else if(typeof a==="object"){if("left"in a){b[0]="left";d[0]=a.left}else if("right"in a){b[0]="right";d[0]=-a.right}if("top"in a){b[1]="top";d[1]=a.top}else if("bottom"in a){b[1]="bottom";d[1]=-a.bottom}}(a=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:b.join(" "),at:b.join(" "),offset:d.join(" "),of:window,collision:"fit",using:function(e){var g=c(this).css(e).offset().top;g<0&&c(this).css("top",e.top-g)}});a||this.uiDialog.hide()},_setOption:function(a, -b){var d=this,e=d.uiDialog,g=e.is(":data(resizable)"),f=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");break;case "draggable":b?d._makeDraggable():e.draggable("destroy");break; -case "height":f=true;break;case "maxHeight":g&&e.resizable("option","maxHeight",b);f=true;break;case "maxWidth":g&&e.resizable("option","maxWidth",b);f=true;break;case "minHeight":g&&e.resizable("option","minHeight",b);f=true;break;case "minWidth":g&&e.resizable("option","minWidth",b);f=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title", -d.uiDialogTitlebar).html(""+(b||" "));break;case "width":f=true;break}c.Widget.prototype._setOption.apply(d,arguments);f&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:"auto"}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight", -this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&& -c(document).bind(c.ui.dialog.overlay.events,function(d){return c(d.target).zIndex()>=c.ui.dialog.overlay.maxZ})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&& -b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight, -document.body.offsetHeight);return a");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("
    ");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); -if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur(); -else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),g,h,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= -false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");g=a._start(c,f);if(g===false)return}break}i=a.options.step;g=a.options.values&&a.options.values.length?(h=a.values(f)):(h=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(g+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(g-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(g=== -a._valueMax())return;h=a._trimAlignValue(g+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(g===a._valueMin())return;h=a._trimAlignValue(g-i);break}a._slide(c,f,h);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,g,h,i;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c={x:a.pageX,y:a.pageY};e=this._normValueFromMouse(c);f=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(j){var k=Math.abs(e-h.values(j));if(f>k){f=k;g=d(this);i=j}});if(b.range===true&&this.values(1)===b.min){i+=1;g=d(this.handles[i])}if(this._start(a, -i)===false)return false;this._mouseSliding=true;h._handleIndex=i;g.addClass("ui-state-active").focus();b=g.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-g.width()/2,top:a.pageY-b.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};e=this._normValueFromMouse(c);this._slide(a,i,e);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b; -if(this.orientation==="horizontal"){b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value= -this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;fthis._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= -this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,g={},h,i,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){f=(c.values(l)-c._valueMin())/(c._valueMax()-c._valueMin())*100;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](g,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(l===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({width:f- -h+"%"},{queue:false,duration:b.animate})}else{if(l===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(l===1)c.range[e?"animate":"css"]({height:f-h+"%"},{queue:false,duration:b.animate})}h=f});else{i=this.value();j=this._valueMin();k=this._valueMax();f=k!==j?(i-j)/(k-j)*100:0;g[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"}, -b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Tabs 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d){function s(){return++u}function v(){return++w}var u=0,w=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
  • #{label}
  • '},_create:function(){this._tabify(true)},_setOption:function(c,e){if(c=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[c]=e;this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+s()},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+v());return d.cookie.apply(null,[c].concat(d.makeArray(arguments)))},_ui:function(c,e){return{tab:c,panel:e,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c= -d(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function e(g,f){g.css({display:""});!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);var a=this,b=this.options,h=/^#.+/;this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],p;if(l&&(l===location.toString().split("#")[0]|| -(p=d("base")[0])&&l===p.href)){j=f.hash;f.href=j}if(h.test(j))a.panels=a.panels.add(a._sanitizeSelector(j));else if(j!="#"){d.data(f,"href.tabs",j);d.data(f,"load.tabs",j.replace(/#.*$/,""));j=a._tabId(f);f.href="#"+j;f=d("#"+j);if(!f.length){f=d(b.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else b.disabled.push(g)});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(b.selected===undefined){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){b.selected=g;return false}});if(typeof b.selected!="number"&&b.cookie)b.selected=parseInt(a._cookie(),10);if(typeof b.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)b.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));b.selected=b.selected||(this.lis.length?0:-1)}else if(b.selected===null)b.selected=-1;b.selected=b.selected>=0&&this.anchors[b.selected]||b.selected<0?b.selected:0;b.disabled=d.unique(b.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(b.selected,b.disabled)!=-1&&b.disabled.splice(d.inArray(b.selected,b.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(b.selected>=0&&this.anchors.length){this.panels.eq(b.selected).removeClass("ui-tabs-hide");this.lis.eq(b.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[b.selected],a.panels[b.selected]))});this.load(b.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else b.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[b.collapsible?"addClass": -"removeClass"]("ui-tabs-collapsible");b.cookie&&this._cookie(b.selected,b.cookie);c=0;for(var i;i=this.lis[c];c++)d(i)[d.inArray(c,b.disabled)!=-1&&!d(i).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");b.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(b.event!="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs", -function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(b.fx)if(d.isArray(b.fx)){m=b.fx[0];o=b.fx[1]}else m=o=b.fx;var q=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);a._trigger("show", -null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},r=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};this.anchors.bind(b.event+".tabs", -function(){var g=this,f=d(this).closest("li"),j=a.panels.filter(":not(.ui-tabs-hide)"),l=d(a._sanitizeSelector(this.hash));if(f.hasClass("ui-tabs-selected")&&!b.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}b.selected=a.anchors.index(this);a.abort();if(b.collapsible)if(f.hasClass("ui-tabs-selected")){b.selected=-1;b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){r(g, -j)}).dequeue("tabs");this.blur();return false}else if(!j.length){b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this));this.blur();return false}b.cookie&&a._cookie(b.selected,b.cookie);if(l.length){j.length&&a.element.queue("tabs",function(){r(g,j)});a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs", -function(){return false})},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(b,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this, -"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});c.cookie&&this._cookie(null,c.cookie);return this},add:function(c,e,a){if(a===undefined)a=this.anchors.length;var b=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,e));c=!c.indexOf("#")?c.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs", -true);var i=d("#"+c);i.length||(i=d(h.panelTemplate).attr("id",c).data("destroy.tabs",true));i.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);i.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);i.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide"); -this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(c){var e=this.options,a=this.lis.eq(c).remove(),b=this.panels.eq(c).remove();if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(c+(c+1=c?--h:h});this._tabify();this._trigger("remove", -null,this._ui(a.find("a")[0],b[0]));return this},enable:function(c){var e=this.options;if(d.inArray(c,e.disabled)!=-1){this.lis.eq(c).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=c});this._trigger("enable",null,this._ui(this.anchors[c],this.panels[c]));return this}},disable:function(c){var e=this.options;if(c!=e.selected){this.lis.eq(c).addClass("ui-state-disabled");e.disabled.push(c);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}return this}, -select:function(c){if(typeof c=="string")c=this.anchors.index(this.anchors.filter("[href$="+c+"]"));else if(c===null)c=-1;if(c==-1&&this.options.collapsible)c=this.options.selected;this.anchors.eq(c).trigger(this.options.event+".tabs");return this},load:function(c){var e=this,a=this.options,b=this.anchors.eq(c)[0],h=d.data(b,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(b,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(c).addClass("ui-state-processing"); -if(a.spinner){var i=d("span",b);i.data("label.tabs",i.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(b.hash)).html(k);e._cleanup();a.cache&&d.data(b,"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.error(k,n,c,b)}catch(m){}}}));e.element.dequeue("tabs");return this}}, -abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(c,e){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.2"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(c,e){var a=this,b=this.options,h=a._rotate||(a._rotate= -function(i){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=b.selected;a.select(++k')}function E(a,b){d.extend(a, -b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.2"}});var y=(new Date).getTime();d.extend(J.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]= -f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
    ')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor== -Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); -d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}}, -_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b= -d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; -for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target|| -a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a); -d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&& -d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f, -h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover"); -this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); -a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(), -k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"]; -a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val(): -"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&& -!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth; -b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){a=this._getInst(d(a)[0]); -a.input&&a._selectingMonthYear&&!d.browser.msie&&a.input.focus();a._selectingMonthYear=!a._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a, -"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")|| -this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null; -for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c, -k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c? -c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear|| -a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? -new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a)); -n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m, -g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&& -a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),G=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var K=this._getDefaultDate(a),H="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
    '+(/all|left/.test(t)&&C==0?c? -f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'
    ';var A=k?'":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, -A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var N=0;N";var O=!k?"":'";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,I=B&&!G||!F[0]||j&&qo;O+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=O+""}g++;if(g>11){g=0;m++}x+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(q)+""+(B&&!w?" ":I?''+q.getDate()+ -"":''+q.getDate()+"")+"
    "+(l?"
    "+(i[0]>0&&D==i[1]-1?'
    ':""):"");L+=x}H+=L}H+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': -"");a._keyEvent=false;return H},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='
    ',o="";if(h||!k)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b, -i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="
    ";return j},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); -return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new J;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.2";window["DP_jQuery_"+y]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b){b.widget("ui.progressbar",{options:{value:0},_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===undefined)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){switch(a){case "value":this.options.value=c;this._refreshValue();this._trigger("change");break}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;if(athis._valueMax())a=this._valueMax();return a}, -_valueMin:function(){return 0},_valueMax:function(){return 100},_refreshValue:function(){var a=this.value();this.valueDiv[a===this._valueMax()?"addClass":"removeClass"]("ui-corner-right").width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.2"})})(jQuery); -;/* - * jQuery UI Effects 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit= -true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, -183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, -165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u, -i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? -f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.2",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); -c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| -typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, -arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ -b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, -10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* -a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* -f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.2 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff --git a/js/jquery.blockUI.js b/js/jquery.blockUI.js index 2edc1a4e4..87c8b65a9 100644 --- a/js/jquery.blockUI.js +++ b/js/jquery.blockUI.js @@ -1,486 +1,587 @@ -/*! - * jQuery blockUI plugin - * Version 2.33 (29-MAR-2010) - * @requires jQuery v1.2.3 or later - * - * Examples at: http://malsup.com/jquery/block/ - * Copyright (c) 2007-2008 M. Alsup - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Thanks to Amir-Hossein Sobhi for some excellent contributions! - */ - -;(function($) { - -if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { - alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); - return; -} - -$.fn._fadeIn = $.fn.fadeIn; - -var noOp = function() {}; - -// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle -// retarded userAgent strings on Vista) -var mode = document.documentMode || 0; -var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); -var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode; - -// global $ methods for blocking/unblocking the entire page -$.blockUI = function(opts) { install(window, opts); }; -$.unblockUI = function(opts) { remove(window, opts); }; - -// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) -$.growlUI = function(title, message, timeout, onClose) { - var $m = $('
    '); - if (title) $m.append('

    '+title+'

    '); - if (message) $m.append('

    '+message+'

    '); - if (timeout == undefined) timeout = 3000; - $.blockUI({ - message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, - timeout: timeout, showOverlay: false, - onUnblock: onClose, - css: $.blockUI.defaults.growlCSS - }); -}; - -// plugin method for blocking element content -$.fn.block = function(opts) { - return this.unblock({ fadeOut: 0 }).each(function() { - if ($.css(this,'position') == 'static') - this.style.position = 'relative'; - if ($.browser.msie) - this.style.zoom = 1; // force 'hasLayout' - install(this, opts); - }); -}; - -// plugin method for unblocking element content -$.fn.unblock = function(opts) { - return this.each(function() { - remove(this, opts); - }); -}; - -$.blockUI.version = 2.33; // 2nd generation blocking at no extra cost! - -// override these in your code to change the default behavior and style -$.blockUI.defaults = { - // message displayed when blocking (use null for no message) - message: '

    Please wait...

    ', - - title: null, // title string; only used when theme == true - draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) - - theme: false, // set to true to use with jQuery UI themes - - // styles for the message when blocking; if you wish to disable - // these and use an external stylesheet then do this in your code: - // $.blockUI.defaults.css = {}; - css: { - padding: 0, - margin: 0, - width: '30%', - top: '40%', - left: '35%', - textAlign: 'center', - color: '#000', - border: '3px solid #aaa', - backgroundColor:'#fff', - cursor: 'wait' - }, - - // minimal style set used when themes are used - themedCSS: { - width: '30%', - top: '40%', - left: '35%' - }, - - // styles for the overlay - overlayCSS: { - backgroundColor: '#000', - opacity: 0.6, - cursor: 'wait' - }, - - // styles applied when using $.growlUI - growlCSS: { - width: '350px', - top: '10px', - left: '', - right: '10px', - border: 'none', - padding: '5px', - opacity: 0.6, - cursor: 'default', - color: '#fff', - backgroundColor: '#000', - '-webkit-border-radius': '10px', - '-moz-border-radius': '10px', - 'border-radius': '10px' - }, - - // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w - // (hat tip to Jorge H. N. de Vasconcelos) - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', - - // force usage of iframe in non-IE browsers (handy for blocking applets) - forceIframe: false, - - // z-index for the blocking overlay - baseZ: 1000, - - // set these to true to have the message automatically centered - centerX: true, // <-- only effects element blocking (page block controlled via css above) - centerY: true, - - // allow body element to be stetched in ie6; this makes blocking look better - // on "short" pages. disable if you wish to prevent changes to the body height - allowBodyStretch: true, - - // enable if you want key and mouse events to be disabled for content that is blocked - bindEvents: true, - - // be default blockUI will supress tab navigation from leaving blocking content - // (if bindEvents is true) - constrainTabKey: true, - - // fadeIn time in millis; set to 0 to disable fadeIn on block - fadeIn: 200, - - // fadeOut time in millis; set to 0 to disable fadeOut on unblock - fadeOut: 400, - - // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock - timeout: 0, - - // disable if you don't want to show the overlay - showOverlay: true, - - // if true, focus will be placed in the first available input field when - // page blocking - focusInput: true, - - // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) - applyPlatformOpacityRules: true, - - // callback method invoked when fadeIn has completed and blocking message is visible - onBlock: null, - - // callback method invoked when unblocking has completed; the callback is - // passed the element that has been unblocked (which is the window object for page - // blocks) and the options that were passed to the unblock call: - // onUnblock(element, options) - onUnblock: null, - - // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 - quirksmodeOffsetHack: 4 -}; - -// private data and functions follow... - -var pageBlock = null; -var pageBlockEls = []; - -function install(el, opts) { - var full = (el == window); - var msg = opts && opts.message !== undefined ? opts.message : undefined; - opts = $.extend({}, $.blockUI.defaults, opts || {}); - opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); - var css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); - var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); - msg = msg === undefined ? opts.message : msg; - - // remove the current block (if there is one) - if (full && pageBlock) - remove(window, {fadeOut:0}); - - // if an existing element is being used as the blocking content then we capture - // its current place in the DOM (and current display style) so we can restore - // it when we unblock - if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { - var node = msg.jquery ? msg[0] : msg; - var data = {}; - $(el).data('blockUI.history', data); - data.el = node; - data.parent = node.parentNode; - data.display = node.style.display; - data.position = node.style.position; - if (data.parent) - data.parent.removeChild(node); - } - - var z = opts.baseZ; - - // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; - // layer1 is the iframe layer which is used to supress bleed through of underlying content - // layer2 is the overlay layer which has opacity and a wait cursor (by default) - // layer3 is the message content that is displayed while blocking - - var lyr1 = ($.browser.msie || opts.forceIframe) - ? $('') - : $(''); - var lyr2 = $(''); - - var lyr3, s; - if (opts.theme && full) { - s = ''; - } - else if (opts.theme) { - s = ''; - } - else if (full) { - s = ''; - } - else { - s = ''; - } - lyr3 = $(s); - - // if we have a message, style it - if (msg) { - if (opts.theme) { - lyr3.css(themedCSS); - lyr3.addClass('ui-widget-content'); - } - else - lyr3.css(css); - } - - // style the overlay - if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) - lyr2.css(opts.overlayCSS); - lyr2.css('position', full ? 'fixed' : 'absolute'); - - // make iframe layer transparent in IE - if ($.browser.msie || opts.forceIframe) - lyr1.css('opacity',0.0); - - //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); - var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); - $.each(layers, function() { - this.appendTo($par); - }); - - if (opts.theme && opts.draggable && $.fn.draggable) { - lyr3.draggable({ - handle: '.ui-dialog-titlebar', - cancel: 'li' - }); - } - - // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) - var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0); - if (ie6 || expr) { - // give body 100% height - if (full && opts.allowBodyStretch && $.boxModel) - $('html,body').css('height','100%'); - - // fix ie6 issue when blocked element has a border width - if ((ie6 || !$.boxModel) && !full) { - var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); - var fixT = t ? '(0 - '+t+')' : 0; - var fixL = l ? '(0 - '+l+')' : 0; - } - - // simulate fixed position - $.each([lyr1,lyr2,lyr3], function(i,o) { - var s = o[0].style; - s.position = 'absolute'; - if (i < 2) { - full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"') - : s.setExpression('height','this.parentNode.offsetHeight + "px"'); - full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') - : s.setExpression('width','this.parentNode.offsetWidth + "px"'); - if (fixL) s.setExpression('left', fixL); - if (fixT) s.setExpression('top', fixT); - } - else if (opts.centerY) { - if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); - s.marginTop = 0; - } - else if (!opts.centerY && full) { - var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; - var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; - s.setExpression('top',expression); - } - }); - } - - // show the message - if (msg) { - if (opts.theme) - lyr3.find('.ui-widget-content').append(msg); - else - lyr3.append(msg); - if (msg.jquery || msg.nodeType) - $(msg).show(); - } - - if (($.browser.msie || opts.forceIframe) && opts.showOverlay) - lyr1.show(); // opacity is zero - if (opts.fadeIn) { - var cb = opts.onBlock ? opts.onBlock : noOp; - var cb1 = (opts.showOverlay && !msg) ? cb : noOp; - var cb2 = msg ? cb : noOp; - if (opts.showOverlay) - lyr2._fadeIn(opts.fadeIn, cb1); - if (msg) - lyr3._fadeIn(opts.fadeIn, cb2); - } - else { - if (opts.showOverlay) - lyr2.show(); - if (msg) - lyr3.show(); - if (opts.onBlock) - opts.onBlock(); - } - - // bind key and mouse events - bind(1, el, opts); - - if (full) { - pageBlock = lyr3[0]; - pageBlockEls = $(':input:enabled:visible',pageBlock); - if (opts.focusInput) - setTimeout(focus, 20); - } - else - center(lyr3[0], opts.centerX, opts.centerY); - - if (opts.timeout) { - // auto-unblock - var to = setTimeout(function() { - full ? $.unblockUI(opts) : $(el).unblock(opts); - }, opts.timeout); - $(el).data('blockUI.timeout', to); - } -}; - -// remove the block -function remove(el, opts) { - var full = (el == window); - var $el = $(el); - var data = $el.data('blockUI.history'); - var to = $el.data('blockUI.timeout'); - if (to) { - clearTimeout(to); - $el.removeData('blockUI.timeout'); - } - opts = $.extend({}, $.blockUI.defaults, opts || {}); - bind(0, el, opts); // unbind events - - var els; - if (full) // crazy selector to handle odd field errors in ie6/7 - els = $('body').children().filter('.blockUI').add('body > .blockUI'); - else - els = $('.blockUI', el); - - if (full) - pageBlock = pageBlockEls = null; - - if (opts.fadeOut) { - els.fadeOut(opts.fadeOut); - setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); - } - else - reset(els, data, opts, el); -}; - -// move blocking element back into the DOM where it started -function reset(els,data,opts,el) { - els.each(function(i,o) { - // remove via DOM calls so we don't lose event handlers - if (this.parentNode) - this.parentNode.removeChild(this); - }); - - if (data && data.el) { - data.el.style.display = data.display; - data.el.style.position = data.position; - if (data.parent) - data.parent.appendChild(data.el); - $(el).removeData('blockUI.history'); - } - - if (typeof opts.onUnblock == 'function') - opts.onUnblock(el,opts); -}; - -// bind/unbind the handler -function bind(b, el, opts) { - var full = el == window, $el = $(el); - - // don't bother unbinding if there is nothing to unbind - if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) - return; - if (!full) - $el.data('blockUI.isBlocked', b); - - // don't bind events when overlay is not in use or if bindEvents is false - if (!opts.bindEvents || (b && !opts.showOverlay)) - return; - - // bind anchors and inputs for mouse and key events - var events = 'mousedown mouseup keydown keypress'; - b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler); - -// former impl... -// var $e = $('a,:input'); -// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); -}; - -// event handler to suppress keyboard/mouse events when blocking -function handler(e) { - // allow tab navigation (conditionally) - if (e.keyCode && e.keyCode == 9) { - if (pageBlock && e.data.constrainTabKey) { - var els = pageBlockEls; - var fwd = !e.shiftKey && e.target == els[els.length-1]; - var back = e.shiftKey && e.target == els[0]; - if (fwd || back) { - setTimeout(function(){focus(back)},10); - return false; - } - } - } - // allow events within the message content - if ($(e.target).parents('div.blockMsg').length > 0) - return true; - - // allow events for content that is not being blocked - return $(e.target).parents().children().filter('div.blockUI').length == 0; -}; - -function focus(back) { - if (!pageBlockEls) - return; - var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; - if (e) - e.focus(); -}; - -function center(el, x, y) { - var p = el.parentNode, s = el.style; - var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); - var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); - if (x) s.left = l > 0 ? (l+'px') : '0'; - if (y) s.top = t > 0 ? (t+'px') : '0'; -}; - -function sz(el, p) { - return parseInt($.css(el,p))||0; -}; - -})(jQuery); +/*! + * jQuery blockUI plugin + * Version 2.59.0-2013.04.05 + * @requires jQuery v1.7 or later + * + * Examples at: http://malsup.com/jquery/block/ + * Copyright (c) 2007-2013 M. Alsup + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Thanks to Amir-Hossein Sobhi for some excellent contributions! + */ + +;(function() { +/*jshint eqeqeq:false curly:false latedef:false */ +"use strict"; + + function setup($) { + $.fn._fadeIn = $.fn.fadeIn; + + var noOp = $.noop || function() {}; + + // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle + // retarded userAgent strings on Vista) + var msie = /MSIE/.test(navigator.userAgent); + var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); + var mode = document.documentMode || 0; + var setExpr = $.isFunction( document.createElement('div').style.setExpression ); + + // global $ methods for blocking/unblocking the entire page + $.blockUI = function(opts) { install(window, opts); }; + $.unblockUI = function(opts) { remove(window, opts); }; + + // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) + $.growlUI = function(title, message, timeout, onClose) { + var $m = $('
    '); + if (title) $m.append('

    '+title+'

    '); + if (message) $m.append('

    '+message+'

    '); + if (timeout === undefined) timeout = 3000; + $.blockUI({ + message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, + timeout: timeout, showOverlay: false, + onUnblock: onClose, + css: $.blockUI.defaults.growlCSS + }); + }; + + // plugin method for blocking element content + $.fn.block = function(opts) { + if ( this[0] === window ) { + $.blockUI( opts ); + return this; + } + var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); + this.each(function() { + var $el = $(this); + if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) + return; + $el.unblock({ fadeOut: 0 }); + }); + + return this.each(function() { + if ($.css(this,'position') == 'static') { + this.style.position = 'relative'; + $(this).data('blockUI.static', true); + } + this.style.zoom = 1; // force 'hasLayout' in ie + install(this, opts); + }); + }; + + // plugin method for unblocking element content + $.fn.unblock = function(opts) { + if ( this[0] === window ) { + $.unblockUI( opts ); + return this; + } + return this.each(function() { + remove(this, opts); + }); + }; + + $.blockUI.version = 2.59; // 2nd generation blocking at no extra cost! + + // override these in your code to change the default behavior and style + $.blockUI.defaults = { + // message displayed when blocking (use null for no message) + message: '

    Please wait...

    ', + + title: null, // title string; only used when theme == true + draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) + + theme: false, // set to true to use with jQuery UI themes + + // styles for the message when blocking; if you wish to disable + // these and use an external stylesheet then do this in your code: + // $.blockUI.defaults.css = {}; + css: { + padding: 0, + margin: 0, + width: '30%', + top: '40%', + left: '35%', + textAlign: 'center', + color: '#000', + border: '3px solid #aaa', + backgroundColor:'#fff', + cursor: 'wait' + }, + + // minimal style set used when themes are used + themedCSS: { + width: '30%', + top: '40%', + left: '35%' + }, + + // styles for the overlay + overlayCSS: { + backgroundColor: '#000', + opacity: 0.6, + cursor: 'wait' + }, + + // style to replace wait cursor before unblocking to correct issue + // of lingering wait cursor + cursorReset: 'default', + + // styles applied when using $.growlUI + growlCSS: { + width: '350px', + top: '10px', + left: '', + right: '10px', + border: 'none', + padding: '5px', + opacity: 0.6, + cursor: 'default', + color: '#fff', + backgroundColor: '#000', + '-webkit-border-radius':'10px', + '-moz-border-radius': '10px', + 'border-radius': '10px' + }, + + // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w + // (hat tip to Jorge H. N. de Vasconcelos) + /*jshint scripturl:true */ + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', + + // force usage of iframe in non-IE browsers (handy for blocking applets) + forceIframe: false, + + // z-index for the blocking overlay + baseZ: 1000, + + // set these to true to have the message automatically centered + centerX: true, // <-- only effects element blocking (page block controlled via css above) + centerY: true, + + // allow body element to be stetched in ie6; this makes blocking look better + // on "short" pages. disable if you wish to prevent changes to the body height + allowBodyStretch: true, + + // enable if you want key and mouse events to be disabled for content that is blocked + bindEvents: true, + + // be default blockUI will supress tab navigation from leaving blocking content + // (if bindEvents is true) + constrainTabKey: true, + + // fadeIn time in millis; set to 0 to disable fadeIn on block + fadeIn: 200, + + // fadeOut time in millis; set to 0 to disable fadeOut on unblock + fadeOut: 400, + + // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock + timeout: 0, + + // disable if you don't want to show the overlay + showOverlay: true, + + // if true, focus will be placed in the first available input field when + // page blocking + focusInput: true, + + // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) + // no longer needed in 2012 + // applyPlatformOpacityRules: true, + + // callback method invoked when fadeIn has completed and blocking message is visible + onBlock: null, + + // callback method invoked when unblocking has completed; the callback is + // passed the element that has been unblocked (which is the window object for page + // blocks) and the options that were passed to the unblock call: + // onUnblock(element, options) + onUnblock: null, + + // callback method invoked when the overlay area is clicked. + // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used. + onOverlayClick: null, + + // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 + quirksmodeOffsetHack: 4, + + // class name of the message block + blockMsgClass: 'blockMsg', + + // if it is already blocked, then ignore it (don't unblock and reblock) + ignoreIfBlocked: false + }; + + // private data and functions follow... + + var pageBlock = null; + var pageBlockEls = []; + + function install(el, opts) { + var css, themedCSS; + var full = (el == window); + var msg = (opts && opts.message !== undefined ? opts.message : undefined); + opts = $.extend({}, $.blockUI.defaults, opts || {}); + + if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) + return; + + opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); + css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); + if (opts.onOverlayClick) + opts.overlayCSS.cursor = 'pointer'; + + themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); + msg = msg === undefined ? opts.message : msg; + + // remove the current block (if there is one) + if (full && pageBlock) + remove(window, {fadeOut:0}); + + // if an existing element is being used as the blocking content then we capture + // its current place in the DOM (and current display style) so we can restore + // it when we unblock + if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { + var node = msg.jquery ? msg[0] : msg; + var data = {}; + $(el).data('blockUI.history', data); + data.el = node; + data.parent = node.parentNode; + data.display = node.style.display; + data.position = node.style.position; + if (data.parent) + data.parent.removeChild(node); + } + + $(el).data('blockUI.onUnblock', opts.onUnblock); + var z = opts.baseZ; + + // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; + // layer1 is the iframe layer which is used to supress bleed through of underlying content + // layer2 is the overlay layer which has opacity and a wait cursor (by default) + // layer3 is the message content that is displayed while blocking + var lyr1, lyr2, lyr3, s; + if (msie || opts.forceIframe) + lyr1 = $(''); + else + lyr1 = $(''); + + if (opts.theme) + lyr2 = $(''); + else + lyr2 = $(''); + + if (opts.theme && full) { + s = ''; + } + else if (opts.theme) { + s = ''; + } + else if (full) { + s = ''; + } + else { + s = ''; + } + lyr3 = $(s); + + // if we have a message, style it + if (msg) { + if (opts.theme) { + lyr3.css(themedCSS); + lyr3.addClass('ui-widget-content'); + } + else + lyr3.css(css); + } + + // style the overlay + if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/) + lyr2.css(opts.overlayCSS); + lyr2.css('position', full ? 'fixed' : 'absolute'); + + // make iframe layer transparent in IE + if (msie || opts.forceIframe) + lyr1.css('opacity',0.0); + + //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); + var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); + $.each(layers, function() { + this.appendTo($par); + }); + + if (opts.theme && opts.draggable && $.fn.draggable) { + lyr3.draggable({ + handle: '.ui-dialog-titlebar', + cancel: 'li' + }); + } + + // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) + var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); + if (ie6 || expr) { + // give body 100% height + if (full && opts.allowBodyStretch && $.support.boxModel) + $('html,body').css('height','100%'); + + // fix ie6 issue when blocked element has a border width + if ((ie6 || !$.support.boxModel) && !full) { + var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); + var fixT = t ? '(0 - '+t+')' : 0; + var fixL = l ? '(0 - '+l+')' : 0; + } + + // simulate fixed position + $.each(layers, function(i,o) { + var s = o[0].style; + s.position = 'absolute'; + if (i < 2) { + if (full) + s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); + else + s.setExpression('height','this.parentNode.offsetHeight + "px"'); + if (full) + s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'); + else + s.setExpression('width','this.parentNode.offsetWidth + "px"'); + if (fixL) s.setExpression('left', fixL); + if (fixT) s.setExpression('top', fixT); + } + else if (opts.centerY) { + if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); + s.marginTop = 0; + } + else if (!opts.centerY && full) { + var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0; + var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; + s.setExpression('top',expression); + } + }); + } + + // show the message + if (msg) { + if (opts.theme) + lyr3.find('.ui-widget-content').append(msg); + else + lyr3.append(msg); + if (msg.jquery || msg.nodeType) + $(msg).show(); + } + + if ((msie || opts.forceIframe) && opts.showOverlay) + lyr1.show(); // opacity is zero + if (opts.fadeIn) { + var cb = opts.onBlock ? opts.onBlock : noOp; + var cb1 = (opts.showOverlay && !msg) ? cb : noOp; + var cb2 = msg ? cb : noOp; + if (opts.showOverlay) + lyr2._fadeIn(opts.fadeIn, cb1); + if (msg) + lyr3._fadeIn(opts.fadeIn, cb2); + } + else { + if (opts.showOverlay) + lyr2.show(); + if (msg) + lyr3.show(); + if (opts.onBlock) + opts.onBlock(); + } + + // bind key and mouse events + bind(1, el, opts); + + if (full) { + pageBlock = lyr3[0]; + pageBlockEls = $(':input:enabled:visible',pageBlock); + if (opts.focusInput) + setTimeout(focus, 20); + } + else + center(lyr3[0], opts.centerX, opts.centerY); + + if (opts.timeout) { + // auto-unblock + var to = setTimeout(function() { + if (full) + $.unblockUI(opts); + else + $(el).unblock(opts); + }, opts.timeout); + $(el).data('blockUI.timeout', to); + } + } + + // remove the block + function remove(el, opts) { + var count; + var full = (el == window); + var $el = $(el); + var data = $el.data('blockUI.history'); + var to = $el.data('blockUI.timeout'); + if (to) { + clearTimeout(to); + $el.removeData('blockUI.timeout'); + } + opts = $.extend({}, $.blockUI.defaults, opts || {}); + bind(0, el, opts); // unbind events + + if (opts.onUnblock === null) { + opts.onUnblock = $el.data('blockUI.onUnblock'); + $el.removeData('blockUI.onUnblock'); + } + + var els; + if (full) // crazy selector to handle odd field errors in ie6/7 + els = $('body').children().filter('.blockUI').add('body > .blockUI'); + else + els = $el.find('>.blockUI'); + + // fix cursor issue + if ( opts.cursorReset ) { + if ( els.length > 1 ) + els[1].style.cursor = opts.cursorReset; + if ( els.length > 2 ) + els[2].style.cursor = opts.cursorReset; + } + + if (full) + pageBlock = pageBlockEls = null; + + if (opts.fadeOut) { + count = els.length; + els.fadeOut(opts.fadeOut, function() { + if ( --count === 0) + reset(els,data,opts,el); + }); + } + else + reset(els, data, opts, el); + } + + // move blocking element back into the DOM where it started + function reset(els,data,opts,el) { + var $el = $(el); + els.each(function(i,o) { + // remove via DOM calls so we don't lose event handlers + if (this.parentNode) + this.parentNode.removeChild(this); + }); + + if (data && data.el) { + data.el.style.display = data.display; + data.el.style.position = data.position; + if (data.parent) + data.parent.appendChild(data.el); + $el.removeData('blockUI.history'); + } + + if ($el.data('blockUI.static')) { + $el.css('position', 'static'); // #22 + } + + if (typeof opts.onUnblock == 'function') + opts.onUnblock(el,opts); + + // fix issue in Safari 6 where block artifacts remain until reflow + var body = $(document.body), w = body.width(), cssW = body[0].style.width; + body.width(w-1).width(w); + body[0].style.width = cssW; + } + + // bind/unbind the handler + function bind(b, el, opts) { + var full = el == window, $el = $(el); + + // don't bother unbinding if there is nothing to unbind + if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) + return; + + $el.data('blockUI.isBlocked', b); + + // don't bind events when overlay is not in use or if bindEvents is false + if (!full || !opts.bindEvents || (b && !opts.showOverlay)) + return; + + // bind anchors and inputs for mouse and key events + var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; + if (b) + $(document).bind(events, opts, handler); + else + $(document).unbind(events, handler); + + // former impl... + // var $e = $('a,:input'); + // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); + } + + // event handler to suppress keyboard/mouse events when blocking + function handler(e) { + // allow tab navigation (conditionally) + if (e.keyCode && e.keyCode == 9) { + if (pageBlock && e.data.constrainTabKey) { + var els = pageBlockEls; + var fwd = !e.shiftKey && e.target === els[els.length-1]; + var back = e.shiftKey && e.target === els[0]; + if (fwd || back) { + setTimeout(function(){focus(back);},10); + return false; + } + } + } + var opts = e.data; + var target = $(e.target); + if (target.hasClass('blockOverlay') && opts.onOverlayClick) + opts.onOverlayClick(); + + // allow events within the message content + if (target.parents('div.' + opts.blockMsgClass).length > 0) + return true; + + // allow events for content that is not being blocked + return target.parents().children().filter('div.blockUI').length === 0; + } + + function focus(back) { + if (!pageBlockEls) + return; + var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; + if (e) + e.focus(); + } + + function center(el, x, y) { + var p = el.parentNode, s = el.style; + var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); + var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); + if (x) s.left = l > 0 ? (l+'px') : '0'; + if (y) s.top = t > 0 ? (t+'px') : '0'; + } + + function sz(el, p) { + return parseInt($.css(el,p),10)||0; + } + + } + + + /*global define:true */ + if (typeof define === 'function' && define.amd && define.amd.jQuery) { + define(['jquery'], setup); + } else { + setup(jQuery); + } + +})(); diff --git a/js/jquery.layout.js b/js/jquery.layout.js index 96929b40d..60d930ece 100755 --- a/js/jquery.layout.js +++ b/js/jquery.layout.js @@ -1,16 +1,18 @@ /** - * @preserve jquery.layout 1.3.0 - Release Candidate 30.4 - * $Date: 2012-03-10 08:00:00 (Sat, 10 Mar 2012) $ - * $Rev: 303004 $ + * @preserve + * jquery.layout 1.3.0 - Release Candidate 30.79 + * $Date: 2013-01-12 08:00:00 (Sat, 12 Jan 2013) $ + * $Rev: 303007 $ * - * Copyright (c) 2012 - * Fabrizio Balliano (http://www.fabrizioballiano.net) - * Kevin Dalman (http://allpro.net) + * 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. * - * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.2 + * 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 @@ -23,6 +25,10 @@ * {number=} optional parameter * {*} ALL types */ +/* TODO for jQ 2.0 + * change .andSelf() to .addBack() + * $.fn.disableSelection won't work + */ // NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars @@ -32,60 +38,38 @@ var min = Math.min , max = Math.max , round = Math.floor + +, isStr = function (v) { return $.type(v) === "string"; } + + /** + * @param {!Object} Instance + * @param {Array.} a_fn + */ +, runPluginCallbacks = function (Instance, a_fn) { + if ($.isArray(a_fn)) + for (var i=0, c=a_fn.length; i').appendTo("body"); - var d = { width: $c.width() - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight }; + var d = { width: $c.css("width") - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight }; $c.remove(); window.scrollbarWidth = d.width; window.scrollbarHeight = d.height; @@ -303,19 +336,20 @@ $.layout = { * Returns hash container 'display' and 'visibility' * * @see $.swap() - swaps CSS, runs callback, resets CSS + * @param {!Object} $E jQuery element + * @param {boolean=} [force=false] Run even if display != none + * @return {!Object} Returns current style props, if applicable */ , showInvisibly: function ($E, force) { - if (!$E) return {}; - if (!$E.jquery) $E = $($E); - var CSS = { - display: $E.css('display') - , visibility: $E.css('visibility') - }; - if (force || CSS.display === "none") { // only if not *already hidden* - $E.css({ display: "block", visibility: "hidden" }); // show element 'invisibly' so can be measured + if ($E && $E.length && (force || $E.css("display") === "none")) { // only if not *already hidden* + var s = $E[0].style + // save ONLY the 'style' props because that is what we must restore + , CSS = { display: s.display || '', visibility: s.visibility || '' }; + // show element 'invisibly' so can be measured + $E.css({ display: "block", visibility: "hidden" }); return CSS; } - else return {}; + return {}; } /** @@ -324,32 +358,29 @@ $.layout = { * @see _create(), onWindowResize() for container, plus others for pane * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc */ -, getElementDimensions: function ($E) { +, getElementDimensions: function ($E, inset) { var - d = {} // dimensions hash - , x = d.css = {} // CSS hash - , i = {} // TEMP insets - , b, p // TEMP border, padding + // dimensions hash - start with current data IF passed + d = { css: {}, inset: {} } + , x = d.css // CSS hash + , i = { bottom: 0 } // TEMP insets (bottom = complier hack) , N = $.layout.cssNum , off = $E.offset() + , b, p, ei // TEMP border, padding ; d.offsetLeft = off.left; d.offsetTop = off.top; + if (!inset) inset = {}; // simplify logic below + $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge b = x["border" + e] = $.layout.borderWidth($E, e); p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e); - i[e] = b + p; // total offset of content from outer side - d["inset"+ e] = p; + ei = e.toLowerCase(); + d.inset[ei] = inset[ei] >= 0 ? inset[ei] : p; // any missing insetX value = paddingX + i[ei] = d.inset[ei] + b; // total offset of content from outer side }); - d.offsetWidth = $E.innerWidth(); // offsetWidth is used in calc when doing manual resize - d.offsetHeight = $E.innerHeight(); // ditto - d.outerWidth = $E.outerWidth(); - d.outerHeight = $E.outerHeight(); - d.innerWidth = max(0, d.outerWidth - i.Left - i.Right); - d.innerHeight = max(0, d.outerHeight - i.Top - i.Bottom); - x.width = $E.width(); x.height = $E.height(); x.top = N($E,"top",true); @@ -357,12 +388,24 @@ $.layout = { x.left = N($E,"left",true); x.right = N($E,"right",true); + d.outerWidth = $E.outerWidth(); + d.outerHeight = $E.outerHeight(); + // calc the TRUE inner-dimensions, even in quirks-mode! + d.innerWidth = max(0, d.outerWidth - i.left - i.right); + d.innerHeight = max(0, d.outerHeight - i.top - i.bottom); + // layoutWidth/Height is used in calcs for manual resizing + // layoutW/H only differs from innerW/H when in quirks-mode - then is like outerW/H + d.layoutWidth = $E.innerWidth(); + d.layoutHeight = $E.innerHeight(); + + //if ($E.prop('tagName') === 'BODY') { debugData( d, $E.prop('tagName') ); } // DEBUG + //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0; return d; } -, getElementCSS: function ($E, list) { +, getElementStyles: function ($E, list) { var CSS = {} , style = $E[0].style @@ -399,23 +442,19 @@ $.layout = { * @return {number} Returns the innerWidth of the elem by subtracting padding and borders */ , cssWidth: function ($E, outerWidth) { - var - b = $.layout.borderWidth - , n = $.layout.cssNum - ; // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed if (outerWidth <= 0) return 0; - if (!$.support.boxModel) return outerWidth; - - // strip border and padding from outerWidth to get CSS Width - var W = outerWidth - - b($E, "Left") - - b($E, "Right") - - n($E, "paddingLeft") - - n($E, "paddingRight") + var bs = !$.layout.browser.boxModel ? "border-box" : $.support.boxSizing ? $E.css("boxSizing") : "content-box" + , b = $.layout.borderWidth + , n = $.layout.cssNum + , W = outerWidth ; - + // strip border and/or padding from outerWidth to get CSS Width + if (bs !== "border-box") + W -= (b($E, "Left") + b($E, "Right")); + if (bs === "content-box") + W -= (n($E, "paddingLeft") + n($E, "paddingRight")); return max(0,W); } @@ -428,23 +467,19 @@ $.layout = { * @return {number} Returns the innerHeight of the elem by subtracting padding and borders */ , cssHeight: function ($E, outerHeight) { - var - b = $.layout.borderWidth - , n = $.layout.cssNum - ; // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed if (outerHeight <= 0) return 0; - if (!$.support.boxModel) return outerHeight; - - // strip border and padding from outerHeight to get CSS Height - var H = outerHeight - - b($E, "Top") - - b($E, "Bottom") - - n($E, "paddingTop") - - n($E, "paddingBottom") + var bs = !$.layout.browser.boxModel ? "border-box" : $.support.boxSizing ? $E.css("boxSizing") : "content-box" + , b = $.layout.borderWidth + , n = $.layout.cssNum + , H = outerHeight ; - + // strip border and/or padding from outerHeight to get CSS Height + if (bs !== "border-box") + H -= (b($E, "Top") + b($E, "Bottom")); + if (bs === "content-box") + H -= (n($E, "paddingTop") + n($E, "paddingBottom")); return max(0,H); } @@ -460,8 +495,8 @@ $.layout = { , cssNum: function ($E, prop, allowAuto) { if (!$E.jquery) $E = $($E); var CSS = $.layout.showInvisibly($E) - , p = $.curCSS($E[0], prop, true) - , v = allowAuto && p=="auto" ? p : (parseInt(p, 10) || 0); + , p = $.css($E[0], prop, true) + , v = allowAuto && p=="auto" ? p : Math.round(parseFloat(p) || 0); $E.css( CSS ); // RESET return v; } @@ -469,7 +504,7 @@ $.layout = { , borderWidth: function (el, side) { if (el.jquery) el = el[0]; var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left - return $.curCSS(el, b+"Style", true) === "none" ? 0 : (parseInt($.curCSS(el, b+"Width", true), 10) || 0); + return $.css(el, b+"Style", true) === "none" ? 0 : Math.round(parseFloat($.css(el, b+"Width", true)) || 0); } /** @@ -520,7 +555,7 @@ $.layout = { * @param {(Object|string)} info String message OR Hash/Array * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped - * @param {Object=} [debutOpts={}] Extra options for debug output + * @param {Object=} [debugOpts] Extra options for debug output */ , msg: function (info, popup, debugTitle, debugOpts) { if ($.isPlainObject(info) && window.debugData) { @@ -543,13 +578,62 @@ $.layout = { alert(info); else if (window.console) console.log(info); + else { + var id = "#layoutLogger" + , $l = $(id); + if (!$l.length) + $l = createLog(); + $l.children("ul").append('
  • '+ info.replace(/\/g,">") +'
  • '); + } + + function createLog () { + var pos = $.support.fixedPosition ? 'fixed' : 'absolute' + , $e = $('
    ' + + '
    ' + + 'XLayout console.log
    ' + + '
      ' + + '
      ' + ).appendTo("body"); + $e.css('left', $(window).width() - $e.outerWidth() - 5) + if ($.ui.draggable) $e.draggable({ handle: ':first-child' }); + return $e; + }; } }; -var lang = $.layout.language; // alias used in defaults... -// DEFAULT OPTIONS - CHANGE IF DESIRED +/* + * $.layout.browser REPLACES removed $.browser, with extra data + * Parsing code here adapted from jQuery 1.8 $.browse + */ +var u = navigator.userAgent.toLowerCase() +, m = /(chrome)[ \/]([\w.]+)/.exec( u ) + || /(webkit)[ \/]([\w.]+)/.exec( u ) + || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( u ) + || /(msie) ([\w.]+)/.exec( u ) + || u.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( u ) + || [] +, b = m[1] || "" +, v = m[2] || 0 +, ie = b === "msie" +; +$.layout.browser = { + version: v +, safari: b === "webkit" // webkit (NOT chrome) = safari +, webkit: b === "chrome" // chrome = webkit +, msie: ie +, isIE6: ie && v == 6 + // ONLY IE reverts to old box-model - update for older jQ onReady +, boxModel: !ie || $.support.boxModel !== false +}; +if (b) $.layout.browser[b] = true; // set CURRENT browser +/* OLD versions of jQuery only set $.support.boxModel after page is loaded + * so if this is IE, use support.boxModel to test for quirks-mode (ONLY IE changes boxModel) */ +if (ie) $(function(){ $.layout.browser.boxModel = $.support.boxModel; }); + + +// DEFAULT OPTIONS $.layout.defaults = { /* * LAYOUT & LAYOUT-CONTAINER OPTIONS @@ -557,17 +641,18 @@ $.layout.defaults = { */ name: "" // Not required, but useful for buttons and used for the state-cookie , containerClass: "ui-layout-container" // layout-container element +, inset: null // custom container-inset values (override padding) , scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark) , resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event , resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky , resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized +, maskPanesEarly: false // true = create pane-masks on resizer.mouseDown instead of waiting for resizer.dragstart , onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific , onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific , onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements , onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized , onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload , onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload -, autoBindCustomButtons: false // search for buttons with ui-layout-button class and auto-bind them , initPanes: true // false = DO NOT initialize the panes onLoad - will init later , showErrorMessages: true // enables fatal error messages to warn developers of common errors , showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code! @@ -582,6 +667,15 @@ $.layout.defaults = { , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged' } +, errors: { + pane: "pane" // description of "layout pane element" - used only in error messages + , selector: "selector" // description of "jQuery-selector" - used only in error messages + , 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." + } /* * PANE DEFAULT SETTINGS * - settings under the 'panes' key become the default settings for *all panes* @@ -614,8 +708,6 @@ $.layout.defaults = { , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden' , togglerAlign_open: "center" // top/left, bottom/right, center, OR... , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right - , togglerTip_open: lang.Close // Toggler tool-tip (title) - , togglerTip_closed: lang.Open // ditto , togglerContent_open: "" // text or HTML to put INSIDE the toggler , togglerContent_closed: "" // ditto // RESIZING OPTIONS @@ -631,10 +723,7 @@ $.layout.defaults = { , livePaneResizing: false // true = LIVE Resizing as resizer is dragged , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance - // TIPS & MESSAGES - also see lang object - , noRoomToOpenTip: lang.noRoomToOpenTip - , resizerTip: lang.Resize // Resizer tool-tip (title) - , sliderTip: lang.Slide // resizer-bar triggers 'sliding' when pane is closed + // SLIDING OPTIONS , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding' , slideTrigger_open: "click" // click, dblclick, mouseenter , slideTrigger_close: "mouseleave"// click, mouseleave @@ -643,6 +732,18 @@ $.layout.defaults = { , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show? , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE + // PANE-SPECIFIC TIPS & MESSAGES + , tips: { + Open: "Open" // eg: "Open Pane" + , Close: "Close" + , Resize: "Resize" + , Slide: "Slide Open" + , Pin: "Pin" + , Unpin: "Un-Pin" + , noRoomToOpen: "Not enough room to show this panel." // alert if user tries to open a pane that cannot + , minSizeWarning: "Panel has reached its minimum size" // displays in browser statusbar + , maxSizeWarning: "Panel has reached its maximum size" // ditto + } // HOT-KEYS & MISC , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver , enableCursorHotkey: true // enabled 'cursor' hotkeys @@ -655,7 +756,7 @@ $.layout.defaults = { , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 } , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called - /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: + /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: fxName_open: "slide" // 'Open' pane animation fnName_close: "slide" // 'Close' pane animation fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true @@ -667,13 +768,15 @@ $.layout.defaults = { fxSettings_size: {} */ // CHILD/NESTED LAYOUTS - , childOptions: null // Layout-options for nested/child layout - even {} is valid as options - , initChildLayout: true // true = child layout will be created as soon as _this_ layout completes initialization - , destroyChildLayout: true // true = destroy child-layout if this pane is destroyed - , resizeChildLayout: true // true = trigger child-layout.resizeAll() when this pane is resized - // PANE CALLBACKS + , children: null // Layout-options for nested/child layout - even {} is valid as options + , containerSelector: '' // if child is NOT 'directly nested', a selector to find it/them (can have more than one child layout!) + , initChildren: true // true = child layout will be created as soon as _this_ layout completes initialization + , destroyChildren: true // true = destroy child-layout if this pane is destroyed + , resizeChildren: true // true = trigger child-layout.resizeAll() when this pane is resized + // EVENT TRIGGERING , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true + // PANE CALLBACKS , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start @@ -730,15 +833,15 @@ $.layout.defaults = { $.layout.optionsMap = { // layout/global options - NOT pane-options - layout: ("stateManagement,effects,zIndexes," - + "name,zIndex,scrollToBookmarkOnLoad,showErrorMessages," - + "resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay," - + "onresizeall,onresizeall_start,onresizeall_end,onload,onunload,autoBindCustomButtons").split(",") + 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(",") // borderPanes: [ ALL options that are NOT specified as 'layout' ] // default.panes options that apply to the center-pane (most options apply _only_ to border-panes) , center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad," + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing," - + "childOptions,initChildLayout,resizeChildLayout,destroyChildLayout," + + "containerSelector,children,initChildren,resizeChildren,destroyChildren," + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",") // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key , noDefault: ("paneSelector,resizerCursor,customHotkey").split(",") @@ -749,36 +852,41 @@ $.layout.optionsMap = { * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName * Plugins may also call this method so they can transform their own data * - * @param {!Object} hash Data/options passed by user - may be a single level or nested levels - * @return {Object} Returns hash of minWidth & minHeight + * @param {!Object} hash Data/options passed by user - may be a single level or nested levels + * @param {boolean=} [addKeys=false] Should the primary layout.options keys be added if they do not exist? + * @return {Object} Returns hash of minWidth & minHeight */ -$.layout.transformData = function (hash) { - var json = { panes: {}, center: {} } // init return object - , data, branch, optKey, keys, key, val, i, c; +$.layout.transformData = function (hash, addKeys) { + var json = addKeys ? { panes: {}, center: {} } : {} // init return object + , branch, optKey, keys, key, val, i, c; if (typeof hash !== "object") return json; // no options passed // convert all 'flat-keys' to 'sub-key' format for (optKey in hash) { branch = json; - data = $.layout.optionsMap.layout; val = hash[ optKey ]; keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration c = keys.length - 1; // convert underscore-delimited to subkeys for (i=0; i <= c; i++) { key = keys[i]; - if (i === c) - branch[key] = val; - else if (!branch[key]) - branch[key] = {}; // create the subkey - // recurse to sub-key for next loop - if not done - branch = branch[key]; + if (i === c) { // last key = value + if ($.isPlainObject( val )) + branch[key] = $.layout.transformData( val ); // RECURSE + else + branch[key] = val; + } + else { + if (!branch[key]) + branch[key] = {}; // create the subkey + // recurse to sub-key for next loop - if not done + branch = branch[key]; + } } } - return json; -} +}; // INTERNAL CONFIG DATA - DO NOT CHANGE THIS! $.layout.backwardCompatibility = { @@ -786,11 +894,18 @@ $.layout.backwardCompatibility = { map: { // OLD Option Name: NEW Option Name applyDefaultStyles: "applyDemoStyles" - , resizeNestedLayout: "resizeChildLayout" + // CHILD/NESTED LAYOUTS + , childOptions: "children" + , initChildLayout: "initChildren" + , destroyChildLayout: "destroyChildren" + , resizeChildLayout: "resizeChildren" + , resizeNestedLayout: "resizeChildren" + // MISC Options , resizeWhileDragging: "livePaneResizing" , resizeContentWhileDragging: "liveContentResizing" , triggerEventsWhileDragging: "triggerEventsDuringLiveResize" , maskIframesOnResize: "maskContents" + // STATE MANAGEMENT , useStateCookie: "stateManagement.enabled" , "cookie.autoLoad": "stateManagement.autoLoad" , "cookie.autoSave": "stateManagement.autoSave" @@ -800,19 +915,26 @@ $.layout.backwardCompatibility = { , "cookie.path": "stateManagement.cookie.path" , "cookie.expires": "stateManagement.cookie.expires" , "cookie.secure": "stateManagement.cookie.secure" + // OLD Language options + , noRoomToOpenTip: "tips.noRoomToOpen" + , togglerTip_open: "tips.Close" // open = Close + , togglerTip_closed: "tips.Open" // closed = Open + , resizerTip: "tips.Resize" + , sliderTip: "tips.Slide" } - /** - * @param {Object} opts - */ + +/** +* @param {Object} opts +*/ , renameOptions: function (opts) { var map = $.layout.backwardCompatibility.map , oldData, newData, value ; for (var itemPath in map) { oldData = getBranch( itemPath ); - value = oldData.branch[ oldData.key ] + value = oldData.branch[ oldData.key ]; if (value !== undefined) { - newData = getBranch( map[itemPath], true ) + newData = getBranch( map[itemPath], true ); newData.branch[ newData.key ] = value; delete oldData.branch[ oldData.key ]; } @@ -842,9 +964,10 @@ $.layout.backwardCompatibility = { return D; }; } - /** - * @param {Object} opts - */ + +/** +* @param {Object} opts +*/ , renameAllOptions: function (opts) { var ren = $.layout.backwardCompatibility.renameOptions; // rename root (layout) options @@ -868,6 +991,7 @@ $.layout.backwardCompatibility = { + /* ============================================================ * BEGIN WIDGET: $( selector ).layout( {options} ); * ============================================================ @@ -877,14 +1001,15 @@ $.fn.layout = function (opts) { // local aliases to global data browser = $.layout.browser -, lang = $.layout.language // internal alias , _c = $.layout.config // local aliases to utlity methods , cssW = $.layout.cssWidth , cssH = $.layout.cssHeight , elDims = $.layout.getElementDimensions -, elCSS = $.layout.getElementCSS +, styles = $.layout.getElementStyles +, evtObj = $.layout.getEventObject +, evtPane = $.layout.parsePaneName /** * options - populated by initOptions() @@ -897,20 +1022,29 @@ $.fn.layout = function (opts) { */ , state = { // generate unique ID to use for event.namespace so can unbind only events added by 'this layout' - id: "layout"+ $.now() // code uses alias: sID - , initialized: false - , container: {} // init all keys - , north: {} - , south: {} - , east: {} - , west: {} - , center: {} + id: "layout"+ $.now() // code uses alias: sID + , initialized: false + , paneResizing: false + , panesSliding: {} + , container: { // list all keys referenced in code to avoid compiler error msgs + 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 } } /** * parent/child-layout pointers */ -//, Layout = false - exists ONLY as Instance.Layout +//, hasParentLayout = false - exists ONLY inside Instance so can be set externally , children = { north: null , south: null @@ -934,52 +1068,104 @@ $.fn.layout = function (opts) { , clear: function (s) { var t=timer.data; if (t[s]) {clearTimeout(t[s]); delete t[s];} } } -, _log = function (msg, popup) { - $.layout.msg( msg, (popup && options.showErrorMessages) ); + /** + * Alert or console.log a message - IF option is enabled. + * + * @param {(string|!Object)} msg Message (or debug-data) to display + * @param {boolean=} [popup=false] True by default, means 'alert', false means use console.log + * @param {boolean=} [debug=false] True means is a widget debugging message + */ +, _log = function (msg, popup, debug) { + var o = options; + if ((o.showErrorMessages && !debug) || (debug && o.showDebugMessages)) + $.layout.msg( o.name +' / '+ msg, (popup !== false) ); + return false; } /** * Executes a Callback function after a trigger event, like resize, open or close * - * @param {?string} pane This is passed only so we can pass the 'pane object' to the callback - * @param {(string|function())} v_fn Accepts a function name, OR a comma-delimited array: [0]=function name, [1]=argument + * @param {string} evtName Name of the layout callback, eg "onresize_start" + * @param {(string|boolean)=} [pane=""] This is passed only so we can pass the 'pane object' to the callback + * @param {(string|boolean)=} [skipBoundEvents=false] True = do not run events bound to the elements - only the callbacks set in options */ -, _execCallback = function (pane, v_fn) { - if (!v_fn) return; - var fn; - try { - if (typeof v_fn === "function") - fn = v_fn; - else if (!isStr(v_fn)) - return; - else if (v_fn.match(/,/)) { - // function name cannot contain a comma, so must be a function name AND a 'name' parameter - var - args = v_fn.split(",") - , fn = eval(args[0]) - ; - if (typeof fn=="function" && args.length > 1) - return fn(args[1]); // pass the argument parsed from 'list' - } - else // just the name of an external function? - fn = eval(v_fn); +, _runCallbacks = function (evtName, pane, skipBoundEvents) { + var hasPane = pane && isStr(pane) + , s = hasPane ? state[pane] : state + , o = hasPane ? options[pane] : options + , lName = options.name + // names like onopen and onopen_end separate are interchangeable in options... + , lng = evtName + (evtName.match(/_/) ? "" : "_end") + , shrt = lng.match(/_end$/) ? lng.substr(0, lng.length - 4) : "" + , fn = o[lng] || o[shrt] + , retVal = "NC" // NC = No Callback + , args = [] + , $P + ; + if ( !hasPane && $.type(pane) === 'boolean' ) { + skipBoundEvents = pane; // allow pane param to be skipped for Layout callback + pane = ""; + } - if ($.isFunction( fn )) { - if (pane && $Ps[pane]) - // pass data: pane-name, pane-element, pane-state, pane-options, and layout-name - return fn( pane, $Ps[pane], state[pane], options[pane], options.name ); - else // must be a layout/container callback - pass suitable info - return fn( Instance, state, options, options.name ); + // first trigger the callback set in the options + if (fn) { + try { + // convert function name (string) to function object + if (isStr( fn )) { + if (fn.match(/,/)) { + // function name cannot contain a comma, + // so must be a function name AND a parameter to pass + args = fn.split(",") + , fn = eval(args[0]); + } + else // just the name of an external function? + fn = eval(fn); + } + // execute the callback, if exists + if ($.isFunction( fn )) { + if (args.length) + retVal = g(fn)(args[1]); // pass the argument parsed from 'list' + else if ( hasPane ) + // pass data: pane-name, pane-element, pane-state, pane-options, and layout-name + retVal = g(fn)( pane, $Ps[pane], s, o, lName ); + else // must be a layout/container callback - pass suitable info + retVal = g(fn)( Instance, s, o, lName ); + } + } + catch (ex) { + _log( options.errors.callbackError.replace(/EVENT/, $.trim((pane || "") +" "+ lng)), false ); + if ($.type(ex) === 'string' && string.length) + _log('Exception: '+ ex, false ); } } - catch (ex) {} + + // trigger additional events bound directly to the pane + if (!skipBoundEvents && retVal !== false) { + if ( hasPane ) { // PANE events can be bound to each pane-elements + $P = $Ps[pane]; + o = options[pane]; + s = state[pane]; + $P.triggerHandler('layoutpane'+ lng, [ pane, $P, s, o, lName ]); + if (shrt) + $P.triggerHandler('layoutpane'+ shrt, [ pane, $P, s, o, lName ]); + } + else { // LAYOUT events can be bound to the container-element + $N.triggerHandler('layout'+ lng, [ Instance, s, o, lName ]); + if (shrt) + $N.triggerHandler('layout'+ shrt, [ Instance, s, o, lName ]); + } + } + + // ALWAYS resizeChildren after an onresize_end event - even during initialization + // IGNORE onsizecontent_end event because causes child-layouts to resize TWICE + if (hasPane && evtName === "onresize_end") // BAD: || evtName === "onsizecontent_end" + resizeChildren(pane+"", true); // compiler hack -force string + + return retVal; + + function g (f) { return f; }; // compiler hack } -, trigger = function (fnName, pane) { - var o = options - , fn = pane && o[pane] ? o[pane][fnName] : o[fnName]; - if (fn) _execCallback(pane || null, fn); - } /** * cure iframe display issues in IE & other browsers @@ -1010,9 +1196,8 @@ $.fn.layout = function (opts) { */ , cssMinDims = function (pane) { // minWidth/Height means CSS width/height = 1px - var - $P = $Ps[pane] - dir = _c[pane].dir + var $P = $Ps[pane] + , dir = _c[pane].dir , d = { minWidth: 1001 - cssW($P, 1000) , minHeight: 1001 - cssH($P, 1000) @@ -1071,18 +1256,6 @@ $.fn.layout = function (opts) { $E.hide().data('autoHidden', true); } - /** - * @param {(string|!Object)} el - * @param {number=} outerSize - * @param {boolean=} [autoHide=false] - */ -, setOuterSize = function (el, outerSize, autoHide) { - if (_c[pane].dir=="horz") // pane = north or south - setOuterHeight(el, outerSize, autoHide); - else // pane = east or west - setOuterWidth(el, outerSize, autoHide); - } - /** * Converts any 'size' params to a pixel/integer size, if not already @@ -1119,15 +1292,18 @@ $.fn.layout = function (opts) { return 0; else { // size < 0 || size=='auto' || size==Missing || size==Invalid // auto-size the pane - var - $P = $Ps[pane] - , dim = (dir === "horz" ? "height" : "width") + var dim = (dir === "horz" ? "height" : "width") + , $P = $Ps[pane] + , $C = dim === 'height' ? $Cs[pane] : false , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden - , s = $P.css(dim); // SAVE current size + , szP = $P.css(dim) // SAVE current pane size + , szC = $C ? $C.css(dim) : 0 // SAVE current content size ; $P.css(dim, "auto"); + if ($C) $C.css(dim, "auto"); size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE - $P.css(dim, s).css(vis); // RESET size & visibility + $P.css(dim, szP).css(vis); // RESET size & visibility + if ($C) $C.css(dim, szC); return size; } } @@ -1137,7 +1313,7 @@ $.fn.layout = function (opts) { * * @param {(string|!Object)} pane * @param {boolean=} [inclSpace=false] - * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes - adjusted for boxModel & browser + * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes */ , getPaneSize = function (pane, inclSpace) { var @@ -1170,7 +1346,6 @@ $.fn.layout = function (opts) { , s = state[pane] , c = _c[pane] , dir = c.dir - , side = c.side.toLowerCase() , type = c.sizeType.toLowerCase() , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param , $P = $Ps[pane] @@ -1190,8 +1365,8 @@ $.fn.layout = function (opts) { , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize ) , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize ) , r = s.resizerPosition = {} // used to set resizing limits - , top = sC.insetTop - , left = sC.insetLeft + , top = sC.inset.top + , left = sC.inset.left , W = sC.innerWidth , H = sC.innerHeight , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east @@ -1232,10 +1407,10 @@ $.fn.layout = function (opts) { d.width = sC.innerWidth - d.left - d.right; // outerWidth d.height = sC.innerHeight - d.bottom - d.top; // outerHeight // add the 'container border/padding' to get final positions relative to the container - d.top += sC.insetTop; - d.bottom += sC.insetBottom; - d.left += sC.insetLeft; - d.right += sC.insetRight; + d.top += sC.inset.top; + d.bottom += sC.inset.bottom; + d.left += sC.inset.left; + d.right += sC.inset.right; return d; } @@ -1281,14 +1456,22 @@ $.fn.layout = function (opts) { } , onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter + var pane = $(this).data("layoutEdge") + , s = state[pane] + ; + // ignore closed-panes and mouse moving back & forth over resizer! + // also ignore if ANY pane is currently resizing + if ( s.isClosed || s.isResizing || state.paneResizing ) return; + if ($.fn.disableSelection) $("body").disableSelection(); + if (options.maskPanesEarly) + showMasks( pane, { resizing: true }); } , onResizerLeave = function (evt, el) { - var - e = el || this // el is only passed when called by the timer - , pane = $(e).data("layoutEdge") - , name = pane +"ResizerLeave" + var e = el || this // el is only passed when called by the timer + , pane = $(e).data("layoutEdge") + , name = pane +"ResizerLeave" ; timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set timer.clear(name); // cancel enableSelection timer - may re/set below @@ -1298,8 +1481,12 @@ $.fn.layout = function (opts) { if (!el) // 1st call - mouseleave event timer.set(name, function(){ onResizerLeave(evt, e); }, 200); // if user is resizing, then dragStop will enableSelection(), so can skip it here - else if (!state[pane].isResizing && $.fn.enableSelection) // 2nd call - by timer - $("body").enableSelection(); + else if ( !state.paneResizing ) { // 2nd call - by timer + if ($.fn.enableSelection) + $("body").enableSelection(); + if (options.maskPanesEarly) + hideMasks(); + } } /* @@ -1317,17 +1504,18 @@ $.fn.layout = function (opts) { , _create = function () { // initialize config/options initOptions(); - var o = options; + var o = options + , s = state; // TEMP state so isInitialized returns true during init process - state.creatingLayout = true; + s.creatingLayout = true; // init plugins for this layout, if there are any (eg: stateManagement) runPluginCallbacks( Instance, $.layout.onCreate ); // options & state have been initialized, so now run beforeLoad callback // onload will CANCEL layout creation if it returns false - if (false === _execCallback(null, o.onload_start)) + if (false === _runCallbacks("onload_start")) return 'cancel'; // initialize the container element @@ -1342,21 +1530,11 @@ $.fn.layout = function (opts) { // init plugins for this layout, if there are any (eg: customButtons) runPluginCallbacks( Instance, $.layout.onLoad ); - // if this layout's container is another layout's pane, then set child/parent pointers - var parent = $N.data("parentLayout"); - if (parent) { - Instance.hasParentLayout = true; - var pane = $N.data("layoutEdge"); // container's pane-name in parent-layout - // set pointers to THIS child-layout in parent-layout - // NOTE: parent.PANE.child is an ALIAS to parent.children.PANE - parent[pane].child = parent.children[pane] = Instance; - } - // if layout elements are hidden, then layout WILL NOT complete initialization! // initLayoutElements will set initialized=true and run the onload callback IF successful if (o.initPanes) _initLayoutElements(); - delete state.creatingLayout; + delete s.creatingLayout; return state.initialized; } @@ -1376,12 +1554,12 @@ $.fn.layout = function (opts) { * Initialize the layout - called automatically whenever an instance of layout is created * * @see _create() & isInitialized + * @param {boolean=} [retry=false] // indicates this is a 2nd try * @return An object pointer to the instance created */ , _initLayoutElements = function (retry) { // initialize config/options var o = options; - // CANNOT init panes inside a hidden container! if (!$N.is(":visible")) { // handle Chrome bug where popup window 'has no height' @@ -1394,21 +1572,16 @@ $.fn.layout = function (opts) { // a center pane is required, so make sure it exists if (!getPane("center").length) { - _log( lang.errCenterPaneMissing, true ); - return false; + return _log( o.errors.centerPaneMissing ); } // TEMP state so isInitialized returns true during init process state.creatingLayout = true; // update Container dims - $.extend(sC, elDims( $N )); + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values - // check to see if this layout 'nested' inside a pane - if ($N.data("layoutRole") === "pane") - o.resizeWithWindow = false; - - // initialize all layout elements + // initialize all layout elements initPanes(); // size & position panes - calls initHandles() - which calls initResizable() if (o.scrollToBookmarkOnLoad) { @@ -1416,8 +1589,11 @@ $.fn.layout = function (opts) { if (l.hash) l.replace( l.hash ); // scrollTo Bookmark } + // check to see if this layout 'nested' inside a pane + if (Instance.hasParentLayout) + o.resizeWithWindow = false; // bind resizeAll() for 'this layout instance' to window.resize event - if (o.resizeWithWindow) + else if (o.resizeWithWindow) $(window).bind("resize."+ sID, windowResize); delete state.creatingLayout; @@ -1427,59 +1603,154 @@ $.fn.layout = function (opts) { runPluginCallbacks( Instance, $.layout.onReady ); // now run the onload callback, if exists - _execCallback(null, o.onload_end || o.onload); + _runCallbacks("onload_end"); return true; // elements initialized successfully } /** - * Initialize nested layouts - called when _initLayoutElements completes + * Initialize nested layouts for a specific pane - can optionally pass layout-options * - * NOT CURRENTLY USED - * - * @see _initLayoutElements - * @return An object pointer to the instance created + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].children + * @return An object pointer to the layout instance created - or null */ -, _initChildLayouts = function () { - $.each(_c.allPanes, function (idx, pane) { - if (options[pane].initChildLayout) - createChildLayout( pane ); +, createChildren = function (evt_or_pane, opts) { + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] + ; + if (!$P) return; + var $C = $Cs[pane] + , s = state[pane] + , o = options[pane] + , sm = options.stateManagement || {} + , cos = opts ? (o.children = opts) : o.children + ; + if ( $.isPlainObject( cos ) ) + cos = [ cos ]; // convert a hash to a 1-elem array + else if (!cos || !$.isArray( cos )) + return; + + $.each( cos, function (idx, co) { + if ( !$.isPlainObject( co ) ) return; + + // determine which element is supposed to be the 'child container' + // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane + var $containers = co.containerSelector ? $P.find( co.containerSelector ) : ($C || $P); + + $containers.each(function(){ + var $cont = $(this) + , child = $cont.data("layout") // see if a child-layout ALREADY exists on this element + ; + // if no layout exists, but children are set, try to create the layout now + if (!child) { + // TODO: see about moving this to the stateManagement plugin, as a method + // set a unique child-instance key for this layout, if not already set + setInstanceKey({ container: $cont, options: co }, s ); + // If THIS layout has a hash in stateManagement.autoLoad, + // then see if it also contains state-data for this child-layout + // If so, copy the stateData to child.options.stateManagement.autoLoad + if ( sm.includeChildren && state.stateData[pane] ) { + // THIS layout's state was cached when its state was loaded + var paneChildren = state.stateData[pane].children || {} + , childState = paneChildren[ co.instanceKey ] + , co_sm = co.stateManagement || (co.stateManagement = { autoLoad: true }) + ; + // COPY the stateData into the autoLoad key + if ( co_sm.autoLoad === true && childState ) { + co_sm.autoSave = false; // disable autoSave because saving handled by parent-layout + co_sm.includeChildren = true; // cascade option - FOR NOW + co_sm.autoLoad = $.extend(true, {}, childState); // COPY the state-hash + } + } + + // create the layout + child = $cont.layout( co ); + + // if successful, update data + if (child) { + // add the child and update all layout-pointers + // MAY have already been done by child-layout calling parent.refreshChildren() + refreshChildren( pane, child ); + } + } + }); }); } - /** - * Initialize nested layouts for a specific pane - can optionally pass layout-options - * - * @see _initChildLayouts - * @param {string} pane The pane being opened, ie: north, south, east, or west - * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].childOptions - * @return An object pointer to the layout instance created - or null - */ -, createChildLayout = function (pane, opts) { - var $P = $Ps[pane] - , o = opts || options[pane].childOptions - , C = children - , d = "layout" - // see if a child-layout ALREADY exists on this element - , L = $P ? (C[pane] = $P.data(d) || null) : false +, setInstanceKey = function (child, parentPaneState) { + // create a named key for use in state and instance branches + var $c = child.container + , o = child.options + , sm = o.stateManagement + , key = o.instanceKey || $c.data("layoutInstanceKey") ; - // if no layout exists, but childOptions are set, try to create the layout now - if (!L && $P && o) - L = C[pane] = $P.layout(o) || null; - if (L) - L.Layout = true; // set parent-flag in child - DO NOT set pointer or else have infinite recursion! - Instance[pane].child = C[pane]; // set pane-object pointer, even if null + if (!key) key = (sm && sm.cookie ? sm.cookie.name : '') || o.name; // look for a name/key + if (!key) key = "layout"+ (++parentPaneState.childIdx); // if no name/key found, generate one + else key = key.replace(/[^\w-]/gi, '_').replace(/_{2,}/g, '_'); // ensure is valid as a hash key + o.instanceKey = key; + $c.data("layoutInstanceKey", key); // useful if layout is destroyed and then recreated + return key; + } + + /** + * @param {string} pane The pane being opened, ie: north, south, east, or west + * @param {Object=} newChild New child-layout Instance to add to this pane + */ +, refreshChildren = function (pane, newChild) { + var $P = $Ps[pane] + , pC = children[pane] + , s = state[pane] + , o + ; + // check for destroy()ed layouts and update the child pointers & arrays + if ($.isPlainObject( pC )) { + $.each( pC, function (key, child) { + if (child.destroyed) delete pC[key] + }); + // if no more children, remove the children hash + if ($.isEmptyObject( pC )) + pC = children[pane] = null; // clear children hash + } + + // see if there is a directly-nested layout inside this pane + // if there is, then there can be only ONE child-layout, so check that... + if (!newChild && !pC) { + newChild = $P.data("layout"); + } + + // if a newChild instance was passed, add it to children[pane] + if (newChild) { + // update child.state + newChild.hasParentLayout = true; // set parent-flag in child + // instanceKey is a key-name used in both state and children + o = newChild.options; + // set a unique child-instance key for this layout, if not already set + setInstanceKey( newChild, s ); + // add pointer to pane.children hash + if (!pC) pC = children[pane] = {}; // create an empty children hash + pC[ o.instanceKey ] = newChild.container.data("layout"); // add childLayout instance + } + + // ALWAYS refresh the pane.children alias, even if null + Instance[pane].children = children[pane]; + + // if newChild was NOT passed - see if there is a child layout NOW + if (!newChild) { + createChildren(pane); // MAY create a child and re-call this method + } } , windowResize = function () { - var delay = Number(options.resizeWithWindowDelay); + var o = options + , delay = Number(o.resizeWithWindowDelay); if (delay < 10) delay = 100; // MUST have a delay! // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway timer.clear("winResize"); // if already running timer.set("winResize", function(){ timer.clear("winResize"); timer.clear("winResizeRepeater"); - var dims = elDims( $N ); + var dims = elDims( $N, o.inset ); // only trigger resizeAll() if container has changed size if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight) resizeAll(); @@ -1497,12 +1768,12 @@ $.fn.layout = function (opts) { , unload = function () { var o = options; - _execCallback(null, o.onunload_start); + _runCallbacks("onunload_start"); // trigger plugin callabacks for this layout (eg: stateManagement) runPluginCallbacks( Instance, $.layout.onUnload ); - _execCallback(null, o.onunload_end || o.onunload); + _runCallbacks("onunload_end"); } /** @@ -1512,99 +1783,179 @@ $.fn.layout = function (opts) { */ , _initContainer = function () { var - N = $N[0] + N = $N[0] + , $H = $("html") , tag = sC.tagName = N.tagName , id = sC.id = N.id , cls = sC.className = N.className , o = options , name = o.name - , fullPage= (tag === "BODY") - , props = "overflow,position,margin,padding,border" + , props = "position,margin,padding,border" + , css = "layoutCSS" , CSS = {} , hid = "hidden" // used A LOT! + // see if this container is a 'pane' inside an outer-layout + , parent = $N.data("parentLayout") // parent-layout Instance + , pane = $N.data("layoutEdge") // pane-name in parent-layout + , isChild = parent && pane + , num = $.layout.cssNum + , $parent, n ; - // sC -> state.container + // sC = state.container sC.selector = $N.selector.split(".slice")[0]; sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages + sC.isBody = (tag === "BODY"); - $N .data("layout", Instance) - .data("layoutContainer", sID) // unique identifier for internal use + // try to find a parent-layout + if (!isChild && !sC.isBody) { + $parent = $N.closest("."+ $.layout.defaults.panes.paneClass); + parent = $parent.data("parentLayout"); + pane = $parent.data("layoutEdge"); + isChild = parent && pane; + } + + $N .data({ + layout: Instance + , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID + }) .addClass(o.containerClass) ; + var layoutMethods = { + destroy: '' + , initPanes: '' + , resizeAll: 'resizeAll' + , resize: 'resizeAll' + }; + // loop hash and bind all methods - include layoutID namespacing + for (name in layoutMethods) { + $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]); + } + + // if this container is another layout's 'pane', then set child/parent pointers + if (isChild) { + // update parent flag + Instance.hasParentLayout = true; + // set pointers to THIS child-layout (Instance) in parent-layout + parent.refreshChildren( pane, Instance ); + } // SAVE original container CSS for use in destroy() - var css = "layoutCSS"; if (!$N.data(css)) { // handle props like overflow different for BODY & HTML - has 'system default' values - if (fullPage) { - CSS = $.extend( elCSS($N, props), { + if (sC.isBody) { + // SAVE CSS + $N.data(css, $.extend( styles($N, props), { height: $N.css("height") , overflow: $N.css("overflow") , overflowX: $N.css("overflowX") , overflowY: $N.css("overflowY") - }); + })); // ALSO SAVE CSS - var $H = $("html"); - $H.data(css, { + $H.data(css, $.extend( styles($H, 'padding'), { height: "auto" // FF would return a fixed px-size! , overflow: $H.css("overflow") , overflowX: $H.css("overflowX") , overflowY: $H.css("overflowY") - }); + })); } else // handle props normally for non-body elements - CSS = elCSS($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY"); - - $N.data(css, CSS); + $N.data(css, styles($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY") ); } - try { // format html/body if this is a full page layout - if (fullPage) { - $("html").css({ - height: "100%" - , overflow: hid - , overflowX: hid - , overflowY: hid - }); - $("body").css({ - position: "relative" - , height: "100%" - , overflow: hid - , overflowX: hid - , overflowY: hid - , margin: 0 - , padding: 0 // TODO: test whether body-padding could be handled? - , border: "none" // a body-border creates problems because it cannot be measured! - }); + try { + // common container CSS + CSS = { + overflow: hid + , overflowX: hid + , overflowY: hid + }; + $N.css( CSS ); - // set current layout-container dimensions - $.extend(sC, elDims( $N )); + if (o.inset && !$.isPlainObject(o.inset)) { + // can specify a single number for equal outset all-around + n = parseInt(o.inset, 10) || 0 + o.inset = { + top: n + , bottom: n + , left: n + , right: n + }; } - else { // set required CSS for overflow and position - // ENSURE container will not 'scroll' - CSS = { overflow: hid, overflowX: hid, overflowY: hid } - var - p = $N.css("position") - , h = $N.css("height") - ; - // if this is a NESTED layout, then container/outer-pane ALREADY has position and height - if (!$N.data("layoutRole")) { - if (!p || !p.match(/fixed|absolute|relative/)) - CSS.position = "relative"; // container MUST have a 'position' - /* - if (!h || h=="auto") - CSS.height = "100%"; // container MUST have a 'height' - */ + + // format html & body if this is a full page layout + if (sC.isBody) { + // if HTML has padding, use this as an outer-spacing around BODY + if (!o.outset) { + // use padding from parent-elem (HTML) as outset + o.outset = { + top: num($H, "paddingTop") + , bottom: num($H, "paddingBottom") + , left: num($H, "paddingLeft") + , right: num($H, "paddingRight") + }; } - $N.css( CSS ); + else if (!$.isPlainObject(o.outset)) { + // can specify a single number for equal outset all-around + n = parseInt(o.outset, 10) || 0 + o.outset = { + top: n + , bottom: n + , left: n + , right: n + }; + } + // HTML + $H.css( CSS ).css({ + height: "100%" + , border: "none" // no border or padding allowed when using height = 100% + , padding: 0 // ditto + , margin: 0 + }); + // BODY + if (browser.isIE6) { + // IE6 CANNOT use the trick of setting absolute positioning on all 4 sides - must have 'height' + $N.css({ + width: "100%" + , height: "100%" + , border: "none" // no border or padding allowed when using height = 100% + , padding: 0 // ditto + , margin: 0 + , position: "relative" + }); + // convert body padding to an inset option - the border cannot be measured in IE6! + if (!o.inset) o.inset = elDims( $N ).inset; + } + else { // use absolute positioning for BODY to allow borders & padding without overflow + $N.css({ + width: "auto" + , height: "auto" + , margin: 0 + , position: "absolute" // allows for border and padding on BODY + }); + // apply edge-positioning created above + $N.css( o.outset ); + } + // set current layout-container dimensions + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values + } + else { + // container MUST have 'position' + var p = $N.css("position"); + if (!p || !p.match(/(fixed|absolute|relative)/)) + $N.css("position","relative"); // set current layout-container dimensions if ( $N.is(":visible") ) { - $.extend(sC, elDims( $N )); - if (o.showErrorMessages && sC.innerHeight < 1) - _log( lang.errContainerHeight.replace(/CONTAINER/, sC.ref), true ); + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT change insetX (padding) values + if (sC.innerHeight < 1) // container has no 'height' - warn developer + _log( o.errors.noContainerHeight.replace(/CONTAINER/, sC.ref) ); } } + + // if container has min-width/height, then enable scrollbar(s) + if ( num($N, "minWidth") ) $N.parent().css("overflowX","auto"); + if ( num($N, "minHeight") ) $N.parent().css("overflowY","auto"); + } catch (ex) {} } @@ -1635,12 +1986,12 @@ $.fn.layout = function (opts) { var data, d, pane, key, val, i, c, o; // reprocess user's layout-options to have correct options sub-key structure - opts = $.layout.transformData( opts ); // panes = default subkey + opts = $.layout.transformData( opts, true ); // panes = default subkey // auto-rename old options for backward compatibility opts = $.layout.backwardCompatibility.renameAllOptions( opts ); - // if user-options has 'panes' key (pane-defaults), process it... + // if user-options has 'panes' key (pane-defaults), clean it... if (!$.isEmptyObject(opts.panes)) { // REMOVE any pane-defaults that MUST be set per-pane data = $.layout.optionsMap.noDefault; @@ -1656,7 +2007,7 @@ $.fn.layout = function (opts) { } } - // MOVE any NON-layout-options to opts.panes + // MOVE any NON-layout-options from opts-root to opts.panes data = $.layout.optionsMap.layout; var rootKeys = $.layout.config.optionRootKeys; for (key in opts) { @@ -1675,7 +2026,7 @@ $.fn.layout = function (opts) { $.each(_c.allPanes, function (i, pane) { // apply 'pane-defaults' to CONFIG.[PANE] - _c[pane] = $.extend( true, {}, _c.panes, _c[pane] ); + _c[pane] = $.extend(true, {}, _c.panes, _c[pane]); d = options.panes; o = options[pane]; @@ -1693,7 +2044,7 @@ $.fn.layout = function (opts) { } else { // border-panes use ALL keys in defaults.panes branch - o = options[pane] = $.extend({}, d, o); // re-apply pane-specific opts AFTER pane-defaults + o = options[pane] = $.extend(true, {}, d, o); // re-apply pane-specific opts AFTER pane-defaults createFxOptions( pane ); // ensure all border-pane-specific base-classes exist if (!o.resizerClass) o.resizerClass = "ui-layout-resizer"; @@ -1712,6 +2063,10 @@ $.fn.layout = function (opts) { z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2 } + // DELETE 'panes' key now that we are done - values were copied to EACH pane + delete options.panes; + + function createFxOptions ( pane ) { var o = options[pane] , d = options.panes; @@ -1731,9 +2086,10 @@ $.fn.layout = function (opts) { || o.fxName // options.west.fxName || d.fxName // options.panes.fxName || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0 + , fxExists = $.effects && ($.effects[fxName] || ($.effects.effect && $.effects.effect[fxName])) ; // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects - if (fxName === "none" || !$.effects || !$.effects[fxName] || !options.effects[fxName]) + if (fxName === "none" || !options.effects[fxName] || !fxExists) fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName // set vars for effects subkeys to simplify logic @@ -1751,7 +2107,8 @@ $.fn.layout = function (opts) { ; // create fxSettings[_open|_close|_size] o[sSettings] = $.extend( - {} + true + , {} , fx_all // effects.slide.all , fx_pane // effects.slide.west , d.fxSettings // options.panes.fxSettings @@ -1767,9 +2124,6 @@ $.fn.layout = function (opts) { delete o.fxSpeed; delete o.fxSettings; } - - // DELETE 'panes' key now that we are done - values were copied to EACH pane - delete options.panes; } /** @@ -1790,7 +2144,13 @@ $.fn.layout = function (opts) { } } -, initPanes = function () { + /** + * @param {Object=} evt + */ +, initPanes = function (evt) { + // stopPropagation if called by trigger("layoutinitpanes") - use evtPane utility + evtPane(evt); + // NOTE: do north & south FIRST so we can measure their height - do center LAST $.each(_c.allPanes, function (idx, pane) { addPane( pane, true ); @@ -1815,21 +2175,8 @@ $.fn.layout = function (opts) { // to load asynchrously, which is BAD, so try skipping delay for now // process pane contents and callbacks, and init/resize child-layout if exists - $.each(_c.allPanes, function (i, pane) { - var o = options[pane]; - if ($Ps[pane]) { - if (state[pane].isVisible) { // pane is OPEN - sizeContent(pane); - // trigger pane.onResize if triggerEventsOnLoad = true - if (o.triggerEventsOnLoad) - _execCallback(pane, o.onresize_end || o.onresize); - // resize child - IF inner-layout already exists (created before this layout) - resizeChildLayout(pane); - } - // init childLayout - even if pane is not visible - if (o.initChildLayout && o.childOptions) - createChildLayout(pane); - } + $.each(_c.allPanes, function (idx, pane) { + afterInitPane(pane); }); } @@ -1846,15 +2193,14 @@ $.fn.layout = function (opts) { o = options[pane] , s = state[pane] , c = _c[pane] - , fx = s.fx , dir = c.dir + , fx = s.fx , spacing = o.spacing_open || 0 , isCenter = (pane === "center") , CSS = {} , $P = $Ps[pane] - , size, minSize, maxSize + , size, minSize, maxSize, child ; - // if pane-pointer already exists, remove the old one first if ($P) removePane( pane, false, true, false ); @@ -1870,21 +2216,66 @@ $.fn.layout = function (opts) { // SAVE original Pane CSS if (!$P.data("layoutCSS")) { var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"; - $P.data("layoutCSS", elCSS($P, props)); + $P.data("layoutCSS", styles($P, props)); } + // create alias for pane data in Instance - initHandles will add more + Instance[pane] = { + name: pane + , pane: $Ps[pane] + , content: $Cs[pane] + , options: options[pane] + , state: state[pane] + , children: children[pane] + }; + // add classes, attributes & events - $P .data("parentLayout", Instance) - .data("layoutRole", "pane") - .data("layoutEdge", pane) + $P .data({ + parentLayout: Instance // pointer to Layout Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "pane" + }) .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal) .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector' .bind("mouseenter."+ sID, addHover ) - .bind("mouseleave."+ sID, removeHover ); - - // create alias for pane data in Instance - initHandles will add more - Instance[pane] = { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], child: children[pane] }; + .bind("mouseleave."+ sID, removeHover ) + ; + var paneMethods = { + 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' + } + , name; + // loop hash and bind all methods - include layoutID namespacing + for (name in paneMethods) { + $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]); + } // see if this pane has a 'scrolling-content element' initContent(pane, false); // false = do NOT sizeContent() - called later @@ -1896,6 +2287,7 @@ $.fn.layout = function (opts) { minSize = _parseSize(pane,o.minSize) || 1; maxSize = _parseSize(pane,o.maxSize) || 100000; if (size > 0) size = max(min(size, maxSize), minSize); + s.autoResize = o.autoResize; // used with percentage sizes // state for border-panes s.isClosed = false; // true = pane is closed @@ -1912,23 +2304,10 @@ $.fn.layout = function (opts) { s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic - // set css-position to account for container borders & padding - switch (pane) { - case "north": CSS.top = sC.insetTop; - CSS.left = sC.insetLeft; - CSS.right = sC.insetRight; - break; - case "south": CSS.bottom = sC.insetBottom; - CSS.left = sC.insetLeft; - CSS.right = sC.insetRight; - break; - case "west": CSS.left = sC.insetLeft; // top, bottom & height set by sizeMidPanes() - break; - case "east": CSS.right = sC.insetRight; // ditto - break; - case "center": // top, left, width & height set by sizeMidPanes() - } + // init pane positioning + setPanePosition( pane ); + // if pane is not visible, if (dir === "horz") // north or south pane CSS.height = cssH($P, size); else if (dir === "vert") // east or west pane @@ -1938,6 +2317,12 @@ $.fn.layout = function (opts) { $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback + // if manually adding a pane AFTER layout initialization, then... + if (state.initialized) { + initHandles( pane ); + initHotkeys( pane ); + } + // close or hide the pane if specified in settings if (o.initClosed && o.closable && !o.initHidden) close(pane, true, true); // true, true = force, noAnimation @@ -1955,21 +2340,86 @@ $.fn.layout = function (opts) { if (o.showOverflowOnHover) $P.hover( allowOverflow, resetOverflow ); - // if adding a pane AFTER initialization, then... + // if manually adding a pane AFTER layout initialization, then... if (state.initialized) { - initHandles( pane ); - initHotkeys( pane ); - resizeAll(); // will sizeContent if pane is visible - if (s.isVisible) { // pane is OPEN - if (o.triggerEventsOnLoad) - _execCallback(pane, o.onresize_end || o.onresize); - resizeChildLayout(pane); - } - if (o.initChildLayout && o.childOptions) - createChildLayout(pane); + afterInitPane( pane ); } } +, afterInitPane = function (pane) { + var $P = $Ps[pane] + , s = state[pane] + , o = options[pane] + ; + if (!$P) return; + + // see if there is a directly-nested layout inside this pane + if ($P.data("layout")) + refreshChildren( pane, $P.data("layout") ); + + // process pane contents and callbacks, and init/resize child-layout if exists + if (s.isVisible) { // pane is OPEN + if (state.initialized) // this pane was added AFTER layout was created + resizeAll(); // will also sizeContent + else + sizeContent(pane); + + if (o.triggerEventsOnLoad) + _runCallbacks("onresize_end", pane); + else // automatic if onresize called, otherwise call it specifically + // resize child - IF inner-layout already exists (created before this layout) + resizeChildren(pane, true); // a previously existing childLayout + } + + // init childLayouts - even if pane is not visible + if (o.initChildren && o.children) + createChildren(pane); + } + + /** + * @param {string=} panes The pane(s) to process + */ +, setPanePosition = function (panes) { + panes = panes ? panes.split(",") : _c.borderPanes; + + // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV + $.each(panes, function (i, pane) { + var $P = $Ps[pane] + , $R = $Rs[pane] + , o = options[pane] + , s = state[pane] + , side = _c[pane].side + , CSS = {} + ; + if (!$P) return; // pane does not exist - skip + + // set css-position to account for container borders & padding + switch (pane) { + case "north": CSS.top = sC.inset.top; + CSS.left = sC.inset.left; + CSS.right = sC.inset.right; + break; + case "south": CSS.bottom = sC.inset.bottom; + CSS.left = sC.inset.left; + CSS.right = sC.inset.right; + break; + case "west": CSS.left = sC.inset.left; // top, bottom & height set by sizeMidPanes() + break; + case "east": CSS.right = sC.inset.right; // ditto + break; + case "center": // top, left, width & height set by sizeMidPanes() + } + // apply position + $P.css(CSS); + + // update resizer position + if ($R && s.isClosed) + $R.css(side, sC.inset[side]); + else if ($R && !s.isHidden) + $R.css(side, sC.inset[side] + getPaneSize(pane)); + }); + } + /** * Initialize module objects, styling, size and position for all resize bars and toggler buttons * @@ -1986,13 +2436,12 @@ $.fn.layout = function (opts) { $Ts[pane] = false; if (!$P) return; // pane does not exist - skip - var - o = options[pane] + var o = options[pane] , s = state[pane] , c = _c[pane] + , paneId = o.paneSelector.substr(0,1) === "#" ? o.paneSelector.substr(1) : "" , rClass = o.resizerClass , tClass = o.togglerClass - , side = c.side.toLowerCase() , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed) , _pane = "-"+ pane // used for classNames , _state = (s.isVisible ? "-open" : "-closed") // used for classNames @@ -2005,13 +2454,16 @@ $.fn.layout = function (opts) { //if (s.isVisible && o.resizable) ... handled by initResizable if (!s.isVisible && o.slidable) - $R.attr("title", o.sliderTip).css("cursor", o.sliderCursor); + $R.attr("title", o.tips.Slide).css("cursor", o.sliderCursor); $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer" - .attr("id", (o.paneSelector.substr(0,1)=="#" ? o.paneSelector.substr(1) + "-resizer" : "")) - .data("parentLayout", Instance) - .data("layoutRole", "resizer") - .data("layoutEdge", pane) + .attr("id", paneId ? paneId +"-resizer" : "" ) + .data({ + parentLayout: Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "resizer" + }) .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal) .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles .addClass(rClass +" "+ rClass+_pane) @@ -2019,13 +2471,18 @@ $.fn.layout = function (opts) { .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter .appendTo($N) // append DIV to container ; + if (o.resizerDblClickToggle) + $R.bind("dblclick."+ sID, toggle ); if ($T) { $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler" - .attr("id", (o.paneSelector.substr(0,1)=="#" ? o.paneSelector.substr(1) + "-toggler" : "")) - .data("parentLayout", Instance) - .data("layoutRole", "toggler") - .data("layoutEdge", pane) + .attr("id", paneId ? paneId +"-toggler" : "" ) + .data({ + parentLayout: Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "toggler" + }) .css(_c.togglers.cssReq) // add base/required styles .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles .addClass(tClass +" "+ tClass+_pane) @@ -2036,6 +2493,10 @@ $.fn.layout = function (opts) { // ADD INNER-SPANS TO TOGGLER if (o.togglerContent_open) // ui-layout-open $(""+ o.togglerContent_open +"") + .data({ + layoutEdge: pane + , layoutRole: "togglerContent" + }) .data("layoutRole", "togglerContent") .data("layoutEdge", pane) .addClass("content content-open") @@ -2045,8 +2506,10 @@ $.fn.layout = function (opts) { ; if (o.togglerContent_closed) // ui-layout-closed $(""+ o.togglerContent_closed +"") - .data("layoutRole", "togglerContent") - .data("layoutEdge", pane) + .data({ + layoutEdge: pane + , layoutRole: "togglerContent" + }) .addClass("content content-closed") .css("display","none") .appendTo( $T ) @@ -2064,7 +2527,7 @@ $.fn.layout = function (opts) { setAsOpen(pane); // onOpen will be called, but NOT onResize else { setAsClosed(pane); // onClose will be called - bindStartSlidingEvent(pane, true); // will enable events IF option is set + bindStartSlidingEvents(pane, true); // will enable events IF option is set } }); @@ -2078,7 +2541,7 @@ $.fn.layout = function (opts) { * Initialize scrolling ui-layout-content div - if exists * * @see initPane() - or externally after an Ajax injection - * @param {string} [pane] The pane to process + * @param {string} pane The pane to process * @param {boolean=} [resize=true] Size content after init */ , initContent = function (pane, resize) { @@ -2096,14 +2559,18 @@ $.fn.layout = function (opts) { ; if ($C && $C.length) { $C.data("layoutRole", "content"); - // SAVE original Pane CSS + // SAVE original Content CSS if (!$C.data("layoutCSS")) - $C.data("layoutCSS", elCSS($C, "height")); + $C.data("layoutCSS", styles($C, "height")); $C.css( _c.content.cssReq ); if (o.applyDemoStyles) { $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane } + // ensure no vertical scrollbar on pane - will mess up measurements + if ($P.css("overflowX").match(/(scroll|auto)/)) { + $P.css("overflow", "hidden"); + } state[pane].content = {}; // init content state if (resize !== false) sizeContent(pane); // sizeContent() is called AFTER init of all elements @@ -2137,8 +2604,6 @@ $.fn.layout = function (opts) { , z = options.zIndexes , c = _c[pane] , side = c.dir=="horz" ? "top" : "left" - , opEdge = _c.oppositeEdge[pane] - , masks = pane +",center,"+ opEdge + (c.dir=="horz" ? ",west,east" : "") , $P = $Ps[pane] , $R = $Rs[pane] , base = o.resizerClass @@ -2156,7 +2621,7 @@ $.fn.layout = function (opts) { ; if (!s.isClosed) - $R.attr("title", o.resizerTip) + $R.attr("title", o.tips.Resize) .css("cursor", o.resizerCursor); // n-resize, s-resize, etc $R.draggable({ @@ -2181,9 +2646,10 @@ $.fn.layout = function (opts) { // ondrag_start callback - will CANCEL hide if returns false // TODO: dragging CANNOT be cancelled like this, so see if there is a way? - if (false === _execCallback(pane, o.ondrag_start)) return false; + if (false === _runCallbacks("ondrag_start", pane)) return false; - s.isResizing = true; // prevent pane from closing while resizing + s.isResizing = true; // prevent pane from closing while resizing + state.paneResizing = pane; // easy to see if ANY pane is resizing timer.clear(pane+"_closeSlider"); // just in case already triggered // SET RESIZER LIMITS - used in drag() @@ -2198,7 +2664,7 @@ $.fn.layout = function (opts) { $('body').disableSelection(); // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS - showMasks( masks ); + showMasks( pane, { resizing: true }); } , drag: function (e, ui) { @@ -2226,7 +2692,7 @@ $.fn.layout = function (opts) { // ADD/REMOVE dragging-limit CLASS if (limit) { ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit - window.defaultStatus = (limit>0 && pane.match(/north|west/)) || (limit<0 && pane.match(/south|east/)) ? lang.maxSizeWarning : lang.minSizeWarning; + window.defaultStatus = (limit>0 && pane.match(/(north|west)/)) || (limit<0 && pane.match(/(south|east)/)) ? o.tips.maxSizeWarning : o.tips.minSizeWarning; } else { ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit @@ -2244,8 +2710,9 @@ $.fn.layout = function (opts) { $('body').enableSelection(); // RE-ENABLE TEXT SELECTION window.defaultStatus = ""; // clear 'resizing limit' message from statusbar $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer - s.isResizing = false; - resizePanes(e, ui, pane, true, masks); // true = resizingDone + s.isResizing = false; + state.paneResizing = false; // easy to see if ANY pane is resizing + resizePanes(e, ui, pane, true); // true = resizingDone } }); @@ -2261,7 +2728,7 @@ $.fn.layout = function (opts) { * @param {string} pane * @param {boolean=} [resizingDone=false] */ - var resizePanes = function (evt, ui, pane, resizingDone, masks) { + var resizePanes = function (evt, ui, pane, resizingDone) { var dragPos = ui.position , c = _c[pane] , o = options[pane] @@ -2271,11 +2738,11 @@ $.fn.layout = function (opts) { switch (pane) { case "north": resizerPos = dragPos.top; break; case "west": resizerPos = dragPos.left; break; - case "south": resizerPos = sC.offsetHeight - dragPos.top - o.spacing_open; break; - case "east": resizerPos = sC.offsetWidth - dragPos.left - o.spacing_open; break; + case "south": resizerPos = sC.layoutHeight - dragPos.top - o.spacing_open; break; + case "east": resizerPos = sC.layoutWidth - dragPos.left - o.spacing_open; break; }; // remove container margin from resizer position to get the pane size - var newSize = resizerPos - sC["inset"+ c.side]; + var newSize = resizerPos - sC.inset[c.side]; // Disable OR Resize Mask(s) created in drag.start if (!resizingDone) { @@ -2288,21 +2755,21 @@ $.fn.layout = function (opts) { } else { // resizingDone // ondrag_end callback - if (false !== _execCallback(pane, o.ondrag_end || o.ondrag)) + if (false !== _runCallbacks("ondrag_end", pane)) manualSizePane(pane, newSize, false, true); // true = noAnimation - hideMasks(); // hide all masks, which include panes with 'content/iframe-masks' - if (s.isSliding && masks) // RE-SHOW only 'object-masks' so objects won't show through sliding pane - showMasks( masks, true ); // true = onlyForObjects + hideMasks(true); // true = force hiding all masks even if one is 'sliding' + if (s.isSliding) // RE-SHOW 'object-masks' so objects won't show through sliding pane + showMasks( pane, { resizing: true }); } }; } /** - * sizeMask - * - * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane - * Called when mask created, and during livePaneResizing - */ + * sizeMask + * + * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane + * Called when mask created, and during livePaneResizing + */ , sizeMask = function () { var $M = $(this) , pane = $M.data("layoutMask") // eg: "west" @@ -2325,16 +2792,38 @@ $.fn.layout = function (opts) { $Ms.each( sizeMask ); // resize all 'visible' masks } -, showMasks = function (panes, onlyForObjects) { - var a = panes ? panes.split(",") : $.layout.config.allPanes - , z = options.zIndexes - , o, s; - $.each(a, function(i,p){ + /** + * @param {string} pane The pane being resized, animated or isSliding + * @param {Object=} [args] (optional) Options: which masks to apply, and to which panes + */ +, showMasks = function (pane, args) { + var c = _c[pane] + , panes = ["center"] + , z = options.zIndexes + , a = $.extend({ + objectsOnly: false + , animation: false + , resizing: true + , sliding: state[pane].isSliding + }, args ) + , o, s + ; + if (a.resizing) + panes.push( pane ); + if (a.sliding) + panes.push( _c.oppositeEdge[pane] ); // ADD the oppositeEdge-pane + + if (c.dir === "horz") { + panes.push("west"); + panes.push("east"); + } + + $.each(panes, function(i,p){ s = state[p]; o = options[p]; - if (s.isVisible && ( (!onlyForObjects && o.maskContents) || o.maskObjects )) { + if (s.isVisible && ( o.maskObjects || (!a.objectsOnly && o.maskContents) )) { getMasks(p).each(function(){ - sizeMask.apply(this); + sizeMask.call(this); this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1 this.style.display = "block"; }); @@ -2342,19 +2831,31 @@ $.fn.layout = function (opts) { }); } -, hideMasks = function () { + /** + * @param {boolean=} force Hide masks even if a pane is sliding + */ +, hideMasks = function (force) { // ensure no pane is resizing - could be a timing issue - var skip; - $.each( $.layout.config.borderPanes, function(i,p){ - if (state[p].isResizing) { - skip = true; - return false; // BREAK - } - }); - if (!skip) + if (force || !state.paneResizing) { $Ms.hide(); // hide ALL masks + } + // if ANY pane is sliding, then DO NOT remove masks from panes with maskObjects enabled + else if (!force && !$.isEmptyObject( state.panesSliding )) { + var i = $Ms.length - 1 + , p, $M; + for (; i >= 0; i--) { + $M = $Ms.eq(i); + p = $M.data("layoutMask"); + if (!options[p].maskObjects) { + $M.hide(); + } + } + } } + /** + * @param {string} pane + */ , getMasks = function (pane) { var $Masks = $([]) , $M, i = 0, c = $Ms.length @@ -2371,11 +2872,13 @@ $.fn.layout = function (opts) { } /** - * createMasks - * - * Generates both DIV (ALWAYS used) and IFRAME (optional) elements as masks - * An IFRAME mask is created *under* the DIV when maskObjects=true, because a DIV cannot mask an applet - */ + * createMasks + * + * Generates both DIV (ALWAYS used) and IFRAME (optional) elements as masks + * An IFRAME mask is created *under* the DIV when maskObjects=true, because a DIV cannot mask an applet + * + * @param {string} pane + */ , createMasks = function (pane) { var $P = $Ps[pane] @@ -2397,9 +2900,11 @@ $.fn.layout = function (opts) { // styles common to both DIVs and IFRAMES css.display = "block"; css.position = "absolute"; + css.background = "#FFF"; if (isIframe) { // IFRAME-only props el.frameborder = 0; el.src = "about:blank"; + //el.allowTransparency = true; - for IE, but breaks masking ability! css.opacity = 0; css.filter = "Alpha(Opacity='0')"; css.border = 0; @@ -2434,16 +2939,26 @@ $.fn.layout = function (opts) { * * @param {boolean=} [destroyChildren=false] Destory Child-Layouts first? */ -, destroy = function (destroyChildren) { +, destroy = function (evt_or_destroyChildren, destroyChildren) { // UNBIND layout events and remove global object $(window).unbind("."+ sID); // resize & unload $(document).unbind("."+ sID); // keyDown (hotkeys) + if (typeof evt_or_destroyChildren === "object") + // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility + evtPane(evt_or_destroyChildren); + else // no event, so transfer 1st param to destroyChildren param + destroyChildren = evt_or_destroyChildren; + + // need to look for parent layout BEFORE we remove the container data, else skips a level + //var parentPane = Instance.hasParentLayout ? $.layout.getParentPaneInstance( $N ) : null; + // reset layout-container $N .clearQueue() .removeData("layout") .removeData("layoutContainer") .removeClass(options.containerClass) + .unbind("."+ sID) // remove ALL Layout events ; // remove all mask elements that have been created @@ -2471,23 +2986,37 @@ $.fn.layout = function (opts) { // clear the Instance of everything except for container & options (so could recreate) // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options ); - for (n in Instance) + for (var n in Instance) if (!n.match(/^(container|options)$/)) delete Instance[ n ]; // add a 'destroyed' flag to make it easy to check Instance.destroyed = true; + + // if this is a child layout, CLEAR the child-pointer in the parent + /* for now the pointer REMAINS, but with only container, options and destroyed keys + if (parentPane) { + var layout = parentPane.pane.data("parentLayout") + , key = layout.options.instanceKey || 'error'; + // THIS SYNTAX MAY BE WRONG! + parentPane.children[key] = layout.children[ parentPane.name ].children[key] = null; + } + */ + + return Instance; // for coding convenience } /** * Remove a pane from the layout - subroutine of destroy() * * @see destroy() - * @param {string} pane The pane to process - * @param {boolean=} [remove=false] Remove the DOM element? - * @param {boolean=} [skipResize=false] Skip calling resizeAll()? + * @param {(string|Object)} evt_or_pane The pane to process + * @param {boolean=} [remove=false] Remove the DOM element? + * @param {boolean=} [skipResize=false] Skip calling resizeAll()? + * @param {boolean=} [destroyChild=true] Destroy Child-layouts? If not passed, obeys options setting */ -, removePane = function (pane, remove, skipResize, destroyChild) { +, removePane = function (evt_or_pane, remove, skipResize, destroyChild) { if (!isInitialized()) return; - var $P = $Ps[pane] + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] , $C = $Cs[pane] , $R = $Rs[pane] , $T = $Ts[pane] @@ -2501,25 +3030,33 @@ $.fn.layout = function (opts) { if ($P) $P.stop(true, true); - // check for a child layout var o = options[pane] , s = state[pane] , d = "layout" , css = "layoutCSS" - , Child = children[pane] || ($P ? $P.data(d) : 0) || ($C ? $C.data(d) : 0) || null - , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildLayout + , pC = children[pane] + , hasChildren = $.isPlainObject( pC ) && !$.isEmptyObject( pC ) + , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildren ; - // FIRST destroy the child-layout(s) - if (destroy && Child && !Child.destroyed) { - Child.destroy(true); // tell child-layout to destroy ALL its child-layouts too - if (Child.destroyed) // destroy was successful - Child = null; // clear pointer for logic below + if (hasChildren && destroy) { + $.each( pC, function (key, child) { + if (!child.destroyed) + child.destroy(true);// tell child-layout to destroy ALL its child-layouts too + if (child.destroyed) // destroy was successful + delete pC[key]; + }); + // if no more children, remove the children hash + if ($.isEmptyObject( pC )) { + pC = children[pane] = null; // clear children hash + hasChildren = false; + } } - if ($P && remove && !Child) - $P.remove(); - else if ($P) { + // Note: can't 'remove' a pane element with non-destroyed children + if ($P && remove && !hasChildren) + $P.remove(); // remove the pane-element and everything inside it + else if ($P && $P[0]) { // create list of ALL pane-classes that need to be removed var root = o.paneClass // default="ui-layout-pane" , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west" @@ -2532,7 +3069,8 @@ $.fn.layout = function (opts) { $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes // remove all Layout classes from pane-element $P .removeClass( classes.join(" ") ) // remove ALL pane-classes - .removeData("layoutParent") + .removeData("parentLayout") + .removeData("layoutPane") .removeData("layoutRole") .removeData("layoutEdge") .removeData("autoHidden") // in case set @@ -2543,10 +3081,12 @@ $.fn.layout = function (opts) { ; // do NOT reset CSS if this pane/content is STILL the container of a nested layout! // the nested layout will reset its 'container' CSS when/if it is destroyed - if ($C && $C.data(d)) { + if (hasChildren && $C) { // a content-div may not have a specific width, so give it one to contain the Layout $C.width( $C.width() ); - Child.resizeAll(); // now resize the Layout + $.each( pC, function (key, child) { + child.resizeAll(); // resize the Layout + }); } else if ($C) $C.css( $C.data(css) ).removeData(css).removeData("layoutRole"); @@ -2560,7 +3100,7 @@ $.fn.layout = function (opts) { if ($R) $R.remove(); // CLEAR all pointers and state data - Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = children[pane] = false; + Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = false; s = { removed: true }; if (!skipResize) @@ -2574,17 +3114,55 @@ $.fn.layout = function (opts) { * ########################### */ + /** + * @param {string} pane + */ +, _hidePane = function (pane) { + var $P = $Ps[pane] + , o = options[pane] + , s = $P[0].style + ; + if (o.useOffscreenClose) { + if (!$P.data(_c.offscreenReset)) + $P.data(_c.offscreenReset, { left: s.left, right: s.right }); + $P.css( _c.offscreenCSS ); + } + else + $P.hide().removeData(_c.offscreenReset); + } + + /** + * @param {string} pane + */ +, _showPane = function (pane) { + var $P = $Ps[pane] + , o = options[pane] + , off = _c.offscreenCSS + , old = $P.data(_c.offscreenReset) + , s = $P[0].style + ; + $P .show() // ALWAYS show, just in case + .removeData(_c.offscreenReset); + if (o.useOffscreenClose && old) { + if (s.left == off.left) + s.left = old.left; + if (s.right == off.right) + s.right = old.right; + } + } + + /** * Completely 'hides' a pane, including its spacing - as if it does not exist * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it * - * @param {string} pane The pane being hidden, ie: north, south, east, or west - * @param {boolean=} [noAnimation=false] + * @param {(string|Object)} evt_or_pane The pane being hidden, ie: north, south, east, or west + * @param {boolean=} [noAnimation=false] */ -, hide = function (pane, noAnimation) { +, hide = function (evt_or_pane, noAnimation) { if (!isInitialized()) return; - var - o = options[pane] + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] @@ -2592,9 +3170,10 @@ $.fn.layout = function (opts) { if (!$P || s.isHidden) return; // pane does not exist OR is already hidden // onhide_start callback - will CANCEL hide if returns false - if (state.initialized && false === _execCallback(pane, o.onhide_start)) return; + if (state.initialized && false === _runCallbacks("onhide_start", pane)) return; s.isSliding = false; // just in case + delete state.panesSliding[pane]; // now hide the elements if ($R) $R.hide(); // hide resizer-bar @@ -2602,10 +3181,11 @@ $.fn.layout = function (opts) { s.isClosed = true; // to trigger open-animation on show() s.isHidden = true; s.isVisible = false; - $P.hide(); // no animation when loading page + if (!state.initialized) + _hidePane(pane); // no animation when loading page sizeMidPanes(_c[pane].dir === "horz" ? "" : "center"); if (state.initialized || o.triggerEventsOnLoad) - _execCallback(pane, o.onhide_end || o.onhide); + _runCallbacks("onhide_end", pane); } else { s.isHiding = true; // used by onclose @@ -2616,15 +3196,15 @@ $.fn.layout = function (opts) { /** * Show a hidden pane - show as 'closed' by default unless openPane = true * - * @param {string} pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [openPane=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {boolean=} [openPane=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [noAlert=false] */ -, show = function (pane, openPane, noAnimation, noAlert) { +, show = function (evt_or_pane, openPane, noAnimation, noAlert) { if (!isInitialized()) return; - var - o = options[pane] + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] @@ -2632,11 +3212,12 @@ $.fn.layout = function (opts) { if (!$P || !s.isHidden) return; // pane does not exist OR is not hidden // onshow_start callback - will CANCEL show if returns false - if (false === _execCallback(pane, o.onshow_start)) return; + if (false === _runCallbacks("onshow_start", pane)) return; - s.isSliding = false; // just in case s.isShowing = true; // used by onopen/onclose //s.isHidden = false; - will be set by open/close - if not cancelled + s.isSliding = false; // just in case + delete state.panesSliding[pane]; // now show the elements //if ($R) $R.show(); - will be shown by open/close @@ -2650,16 +3231,17 @@ $.fn.layout = function (opts) { /** * Toggles a pane open/closed by calling either open or close * - * @param {string} pane The pane being toggled, ie: north, south, east, or west - * @param {boolean=} [slide=false] + * @param {(string|Object)} evt_or_pane The pane being toggled, ie: north, south, east, or west + * @param {boolean=} [slide=false] */ -, toggle = function (pane, slide) { +, toggle = function (evt_or_pane, slide) { if (!isInitialized()) return; - if (!isStr(pane)) { - pane.stopImmediatePropagation(); // pane = event - pane = $(this).data("layoutEdge"); // bound to $R.dblclick - } - var s = state[pane]; + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) + , s = state[pane] + ; + if (evt) // called from to $R.dblclick OR triggerPaneEvent + evt.stopImmediatePropagation(); if (s.isHidden) show(pane); // will call 'open' after unhiding it else if (s.isClosed) @@ -2680,23 +3262,25 @@ $.fn.layout = function (opts) { $P = $Ps[pane] , s = state[pane] ; - $P.hide(); + _hidePane(pane); s.isClosed = true; s.isVisible = false; - // UNUSED: if (setHandles) setAsClosed(pane, true); // true = force + if (setHandles) setAsClosed(pane); } /** * Close the specified pane (animation optional), and resize all other panes as needed * - * @param {string} pane The pane being closed, ie: north, south, east, or west - * @param {boolean=} [force=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [skipCallback=false] + * @param {(string|Object)} evt_or_pane The pane being closed, ie: north, south, east, or west + * @param {boolean=} [force=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [skipCallback=false] */ -, close = function (pane, force, noAnimation, skipCallback) { +, close = function (evt_or_pane, force, noAnimation, skipCallback) { + var pane = evtPane.call(this, evt_or_pane); + // if pane has been initialized, but NOT the complete layout, close pane instantly if (!state.initialized && $Ps[pane]) { - _closePane(pane); // INIT pane as closed + _closePane(pane, true); // INIT pane as closed return; } if (!isInitialized()) return; @@ -2712,7 +3296,7 @@ $.fn.layout = function (opts) { // QUEUE in case another action/animation is in progress $N.queue(function( queueNext ){ - + if ( !$P || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ??? || (!force && s.isClosed && !s.isShowing) // already closed @@ -2720,13 +3304,13 @@ $.fn.layout = function (opts) { // onclose_start callback - will CANCEL hide if returns false // SKIP if just 'showing' a hidden pane as 'closed' - var abort = !s.isShowing && false === _execCallback(pane, o.onclose_start); + var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane); // transfer logic vars to temp vars isShowing = s.isShowing; isHiding = s.isHiding; wasSliding = s.isSliding; - // now clear the logic vars + // now clear the logic vars (REQUIRED before aborting) delete s.isShowing; delete s.isHiding; @@ -2750,9 +3334,6 @@ $.fn.layout = function (opts) { // CLOSE THE PANE if (doFX) { // animate the close - // mask panes with objects - var masks = "center"+ (c.dir=="horz" ? ",west,east" : ""); - showMasks( masks, true ); // true = ONLY mask panes with maskObjects=true lockPaneForFX(pane, true); // need to set left/top so animation will work $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () { lockPaneForFX(pane, false); // undo @@ -2761,7 +3342,7 @@ $.fn.layout = function (opts) { }); } else { // hide the pane without animation - $P.hide(); + _hidePane(pane); close_2(); queueNext(); }; @@ -2770,7 +3351,7 @@ $.fn.layout = function (opts) { // SUBROUTINE function close_2 () { s.isMoving = false; - bindStartSlidingEvent(pane, true); // will enable if o.slidable = true + bindStartSlidingEvents(pane, true); // will enable if o.slidable = true // if opposite-pane was autoClosed, see if it can be autoOpened now var altPane = _c.oppositeEdge[pane]; @@ -2779,15 +3360,12 @@ $.fn.layout = function (opts) { makePaneFit( altPane ); } - // hide any masks shown while closing - hideMasks(); - if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) { // onclose callback - UNLESS just 'showing' a hidden pane as 'closed' - if (!isShowing) _execCallback(pane, o.onclose_end || o.onclose); + if (!isShowing) _runCallbacks("onclose_end", pane); // onhide OR onshow callback - if (isShowing) _execCallback(pane, o.onshow_end || o.onshow); - if (isHiding) _execCallback(pane, o.onhide_end || o.onhide); + if (isShowing) _runCallbacks("onshow_end", pane); + if (isHiding) _runCallbacks("onhide_end", pane); } } } @@ -2796,14 +3374,14 @@ $.fn.layout = function (opts) { * @param {string} pane The pane just closed, ie: north, south, east, or west */ , setAsClosed = function (pane) { + if (!$Rs[pane]) return; // handles not initialized yet! var $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] - , side = _c[pane].side.toLowerCase() - , inset = "inset"+ _c[pane].side + , side = _c[pane].side , rClass = o.resizerClass , tClass = o.togglerClass , _pane = "-"+ pane // used for classNames @@ -2812,13 +3390,12 @@ $.fn.layout = function (opts) { , _closed = "-closed" ; $R - .css(side, sC[inset]) // move the resizer + .css(side, sC.inset[side]) // move the resizer .removeClass( rClass+_open +" "+ rClass+_pane+_open ) .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) .addClass( rClass+_closed +" "+ rClass+_pane+_closed ) - .unbind("dblclick."+ sID) ; - // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvent? + // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvents? if (o.resizable && $.layout.plugins.draggable) $R .draggable("disable") @@ -2832,7 +3409,7 @@ $.fn.layout = function (opts) { $T .removeClass( tClass+_open +" "+ tClass+_pane+_open ) .addClass( tClass+_closed +" "+ tClass+_pane+_closed ) - .attr("title", o.togglerTip_closed) // may be blank + .attr("title", o.tips.Open) // may be blank ; // toggler-content - if exists $T.children(".content-open").hide(); @@ -2851,22 +3428,22 @@ $.fn.layout = function (opts) { /** * Open the specified pane (animation optional), and resize all other panes as needed * - * @param {string} pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [slide=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {boolean=} [slide=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [noAlert=false] */ -, open = function (pane, slide, noAnimation, noAlert) { +, open = function (evt_or_pane, slide, noAnimation, noAlert) { if (!isInitialized()) return; - var - $P = $Ps[pane] + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] , c = _c[pane] - , doFX, isShowing; - + , doFX, isShowing + ; // QUEUE in case another action/animation is in progress $N.queue(function( queueNext ){ @@ -2877,25 +3454,31 @@ $.fn.layout = function (opts) { // pane can ALSO be unhidden by just calling show(), so handle this scenario if (s.isHidden && !s.isShowing) { + queueNext(); // call before show() because it needs the queue free show(pane, true); return; } - if (o.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/forceResize/noAnimation + if (s.autoResize && s.size != o.size) // resize pane to original size set in options + sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize else + // make sure there is enough space available to open the pane setSizeLimits(pane, slide); - //setSizeLimits(pane, slide); // update pane-state - // onopen_start callback - will CANCEL hide if returns false - if (false === _execCallback(pane, o.onopen_start)) return; + // onopen_start callback - will CANCEL open if returns false + var cbReturn = _runCallbacks("onopen_start", pane); + + if (cbReturn === "abort") + return queueNext(); + + // update pane-state again in case options were changed in onopen_start + if (cbReturn !== "NC") // NC = "No Callback" + setSizeLimits(pane, slide); - // make sure there is enough space available to open the pane - setSizeLimits(pane, slide); // update pane-state if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN! syncPinBtns(pane, false); // make sure pin-buttons are reset - if (!noAlert && o.noRoomToOpenTip) - alert(o.noRoomToOpenTip); + if (!noAlert && o.tips.noRoomToOpen) + alert(o.tips.noRoomToOpen); return queueNext(); // ABORT } @@ -2904,7 +3487,7 @@ $.fn.layout = function (opts) { else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false else if (o.slidable) - bindStartSlidingEvent(pane, false); // UNBIND trigger events + bindStartSlidingEvents(pane, false); // UNBIND trigger events s.noRoom = false; // will be reset by makePaneFit if 'noRoom' makePaneFit(pane); @@ -2920,22 +3503,19 @@ $.fn.layout = function (opts) { s.isClosed = false; // update isHidden BEFORE sizing panes - WHY??? Old? if (isShowing) s.isHidden = false; - + if (doFX) { // ANIMATE - // mask panes with objects - var masks = "center"+ (c.dir=="horz" ? ",west,east" : ""); - if (s.isSliding) masks += ","+ _c.oppositeEdge[pane]; - showMasks( masks, true ); // true = ONLY mask panes with maskObjects=true + // mask adjacent panes with objects lockPaneForFX(pane, true); // need to set left/top so animation will work - $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { + $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { lockPaneForFX(pane, false); // undo if (s.isVisible) open_2(); // continue queueNext(); }); } - else {// no animation - $P.show(); // just show pane and... - open_2(); // continue + else { // no animation + _showPane(pane);// just show pane and... + open_2(); // continue queueNext(); }; }); @@ -2949,7 +3529,6 @@ $.fn.layout = function (opts) { // NOTE: if isSliding, then other panes are NOT 'resized' if (!s.isSliding) { // resize all panes adjacent to this one - hideMasks(); // remove any masks shown while opening sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback } @@ -2970,8 +3549,7 @@ $.fn.layout = function (opts) { , $T = $Ts[pane] , o = options[pane] , s = state[pane] - , side = _c[pane].side.toLowerCase() - , inset = "inset"+ _c[pane].side + , side = _c[pane].side , rClass = o.resizerClass , tClass = o.togglerClass , _pane = "-"+ pane // used for classNames @@ -2980,7 +3558,7 @@ $.fn.layout = function (opts) { , _sliding= "-sliding" ; $R - .css(side, sC[inset] + getPaneSize(pane)) // move the resizer + .css(side, sC.inset[side] + getPaneSize(pane)) // move the resizer .removeClass( rClass+_closed +" "+ rClass+_pane+_closed ) .addClass( rClass+_open +" "+ rClass+_pane+_open ) ; @@ -2989,13 +3567,11 @@ $.fn.layout = function (opts) { else // in case 'was sliding' $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - if (o.resizerDblClickToggle) - $R.bind("dblclick", toggle ); removeHover( 0, $R ); // remove hover classes if (o.resizable && $.layout.plugins.draggable) $R .draggable("enable") .css("cursor", o.resizerCursor) - .attr("title", o.resizerTip); + .attr("title", o.tips.Resize); else if (!s.isSliding) $R.css("cursor", "default"); // n-resize, s-resize, etc @@ -3003,7 +3579,7 @@ $.fn.layout = function (opts) { if ($T) { $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed ) .addClass( tClass+_open +" "+ tClass+_pane+_open ) - .attr("title", o.togglerTip_open); // may be blank + .attr("title", o.tips.Close); // may be blank removeHover( 0, $T ); // remove hover classes // toggler-content - if exists $T.children(".content-closed").hide(); @@ -3025,15 +3601,16 @@ $.fn.layout = function (opts) { if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) { // onopen callback - _execCallback(pane, o.onopen_end || o.onopen); + _runCallbacks("onopen_end", pane); // onshow callback - TODO: should this be here? - if (s.isShowing) _execCallback(pane, o.onshow_end || o.onshow); + if (s.isShowing) _runCallbacks("onshow_end", pane); + // ALSO call onresize because layout-size *may* have changed while pane was closed - if (state.initialized) { - _execCallback(pane, o.onresize_end || o.onresize); - resizeChildLayout(pane); - } + if (state.initialized) + _runCallbacks("onresize_end", pane); } + + // TODO: Somehow sizePane("north") is being called after this point??? } @@ -3044,9 +3621,8 @@ $.fn.layout = function (opts) { */ , slideOpen = function (evt_or_pane) { if (!isInitialized()) return; - var - evt = isStr(evt_or_pane) ? null : evt_or_pane - , pane = evt ? $(this).data("layoutEdge") : evt_or_pane + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) , s = state[pane] , delay = options[pane].slideDelay_open ; @@ -3072,9 +3648,8 @@ $.fn.layout = function (opts) { , slideClose = function (evt_or_pane) { if (!isInitialized()) return; - var - evt = isStr(evt_or_pane) ? null : evt_or_pane - , pane = evt ? $(this).data("layoutEdge") : evt_or_pane + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) , o = options[pane] , s = state[pane] , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override @@ -3105,9 +3680,12 @@ $.fn.layout = function (opts) { } /** - * @param {string} pane The pane being opened, ie: north, south, east, or west + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west */ -, slideToggle = function (pane) { toggle(pane, true); } +, slideToggle = function (evt_or_pane) { + var pane = evtPane.call(this, evt_or_pane); + toggle(pane, true); + } /** @@ -3123,18 +3701,20 @@ $.fn.layout = function (opts) { , z = options.zIndexes ; if (doLock) { + showMasks( pane, { animation: true, objectsOnly: true }); $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation if (pane=="south") - $P.css({ top: sC.insetTop + sC.innerHeight - $P.outerHeight() }); + $P.css({ top: sC.inset.top + sC.innerHeight - $P.outerHeight() }); else if (pane=="east") - $P.css({ left: sC.insetLeft + sC.innerWidth - $P.outerWidth() }); + $P.css({ left: sC.inset.left + sC.innerWidth - $P.outerWidth() }); } else { // animation DONE - RESET CSS - // TODO: see if this can be deleted. It causes a quick-close when sliding in Chrome + hideMasks(); $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); if (pane=="south") $P.css({ top: "auto" }); - else if (pane=="east") + // if pane is positioned 'off-screen', then DO NOT screw with it! + else if (pane=="east" && !$P.css("left").match(/\-99999/)) $P.css({ left: "auto" }); // fix anti-aliasing in IE - only needed for animations that change opacity if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1) @@ -3150,33 +3730,38 @@ $.fn.layout = function (opts) { * @param {string} pane The pane to enable/disable, 'north', 'south', etc. * @param {boolean} enable Enable or Disable sliding? */ -, bindStartSlidingEvent = function (pane, enable) { +, bindStartSlidingEvents = function (pane, enable) { var o = options[pane] , $P = $Ps[pane] , $R = $Rs[pane] - , trigger = o.slideTrigger_open.toLowerCase() + , evtName = o.slideTrigger_open.toLowerCase() ; if (!$R || (enable && !o.slidable)) return; // make sure we have a valid event - if (trigger.match(/mouseover/)) - trigger = o.slideTrigger_open = "mouseenter"; - else if (!trigger.match(/click|dblclick|mouseenter/)) - trigger = o.slideTrigger_open = "click"; + if (evtName.match(/mouseover/)) + evtName = o.slideTrigger_open = "mouseenter"; + else if (!evtName.match(/(click|dblclick|mouseenter)/)) + evtName = o.slideTrigger_open = "click"; + + // must remove double-click-toggle when using dblclick-slide + if (o.resizerDblClickToggle && evtName.match(/click/)) { + $R[enable ? "unbind" : "bind"]('dblclick.'+ sID, toggle) + } $R - // add or remove trigger event - [enable ? "bind" : "unbind"](trigger +'.'+ sID, slideOpen) + // add or remove event + [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen) // set the appropriate cursor & title/tip .css("cursor", enable ? o.sliderCursor : "default") - .attr("title", enable ? o.sliderTip : "") + .attr("title", enable ? o.tips.Slide : "") ; } /** * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed * Also increases zIndex when pane is sliding open - * See bindStartSlidingEvent for code to control 'slide open' + * See bindStartSlidingEvents for code to control 'slide open' * * @see slideOpen(), slideClose() * @param {string} pane The pane to process, 'north', 'south', etc. @@ -3187,30 +3772,37 @@ $.fn.layout = function (opts) { , s = state[pane] , c = _c[pane] , z = options.zIndexes - , trigger = o.slideTrigger_close.toLowerCase() + , evtName = o.slideTrigger_close.toLowerCase() , action = (enable ? "bind" : "unbind") , $P = $Ps[pane] , $R = $Rs[pane] ; - s.isSliding = enable; // logic timer.clear(pane+"_closeSlider"); // just in case - // remove 'slideOpen' trigger event from resizer - // ALSO will raise the zIndex of the pane & resizer - if (enable) bindStartSlidingEvent(pane, false); + if (enable) { + s.isSliding = true; + state.panesSliding[pane] = true; + // remove 'slideOpen' event from resizer + // ALSO will raise the zIndex of the pane & resizer + bindStartSlidingEvents(pane, false); + } + else { + s.isSliding = false; + delete state.panesSliding[pane]; + } // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal); $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1 // make sure we have a valid event - if (!trigger.match(/click|mouseleave/)) - trigger = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' + if (!evtName.match(/(click|mouseleave)/)) + evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' // add/remove slide triggers - $R[action](trigger, slideClose); // base event on resize + $R[action](evtName, slideClose); // base event on resize // need extra events for mouseleave - if (trigger === "mouseleave") { + if (evtName === "mouseleave") { // also close on pane.mouseleave $P[action]("mouseleave."+ sID, slideClose); // cancel timer when mouse moves between 'pane' and 'resizer' @@ -3220,11 +3812,11 @@ $.fn.layout = function (opts) { if (!enable) timer.clear(pane+"_closeSlider"); - else if (trigger === "click" && !o.resizable) { + else if (evtName === "click" && !o.resizable) { // IF pane is not resizable (which already has a cursor and tip) // then set the a cursor & title/tip on resizer when sliding $R.css("cursor", enable ? o.sliderCursor : "default"); - $R.attr("title", enable ? o.togglerTip_open : ""); // use Toggler-tip, eg: "Close Pane" + $R.attr("title", enable ? o.tips.Close : ""); // use Toggler-tip, eg: "Close Pane" } // SUBROUTINE for mouseleave timer clearing @@ -3245,8 +3837,7 @@ $.fn.layout = function (opts) { * @param {boolean=} [force=false] */ , makePaneFit = function (pane, isOpening, skipCallback, force) { - var - o = options[pane] + var o = options[pane] , s = state[pane] , c = _c[pane] , $P = $Ps[pane] @@ -3260,7 +3851,7 @@ $.fn.layout = function (opts) { // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth); hasRoom = (s.maxHeight >= 0); if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now - $P.show(); + _showPane(pane); if ($R) $R.show(); s.isVisible = true; s.noRoom = false; @@ -3268,7 +3859,7 @@ $.fn.layout = function (opts) { _fixIframe(pane); } else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now - $P.hide(); + _hidePane(pane); if ($R) $R.hide(); s.isVisible = false; s.noRoom = true; @@ -3282,17 +3873,15 @@ $.fn.layout = function (opts) { else if (s.minSize <= s.maxSize) { // pane CAN fit hasRoom = true; if (s.size > s.maxSize) // pane is too big - shrink it - sizePane(pane, s.maxSize, skipCallback, force, true); // true = noAnimation + sizePane(pane, s.maxSize, skipCallback, true, force); // true = noAnimation else if (s.size < s.minSize) // pane is too small - enlarge it - sizePane(pane, s.minSize, skipCallback, force, true); - else if ($R && $P.is(":visible")) { + sizePane(pane, s.minSize, skipCallback, true, force); // true = noAnimation + // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen + else if ($R && s.isVisible && $P.is(":visible")) { // make sure resizer-bar is positioned correctly // handles situation where nested layout was 'hidden' when initialized - var - side = c.side.toLowerCase() - , pos = s.size + sC["inset"+ c.side] - ; - if ($.layout.cssNum($R, side) != pos) $R.css( side, pos ); + var pos = s.size + sC.inset[c.side]; + if ($.layout.cssNum( $R, c.side ) != pos) $R.css( c.side, pos ); } // if was previously hidden due to noRoom, then RESET because NOW there is room @@ -3323,46 +3912,46 @@ $.fn.layout = function (opts) { /** - * sizePane / manualSizePane - * sizePane is called only by internal methods whenever a pane needs to be resized * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized' * - * @param {string} pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [noAnimation=false] + * @param {(string|Object)} evt_or_pane The pane being resized + * @param {number} size The *desired* new size for this pane - will be validated + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [force=false] Force resizing even if does not seem necessary */ -, manualSizePane = function (pane, size, skipCallback, noAnimation) { +, manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { if (!isInitialized()) return; - var - o = options[pane] - , s = state[pane] + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] + , s = state[pane] // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete... - , forceResize = o.livePaneResizing && !s.isResizing + , forceResize = force || (o.livePaneResizing && !s.isResizing) ; // ANY call to manualSizePane disables autoResize - ie, percentage sizing - o.autoResize = false; + s.autoResize = false; // flow-through... - sizePane(pane, size, skipCallback, forceResize, noAnimation); // will animate resize if option enabled + sizePane(pane, size, skipCallback, noAnimation, forceResize); // will animate resize if option enabled } /** - * @param {string} pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] Force resizing even if does not seem necessary - * @param {boolean=} [noAnimation=false] + * sizePane is called only by internal methods whenever a pane needs to be resized + * + * @param {(string|Object)} evt_or_pane The pane being resized + * @param {number} size The *desired* new size for this pane - will be validated + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [force=false] Force resizing even if does not seem necessary */ -, sizePane = function (pane, size, skipCallback, force, noAnimation) { +, sizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { if (!isInitialized()) return; - var - o = options[pane] + var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event? + , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] - , side = _c[pane].side.toLowerCase() + , side = _c[pane].side , dimName = _c[pane].sizeType.toLowerCase() - , inset = "inset"+ _c[pane].side , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize , doFX = noAnimation !== true && o.animatePaneSizing , oldSize, newSize @@ -3376,17 +3965,20 @@ $.fn.layout = function (opts) { size = max(size, _parseSize(pane, o.minSize)); size = min(size, s.maxSize); if (size < s.minSize) { // not enough room for pane! + queueNext(); // call before makePaneFit() because it needs the queue free makePaneFit(pane, false, skipCallback); // will hide or close pane - return queueNext(); + return; } // IF newSize is same as oldSize, then nothing to do - abort if (!force && size === oldSize) return queueNext(); + s.newSize = size; + // onresize_start callback CANNOT cancel resizing because this would break the layout! if (!skipCallback && state.initialized && s.isVisible) - _execCallback(pane, o.onresize_start); + _runCallbacks("onresize_start", pane); // resize the pane, and make sure its visible newSize = cssSize(pane, size); @@ -3404,12 +3996,14 @@ $.fn.layout = function (opts) { // reset zIndex after animation $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); s.isMoving = false; + delete s.newSize; sizePane_2(); // continue queueNext(); }); } else { // no animation $P.css( dimName, newSize ); // resize pane + delete s.newSize; // if pane is visible, then if ($P.is(":visible")) sizePane_2(); // continue @@ -3440,6 +4034,7 @@ $.fn.layout = function (opts) { , cssSize: newSize }] , lastTry = tries[0] + , thisTry = {} , msg = 'Inaccurate size after resizing the '+ pane +'-pane.' ; while ( !lastTry.correct ) { @@ -3456,15 +4051,12 @@ $.fn.layout = function (opts) { thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight(); thisTry.correct = (size === thisTry.actual); - // if showDebugMessages, log attempts and alert the user of this *non-fatal error* - if (options.showDebugMessages) { - if ( tries.length === 1) { - _log(msg, false); - _log(lastTry, false); - } - _log(thisTry, false); + // log attempts and alert the user of this *non-fatal error* (if showDebugMessages) + if ( tries.length === 1) { + _log(msg, false, true); + _log(lastTry, false, true); } - + _log(thisTry, false, true); // after 4 tries, is as close as its gonna get! if (tries.length > 3) break; @@ -3474,19 +4066,19 @@ $.fn.layout = function (opts) { // END TESTING CODE // update pane-state dimensions - s.size = size; + s.size = size; $.extend(s, elDims($P)); - // reposition the resizer-bar - if ($R && $P.is(":visible")) $R.css( side, size + sC[inset] ); - - sizeContent(pane); - - if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) { - _execCallback(pane, o.onresize_end || o.onresize); - resizeChildLayout(pane); + if (s.isVisible && $P.is(":visible")) { + // reposition the resizer-bar + if ($R) $R.css( side, size + sC.inset[side] ); + // resize the content-div + sizeContent(pane); } + if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) + _runCallbacks("onresize_end", pane); + // resize all the adjacent panes, and adjust their toggler buttons // when skipCallback passed, it means the controlling method will handle 'other panes' if (!skipCallback) { @@ -3503,16 +4095,16 @@ $.fn.layout = function (opts) { } // DEBUG - ALERT user/developer so they know there was a sizing problem - if (options.showDebugMessages && tries.length > 1) - _log(msg +'\nSee the Error Console for details.', true); + if (tries.length > 1) + _log(msg +'\nSee the Error Console for details.', true, true); } } /** - * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() - * @param {string} panes The pane(s) being resized, comma-delmited string - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] + * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() + * @param {(Array.|string)} panes The pane(s) being resized, comma-delmited string + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [force=false] */ , sizeMidPanes = function (panes, skipCallback, force) { panes = (panes ? panes : "east,west,center").split(","); @@ -3527,27 +4119,36 @@ $.fn.layout = function (opts) { , isCenter= (pane=="center") , hasRoom = true , CSS = {} + // if pane is not visible, show it invisibly NOW rather than for *each call* in this script + , visCSS = $.layout.showInvisibly($P) + , newCenter = calcNewCenterPaneDims() ; + // update pane-state dimensions $.extend(s, elDims($P)); if (pane === "center") { - if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) + if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) { + $P.css(visCSS); return true; // SKIP - pane already the correct size + } // set state for makePaneFit() logic $.extend(s, cssMinDims(pane), { maxWidth: newCenter.width , maxHeight: newCenter.height }); CSS = newCenter; + s.newWidth = CSS.width; + s.newHeight = CSS.height; // convert OUTER width/height to CSS width/height CSS.width = cssW($P, CSS.width); // NEW - allow pane to extend 'below' visible area rather than hide it CSS.height = cssH($P, CSS.height); hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW + // during layout init, try to shrink east/west panes to make room for center - if (!state.initialized && o.minWidth > s.outerWidth) { + if (!state.initialized && o.minWidth > newCenter.width) { var reqPx = o.minWidth - s.outerWidth , minE = options.east.minSize || 0 @@ -3567,12 +4168,13 @@ $.fn.layout = function (opts) { } // IF we found enough extra space, then resize the border panes as calculated if (reqPx === 0) { - if (sizeE != minE) - sizePane('east', newE, true, force, true); // true = skipCallback/noAnimation - initPanes will handle when done - if (sizeW != minW) - sizePane('west', newW, true, force, true); + if (sizeE && sizeE != minE) + sizePane('east', newE, true, true, force); // true = skipCallback/noAnimation - initPanes will handle when done + if (sizeW && sizeW != minW) + sizePane('west', newW, true, true, force); // true = skipCallback/noAnimation // now start over! sizeMidPanes('center', skipCallback, force); + $P.css(visCSS); return; // abort this loop } } @@ -3581,11 +4183,14 @@ $.fn.layout = function (opts) { // set state.min/maxWidth/Height for makePaneFit() logic if (s.isVisible && !s.noVerticalRoom) $.extend(s, elDims($P), cssMinDims(pane)) - if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) + if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) { + $P.css(visCSS); return true; // SKIP - pane already the correct size + } // east/west have same top, bottom & height as center CSS.top = newCenter.top; CSS.bottom = newCenter.bottom; + s.newSize = newCenter.height // NEW - allow pane to extend 'below' visible area rather than hide it CSS.height = cssH($P, newCenter.height); s.maxHeight = CSS.height; @@ -3596,9 +4201,11 @@ $.fn.layout = function (opts) { if (hasRoom) { // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized if (!skipCallback && state.initialized) - _execCallback(pane, o.onresize_start); + _runCallbacks("onresize_start", pane); $P.css(CSS); // apply the CSS to pane + if (pane !== "center") + sizeHandles(pane); // also update resizer length if (s.noRoom && !s.isClosed && !s.isHidden) makePaneFit(pane); // will re-open/show auto-closed/hidden pane if (s.isVisible) { @@ -3609,6 +4216,13 @@ $.fn.layout = function (opts) { else if (!s.noRoom && s.isVisible) // no room for pane makePaneFit(pane); // will hide or close pane + // reset visibility, if necessary + $P.css(visCSS); + + delete s.newSize; + delete s.newWidth; + delete s.newHeight; + if (!s.isVisible) return true; // DONE - next pane @@ -3616,10 +4230,11 @@ $.fn.layout = function (opts) { * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes * Normally these panes have only 'left' & 'right' positions so pane auto-sizes * ALSO required when pane is an IFRAME because will NOT default to 'full width' + * TODO: Can I use width:100% for a north/south iframe? + * TODO: Sounds like a job for $P.outerWidth( sC.innerWidth ) SETTER METHOD */ if (pane === "center") { // finished processing midPanes - var b = $.layout.browser; - var fix = b.isIE6 || (b.msie && !$.support.boxModel); + var fix = browser.isIE6 || !browser.boxModel; if ($Ps.north && (fix || state.north.tagName=="IFRAME")) $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)); if ($Ps.south && (fix || state.south.tagName=="IFRAME")) @@ -3627,116 +4242,114 @@ $.fn.layout = function (opts) { } // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized - if (!skipCallback && state.initialized) { - _execCallback(pane, o.onresize_end || o.onresize); - resizeChildLayout(pane); - } + if (!skipCallback && state.initialized) + _runCallbacks("onresize_end", pane); }); } /** * @see window.onresize(), callbacks or custom code + * @param {(Object|boolean)=} evt_or_refresh If 'true', then also reset pane-positioning */ -, resizeAll = function () { +, resizeAll = function (evt_or_refresh) { + var oldW = sC.innerWidth + , oldH = sC.innerHeight + ; + // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility + evtPane(evt_or_refresh); + + // cannot size layout when 'container' is hidden or collapsed + if (!$N.is(":visible")) return; + if (!state.initialized) { _initLayoutElements(); return; // no need to resize since we just initialized! } - var oldW = sC.innerWidth - , oldH = sC.innerHeight - ; - // cannot size layout when 'container' is hidden or collapsed - if (!$N.is(":visible:") ) return; - $.extend( state.container, elDims( $N ) ); // UPDATE container dimensions + + if (evt_or_refresh === true && $.isPlainObject(options.outset)) { + // update container CSS in case outset option has changed + $N.css( options.outset ); + } + // UPDATE container dimensions + $.extend(sC, elDims( $N, options.inset )); if (!sC.outerHeight) return; + // if 'true' passed, refresh pane & handle positioning too + if (evt_or_refresh === true) { + setPanePosition(); + } + // onresizeall_start will CANCEL resizing if returns false // state.container has already been set, so user can access this info for calcuations - if (false === _execCallback(null, options.onresizeall_start)) return false; + if (false === _runCallbacks("onresizeall_start")) return false; var // see if container is now 'smaller' than before shrunkH = (sC.innerHeight < oldH) , shrunkW = (sC.innerWidth < oldW) - , $P, o, s, dir + , $P, o, s ; // NOTE special order for sizing: S-N-E-W $.each(["south","north","east","west"], function (i, pane) { if (!$Ps[pane]) return; // no pane - SKIP - s = state[pane]; - o = options[pane]; - dir = _c[pane].dir; - - if (o.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/forceResize/noAnimation + o = options[pane]; + s = state[pane]; + if (s.autoResize && s.size != o.size) // resize pane to original size set in options + sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize else { setSizeLimits(pane); makePaneFit(pane, false, true, true); // true=skipCallback/forceResize } }); - sizeMidPanes("", true, true); // true=skipCallback, true=forceResize + sizeMidPanes("", true, true); // true=skipCallback/forceResize sizeHandles(); // reposition the toggler elements // trigger all individual pane callbacks AFTER layout has finished resizing - o = options; // reuse alias $.each(_c.allPanes, function (i, pane) { $P = $Ps[pane]; if (!$P) return; // SKIP - if (state[pane].isVisible) { // undefined for non-existent panes - _execCallback(pane, o[pane].onresize_end || o[pane].onresize); // callback - if exists - resizeChildLayout(pane); - } + if (state[pane].isVisible) // undefined for non-existent panes + _runCallbacks("onresize_end", pane); // callback - if exists }); - _execCallback(null, o.onresizeall_end || o.onresizeall); // onresizeall callback, if exists + _runCallbacks("onresizeall_end"); + //_triggerLayoutEvent(pane, 'resizeall'); } - /** * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll * - * @param {string} pane The pane just resized or opened + * @param {(string|Object)} evt_or_pane The pane just resized or opened */ -, resizeChildLayout = function (pane) { - if (!options[pane].resizeChildLayout) return; - var - $P = $Ps[pane] - , $C = $Cs[pane] - , d = "layout" - , P = Instance[pane] - , L = children[pane] - ; - // user may have manually set EITHER instance pointer, so handle that - if (P.child && !L) { - // have to reverse the pointers! - var el = P.child.container; - L = children[pane] = (el ? el.data(d) : 0) || null; // set pointer _directly_ to layout instance +, resizeChildren = function (evt_or_pane, skipRefresh) { + var pane = evtPane.call(this, evt_or_pane); + + if (!options[pane].resizeChildren) return; + + // ensure the pane-children are up-to-date + if (!skipRefresh) refreshChildren( pane ); + var pC = children[pane]; + if ($.isPlainObject( pC )) { + // resize one or more children + $.each( pC, function (key, child) { + if (!child.destroyed) child.resizeAll(); + }); } - - // if a layout-pointer exists, see if child has been destroyed - if (L && L.destroyed) - L = children[pane] = null; // clear child pointers - // no child layout pointer is set - see if there is a child layout NOW - if (!L) L = children[pane] = $P.data(d) || ($C ? $C.data(d) : 0) || null; // set/update child pointers - - // ALWAYS refresh the pane.child alias - P.child = children[pane]; - - if (L) L.resizeAll(); } - /** * IF pane has a content-div, then resize all elements inside pane to fit pane-height * - * @param {string=} [panes=""] The pane(s) being resized - * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? + * @param {(string|Object)} evt_or_panes The pane(s) being resized + * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? */ -, sizeContent = function (panes, remeasure) { +, sizeContent = function (evt_or_panes, remeasure) { if (!isInitialized()) return; + var panes = evtPane.call(this, evt_or_panes); panes = panes ? panes.split(",") : _c.allPanes; + $.each(panes, function (idx, pane) { var $P = $Ps[pane] @@ -3747,8 +4360,14 @@ $.fn.layout = function (opts) { ; if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip + // if content-element was REMOVED, update OR remove the pointer + if (!$C.length) { + initContent(pane, false); // false = do NOT sizeContent() - already there! + if (!$C) return; // no replacement element found - pointer have been removed + } + // onsizecontent_start will CANCEL resizing if returns false - if (false === _execCallback(null, o.onsizecontent_start)) return; + if (false === _runCallbacks("onsizecontent_start", pane)) return; // skip re-measuring offsets if live-resizing if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) { @@ -3770,10 +4389,8 @@ $.fn.layout = function (opts) { m.height = newH; // save new height }; - if (state.initialized) { - _execCallback(pane, o.onsizecontent_end || o.onsizecontent); - resizeChildLayout(pane); - } + if (state.initialized) + _runCallbacks("onsizecontent_end", pane); function _below ($E) { return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0)); @@ -3782,7 +4399,7 @@ $.fn.layout = function (opts) { function _measure () { var ignore = options[pane].contentIgnoreSelector - , $Fs = $C.nextAll().not(ignore || ':lt(0)') // not :lt(0) = ALL + , $Fs = $C.nextAll().not(".ui-layout-mask").not(ignore || ":lt(0)") // not :lt(0) = ALL , $Fs_vis = $Fs.filter(':visible') , $F = $Fs_vis.filter(':last') ; @@ -3809,9 +4426,10 @@ $.fn.layout = function (opts) { * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary * * @see initHandles(), open(), close(), resizeAll() - * @param {string=} [panes=""] The pane(s) being resized + * @param {(string|Object)=} evt_or_panes The pane(s) being resized */ -, sizeHandles = function (panes) { +, sizeHandles = function (evt_or_panes) { + var panes = evtPane.call(this, evt_or_panes) panes = panes ? panes.split(",") : _c.borderPanes; $.each(panes, function (i, pane) { @@ -3832,6 +4450,7 @@ $.fn.layout = function (opts) { , togAlign = o["togglerAlign"+ _state] , togLen = o["togglerLength"+ _state] , paneLen + , left , offset , CSS = {} ; @@ -3845,12 +4464,14 @@ $.fn.layout = function (opts) { // Resizer Bar is ALWAYS same width/height of pane it is attached to if (dir === "horz") { // north/south - paneLen = $P.outerWidth(); // s.outerWidth || + //paneLen = $P.outerWidth(); // s.outerWidth || + paneLen = sC.innerWidth; // handle offscreen-panes s.resizerLength = paneLen; + left = $.layout.cssNum($P, "left") $R.css({ width: cssW($R, paneLen) // account for borders & padding , height: cssH($R, spacing) // ditto - , left: $.layout.cssNum($P, "left") + , left: left > -9999 ? left : sC.inset.left // handle offscreen-panes }); } else { // east/west @@ -3859,7 +4480,7 @@ $.fn.layout = function (opts) { $R.css({ height: cssH($R, paneLen) // account for borders & padding , width: cssW($R, spacing) // ditto - , top: sC.insetTop + getPaneSize("north", true) // TODO: what if no North pane? + , top: sC.inset.top + getPaneSize("north", true) // TODO: what if no North pane? //, top: $.layout.cssNum($Ps["center"], "top") }); } @@ -3934,7 +4555,7 @@ $.fn.layout = function (opts) { } // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now - if (!state.initialized && (o.initHidden || s.noRoom)) { + if (!state.initialized && (o.initHidden || s.isHidden)) { $R.hide(); if ($T) $T.hide(); } @@ -3943,26 +4564,31 @@ $.fn.layout = function (opts) { /** - * @param {string} pane + * @param {(string|Object)} evt_or_pane */ -, enableClosable = function (pane) { +, enableClosable = function (evt_or_pane) { if (!isInitialized()) return; - var $T = $Ts[pane], o = options[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $T = $Ts[pane] + , o = options[pane] + ; if (!$T) return; o.closable = true; $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); }) .css("visibility", "visible") .css("cursor", "pointer") - .attr("title", state[pane].isClosed ? o.togglerTip_closed : o.togglerTip_open) // may be blank + .attr("title", state[pane].isClosed ? o.tips.Open : o.tips.Close) // may be blank .show(); } /** - * @param {string} pane - * @param {boolean=} [hide=false] + * @param {(string|Object)} evt_or_pane + * @param {boolean=} [hide=false] */ -, disableClosable = function (pane, hide) { +, disableClosable = function (evt_or_pane, hide) { if (!isInitialized()) return; - var $T = $Ts[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $T = $Ts[pane] + ; if (!$T) return; options[pane].closable = false; // is closable is disable, then pane MUST be open! @@ -3975,28 +4601,32 @@ $.fn.layout = function (opts) { /** - * @param {string} pane + * @param {(string|Object)} evt_or_pane */ -, enableSlidable = function (pane) { +, enableSlidable = function (evt_or_pane) { if (!isInitialized()) return; - var $R = $Rs[pane], o = options[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; if (!$R || !$R.data('draggable')) return; options[pane].slidable = true; - if (s.isClosed) - bindStartSlidingEvent(pane, true); + if (state[pane].isClosed) + bindStartSlidingEvents(pane, true); } /** - * @param {string} pane + * @param {(string|Object)} evt_or_pane */ -, disableSlidable = function (pane) { +, disableSlidable = function (evt_or_pane) { if (!isInitialized()) return; - var $R = $Rs[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; if (!$R) return; options[pane].slidable = false; if (state[pane].isSliding) close(pane, false, true); else { - bindStartSlidingEvent(pane, false); + bindStartSlidingEvents(pane, false); $R .css("cursor", "default") .attr("title", ""); removeHover(null, $R[0]); // in case currently hovered @@ -4005,24 +4635,29 @@ $.fn.layout = function (opts) { /** - * @param {string} pane + * @param {(string|Object)} evt_or_pane */ -, enableResizable = function (pane) { +, enableResizable = function (evt_or_pane) { if (!isInitialized()) return; - var $R = $Rs[pane], o = options[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + , o = options[pane] + ; if (!$R || !$R.data('draggable')) return; o.resizable = true; $R.draggable("enable"); if (!state[pane].isClosed) $R .css("cursor", o.resizerCursor) - .attr("title", o.resizerTip); + .attr("title", o.tips.Resize); } /** - * @param {string} pane + * @param {(string|Object)} evt_or_pane */ -, disableResizable = function (pane) { +, disableResizable = function (evt_or_pane) { if (!isInitialized()) return; - var $R = $Rs[pane]; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; if (!$R || !$R.data('draggable')) return; options[pane].resizable = false; $R .draggable("disable") @@ -4036,19 +4671,19 @@ $.fn.layout = function (opts) { * Move a pane from source-side (eg, west) to target-side (eg, east) * If pane exists on target-side, move that to source-side, ie, 'swap' the panes * - * @param {string} pane1 The pane/edge being swapped - * @param {string} pane2 ditto + * @param {(string|Object)} evt_or_pane1 The pane/edge being swapped + * @param {string} pane2 ditto */ -, swapPanes = function (pane1, pane2) { +, swapPanes = function (evt_or_pane1, pane2) { if (!isInitialized()) return; + var pane1 = evtPane.call(this, evt_or_pane1); // change state.edge NOW so callbacks can know where pane is headed... state[pane1].edge = pane2; state[pane2].edge = pane1; // run these even if NOT state.initialized - var cancelled = false; - if (false === _execCallback(pane1, options[pane1].onswap_start)) cancelled = true; - if (!cancelled && false === _execCallback(pane2, options[pane2].onswap_start)) cancelled = true; - if (cancelled) { + if (false === _runCallbacks("onswap_start", pane1) + || false === _runCallbacks("onswap_start", pane2) + ) { state[pane1].edge = pane1; // reset state[pane2].edge = pane2; return; @@ -4090,8 +4725,8 @@ $.fn.layout = function (opts) { resizeAll(); // run these even if NOT state.initialized - _execCallback(pane1, options[pane1].onswap_end || options[pane1].onswap); - _execCallback(pane2, options[pane2].onswap_end || options[pane2].onswap); + _runCallbacks("onswap_end", pane1); + _runCallbacks("onswap_end", pane2); return; @@ -4116,10 +4751,8 @@ $.fn.layout = function (opts) { , C = oPane.C , oldPane = oPane.pane , c = _c[pane] - , side = c.side.toLowerCase() - , inset = "inset"+ c.side // save pane-options that should be retained - , s = $.extend({}, state[pane]) + , s = $.extend(true, {}, state[pane]) , o = options[pane] // RETAIN side-specific FX Settings - more below , fx = { resizerCursor: o.resizerCursor } @@ -4133,15 +4766,18 @@ $.fn.layout = function (opts) { // update object pointers and attributes $Ps[pane] = $(P) - .data("layoutEdge", pane) + .data({ + layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + }) .css(_c.hidden) .css(c.cssReq) ; $Cs[pane] = C ? $(C) : false; // set options and state - options[pane] = $.extend({}, oPane.options, fx); - state[pane] = $.extend({}, oPane.state); + options[pane] = $.extend(true, {}, oPane.options, fx); + state[pane] = $.extend(true, {}, oPane.state); // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west re = new RegExp(o.paneClass +"-"+ oldPane, "g"); @@ -4156,10 +4792,10 @@ $.fn.layout = function (opts) { setSizeLimits(pane); // update pane-state size = max(size, state[pane].minSize); // use manualSizePane to disable autoResize - not useful after panes are swapped - manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation) + manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation } else // move the resizer here - $Rs[pane].css(side, sC[inset] + (state[pane].isVisible ? getPaneSize(pane) : 0)); + $Rs[pane].css(c.side, sC.inset[c.side] + (state[pane].isVisible ? getPaneSize(pane) : 0)); // ADD CLASSNAMES & SLIDE-BINDINGS @@ -4167,7 +4803,7 @@ $.fn.layout = function (opts) { setAsOpen(pane, true); // true = skipCallback else { setAsClosed(pane); - bindStartSlidingEvent(pane, true); // will enable events IF option is set + bindStartSlidingEvents(pane, true); // will enable events IF option is set } // DESTROY the object @@ -4301,11 +4937,11 @@ $.fn.layout = function (opts) { curCSS.overflow = of; newCSS.overflow = "visible"; } - if (ofX && !ofX.match(/visible|auto/)) { + if (ofX && !ofX.match(/(visible|auto)/)) { curCSS.overflowX = ofX; newCSS.overflowX = "visible"; } - if (ofY && !ofY.match(/visible|auto/)) { + if (ofY && !ofY.match(/(visible|auto)/)) { curCSS.overflowY = ofX; newCSS.overflowY = "visible"; } @@ -4367,9 +5003,7 @@ $.fn.layout = function (opts) { // validate that container exists var $N = $(this).eq(0); // FIRST matching Container element if (!$N.length) { - if (options.showErrorMessages) - _log( lang.errContainerMissing, true ); - return null; + return _log( options.errors.containerMissing ); }; // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout") @@ -4413,35 +5047,40 @@ $.fn.layout = function (opts) { , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data , _sizePane: sizePane // method -intended for user by plugins only! , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto' - , sizeContent: sizeContent // method - ditto + , sizeContent: sizeContent // method - pass a 'pane' , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them - // layout control - , createChildLayout: createChildLayout// method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].childOptions - , destroy: destroy // method - no parameters + , showMasks: showMasks // method - pass a 'pane' OR list of panes - default = all panes with mask option set + , hideMasks: hideMasks // method - ditto' + // pane element methods + , initContent: initContent // method - ditto , addPane: addPane // method - pass a 'pane' , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem - , initPanes: isInitialized // method - no parameters - , initContent: initContent // method - ditto - , resizeAll: resizeAll // method - no parameters + , createChildren: createChildren // method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].children + , refreshChildren: refreshChildren // method - pass a 'pane' and a layout-instance + // special pane option setting + , enableClosable: enableClosable // method - pass a 'pane' + , disableClosable: disableClosable // method - ditto + , enableSlidable: enableSlidable // method - ditto + , disableSlidable: disableSlidable // method - ditto + , enableResizable: enableResizable // method - ditto + , disableResizable: disableResizable// method - ditto + // utility methods for panes , allowOverflow: allowOverflow // utility - pass calling element (this) , resetOverflow: resetOverflow // utility - ditto - // special option setting - , enableClosable: enableClosable - , disableClosable: disableClosable - , enableSlidable: enableSlidable - , disableSlidable: disableSlidable - , enableResizable: enableResizable - , disableResizable: disableResizable - // event triggering - , trigger: trigger + // layout control + , destroy: destroy // method - no parameters + , initPanes: isInitialized // method - no parameters + , resizeAll: resizeAll // method - no parameters + // callback triggering + , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west") // alias collections of options, state and children - created in addPane and extended elsewhere - , Layout: false - , children: children - , north: false - , south: false - , west: false - , east: false - , center: false + , hasParentLayout: false // set by initContainer() + , children: children // pointers to child-layouts, eg: Instance.children.west.layoutName + , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], children: children[pane] } + , south: false // ditto + , west: false // ditto + , east: false // ditto + , center: false // ditto }; // create the border layout NOW @@ -4453,22 +5092,29 @@ $.fn.layout = function (opts) { } +})( jQuery ); +// END Layout - keep internal vars internal! + + + +// START Plugins - shared wrapper, no global vars +(function ($) { /** * jquery.layout.state 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * - * Copyright (c) 2010 + * Copyright (c) 2012 * 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. * - * @dependancies: UI Layout 1.3.0.rc30.1 or higher - * @dependancies: $.ui.cookie (above) + * @requires: UI Layout 1.3.0.rc30.1 or higher + * @requires: $.ui.cookie (above) * - * @support: http://groups.google.com/group/jquery-ui-layout + * @see: http://groups.google.com/group/jquery-ui-layout */ /* * State-management options stored in options.stateManagement, which includes a .cookie hash @@ -4511,12 +5157,11 @@ $.fn.layout = function (opts) { if (!$.ui) $.ui = {}; $.ui.cookie = { - // TODO: is the cookieEnabled property fully cross-browser??? + // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6 acceptsCookies: !!navigator.cookieEnabled , read: function (name) { - var - c = document.cookie + var c = document.cookie , cs = c ? c.split(';') : [] , pair // loop var ; @@ -4524,22 +5169,25 @@ $.ui.cookie = { pair = $.trim(cs[i]).split('='); // name=value pair if (pair[0] == name) // found the layout cookie return decodeURIComponent(pair[1]); - } return null; } , write: function (name, val, cookieOpts) { - var - params = '' - , date = '' + var params = "" + , date = "" , clear = false , o = cookieOpts || {} - , x = o.expires + , x = o.expires || null + , t = $.type(x) ; - if (x && x.toUTCString) + if (t === "date") date = x; - else if (x === null || typeof x === 'number') { + else if (t === "string" && x > 0) { + x = parseInt(x,10); + t = "number"; + } + if (t === "number") { date = new Date(); if (x > 0) date.setDate(date.getDate() + x); @@ -4548,15 +5196,15 @@ $.ui.cookie = { clear = true; } } - if (date) params += ';expires='+ date.toUTCString(); - if (o.path) params += ';path='+ o.path; - if (o.domain) params += ';domain='+ o.domain; - if (o.secure) params += ';secure'; - document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie + if (date) params += ";expires="+ date.toUTCString(); + if (o.path) params += ";path="+ o.path; + if (o.domain) params += ";domain="+ o.domain; + if (o.secure) params += ";secure"; + document.cookie = name +"="+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie } , clear: function (name) { - $.ui.cookie.write(name, '', {expires: -1}); + $.ui.cookie.write(name, "", {expires: -1}); } }; @@ -4579,9 +5227,11 @@ $.layout.plugins.stateManagement = true; // Add State-Management options to layout.defaults $.layout.config.optionRootKeys.push("stateManagement"); $.layout.defaults.stateManagement = { - enabled: false // true = enable state-management, even if not using cookies -, autoSave: true // Save a state-cookie when page exits? -, autoLoad: true // Load the state-cookie when Layout inits? + enabled: false // true = enable state-management, even if not using cookies +, autoSave: true // Save a state-cookie when page exits? +, autoLoad: true // Load the state-cookie when Layout inits? +, animateLoad: true // animate panes when loading state into an active layout +, includeChildren: true // recurse into child layouts to include their state as well // List state-data to save - must be pane-specific , stateKeys: "north.size,south.size,east.size,west.size,"+ "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+ @@ -4589,7 +5239,7 @@ $.layout.defaults.stateManagement = { , cookie: { name: "" // If not specified, will use Layout.name, else just "Layout" , domain: "" // blank = current domain - , path: "" // blank = current page, '/' = entire website + , path: "" // blank = current page, "/" = entire website , expires: "" // 'days' to keep cookie - leave blank for 'session cookie' , secure: false } @@ -4609,13 +5259,13 @@ $.layout.state = { * * @param {Object} inst * @param {(string|Array)=} keys - * @param {Object=} opts + * @param {Object=} cookieOpts */ saveCookie: function (inst, keys, cookieOpts) { var o = inst.options - , oS = o.stateManagement - , oC = $.extend(true, {}, oS.cookie, cookieOpts || null) - , data = inst.state.stateData = inst.readState( keys || oS.stateKeys ) // read current panes-state + , sm = o.stateManagement + , oC = $.extend(true, {}, sm.cookie, cookieOpts || null) + , data = inst.state.stateData = inst.readState( keys || sm.stateKeys ) // read current panes-state ; $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC ); return $.extend(true, {}, data); // return COPY of state.stateData data @@ -4656,7 +5306,7 @@ $.layout.state = { } return c; } - + /** * Update layout options from the cookie, if one exists * @@ -4664,53 +5314,107 @@ $.layout.state = { * @param {Object=} stateData * @param {boolean=} animate */ -, loadState: function (inst, stateData, animate) { - stateData = $.layout.transformData( stateData ); // panes = default subkey - if ($.isEmptyObject( stateData )) return; - $.extend(true, inst.options, stateData); // update layout options - // if layout has already been initialized, then UPDATE layout state - if (inst.state.initialized) { - var pane, vis, o, s, h, c - , noAnimate = (animate===false) +, loadState: function (inst, data, opts) { + if (!$.isPlainObject( data ) || $.isEmptyObject( data )) return; + + // normalize data & cache in the state object + data = inst.state.stateData = $.layout.transformData( data ); // panes = default subkey + + // add missing/default state-restore options + var smo = inst.options.stateManagement; + opts = $.extend({ + animateLoad: false //smo.animateLoad + , includeChildren: smo.includeChildren + }, opts ); + + if (!inst.state.initialized) { + /* + * layout NOT initialized, so just update its options + */ + // MUST remove pane.children keys before applying to options + // use a copy so we don't remove keys from original data + var o = $.extend(true, {}, data); + //delete o.center; // center has no state-data - only children + $.each($.layout.config.allPanes, function (idx, pane) { + if (o[pane]) delete o[pane].children; + }); + // update CURRENT layout-options with saved state data + $.extend(true, inst.options, o); + } + else { + /* + * layout already initialized, so modify layout's configuration + */ + var noAnimate = !opts.animateLoad + , o, c, h, state, open ; $.each($.layout.config.borderPanes, function (idx, pane) { - state = inst.state[pane]; - o = stateData[ pane ]; - if (typeof o != 'object') return; // no key, continue + o = data[ pane ]; + if (!$.isPlainObject( o )) return; // no key, skip pane + s = o.size; c = o.initClosed; h = o.initHidden; - vis = state.isVisible; + ar = o.autoResize + state = inst.state[pane]; + open = state.isVisible; + + // reset autoResize + if (ar) + state.autoResize = ar; // resize BEFORE opening - // resize BEFORE opening - if (!vis) - inst.sizePane(pane, s, false, false); + if (!open) + inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize + // open/close as necessary - DO NOT CHANGE THIS ORDER! if (h === true) inst.hide(pane, noAnimate); - else if (c === false) inst.open (pane, false, noAnimate); else if (c === true) inst.close(pane, false, noAnimate); + else if (c === false) inst.open (pane, false, noAnimate); else if (h === false) inst.show (pane, false, noAnimate); // resize AFTER any other actions - if (vis) - inst.sizePane(pane, s, false, noAnimate); // animate resize if option passed + if (open) + inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed }); - }; + + /* + * RECURSE INTO CHILD-LAYOUTS + */ + if (opts.includeChildren) { + var paneStateChildren, childState; + $.each(inst.children, function (pane, paneChildren) { + paneStateChildren = data[pane] ? data[pane].children : 0; + if (paneStateChildren && paneChildren) { + $.each(paneChildren, function (stateKey, child) { + childState = paneStateChildren[stateKey]; + if (child && childState) + child.loadState( childState ); + }); + } + }); + } + } } /** * Get the *current layout state* and return it as a hash * - * @param {Object=} inst - * @param {(string|Array)=} keys + * @param {Object=} inst // Layout instance to get state for + * @param {object=} [opts] // State-Managements override options */ -, readState: function (inst, keys) { - var - data = {} +, readState: function (inst, opts) { + // backward compatility + if ($.type(opts) === 'string') opts = { keys: opts }; + if (!opts) opts = {}; + var sm = inst.options.stateManagement + , ic = opts.includeChildren + , recurse = ic !== undefined ? ic : sm.includeChildren + , keys = opts.stateKeys || sm.stateKeys , alt = { isClosed: 'initClosed', isHidden: 'initHidden' } , state = inst.state , panes = $.layout.config.allPanes + , data = {} , pair, pane, key, val + , ps, pC, child, array, count, branch ; - if (!keys) keys = inst.options.stateManagement.stateKeys; // if called by user if ($.isArray(keys)) keys = keys.join(","); // convert keys to an array and change delimiters from '__' to '.' keys = keys.replace(/__/g, ".").split(','); @@ -4726,6 +5430,29 @@ $.layout.state = { val = true; // if sliding, then *really* isClosed ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val; } + + // recurse into the child-layouts for each pane + if (recurse) { + $.each(panes, function (idx, pane) { + pC = inst.children[pane]; + ps = state.stateData[pane]; + if ($.isPlainObject( pC ) && !$.isEmptyObject( pC )) { + // ensure a key exists for this 'pane', eg: branch = data.center + branch = data[pane] || (data[pane] = {}); + if (!branch.children) branch.children = {}; + $.each( pC, function (key, child) { + // ONLY read state from an initialize layout + if ( child.state.initialized ) + branch.children[ key ] = $.layout.state.readState( child ); + // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT! + else if ( ps && ps.children && ps.children[ key ] ) { + branch.children[ key ] = $.extend(true, {}, ps.children[ key ] ); + } + }); + } + }); + } + return data; } @@ -4735,7 +5462,9 @@ $.layout.state = { , encodeJSON: function (JSON) { return parse(JSON); function parse (h) { - var D=[], i=0, k, v, t; // k = key, v = value + var D=[], i=0, k, v, t // k = key, v = value + , a = $.isArray(h) + ; for (k in h) { v = h[k]; t = typeof v; @@ -4743,9 +5472,9 @@ $.layout.state = { v = '"'+ v +'"'; else if (t == 'object') // SUB-KEY - recurse into it v = parse(v); - D[i++] = '"'+ k +'":'+ v; + D[i++] = (!a ? '"'+ k +'":' : '') + v; } - return '{'+ D.join(',') +'}'; + return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}'); }; } @@ -4760,7 +5489,10 @@ $.layout.state = { , _create: function (inst) { - var _ = $.layout.state; + var _ = $.layout.state + , o = inst.options + , sm = o.stateManagement + ; // ADD State-Management plugin methods to inst $.extend( inst, { // readCookie - update options from cookie - returns hash of cookie data @@ -4772,7 +5504,7 @@ $.layout.state = { // loadCookie - readCookie and use to loadState() - returns hash of cookie data , loadCookie: function () { return _.loadCookie(inst); } // loadState - pass a hash of state to use to update options - , loadState: function (stateData, animate) { _.loadState(inst, stateData, animate); } + , loadState: function (stateData, opts) { _.loadState(inst, stateData, opts); } // readState - returns hash of current layout-state , readState: function (keys) { return _.readState(inst, keys); } // add JSON utility methods too... @@ -4783,23 +5515,43 @@ $.layout.state = { // init state.stateData key, even if plugin is initially disabled inst.state.stateData = {}; - // read and load cookie-data per options - var oS = inst.options.stateManagement; - if (oS.enabled) { - if (oS.autoLoad) // update the options from the cookie + // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE + if ( !sm.autoLoad ) return; + + // When state-data exists in the autoLoad key USE IT, + // even if stateManagement.enabled == false + if ($.isPlainObject( sm.autoLoad )) { + if (!$.isEmptyObject( sm.autoLoad )) { + inst.loadState( sm.autoLoad ); + } + } + else if ( sm.enabled ) { + // update the options from cookie or callback + // if options is a function, call it to get stateData + if ($.isFunction( sm.autoLoad )) { + var d = {}; + try { + d = sm.autoLoad( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn + } catch (e) {} + if (d && $.isPlainObject( d ) && !$.isEmptyObject( d )) + inst.loadState(d); + } + else // any other truthy value will trigger loadCookie inst.loadCookie(); - else // don't modify options - just store cookie data in state.stateData - inst.state.stateData = inst.readCookie(); } } , _unload: function (inst) { - var oS = inst.options.stateManagement; - if (oS.enabled) { - if (oS.autoSave) // save a state-cookie automatically + var sm = inst.options.stateManagement; + if (sm.enabled && sm.autoSave) { + // if options is a function, call it to save the stateData + if ($.isFunction( sm.autoSave )) { + try { + sm.autoSave( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn + } catch (e) {} + } + else // any truthy value will trigger saveCookie inst.saveCookie(); - else // don't save a cookie, but do store state-data in state.stateData key - inst.state.stateData = inst.readState(); } } @@ -4816,15 +5568,15 @@ $.layout.onUnload.push( $.layout.state._unload ); * jquery.layout.buttons 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * - * Copyright (c) 2010 + * Copyright (c) 2012 * 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. * - * @dependancies: UI Layout 1.3.0.rc30.1 or higher + * @requires: UI Layout 1.3.0.rc30.1 or higher * - * @support: http://groups.google.com/group/jquery-ui-layout + * @see: http://groups.google.com/group/jquery-ui-layout * * Docs: [ to come ] * Tips: [ to come ] @@ -4838,8 +5590,6 @@ $.layout.defaults.autoBindCustomButtons = false; // Specify autoBindCustomButtons as a layout-option, NOT a pane-option $.layout.optionsMap.layout.push("autoBindCustomButtons"); -var lang = $.layout.language; - /* * Button methods */ @@ -4888,13 +5638,13 @@ $.layout.buttons = { , get: function (inst, selector, pane, action) { var $E = $(selector) , o = inst.options - , err = o.showErrorMessages + , err = o.errors.addButtonError ; if (!$E.length) { // element not found - if (err) $.layout.msg(lang.errButton + lang.selector +": "+ selector, true); + $.layout.msg(err +" "+ o.errors.selector +": "+ selector, true); } else if ($.inArray(pane, $.layout.config.borderPanes) < 0) { // invalid 'pane' sepecified - if (err) $.layout.msg(lang.errButton + lang.pane +": "+ pane, true); + $.layout.msg(err +" "+ o.errors.pane +": "+ pane, true); $E = $(""); // NO BUTTON } else { // VALID @@ -4954,7 +5704,7 @@ $.layout.buttons = { */ , addOpen: function (inst, selector, pane, slide) { $.layout.buttons.get(inst, selector, pane, "open") - .attr("title", lang.Open) + .attr("title", inst.options[pane].tips.Open) .click(function (evt) { inst.open(pane, !!slide); evt.stopPropagation(); @@ -4971,7 +5721,7 @@ $.layout.buttons = { */ , addClose: function (inst, selector, pane) { $.layout.buttons.get(inst, selector, pane, "close") - .attr("title", lang.Close) + .attr("title", inst.options[pane].tips.Close) .click(function (evt) { inst.close(pane); evt.stopPropagation(); @@ -5027,14 +5777,15 @@ $.layout.buttons = { var updown = $Pin.attr("pin"); if (updown && doPin === (updown=="down")) return; // already in correct state var - pin = inst.options[pane].buttonClass +"-pin" + o = inst.options[pane] + , pin = o.buttonClass +"-pin" , side = pin +"-"+ pane , UP = pin +"-up "+ side +"-up" , DN = pin +"-down "+side +"-down" ; $Pin .attr("pin", doPin ? "down" : "up") // logic - .attr("title", doPin ? lang.Unpin : lang.Pin) + .attr("title", doPin ? o.tips.Unpin : o.tips.Pin) .removeClass( doPin ? UP : DN ) .addClass( doPin ? DN : UP ) ; @@ -5052,7 +5803,7 @@ $.layout.buttons = { */ , syncPinBtns: function (inst, pane, doPin) { // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE - $.each(state[pane].pins, function (i, selector) { + $.each(inst.state[pane].pins, function (i, selector) { $.layout.buttons.setPinState(inst, $(selector), pane, doPin); }); } @@ -5104,12 +5855,12 @@ $.layout.onLoad.push( $.layout.buttons._load ); * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * - * @dependancies: UI Layout 1.3.0.rc30.1 or higher + * @requires: UI Layout 1.3.0.rc30.1 or higher * - * @support: http://groups.google.com/group/jquery-ui-layout + * @see: http://groups.google.com/group/jquery-ui-layout * - * @todo: Extend logic to handle other problematic zooming in browsers - * @todo: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event + * TODO: Extend logic to handle other problematic zooming in browsers + * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event */ // tell Layout that the plugin is available @@ -5124,26 +5875,32 @@ $.layout.optionsMap.layout.push("browserZoomCheckInterval"); $.layout.browserZoom = { _init: function (inst) { - $.layout.browserZoom._setTimer(inst); + // abort if browser does not need this check + if ($.layout.browserZoom.ratio() !== false) + $.layout.browserZoom._setTimer(inst); } , _setTimer: function (inst) { + // abort if layout destroyed or browser does not need this check if (inst.destroyed) return; - var o = inst.options - , s = inst.state - , z = s.browserZoom = $.layout.browserZoom.ratio() + var o = inst.options + , s = inst.state + // don't need check if inst has parentLayout, but check occassionally in case parent destroyed! + // MINIMUM 100ms interval, for performance + , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 ) ; - if (o.resizeWithWindow && z !== false) { - setTimeout(function(){ - if (inst.destroyed) return; - var d = $.layout.browserZoom.ratio(); - if (d !== s.browserZoom) { - s.browserZoom = d; - inst.resizeAll(); - } - $.layout.browserZoom._setTimer(inst); // set a NEW timeout - }, Math.max( o.browserZoomCheckInterval, 100 )); // MINIMUM 100ms interval, for performance + // set the timer + setTimeout(function(){ + if (inst.destroyed || !o.resizeWithWindow) return; + var d = $.layout.browserZoom.ratio(); + if (d !== s.browserZoom) { + s.browserZoom = d; + inst.resizeAll(); + } + // set a NEW timeout + $.layout.browserZoom._setTimer(inst); } + , ms ); } , ratio: function () { @@ -5160,7 +5917,7 @@ $.layout.browserZoom = { || !b.msie ) return false; // don't need to track zoom - if (s.deviceXDPI) + if (s.deviceXDPI && s.systemXDPI) // syntax compiler hack return calc(s.deviceXDPI, s.systemXDPI); // everything below is just for future reference! if (b.webkit && (r = d.body.getBoundingClientRect)) @@ -5179,5 +5936,4 @@ $.layout.browserZoom = { $.layout.onReady.push( $.layout.browserZoom._init ); - })( jQuery ); \ No newline at end of file diff --git a/js/jquery.layout.min.js b/js/jquery.layout.min.js index 92bec652d..161d53617 100755 --- a/js/jquery.layout.min.js +++ b/js/jquery.layout.min.js @@ -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').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;Io;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( )",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;pl)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&&1b&&(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;hc.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"),u=u.toggler=e.closable?G[a]=c("
      "):!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(""+e.togglerContent_open+"").data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display","none").appendTo(u),e.togglerContent_closed&& -c(""+e.togglerContent_closed+"").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.max&&(a.position[g]=v.max,c=1);c?(a.helper.addClass(H+" "+G),window.defaultStatus=0c&&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)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&&0h.maxSize?U(b,h.maxSize,e,f,!0):h.sizea?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(3g.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;0t&&(I=J(y-t,y-q),q-=y-I);0v&&(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(),0A)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;g0)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 -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').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;xA;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( )",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('
      XLayout console.log
        ').appendTo("body"), +d.css("left",b(window).width()-d.outerWidth()-5),b.ui.draggable&&d.draggable({handle:":first-child"})),d.children("ul").append('
      • '+a.replace(/\/g,">")+"
      • "))}};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;rw)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(0b&&(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"),l=l.toggler=g.closable?P[a]=b("
        "):!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(""+g.togglerContent_open+"").data({layoutEdge:a,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display", +"none").appendTo(l),g.togglerContent_closed&&b(""+g.togglerContent_closed+"").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.max&&(b.position[c]=l.max,d=1);d?(b.helper.addClass(cb+" "+v),window.defaultStatus=0d&&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)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&&0g.maxSize?ka(a,g.maxSize,c,!0,f):g.sizec?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(3B.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;0B)&&(A=d(Z-B,Z-h),h-=Z-A);0x)&&(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(),0A)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;lab.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;av.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;fb.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") - : 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); \ No newline at end of file diff --git a/js/ui.calendar.js b/js/ui.calendar.js deleted file mode 100644 index 5c126550b..000000000 --- a/js/ui.calendar.js +++ /dev/null @@ -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 = $('
        '); - $(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('' + appendText + ''); - } - 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 ? '' + buttonText + '' : - ''); - input.wrap('').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 = $(''); - 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 : - $('
        ')); - // 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 = ''; - var prompt = this._get('prompt'); - var closeAtTop = this._get('closeAtTop'); - var hideIfNoPrevNext = this._get('hideIfNoPrevNext'); - // controls and links - var html = (prompt ? '
        ' + prompt + '
        ' : '') + - (closeAtTop && !this._inline ? controls : '') + '
        '; - 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 += ''; - } - // 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 += ''; - } - html += '
        ' + - ''; - 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 += ''; - } - html += ''; - 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 += ''; - 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 += ''; // display for this month - printDate.setDate(printDate.getDate() + 1); - } - html += ''; - } - html += '
        ' + (!changeFirstDay ? '' : '') + dayNames[(dow + firstDay) % 7] + - (changeFirstDay ? '' : '') + '
        ' + // actions - (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months - (unselectable ? printDate.getDate() : '' + printDate.getDate() + '')) + '
        ' + (!closeAtTop && !this._inline ? controls : '') + - '
        ' + (!$.browser.msie ? '' : - ''); - 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 -}); diff --git a/js/ui.dialog.js b/js/ui.dialog.js deleted file mode 100644 index 6411bba0d..000000000 --- a/js/ui.dialog.js +++ /dev/null @@ -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("
        ") - .append("
        ") - .append("
        ") - .append("
        ") - .append("
        ") - .append("
        ") - .append("
        ") - .append("
        "); - - uiDialog.resizable(); - } - - uiDialogContainer.prepend('
        '); - var uiDialogTitlebar = $('.ui-dialog-titlebar', uiDialogContainer); - var title = (options.title) ? options.title : (uiDialogContent.attr('title')) ? uiDialogContent.attr('title') : ''; - uiDialogTitlebar.append('' + title + ''); - uiDialogTitlebar.append('
        '); - $('.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('
        '); - 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); diff --git a/js/ui.draggable.ext.js b/js/ui.draggable.ext.js deleted file mode 100644 index b49b14a38..000000000 --- a/js/ui.draggable.ext.js +++ /dev/null @@ -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").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 }); - $("
        ").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); - diff --git a/js/ui.draggable.js b/js/ui.draggable.js deleted file mode 100644 index b3bcd008a..000000000 --- a/js/ui.draggable.js +++ /dev/null @@ -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 *', 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.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 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; - } - - })($); diff --git a/js/ui.resizable.js b/js/ui.resizable.js deleted file mode 100644 index 169c2f0e8..000000000 --- a/js/ui.resizable.js +++ /dev/null @@ -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').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('
        '); - 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("
        "); }; - //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; - - } - }); - -})($); diff --git a/js/ui.selectable.js b/js/ui.selectable.js deleted file mode 100644 index 90e7b6c21..000000000 --- a/js/ui.selectable.js +++ /dev/null @@ -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); \ No newline at end of file diff --git a/js/ui.shadow.js b/js/ui.shadow.js deleted file mode 100644 index 754a64137..000000000 --- a/js/ui.shadow.js +++ /dev/null @@ -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 = $("
        "); 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 - $('
        ').css({ opacity: options.opacity-0.05, left: 5+options.offset, top: 5+options.offset, width: baseWidth+1, height: baseHeight+1 }).appendTo(shadow); - $('
        ').css({ opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth, height: baseHeight-3 }).appendTo(shadow); - $('
        ').css({ opacity: options.opacity-0.1, left: 7+options.offset, top: 7+options.offset, width: baseWidth-3, height: baseHeight }).appendTo(shadow); - $('
        ').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); - } - - - }); - }; - - -})($); \ No newline at end of file diff --git a/js/ui.slider.js b/js/ui.slider.js deleted file mode 100644 index d1c43729a..000000000 --- a/js/ui.slider.js +++ /dev/null @@ -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 = $("
        ").css({ width: cur.innerWidth()+"px", height: cur.innerHeight()+"px" }).insertAfter(cur); - var handle = $("
        ").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 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 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); - - } - }); - -})($); diff --git a/js/ui.sortable.js b/js/ui.sortable.js deleted file mode 100644 index 3cea9785f..000000000 --- a/js/ui.sortable.js +++ /dev/null @@ -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 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').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 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; - - } - }); - - })($); diff --git a/js/ui.tablesorter.js b/js/ui.tablesorter.js deleted file mode 100644 index 5bd18718e..000000000 --- a/js/ui.tablesorter.js +++ /dev/null @@ -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 = $(''); - $("tbody:first tr:first td",table).each(function() { - - colgroup.append($('').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); \ No newline at end of file diff --git a/js/ui.tabs.js b/js/ui.tabs.js deleted file mode 100644 index fd0009054..000000000 --- a/js/ui.tabs.js +++ /dev/null @@ -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] || $('
        ') - .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
      • . - 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 || $('
        ')) - [method](this.$containers[position - 1]); - } - $('
      • ' + text + '
      • ') - [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('' + o.spinner + ''); - } - 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); diff --git a/js/utils.js b/js/utils.js index be6d0bb3f..d539ee6de 100644 --- a/js/utils.js +++ b/js/utils.js @@ -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();