From da22943171468ddbcfb1bb2fc0dfa52dcb42e216 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 Oct 2010 16:06:37 +0000 Subject: [PATCH] 2010-10-25 Miguel de Dios * include/javascript/jquery.pandora.controls.js, include/javascript/tiny_mce/plugins/media/js/media.js, include/javascript/tiny_mce/plugins/table/editor_plugin.js, include/javascript/tiny_mce/plugins/table/js/cell.js, include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js, include/javascript/tiny_mce/themes/advanced/js/color_picker.js, include/javascript/tiny_mce/themes/advanced/js/image.js, include/javascript/jquery.pandora.js, include/javascript/jquery.tablesorter.js, include/javascript/OpenLayers/OpenLayers.js, include/javascript/jquery.form.js, include/javascript/jquery.timeentry.js, include/javascript/jquery.countdown.js, godmode/reporting/visual_console_builder.editor.js: fixed end of lines that it haven't semicolon end char. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3461 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 17 +++++++++++++++++ .../reporting/visual_console_builder.editor.js | 2 +- .../include/javascript/OpenLayers/OpenLayers.js | 6 +++--- .../include/javascript/jquery.countdown.js | 2 +- .../include/javascript/jquery.form.js | 2 +- .../javascript/jquery.pandora.controls.js | 2 +- .../include/javascript/jquery.pandora.js | 4 ++-- .../include/javascript/jquery.tablesorter.js | 4 ++-- .../include/javascript/jquery.timeentry.js | 2 +- .../tiny_mce/plugins/media/js/media.js | 2 +- .../tiny_mce/plugins/table/editor_plugin.js | 2 +- .../tiny_mce/plugins/table/js/cell.js | 2 +- .../plugins/xhtmlxtras/js/element_common.js | 16 ++++++++-------- .../tiny_mce/themes/advanced/js/color_picker.js | 2 +- .../tiny_mce/themes/advanced/js/image.js | 4 ++-- 15 files changed, 43 insertions(+), 26 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7dabf5e01d..aa0214afdb 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2010-10-25 Miguel de Dios + + * include/javascript/jquery.pandora.controls.js, + include/javascript/tiny_mce/plugins/media/js/media.js, + include/javascript/tiny_mce/plugins/table/editor_plugin.js, + include/javascript/tiny_mce/plugins/table/js/cell.js, + include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js, + include/javascript/tiny_mce/themes/advanced/js/color_picker.js, + include/javascript/tiny_mce/themes/advanced/js/image.js, + include/javascript/jquery.pandora.js, + include/javascript/jquery.tablesorter.js, + include/javascript/OpenLayers/OpenLayers.js, + include/javascript/jquery.form.js, include/javascript/jquery.timeentry.js, + include/javascript/jquery.countdown.js, + godmode/reporting/visual_console_builder.editor.js: fixed end of lines that + it haven't semicolon end char. + 2010-10-25 Miguel de Dios * include/functions_agents.php: clean source style. diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 274d74c6fb..0f63bd6c06 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -280,7 +280,7 @@ function actionClick() { showAdvanceOptions(false); - openPropertiesPanel = false + openPropertiesPanel = false; return; } diff --git a/pandora_console/include/javascript/OpenLayers/OpenLayers.js b/pandora_console/include/javascript/OpenLayers/OpenLayers.js index d5271c4f0f..55b4ce85f4 100755 --- a/pandora_console/include/javascript/OpenLayers/OpenLayers.js +++ b/pandora_console/include/javascript/OpenLayers/OpenLayers.js @@ -433,8 +433,8 @@ return changed;},pagePrevious:function(){var changed=false;if(this.features){if( var start=(this.num-1)*this.length;changed=this.page(start);} return changed;},page:function(start,event){var changed=false;if(this.features){if(start>=0&&start=0;--i){feature=this.features[i];if(!options||options.except!=feature){this.unselect(feature);}}},selectSingle:function(evt){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var bounds=this.pixelToBounds(evt.xy);this.setModifiers(evt);this.request(bounds,{single:true});},selectBox:function(position){if(position instanceof OpenLayers.Bounds){var minXY=this.map.getLonLatFromPixel(new OpenLayers.Pixel(position.left,position.bottom));var maxXY=this.map.getLonLatFromPixel(new OpenLayers.Pixel(position.right,position.top));var bounds=new OpenLayers.Bounds(minXY.lon,minXY.lat,maxXY.lon,maxXY.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(bounds);}},selectHover:function(evt){var bounds=this.pixelToBounds(evt.xy);this.request(bounds,{single:true,hover:true});},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null;}},request:function(bounds,options){options=options||{};var filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:bounds});var response=this.protocol.read({maxFeatures:options.single==true?this.maxFeatures:undefined,filter:filter,callback:function(result){if(result.code==1){if(result.features.length){if(options.single==true){this.selectBestFeature(result.features,bounds.getCenterLonLat(),options);}else{this.select(result.features);}}else if(options.hover){this.hoverSelect();}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll();}}} OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");},scope:this});if(options.hover==true){this.hoverResponse=response;}},selectBestFeature:function(features,clickPosition,options){options=options||{};if(features.length){var point=new OpenLayers.Geometry.Point(clickPosition.lon,clickPosition.lat);var feature,resultFeature,dist;var minDist=Number.MAX_VALUE;for(var i=0;i=b._until.getTime());if(e){if(b._timer||this._get(b,'alwaysExpire')){var f=this._get(b,'onExpiry');if(f){f.apply(c[0],[])}var g=this._get(b,'expiryUrl');if(g){window.location=g}}b._timer=null}else if(b._hold=='pause'){b._time=null}else{var h=this._get(b,'format');b._timer=setTimeout('$.countdown._updateCountdown("#'+c[0].id+'")',(h.match('s|S')?1:(h.match('m|M')?30:600))*980)}$.data(c[0],q,b)},_changeCountdown:function(a,b){var c=$.data(a,q);if(c){this._resetExtraLabels(c.options,b);extendRemove(c.options,b||{});this._adjustSettings(c);$.data(a,q,c);this._updateCountdown(a,c)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_destroyCountdown:function(a){a=$(a);if(!a.is('.'+this.markerClassName)){return}a.removeClass(this.markerClassName).empty();var b=$.data(a[0],q);if(b._timer){clearTimeout(b._timer)}$.removeData(a[0],q)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,q);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'Y'+d+c._periods[1]+'O'+d+c._periods[2]+'W'+d+c._periods[3]+'D'+d+c._periods[4]+'H'+d+c._periods[5]+'M'+d+c._periods[6]+'S')}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,q,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=$.data(a,q);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b])},_adjustSettings:function(a){var b=new Date();var c=this._get(a,'serverTime');a._offset=(c?c.getTime()-b.getTime():0);a._since=this._get(a,'since');if(a._since){a._since=this._determineTime(a._since,null)}a._until=this._determineTime(this._get(a,'until'),b);a._show=this._determineShow(a)},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a,b){return 32-new Date(a,b,32).getDate()};var o=function(a){var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':case'S':h+=parseInt(j[1]);break;case'm':case'M':g+=parseInt(j[1]);break;case'h':case'H':f+=parseInt(j[1]);break;case'd':case'D':e+=parseInt(j[1]);break;case'w':case'W':e+=parseInt(j[1])*7;break;case'o':case'O':d+=parseInt(j[1]);e=Math.min(e,n(c,d));break;case'y':case'Y':c+=parseInt(j[1]);e=Math.min(e,n(c,d));break}j=i.exec(a)}b=new Date(c,d,e,f,g,h,0);return b};var p=(k==null?l:(typeof k=='string'?o(k):(typeof k=='number'?m(k):k)));if(p)p.setMilliseconds(0);return p},_generateHTML:function(c){c._periods=periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,new Date()));var d=false;var e=0;for(var f=0;f0);c._show[f]=(c._show[f]=='?'&&!d?null:c._show[f]);e+=(c._show[f]?1:0)}var g=this._get(c,'compact');var h=this._get(c,'layout');var i=(g?this._get(c,'compactLabels'):this._get(c,'labels'));var j=this._get(c,'timeSeparator');var k=this._get(c,'description')||'';var l=function(a){return(a<10?'0':'')+a};var m=function(a){var b=$.countdown._get(c,'compactLabels'+periods[a]);return(c._show[a]?periods[a]+(b?b[a]:i[a])+' ':'')};var n=function(a){var b=$.countdown._get(c,'labels'+periods[a]);return(c._show[a]?'
'+periods[a]+'
'+(b?b[a]:i[a])+'
':'')};return(h?this._buildLayout(c,h,g):((g?'
'+m(Y)+m(O)+m(W)+m(D)+(c._show[H]?l(periods[H]):'')+(c._show[M]?(c._show[H]?j:'')+l(periods[M]):'')+(c._show[S]?(c._show[H]||c._show[M]?j:'')+l(periods[S]):''):'
'+n(Y)+n(O)+n(W)+n(D)+n(H)+n(M)+n(S))+'
'+(k?'
'+k+'
':'')))},_buildLayout:function(f,g,h){var i=(h?this._get(f,'compactLabels'):this._get(f,'labels'));var j=g;var k=function(a,b){var c=new RegExp('%'+a+'.*%'+a);var d=new RegExp('%'+a+'.*');while(true){var e=c.exec(j);if(!e){break}e[0]=e[0].substr(0,2)+e[0].substr(2).replace(d,'%'+a);j=j.replace(e[0],f._show[b]?l(e[0],a,b):'')}};var l=function(a,b,c){var d=$.countdown._get(f,(h?'compactLabels':'labels')+f._periods[c]);return a.substr(2,a.length-4).replace(/%nn/g,(f._periods[c]<10?'0':'')+f._periods[c]).replace(/%n/g,f._periods[c]).replace(/%l/g,(d?d[c]:i[c]))};k('Y',Y);k('O',O);k('W',W);k('D',D);k('H',H);k('M',M);k('S',S);return j},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e){c._now=e;c._now.setMilliseconds(0);var f=new Date(c._now.getTime());if(c._since&&e.getTime()c._until.getTime()){c._now=e=f}}f.setTime(f.getTime()-c._offset);var g=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var h=Math.max(0,(f.getFullYear()-e.getFullYear())*12+f.getMonth()-e.getMonth()+(f.getDate()=b._until.getTime());if(e){if(b._timer||this._get(b,'alwaysExpire')){var f=this._get(b,'onExpiry');if(f){f.apply(c[0],[]);}var g=this._get(b,'expiryUrl');if(g){window.location=g;}}b._timer=null;}else if(b._hold=='pause'){b._time=null;}else{var h=this._get(b,'format');b._timer=setTimeout('$.countdown._updateCountdown("#'+c[0].id+'")',(h.match('s|S')?1:(h.match('m|M')?30:600))*980);}$.data(c[0],q,b);},_changeCountdown:function(a,b){var c=$.data(a,q);if(c){this._resetExtraLabels(c.options,b);extendRemove(c.options,b||{});this._adjustSettings(c);$.data(a,q,c);this._updateCountdown(a,c);}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n.match(/[Ll]abels/)){c=true;break;}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null;}}}},_destroyCountdown:function(a){a=$(a);if(!a.is('.'+this.markerClassName)){return;}a.removeClass(this.markerClassName).empty();var b=$.data(a[0],q);if(b._timer){clearTimeout(b._timer);}$.removeData(a[0],q);},_pauseCountdown:function(a){this._hold(a,'pause');},_lapCountdown:function(a){this._hold(a,'lap');},_resumeCountdown:function(a){this._hold(a,null);},_hold:function(a,b){var c=$.data(a,q);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'Y'+d+c._periods[1]+'O'+d+c._periods[2]+'W'+d+c._periods[3]+'D'+d+c._periods[4]+'H'+d+c._periods[5]+'M'+d+c._periods[6]+'S');}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,q,c);this._updateCountdown(a,c);}},_getTimesCountdown:function(a){var b=$.data(a,q);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,new Date())));},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b]);},_adjustSettings:function(a){var b=new Date();var c=this._get(a,'serverTime');a._offset=(c?c.getTime()-b.getTime():0);a._since=this._get(a,'since');if(a._since){a._since=this._determineTime(a._since,null);}a._until=this._determineTime(this._get(a,'until'),b);a._show=this._determineShow(a);},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b;};var n=function(a,b){return 32-new Date(a,b,32).getDate();};var o=function(a){var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':case'S':h+=parseInt(j[1]);break;case'm':case'M':g+=parseInt(j[1]);break;case'h':case'H':f+=parseInt(j[1]);break;case'd':case'D':e+=parseInt(j[1]);break;case'w':case'W':e+=parseInt(j[1])*7;break;case'o':case'O':d+=parseInt(j[1]);e=Math.min(e,n(c,d));break;case'y':case'Y':c+=parseInt(j[1]);e=Math.min(e,n(c,d));break;}j=i.exec(a);}b=new Date(c,d,e,f,g,h,0);return b;};var p=(k==null?l:(typeof k=='string'?o(k):(typeof k=='number'?m(k):k)));if(p)p.setMilliseconds(0);return p;},_generateHTML:function(c){c._periods=periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,new Date()));var d=false;var e=0;for(var f=0;f0);c._show[f]=(c._show[f]=='?'&&!d?null:c._show[f]);e+=(c._show[f]?1:0);}var g=this._get(c,'compact');var h=this._get(c,'layout');var i=(g?this._get(c,'compactLabels'):this._get(c,'labels'));var j=this._get(c,'timeSeparator');var k=this._get(c,'description')||'';var l=function(a){return(a<10?'0':'')+a;};var m=function(a){var b=$.countdown._get(c,'compactLabels'+periods[a]);return(c._show[a]?periods[a]+(b?b[a]:i[a])+' ':'');};var n=function(a){var b=$.countdown._get(c,'labels'+periods[a]);return(c._show[a]?'
'+periods[a]+'
'+(b?b[a]:i[a])+'
':'');};return(h?this._buildLayout(c,h,g):((g?'
'+m(Y)+m(O)+m(W)+m(D)+(c._show[H]?l(periods[H]):'')+(c._show[M]?(c._show[H]?j:'')+l(periods[M]):'')+(c._show[S]?(c._show[H]||c._show[M]?j:'')+l(periods[S]):''):'
'+n(Y)+n(O)+n(W)+n(D)+n(H)+n(M)+n(S))+'
'+(k?'
'+k+'
':'')));},_buildLayout:function(f,g,h){var i=(h?this._get(f,'compactLabels'):this._get(f,'labels'));var j=g;var k=function(a,b){var c=new RegExp('%'+a+'.*%'+a);var d=new RegExp('%'+a+'.*');while(true){var e=c.exec(j);if(!e){break;}e[0]=e[0].substr(0,2)+e[0].substr(2).replace(d,'%'+a);j=j.replace(e[0],f._show[b]?l(e[0],a,b):'');}};var l=function(a,b,c){var d=$.countdown._get(f,(h?'compactLabels':'labels')+f._periods[c]);return a.substr(2,a.length-4).replace(/%nn/g,(f._periods[c]<10?'0':'')+f._periods[c]).replace(/%n/g,f._periods[c]).replace(/%l/g,(d?d[c]:i[c]));};k('Y',Y);k('O',O);k('W',W);k('D',D);k('H',H);k('M',M);k('S',S);return j;},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c;},_calculatePeriods:function(c,d,e){c._now=e;c._now.setMilliseconds(0);var f=new Date(c._now.getTime());if(c._since&&e.getTime()c._until.getTime()){c._now=e=f;}}f.setTime(f.getTime()-c._offset);var g=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var h=Math.max(0,(f.getFullYear()-e.getFullYear())*12+f.getMonth()-e.getMonth()+(f.getDate()").attr ("src", "images/groups_small/"+data["icon"]+".png") + img = $("").attr ("src", "images/groups_small/"+data["icon"]+".png"); $(config.spanPreview) .append (img) .fadeIn ('fast'); diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index a1c5a444f5..3509c4eeb5 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -2,12 +2,12 @@ $.fn.check = function () { return this.each (function () { this.checked = true; - })}; + });}; $.fn.uncheck = function () { return this.each (function () { this.checked = false; - })}; + });}; $.fn.enable = function () { return $(this).removeAttr ("disabled"); diff --git a/pandora_console/include/javascript/jquery.tablesorter.js b/pandora_console/include/javascript/jquery.tablesorter.js index 04c3a4be36..0e9e3868a9 100644 --- a/pandora_console/include/javascript/jquery.tablesorter.js +++ b/pandora_console/include/javascript/jquery.tablesorter.js @@ -242,7 +242,7 @@ function appendToTable(table,cache) { - if(table.config.debug) {var appendTime = new Date()} + if(table.config.debug) {var appendTime = new Date();} var c = cache, r = c.row, @@ -583,7 +583,7 @@ // cancel selection }).mousedown(function() { if(config.cancelSelection) { - this.onselectstart = function() {return false}; + this.onselectstart = function() {return false;}; return false; } }); diff --git a/pandora_console/include/javascript/jquery.timeentry.js b/pandora_console/include/javascript/jquery.timeentry.js index c088787fb4..6f5989656c 100644 --- a/pandora_console/include/javascript/jquery.timeentry.js +++ b/pandora_console/include/javascript/jquery.timeentry.js @@ -4,4 +4,4 @@ Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. Please attribute the author if you use it. */ -(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 +(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/tiny_mce/plugins/media/js/media.js b/pandora_console/include/javascript/tiny_mce/plugins/media/js/media.js index 86cfa98563..0ad5812b06 100644 --- a/pandora_console/include/javascript/tiny_mce/plugins/media/js/media.js +++ b/pandora_console/include/javascript/tiny_mce/plugins/media/js/media.js @@ -12,7 +12,7 @@ function init() { ed = tinyMCEPopup.editor; tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] + f = document.forms[0]; fe = ed.selection.getNode(); if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { diff --git a/pandora_console/include/javascript/tiny_mce/plugins/table/editor_plugin.js b/pandora_console/include/javascript/tiny_mce/plugins/table/editor_plugin.js index 39f2c694be..75df2a9fcd 100644 --- a/pandora_console/include/javascript/tiny_mce/plugins/table/editor_plugin.js +++ b/pandora_console/include/javascript/tiny_mce/plugins/table/editor_plugin.js @@ -1 +1 @@ -(function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='
'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;iK){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'
')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce); \ No newline at end of file +(function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='
'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;iK){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l);}});}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m);});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'
')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/pandora_console/include/javascript/tiny_mce/plugins/table/js/cell.js b/pandora_console/include/javascript/tiny_mce/plugins/table/js/cell.js index f24619172d..7e25a57a8e 100644 --- a/pandora_console/include/javascript/tiny_mce/plugins/table/js/cell.js +++ b/pandora_console/include/javascript/tiny_mce/plugins/table/js/cell.js @@ -8,7 +8,7 @@ function init() { document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); var inst = ed; var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); diff --git a/pandora_console/include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/pandora_console/include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js index 5b494a5660..96106c7e68 100644 --- a/pandora_console/include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js +++ b/pandora_console/include/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js @@ -129,7 +129,7 @@ SXE = { currentAction : "insert", inst : tinyMCEPopup.editor, updateElement : null -} +}; SXE.focusElement = SXE.inst.selection.getNode(); @@ -149,7 +149,7 @@ SXE.initElementDialog = function(element_name) { } document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); -} +}; SXE.insertElement = function(element_name) { var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName; @@ -180,7 +180,7 @@ SXE.insertElement = function(element_name) { } SXE.inst.nodeChanged(); tinyMCEPopup.execCommand('mceEndUndoLevel'); -} +}; SXE.removeElement = function(element_name){ element_name = element_name.toLowerCase(); @@ -191,15 +191,15 @@ SXE.removeElement = function(element_name){ SXE.inst.nodeChanged(); tinyMCEPopup.execCommand('mceEndUndoLevel'); } -} +}; SXE.showRemoveButton = function() { document.getElementById("remove").style.display = ''; -} +}; SXE.containsClass = function(elm,cl) { return (elm.className.indexOf(cl) > -1) ? true : false; -} +}; SXE.removeClass = function(elm,cl) { if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { @@ -213,12 +213,12 @@ SXE.removeClass = function(elm,cl) { } } elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} +}; SXE.addClass = function(elm,cl) { if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; return true; -} +}; function insertInlineElement(en) { var ed = tinyMCEPopup.editor, dom = ed.dom; diff --git a/pandora_console/include/javascript/tiny_mce/themes/advanced/js/color_picker.js b/pandora_console/include/javascript/tiny_mce/themes/advanced/js/color_picker.js index fd9700f222..f6c73077d7 100644 --- a/pandora_console/include/javascript/tiny_mce/themes/advanced/js/color_picker.js +++ b/pandora_console/include/javascript/tiny_mce/themes/advanced/js/color_picker.js @@ -178,7 +178,7 @@ function generateNamedColors() { for (n in named) { v = named[n]; - h += '' + h += ''; } el.innerHTML = h; diff --git a/pandora_console/include/javascript/tiny_mce/themes/advanced/js/image.js b/pandora_console/include/javascript/tiny_mce/themes/advanced/js/image.js index 6423d90809..40a2ee5120 100644 --- a/pandora_console/include/javascript/tiny_mce/themes/advanced/js/image.js +++ b/pandora_console/include/javascript/tiny_mce/themes/advanced/js/image.js @@ -171,7 +171,7 @@ var ImageDialog = { break; case 'hspace': - v = dom.getStyle(e, 'margin-left') + v = dom.getStyle(e, 'margin-left'); v2 = dom.getStyle(e, 'margin-right'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); @@ -179,7 +179,7 @@ var ImageDialog = { break; case 'vspace': - v = dom.getStyle(e, 'margin-top') + v = dom.getStyle(e, 'margin-top'); v2 = dom.getStyle(e, 'margin-bottom'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, ''));