diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-10-24 15:48:59 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-10-24 15:48:59 +0200 |
| commit | b79406cb896e6f6003cb7ca6adc71f3f2da82d80 (patch) | |
| tree | 33a733321b42d623c9bf3b30fc6d2fa17359b95a /addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js | |
| parent | 81e7d9ba3defa0dbaed1e244710fce29827bc1d6 (diff) | |
[WIP] Updated dhtmlx calendar
bzr revid: fme@openerp.com-20121024134859-pru7zenpiz0la8mq
Diffstat (limited to 'addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js')
| -rw-r--r-- | addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js index 066e5e5a57b..0cb1e926595 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js @@ -1,9 +1,9 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ -scheduler.attachEvent("onTemplatesReady",function(){function h(d,b,c,f){for(var e=b.getElementsByTagName(d),a=c.getElementsByTagName(d),g=a.length-1;g>=0;g--)if(c=a[g],f){var i=document.createElement("SPAN");i.className="dhx_text_disabled";i.innerHTML=f(e[g]);c.parentNode.insertBefore(i,c);c.parentNode.removeChild(c)}else c.disabled=!0}scheduler.attachEvent("onBeforeLightbox",function(d){if(this.config.readonly_form||this.getEvent(d).readonly)this.config.readonly_active=!0;else return this.config.readonly_active= -!1,!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1;return!0});var k=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var d=this.config.lightbox.sections;if(this.config.readonly_active)for(var b=0;b<d.length;b++)if(d[b].type=="recurring"){var c=document.getElementById(d[b].id);c.style.display=c.nextSibling.style.display="none";d.splice(b,1);b--}var f=k.apply(this,arguments);if(this.config.readonly_active){var e=this._get_lightbox(),a= -this._lightbox_r=e.cloneNode(!0);a.id=scheduler.uid();a.style.color="red";h("textarea",e,a,function(a){return a.value});h("input",e,a,!1);h("select",e,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});a.removeChild(a.childNodes[2]);a.removeChild(a.childNodes[3]);e.parentNode.insertBefore(a,e);j.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b= -a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return f};var j=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||j.apply(this,arguments)};var l=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r), -this._lightbox_r=null;return l.apply(this,arguments)}}); +scheduler.attachEvent("onTemplatesReady",function(){function c(e,b,a,h){for(var i=b.getElementsByTagName(e),g=a.getElementsByTagName(e),f=g.length-1;f>=0;f--)if(a=g[f],h){var d=document.createElement("SPAN");d.className="dhx_text_disabled";d.innerHTML=h(i[f]);a.parentNode.insertBefore(d,a);a.parentNode.removeChild(a)}else a.disabled=!0}var r=scheduler.config.lightbox.sections,k=null,n=scheduler.config.buttons_left.slice(),o=scheduler.config.buttons_right.slice();scheduler.attachEvent("onBeforeLightbox", +function(e){if(this.config.readonly_form||this.getEvent(e).readonly){this.config.readonly_active=!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1}else this.config.readonly_active=!1,scheduler.config.buttons_left=n.slice(),scheduler.config.buttons_right=o.slice();var a=this.config.lightbox.sections;if(this.config.readonly_active){for(var h=!1,b=0;b<a.length;b++)if(a[b].type=="recurring"){k=a[b];this.config.readonly_active&&a.splice(b,1);break}!h&& +!this.config.readonly_active&&k&&a.splice(a.length-2,0,k);for(var i=["dhx_delete_btn","dhx_save_btn"],g=[scheduler.config.buttons_left,scheduler.config.buttons_right],b=0;b<i.length;b++)for(var f=i[b],d=0;d<g.length;d++){for(var c=g[d],l=-1,j=0;j<c.length;j++)if(c[j]==f){l=j;break}l!=-1&&c.splice(l,1)}}this.resetLightbox();return!0});var p=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var e=p.apply(this,arguments);if(this.config.readonly_active){var b=this.getLightbox(),a=this._lightbox_r= +b.cloneNode(!0);a.id=scheduler.uid();c("textarea",b,a,function(a){return a.value});c("input",b,a,!1);c("select",b,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});b.parentNode.insertBefore(a,b);m.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel", +[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return e};var m=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||m.apply(this,arguments)};var q=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r),this._lightbox_r=null;return q.apply(this,arguments)}}); |
