From 2ccb89dbd5a6ae4414be8aac1b9972f56ac44e5f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 28 Oct 2010 11:35:56 +0000 Subject: [PATCH] 2010-10-28 Miguel de Dios * include/javascript/jquery.ui.datepicker.js, include/javascript/jquery.js, include/javascript/jquery.ui.core.js, include/javascript/tiny_mce/tiny_mce_popup.js, include/javascript/OpenLayers/OpenLayers.js, include/javascript/jquery.ui.resizable.js, include/javascript/jquery.timeentry.js: : delete unpacked source code of js. * include/functions_alerts.php: added header comment to function "create_alert_action". * godmode/alerts/alert_list.php: fixed the return status for message status in actions "delete_alert", "add_action" and "delete_action". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3477 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 15 +++++++++++++++ pandora_console/godmode/alerts/alert_list.php | 6 +++--- pandora_console/include/functions_alerts.php | 8 ++++++++ .../include/javascript/OpenLayers/OpenLayers.js | 6 +++--- pandora_console/include/javascript/jquery.js | 2 +- .../include/javascript/jquery.timeentry.js | 2 +- .../include/javascript/jquery.ui.core.js | 3 ++- .../include/javascript/jquery.ui.datepicker.js | 3 ++- .../include/javascript/jquery.ui.resizable.js | 2 +- .../include/javascript/tiny_mce/tiny_mce_popup.js | 2 +- 10 files changed, 37 insertions(+), 12 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 162fb610a1..a72cc8b438 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2010-10-28 Miguel de Dios + + * include/javascript/jquery.ui.datepicker.js, include/javascript/jquery.js, + include/javascript/jquery.ui.core.js, + include/javascript/tiny_mce/tiny_mce_popup.js, + include/javascript/OpenLayers/OpenLayers.js, + include/javascript/jquery.ui.resizable.js, + include/javascript/jquery.timeentry.js: : delete unpacked source code of js. + + * include/functions_alerts.php: added header comment to function + "create_alert_action". + + * godmode/alerts/alert_list.php: fixed the return status for message status + in actions "delete_alert", "add_action" and "delete_action". + 2010-10-28 Sergio Martin * include/functions_custom_graphs.php diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 3b9d3dbb3d..f4a1b7e020 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -114,7 +114,7 @@ if ($delete_alert) { "Deleted alert '$alert_template_name' for module '$module_name' in agent '$agent_name'"); $result = delete_alert_agent_module ($id_alert_agent_module); - $messageAction = print_result_message ($id, __('Successfully deleted'), __('Could not be deleted'), '', true); + $messageAction = print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true); } if ($add_action) { @@ -129,7 +129,7 @@ if ($add_action) { $values['fires_max'] = $fires_max; $result = add_alert_agent_module_action ($id_alert_module, $id_action, $values); - $messageAction = print_result_message ($id, __('Successfully added'), __('Could not be added'), '', true); + $messageAction = print_result_message ($result, __('Successfully added'), __('Could not be added'), '', true); } if ($delete_action) { @@ -137,7 +137,7 @@ if ($delete_action) { $id_alert = (int) get_parameter ('id_alert'); $result = delete_alert_agent_module_action ($id_action); - $messageAction = print_result_message ($id, __('Successfully deleted'), __('Could not be deleted'), '', true); + $messageAction = print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true); } if ($enable_alert) { diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index eac1252d29..6c5e714708 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -144,6 +144,14 @@ function get_alert_command_description ($id_alert_command) { return get_db_value ('description', 'talert_commands', 'id', $id_alert_command); } +/** + * + * @param $name + * @param $id_alert_command + * @param $values + * + * @return mixed Returns the id if success or false in case of fail. + */ function create_alert_action ($name, $id_alert_command, $values = false) { $id_alert_command = safe_int ($id_alert_command, 1); if (empty ($id_alert_command)) diff --git a/pandora_console/include/javascript/OpenLayers/OpenLayers.js b/pandora_console/include/javascript/OpenLayers/OpenLayers.js index 55b4ce85f4..344e0c05b1 100755 --- a/pandora_console/include/javascript/OpenLayers/OpenLayers.js +++ b/pandora_console/include/javascript/OpenLayers/OpenLayers.js @@ -568,7 +568,7 @@ this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this OpenLayers.Projection.transforms[from][to]=method;};OpenLayers.Projection.transform=function(point,source,dest){if(source.proj&&dest.proj){point=Proj4js.transform(source.proj,dest.proj,point);}else if(source&&dest&&OpenLayers.Projection.transforms[source.getCode()]&&OpenLayers.Projection.transforms[source.getCode()][dest.getCode()]){OpenLayers.Projection.transforms[source.getCode()][dest.getCode()](point);} return point;};OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,initialize:function(options){OpenLayers.Protocol.prototype.initialize.apply(this,[options]);if(!options.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions));} if(!this.featureNS){var readNode=this.format.readNode;this.format.readNode=function(node,obj){if(!this.featureNS&&node.prefix==this.featurePrefix){this.featureNS=node.namespaceURI;this.setNamespace("feature",this.featureNS);} -return readNode.apply(this,arguments);}}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy();} +return readNode.apply(this,arguments);};}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy();} this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this);},createCallback:function(method,response,options){return OpenLayers.Function.bind(function(){method.apply(this,[response,options]);},this);},read:function(options){options=OpenLayers.Util.extend({},options);OpenLayers.Util.applyDefaults(options,this.options||{});var response=new OpenLayers.Protocol.Response({requestType:"read"});var data=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",options)]);response.priv=OpenLayers.Request.POST({url:options.url,callback:this.createCallback(this.handleRead,response,options),params:options.params,headers:options.headers,data:data});return response;},handleRead:function(response,options){if(options.callback){var request=response.priv;if(request.status>=200&&request.status<300){response.features=this.parseFeatures(request);response.code=OpenLayers.Protocol.Response.SUCCESS;}else{response.code=OpenLayers.Protocol.Response.FAILURE;} options.callback.call(options.scope,response);};},parseFeatures:function(request){var doc=request.responseXML;if(!doc||!doc.documentElement){doc=request.responseText;} if(!doc||doc.length<=0){return null;} @@ -948,7 +948,7 @@ var schema={};this.readNode(data,schema);return schema;},CLASS_NAME:"OpenLayers. return srsName;},read:function(data){if(typeof data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);} if(data&&data.nodeType==9){data=data.documentElement;} var obj={};this.readNode(data,obj);if(obj.features){obj=obj.features;} -return obj;},readers:{"wfs":{"FeatureCollection":function(node,obj){obj.features=[];this.readChildNodes(node,obj);}}},write:function(features){var node=this.writeNode("wfs:Transaction",features);var value=this.schemaLocationAttr();if(value){this.setAttributeNS(node,this.namespaces["xsi"],"xsi:schemaLocation",value)} +return obj;},readers:{"wfs":{"FeatureCollection":function(node,obj){obj.features=[];this.readChildNodes(node,obj);}}},write:function(features){var node=this.writeNode("wfs:Transaction",features);var value=this.schemaLocationAttr();if(value){this.setAttributeNS(node,this.namespaces["xsi"],"xsi:schemaLocation",value);} return OpenLayers.Format.XML.prototype.write.apply(this,[node]);},writers:{"wfs":{"GetFeature":function(options){var node=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,maxFeatures:options&&options.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(options)}});this.writeNode("Query",options,node);return node;},"Query":function(options){options=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},options);var node=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(options.featureNS?options.featurePrefix+":":"")+ options.featureType,srsName:options.srsName}});if(options.featureNS){node.setAttribute("xmlns:"+options.featurePrefix,options.featureNS);} if(options.filter){this.setFilterProperty(options.filter);this.writeNode("ogc:Filter",options.filter,node);} @@ -1268,7 +1268,7 @@ OpenLayers.Event.stop(evt);},clearFeatures:function(){if(this.features!=null){wh this.termsOfUse=this.div.lastChild;this.div.removeChild(this.termsOfUse);if(this.isFixed){this.map.viewPortDiv.appendChild(this.termsOfUse);}else{this.map.layerContainerDiv.appendChild(this.termsOfUse);} this.termsOfUse.style.zIndex="1100";this.termsOfUse.style.display=this.div.style.display;this.termsOfUse.style.right="";this.termsOfUse.style.bottom="";this.termsOfUse.className="olLayerGoogleCopyright";this.poweredBy=this.div.lastChild;this.div.removeChild(this.poweredBy);if(this.isFixed){this.map.viewPortDiv.appendChild(this.poweredBy);}else{this.map.layerContainerDiv.appendChild(this.poweredBy);} this.poweredBy.style.zIndex="1100";this.poweredBy.style.display=this.div.style.display;this.poweredBy.style.right="";this.poweredBy.style.bottom="";this.poweredBy.className="olLayerGooglePoweredBy gmnoprint";}catch(e){OpenLayers.Console.error(e);}},setMap:function(map){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){this.map.events.register("moveend",this,this.setMapType);}},setMapType:function(){if(this.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type);} -this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType);}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize();}else{if(!this._resized){var layer=this;var handle=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(handle);delete layer._resized;layer.mapObject.checkResize();layer.moveTo(layer.map.getCenter(),layer.map.getZoom());})} +this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType);}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize();}else{if(!this._resized){var layer=this;var handle=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(handle);delete layer._resized;layer.mapObject.checkResize();layer.moveTo(layer.map.getCenter(),layer.map.getZoom());});} this._resized=true;}},display:function(display){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);this.termsOfUse.style.display=this.div.style.display;this.poweredBy.style.display=this.div.style.display;},removeMap:function(map){if(this.termsOfUse&&this.termsOfUse.parentNode){this.termsOfUse.parentNode.removeChild(this.termsOfUse);this.termsOfUse=null;} if(this.poweredBy&&this.poweredBy.parentNode){this.poweredBy.parentNode.removeChild(this.poweredBy);this.poweredBy=null;} OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments);},getOLBoundsFromMapObjectBounds:function(moBounds){var olBounds=null;if(moBounds!=null){var sw=moBounds.getSouthWest();var ne=moBounds.getNorthEast();if(this.sphericalMercator){sw=this.forwardMercator(sw.lng(),sw.lat());ne=this.forwardMercator(ne.lng(),ne.lat());}else{sw=new OpenLayers.LonLat(sw.lng(),sw.lat());ne=new OpenLayers.LonLat(ne.lng(),ne.lat());} diff --git a/pandora_console/include/javascript/jquery.js b/pandora_console/include/javascript/jquery.js index 82b98e1d76..7c52c7f835 100644 --- a/pandora_console/include/javascript/jquery.js +++ b/pandora_console/include/javascript/jquery.js @@ -8,7 +8,7 @@ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ * $Rev: 5685 $ */ -(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/;undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=48){return true}var b=$.timeEntry._getInst(this._timeId);switch(a.keyCode){case 9:return(a.shiftKey?b._previousField(true):b._nextField(true));case 35:if(a.ctrlKey){b._setValue('')}else{b._field=Math.max(1,b._secondField,b._ampmField);b._adjustField(0)}break;case 36:if(a.ctrlKey){b._setTime()}else{b._field=0;b._adjustField(0)}break;case 37:b._previousField(false);break;case 38:b._adjustField(+1);break;case 39:b._nextField(false);break;case 40:b._adjustField(-1);break;case 46:b._setValue('');break}return false},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);if(b<' '){return true}var c=$.timeEntry._getInst(this._timeId);c._handleKeyPress(b);return false},_doMouseWheel:function(a,b){b=($.browser.opera?-b/Math.abs(b):b);var c=$.timeEntry._getInst(this._timeId);c._adjustField(b);a.preventDefault()},_connectTimeEntry:function(b,c){var d=$(b);if(d.is('.'+this.markerClassName)){return}var e=c._get('spinnerImage');var f=c._get('spinnerText');var g=c._get('spinnerSize');var h=c._get('appendText');var i=(!e?null:$(''));d.wrap('').after(h?''+h+'':'').after(i||'');d.addClass(this.markerClassName).bind('focus.timeEntry',this._doFocus).bind('blur.timeEntry',this._doBlur).bind('click.timeEntry',this._doClick).bind('keydown.timeEntry',this._doKeyDown).bind('keypress.timeEntry',this._doKeyPress);if($.browser.mozilla){d.bind('input.timeEntry',function(a){c._parseTime()})}if($.browser.msie){d.bind('paste.timeEntry',function(a){setTimeout(function(){c._parseTime()},1)})}if(c._get('useMouseWheel')&&$.fn.mousewheel){d.mousewheel(this._doMouseWheel)}d[0]._timeId=c._id;if(i){i.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner);i[0]._timeId=c._id}},_enableTimeEntry:function(a){this._enableDisable(a,false)},_disableTimeEntry:function(a){this._enableDisable(a,true)},_enableDisable:function(b,c){var d=$.timeEntry._getInst(b._timeId);if(!d){return}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()=='span'){$.timeEntry._changeSpinner(d,b.nextSibling,(c?5:-1))}$.timeEntry._disabledInputs=$.map($.timeEntry._disabledInputs,function(a){return(a==b?null:a)});if(c){$.timeEntry._disabledInputs[$.timeEntry._disabledInputs.length]=b}},_isDisabledTimeEntry:function(a){for(var i=0;i=3&&f[0]){$.timeEntry._timer=setTimeout(function(){$.timeEntry._repeatSpinner(d,e)},f[0]);$(b).one('mouseout',$.timeEntry._releaseSpinner).one('mouseup',$.timeEntry._releaseSpinner)}},_actionSpinner:function(a,b){switch(b){case 0:a._setTime();break;case 1:a._previousField(false);break;case 2:a._nextField(false);break;case 3:a._adjustField(+1);break;case 4:a._adjustField(-1);break}},_repeatSpinner:function(a,b){$.timeEntry._lastInput=$.timeEntry._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){$.timeEntry._repeatSpinner(a,b)},a._get('spinnerRepeat')[1])},_releaseSpinner:function(a){clearTimeout($.timeEntry._timer)},_endSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._isDisabledTimeEntry(b.previousSibling)){$.timeEntry._changeSpinner(c,b,-1)}if(!$.browser.opera){$.timeEntry._lastInput=$.timeEntry._blurredInput}if($.timeEntry._lastInput){c._showField()}},_getSpinnerTarget:function(a){return(a.target?a.target:a.srcElement)},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=this._findPos(c);var e=this._findScroll(c);var f=a._get('spinnerIncDecOnly');var g=(f?99:b.clientX+e[0]-d[0]-($.browser.msie?1:0));var h=b.clientY+e[1]-d[1]-($.browser.msie?1:0);var i=a._get('spinnerSize');var j=(f?99:i[0]-g);var k=i[1]-h;if(i[2]>0&&Math.abs(g-j)<=i[2]&&Math.abs(h-k)<=i[2]){return 0}var l=Math.min(g,h,j,k);return(l==g?1:(l==j?2:(l==h?3:4)))},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a._get('spinnerSize')[0])+'px 0px')},_findPos:function(a){var b=curTop=0;if(a.offsetParent){b=a.offsetLeft;curTop=a.offsetTop;while(a=a.offsetParent){var c=b;b+=a.offsetLeft;if(b<0){b=c}curTop+=a.offsetTop}}return[b,curTop]},_findScroll:function(a){var b=false;$(a).parents().each(function(){b|=$(this).css('position')=='fixed'});if(b&&!$.browser.opera){return[0,0]}var c=($.browser.opera?document.body.scrollLeft:a.scrollLeft);var d=($.browser.opera?document.body.scrollTop:a.scrollTop);if(!$.browser.opera){while(a=a.parentNode){c+=a.scrollLeft||0;d+=a.scrollTop||0;}}return[c,d];}});function TimeEntryInstance(a){this._id=$.timeEntry._register(this);this._selectedHour=0;this._selectedMinute=0;this._selectedSecond=0;this._field=0;this._input=null;this._settings=extendRemove({},a||{})}$.extend(TimeEntryInstance.prototype,{_get:function(a){return(this._settings[a]!=null?this._settings[a]:$.timeEntry._defaults[a])},_parseTime:function(){var a=this._extractTime();var b=this._get('showSeconds');if(a){this._selectedHour=a[0];this._selectedMinute=a[1];this._selectedSecond=a[2]}else{var c=this._constrainTime();this._selectedHour=c[0];this._selectedMinute=c[1];this._selectedSecond=(b?c[2]:0)}this._secondField=(b?2:-1);this._ampmField=(this._get('show24Hours')?-1:(b?3:2));this._lastChr='';this._field=Math.max(0,Math.min(Math.max(1,this._secondField,this._ampmField),this._get('initialField')));if(this._input.val()!=''){this._showTime()}},_extractTime:function(){var a=(this._input?this._input.val():'');var b=this._get('separator');var c=a.split(b);if(b==''&&a!=''){c[0]=a.substring(0,2);c[1]=a.substring(2,4);c[2]=a.substring(4,6)}var d=this._get('ampmNames');var e=this._get('show24Hours');if(c.length>=2){var f=!e&&(a.indexOf(d[0])>-1);var g=!e&&(a.indexOf(d[1])>-1);var h=parseInt(c[0],10);h=(isNaN(h)?0:h);h=((f||g)&&h==12?0:h)+(g?12:0);var i=parseInt(c[1],10);i=(isNaN(i)?0:i);var j=(c.length>=3?parseInt(c[2],10):0);j=(isNaN(j)||!this._get('showSeconds')?0:j);return this._constrainTime([h,i,j])}return null},_constrainTime:function(a){var b=(a!=null);if(!b){var c=this._determineTime(this._get('defaultTime'))||new Date();a=[c.getHours(),c.getMinutes(),c.getSeconds()]}var d=false;var e=this._get('timeSteps');for(var i=0;i1){a[i]=Math.round(a[i]/e[i])*e[i];d=true}}return a},_showTime:function(){var a=this._get('show24Hours');var b=this._get('separator');var c=(this._formatNumber(a?this._selectedHour:((this._selectedHour+11)%12)+1)+b+this._formatNumber(this._selectedMinute)+(this._get('showSeconds')?b+this._formatNumber(this._selectedSecond):'')+(a?'':this._get('ampmPrefix')+this._get('ampmNames')[(this._selectedHour<12?0:1)]));this._setValue(c);this._showField()},_showField:function(){if(!this._input){return}var a=this._input[0];var b=this._get('separator');var c=b.length+2;var d=(this._field!=this._ampmField?(this._field*c):(this._ampmField*c)-b.length+this._get('ampmPrefix').length);var e=d+(this._field!=this._ampmField?2:this._get('ampmNames')[0].length);if(a.setSelectionRange){a.setSelectionRange(d,e)}else if(a.createTextRange){var f=a.createTextRange();f.moveStart('character',d);f.moveEnd('character',e-this._input.val().length);f.select()}if(!a.disabled){a.focus()}},_formatNumber:function(a){return(a<10?'0':'')+a},_setValue:function(a){this._input.val(a);this._input.trigger('change')},_previousField:function(a){var b=(this._input.val()==''||this._field==0);if(!b){this._field--}this._showField();this._lastChr='';return(b&&a)},_nextField:function(a){var b=(this._input.val()==''||this._field==Math.max(1,this._secondField,this._ampmField));if(!b){this._field++}this._showField();this._lastChr='';return(b&&a)},_adjustField:function(a){if(this._input&&this._input.val()==''){a=0}var b=this._get('timeSteps');this._setTime(new Date(0,0,0,this._selectedHour+(this._field==0?a*b[0]:0)+(this._field==this._ampmField?a*12:0),this._selectedMinute+(this._field==1?a*b[1]:0),this._selectedSecond+(this._field==this._secondField?a*b[2]:0)))},_setTime:function(a){a=this._determineTime(a);var b=this._constrainTime(a?[a.getHours(),a.getMinutes(),a.getSeconds()]:null);a=new Date(0,0,0,b[0],b[1],b[2]);var a=this._normaliseTime(a);var c=this._normaliseTime(this._determineTime(this._get('minTime')));var d=this._normaliseTime(this._determineTime(this._get('maxTime')));a=(c&&ad?d:a));this._selectedHour=a.getHours();this._selectedMinute=a.getMinutes();this._selectedSecond=a.getSeconds();this._showTime()},_determineTime:function(h){var i=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var j=function(a){var b=new Date();var c=b.getHours();var d=b.getMinutes();var e=b.getSeconds();var f=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var g=f.exec(a);while(g){switch(g[2]||'s'){case's':case'S':e+=parseInt(g[1]);break;case'm':case'M':d+=parseInt(g[1]);break;case'h':case'H':c+=parseInt(g[1]);break}g=f.exec(a)}b=new Date(0,0,10,c,d,e,0);if(/^!/.test(a)){if(b.getDate()>10){b=new Date(0,0,10,23,59,59)}else if(b.getDate()<10){b=new Date(0,0,10,0,0,0);}}return b};return(h?(typeof h=='string'?j(h):(typeof h=='number'?i(h):h)):null)},_normaliseTime:function(a){if(!a){return null}a.setFullYear(2001);a.setMonth(1-1);a.setDate(26);return a},_handleKeyPress:function(a){if(a==this._get('separator')){this._nextField(false)}else if(a>='0'&&a<='9'){var b=(this._lastChr+a)*1;var c=this._get('show24Hours');var d=(this._field==0&&((c&&b<24)||(b>=1&&b<=12))?b+(!c&&this._selectedHour>=12?12:0):this._selectedHour);var e=(this._field==1&&b<60?b:this._selectedMinute);var f=(this._field==this._secondField&&b<60?b:this._selectedSecond);var g=this._constrainTime([d,e,f]);this._setTime(new Date(0,0,0,g[0],g[1],g[2]));this._lastChr=a}else if(!this._get('show24Hours')){var h=this._get('ampmNames');if((a==h[0].substring(0,1).toLowerCase()&&this._selectedHour>=12)||(a==h[1].substring(0,1).toLowerCase()&&this._selectedHour<12)){var i=this._field;this._field=this._ampmField;this._adjustField(+1);this._field=i;this._showField()}}}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.timeEntry=function(e){var f=Array.prototype.slice.call(arguments,1);if(typeof e=='string'&&(e=='isDisabled'||e=='getTime')){return $.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this[0]].concat(f))}return this.each(function(){var a=this.nodeName.toLowerCase();if(a=='input'){if(typeof e=='string'){$.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this].concat(f));}else{var b=null;for(attrName in $.timeEntry._defaults){var c=this.getAttribute('time:'+attrName);if(c){b=b||{};try{b[attrName]=eval(c)}catch(err){b[attrName]=c}}}var d=(d&&!b?d:new TimeEntryInstance(!b?e:$.extend(b,e)));$.timeEntry._connectTimeEntry(this,d)}}})};$(document).ready(function(){$.timeEntry=new TimeEntry()})})(jQuery); \ No newline at end of file +(function($){function TimeEntry(){this._nextId=0;this._inst=[];this._disabledInputs=[];this.regional=[];this.regional['']={show24Hours:false,separator:':',ampmPrefix:'',ampmNames:['AM','PM'],spinnerTexts:['Now','Previous field','Next field','Increment','Decrement']};this._defaults={appendText:'',showSeconds:false,timeSteps:[1,1,1],initialField:0,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:'timeEntry.png',spinnerSize:[20,20,8],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null};$.extend(this._defaults,this.regional['']);}$.extend(TimeEntry.prototype,{markerClassName:'hasTimeEntry',_register:function(a){var b=this._nextId++;this._inst[b]=a;return b;},_getInst:function(a){return this._inst[a]||a;},setDefaults:function(a){extendRemove(this._defaults,a||{});},_doFocus:function(a){var b=(a.nodeName&&a.nodeName.toLowerCase()=='input'?a:this);if($.timeEntry._lastInput==b){return}if($.timeEntry._isDisabledTimeEntry(b)){return;}var c=$.timeEntry._getInst(b._timeId);c._input=$(b);$.timeEntry._focussed=true;$.timeEntry._lastInput=b;$.timeEntry._blurredInput=null;var d=c._get('beforeShow');extendRemove(c._settings,(d?d(b):{}));c._parseTime();},_doBlur:function(a){$.timeEntry._blurredInput=$.timeEntry._lastInput;$.timeEntry._lastInput=null;},_doClick:function(a){var b=a.target;var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._focussed){var d=c._get('separator').length+2;c._field=0;if($.browser.msie){var e=b.value;var f=a.clientX+$.timeEntry._findScroll(a.srcElement)[0]-$.timeEntry._findPos(a.srcElement)[0];for(var g=0;g<=Math.max(1,c._secondField,c._ampmField);g++){var h=(g!=c._ampmField?(g*d)+2:(c._ampmField*d)+c._get('ampmPrefix').length+c._get('ampmNames')[0].length);b.value=e.substring(0,h);var i=b.createTextRange();if(f=48){return true}var b=$.timeEntry._getInst(this._timeId);switch(a.keyCode){case 9:return(a.shiftKey?b._previousField(true):b._nextField(true));case 35:if(a.ctrlKey){b._setValue('');}else{b._field=Math.max(1,b._secondField,b._ampmField);b._adjustField(0);}break;case 36:if(a.ctrlKey){b._setTime();}else{b._field=0;b._adjustField(0);}break;case 37:b._previousField(false);break;case 38:b._adjustField(+1);break;case 39:b._nextField(false);break;case 40:b._adjustField(-1);break;case 46:b._setValue('');break}return false;},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);if(b<' '){return true}var c=$.timeEntry._getInst(this._timeId);c._handleKeyPress(b);return false;},_doMouseWheel:function(a,b){b=($.browser.opera?-b/Math.abs(b):b);var c=$.timeEntry._getInst(this._timeId);c._adjustField(b);a.preventDefault()},_connectTimeEntry:function(b,c){var d=$(b);if(d.is('.'+this.markerClassName)){return}var e=c._get('spinnerImage');var f=c._get('spinnerText');var g=c._get('spinnerSize');var h=c._get('appendText');var i=(!e?null:$(''));d.wrap('').after(h?''+h+'':'').after(i||'');d.addClass(this.markerClassName).bind('focus.timeEntry',this._doFocus).bind('blur.timeEntry',this._doBlur).bind('click.timeEntry',this._doClick).bind('keydown.timeEntry',this._doKeyDown).bind('keypress.timeEntry',this._doKeyPress);if($.browser.mozilla){d.bind('input.timeEntry',function(a){c._parseTime();});}if($.browser.msie){d.bind('paste.timeEntry',function(a){setTimeout(function(){c._parseTime()},1);});}if(c._get('useMouseWheel')&&$.fn.mousewheel){d.mousewheel(this._doMouseWheel);}d[0]._timeId=c._id;if(i){i.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner);i[0]._timeId=c._id}},_enableTimeEntry:function(a){this._enableDisable(a,false)},_disableTimeEntry:function(a){this._enableDisable(a,true);},_enableDisable:function(b,c){var d=$.timeEntry._getInst(b._timeId);if(!d){return;}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()=='span'){$.timeEntry._changeSpinner(d,b.nextSibling,(c?5:-1));}$.timeEntry._disabledInputs=$.map($.timeEntry._disabledInputs,function(a){return(a==b?null:a)});if(c){$.timeEntry._disabledInputs[$.timeEntry._disabledInputs.length]=b}},_isDisabledTimeEntry:function(a){for(var i=0;i=3&&f[0]){$.timeEntry._timer=setTimeout(function(){$.timeEntry._repeatSpinner(d,e);},f[0]);$(b).one('mouseout',$.timeEntry._releaseSpinner).one('mouseup',$.timeEntry._releaseSpinner);}},_actionSpinner:function(a,b){switch(b){case 0:a._setTime();break;case 1:a._previousField(false);break;case 2:a._nextField(false);break;case 3:a._adjustField(+1);break;case 4:a._adjustField(-1);break;}},_repeatSpinner:function(a,b){$.timeEntry._lastInput=$.timeEntry._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){$.timeEntry._repeatSpinner(a,b);},a._get('spinnerRepeat')[1]);},_releaseSpinner:function(a){clearTimeout($.timeEntry._timer);},_endSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._isDisabledTimeEntry(b.previousSibling)){$.timeEntry._changeSpinner(c,b,-1);}if(!$.browser.opera){$.timeEntry._lastInput=$.timeEntry._blurredInput;}if($.timeEntry._lastInput){c._showField();}},_getSpinnerTarget:function(a){return(a.target?a.target:a.srcElement);},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=this._findPos(c);var e=this._findScroll(c);var f=a._get('spinnerIncDecOnly');var g=(f?99:b.clientX+e[0]-d[0]-($.browser.msie?1:0));var h=b.clientY+e[1]-d[1]-($.browser.msie?1:0);var i=a._get('spinnerSize');var j=(f?99:i[0]-g);var k=i[1]-h;if(i[2]>0&&Math.abs(g-j)<=i[2]&&Math.abs(h-k)<=i[2]){return 0;}var l=Math.min(g,h,j,k);return(l==g?1:(l==j?2:(l==h?3:4)));},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a._get('spinnerSize')[0])+'px 0px')},_findPos:function(a){var b=curTop=0;if(a.offsetParent){b=a.offsetLeft;curTop=a.offsetTop;while(a=a.offsetParent){var c=b;b+=a.offsetLeft;if(b<0){b=c;}curTop+=a.offsetTop;}}return[b,curTop];},_findScroll:function(a){var b=false;$(a).parents().each(function(){b|=$(this).css('position')=='fixed';});if(b&&!$.browser.opera){return[0,0]}var c=($.browser.opera?document.body.scrollLeft:a.scrollLeft);var d=($.browser.opera?document.body.scrollTop:a.scrollTop);if(!$.browser.opera){while(a=a.parentNode){c+=a.scrollLeft||0;d+=a.scrollTop||0;}}return[c,d];}});function TimeEntryInstance(a){this._id=$.timeEntry._register(this);this._selectedHour=0;this._selectedMinute=0;this._selectedSecond=0;this._field=0;this._input=null;this._settings=extendRemove({},a||{})}$.extend(TimeEntryInstance.prototype,{_get:function(a){return(this._settings[a]!=null?this._settings[a]:$.timeEntry._defaults[a])},_parseTime:function(){var a=this._extractTime();var b=this._get('showSeconds');if(a){this._selectedHour=a[0];this._selectedMinute=a[1];this._selectedSecond=a[2];}else{var c=this._constrainTime();this._selectedHour=c[0];this._selectedMinute=c[1];this._selectedSecond=(b?c[2]:0);}this._secondField=(b?2:-1);this._ampmField=(this._get('show24Hours')?-1:(b?3:2));this._lastChr='';this._field=Math.max(0,Math.min(Math.max(1,this._secondField,this._ampmField),this._get('initialField')));if(this._input.val()!=''){this._showTime();}},_extractTime:function(){var a=(this._input?this._input.val():'');var b=this._get('separator');var c=a.split(b);if(b==''&&a!=''){c[0]=a.substring(0,2);c[1]=a.substring(2,4);c[2]=a.substring(4,6);}var d=this._get('ampmNames');var e=this._get('show24Hours');if(c.length>=2){var f=!e&&(a.indexOf(d[0])>-1);var g=!e&&(a.indexOf(d[1])>-1);var h=parseInt(c[0],10);h=(isNaN(h)?0:h);h=((f||g)&&h==12?0:h)+(g?12:0);var i=parseInt(c[1],10);i=(isNaN(i)?0:i);var j=(c.length>=3?parseInt(c[2],10):0);j=(isNaN(j)||!this._get('showSeconds')?0:j);return this._constrainTime([h,i,j])}return null;},_constrainTime:function(a){var b=(a!=null);if(!b){var c=this._determineTime(this._get('defaultTime'))||new Date();a=[c.getHours(),c.getMinutes(),c.getSeconds()]}var d=false;var e=this._get('timeSteps');for(var i=0;i1){a[i]=Math.round(a[i]/e[i])*e[i];d=true;}}return a;},_showTime:function(){var a=this._get('show24Hours');var b=this._get('separator');var c=(this._formatNumber(a?this._selectedHour:((this._selectedHour+11)%12)+1)+b+this._formatNumber(this._selectedMinute)+(this._get('showSeconds')?b+this._formatNumber(this._selectedSecond):'')+(a?'':this._get('ampmPrefix')+this._get('ampmNames')[(this._selectedHour<12?0:1)]));this._setValue(c);this._showField()},_showField:function(){if(!this._input){return}var a=this._input[0];var b=this._get('separator');var c=b.length+2;var d=(this._field!=this._ampmField?(this._field*c):(this._ampmField*c)-b.length+this._get('ampmPrefix').length);var e=d+(this._field!=this._ampmField?2:this._get('ampmNames')[0].length);if(a.setSelectionRange){a.setSelectionRange(d,e);}else if(a.createTextRange){var f=a.createTextRange();f.moveStart('character',d);f.moveEnd('character',e-this._input.val().length);f.select();}if(!a.disabled){a.focus()}},_formatNumber:function(a){return(a<10?'0':'')+a},_setValue:function(a){this._input.val(a);this._input.trigger('change')},_previousField:function(a){var b=(this._input.val()==''||this._field==0);if(!b){this._field--}this._showField();this._lastChr='';return(b&&a)},_nextField:function(a){var b=(this._input.val()==''||this._field==Math.max(1,this._secondField,this._ampmField));if(!b){this._field++}this._showField();this._lastChr='';return(b&&a);},_adjustField:function(a){if(this._input&&this._input.val()==''){a=0;}var b=this._get('timeSteps');this._setTime(new Date(0,0,0,this._selectedHour+(this._field==0?a*b[0]:0)+(this._field==this._ampmField?a*12:0),this._selectedMinute+(this._field==1?a*b[1]:0),this._selectedSecond+(this._field==this._secondField?a*b[2]:0)))},_setTime:function(a){a=this._determineTime(a);var b=this._constrainTime(a?[a.getHours(),a.getMinutes(),a.getSeconds()]:null);a=new Date(0,0,0,b[0],b[1],b[2]);var a=this._normaliseTime(a);var c=this._normaliseTime(this._determineTime(this._get('minTime')));var d=this._normaliseTime(this._determineTime(this._get('maxTime')));a=(c&&ad?d:a));this._selectedHour=a.getHours();this._selectedMinute=a.getMinutes();this._selectedSecond=a.getSeconds();this._showTime()},_determineTime:function(h){var i=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b;};var j=function(a){var b=new Date();var c=b.getHours();var d=b.getMinutes();var e=b.getSeconds();var f=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var g=f.exec(a);while(g){switch(g[2]||'s'){case's':case'S':e+=parseInt(g[1]);break;case'm':case'M':d+=parseInt(g[1]);break;case'h':case'H':c+=parseInt(g[1]);break;}g=f.exec(a)}b=new Date(0,0,10,c,d,e,0);if(/^!/.test(a)){if(b.getDate()>10){b=new Date(0,0,10,23,59,59)}else if(b.getDate()<10){b=new Date(0,0,10,0,0,0);}}return b};return(h?(typeof h=='string'?j(h):(typeof h=='number'?i(h):h)):null)},_normaliseTime:function(a){if(!a){return null}a.setFullYear(2001);a.setMonth(1-1);a.setDate(26);return a},_handleKeyPress:function(a){if(a==this._get('separator')){this._nextField(false)}else if(a>='0'&&a<='9'){var b=(this._lastChr+a)*1;var c=this._get('show24Hours');var d=(this._field==0&&((c&&b<24)||(b>=1&&b<=12))?b+(!c&&this._selectedHour>=12?12:0):this._selectedHour);var e=(this._field==1&&b<60?b:this._selectedMinute);var f=(this._field==this._secondField&&b<60?b:this._selectedSecond);var g=this._constrainTime([d,e,f]);this._setTime(new Date(0,0,0,g[0],g[1],g[2]));this._lastChr=a;}else if(!this._get('show24Hours')){var h=this._get('ampmNames');if((a==h[0].substring(0,1).toLowerCase()&&this._selectedHour>=12)||(a==h[1].substring(0,1).toLowerCase()&&this._selectedHour<12)){var i=this._field;this._field=this._ampmField;this._adjustField(+1);this._field=i;this._showField()}}}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.timeEntry=function(e){var f=Array.prototype.slice.call(arguments,1);if(typeof e=='string'&&(e=='isDisabled'||e=='getTime')){return $.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this[0]].concat(f));}return this.each(function(){var a=this.nodeName.toLowerCase();if(a=='input'){if(typeof e=='string'){$.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this].concat(f));}else{var b=null;for(attrName in $.timeEntry._defaults){var c=this.getAttribute('time:'+attrName);if(c){b=b||{};try{b[attrName]=eval(c);}catch(err){b[attrName]=c;}}}var d=(d&&!b?d:new TimeEntryInstance(!b?e:$.extend(b,e)));$.timeEntry._connectTimeEntry(this,d);}}});};$(document).ready(function(){$.timeEntry=new TimeEntry();});})(jQuery); \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.core.js b/pandora_console/include/javascript/jquery.ui.core.js index 362ef345e3..f796ef7a9b 100644 --- a/pandora_console/include/javascript/jquery.ui.core.js +++ b/pandora_console/include/javascript/jquery.ui.core.js @@ -1 +1,2 @@ -(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0));}catch(F){}return C.ui.cssCache[D];},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","");},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F;}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments);};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined);}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J);}).bind("remove",function(){return G.destroy();});this.init();};C[F][E].prototype=C.extend({},C.widget.prototype,D);};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled");}},enable:function(){this.setData("disabled",false);},disable:function(){this.setData("disabled",true);}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E);});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on");}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true;}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false;},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D);}if(this._mouseStarted){this.mouseDrag(D);return false;}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D));}return !this._mouseStarted;},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery) \ No newline at end of file + +(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]]);};},call:function(D,F,E){var H=D.plugins[F];if(!H){return;}for(var G=0;G').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0));}catch(F){}return C.ui.cssCache[D];},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none");},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","");},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true;}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F;}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments);};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1);}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined);}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I);}else{if(!H){C.data(this,E,new C[F][E](this,J));}}});};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K);}).bind("getData."+E,function(K,J){return G.getData(J);}).bind("remove",function(){return G.destroy();});this.init();};C[F][E].prototype=C.extend({},C.widget.prototype,D);};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName);},getData:function(D){return this.options[D];},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled");}},enable:function(){this.setData("disabled",false);},disable:function(){this.setData("disabled",true);}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E);});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on");}this.started=false;},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable));},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true;}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true;},this.options.delay);}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true;}}this._mouseMoveDelegate=function(H){return E.mouseMove(H);};this._mouseUpDelegate=function(H){return E.mouseUp(H);};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false;},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D);}if(this._mouseStarted){this.mouseDrag(D);return false;}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D));}return !this._mouseStarted;},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D);}return false;},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance);},mouseDelayMet:function(D){return this._mouseDelayMet;},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true;}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery); \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.datepicker.js b/pandora_console/include/javascript/jquery.ui.datepicker.js index 10981205c1..e874e2b5b6 100644 --- a/pandora_console/include/javascript/jquery.ui.datepicker.js +++ b/pandora_console/include/javascript/jquery.ui.datepicker.js @@ -1 +1,2 @@ -(function($){function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"<Prev",prevStatus:"Show the previous month",nextText:"Next>",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"yy-mm-dd",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - "};$.extend(this._defaults,this.regional[""]);this._datepickerDiv=$('
')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var instSettings=(inlineSettings?$.extend(settings||{},inlineSettings||{}):settings);if(nodeName=="input"){var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst)}else{if(nodeName=="div"||nodeName=="span"){var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst)}}},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;var $target=$(target);if(nodeName=="input"){$target.siblings(".ui-datepicker-append").replaceWith("").end().siblings(".ui-datepicker-trigger").replaceWith("").end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);var wrapper=$target.parents(".ui-datepicker-wrap");if(wrapper){wrapper.replaceWith(wrapper.html())}}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}if($("input[_calId="+calId+"]").length==0){this._inst[calId]=null}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=false}).end().siblings("img.ui-datepicker-trigger").css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=true}).end().siblings("img.ui-datepicker-trigger").css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[$.datepicker._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)},_connectDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }var appendText=inst._get("appendText");var isRTL=inst._get("isRTL");if(appendText){if(isRTL){input.before(''+appendText)}else{input.after(''+appendText)}}var showOn=inst._get("showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){input.wrap('');var buttonText=inst._get("buttonText");var buttonImage=inst._get("buttonImage");var trigger=$(inst._get("buttonImageOnly")?$("").addClass("ui-datepicker-trigger").attr({src:buttonImage,alt:buttonText,title:buttonText}):$("