summaryrefslogtreecommitdiffstats
path: root/sources/ext/dhtmlxscheduler_html_templates.js
diff options
context:
space:
mode:
Diffstat (limited to 'sources/ext/dhtmlxscheduler_html_templates.js')
-rw-r--r--sources/ext/dhtmlxscheduler_html_templates.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/sources/ext/dhtmlxscheduler_html_templates.js b/sources/ext/dhtmlxscheduler_html_templates.js
new file mode 100644
index 0000000..a7df078
--- /dev/null
+++ b/sources/ext/dhtmlxscheduler_html_templates.js
@@ -0,0 +1,19 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){
+ var els = document.body.getElementsByTagName("DIV");
+ for (var i=0; i < els.length; i++) {
+ var cs = els[i].className||"";
+ cs = cs.split(":");
+ if (cs.length == 2 && cs[0] == "template"){
+ var code = "return \""+(els[i].innerHTML||"").replace(/\"/g,"\\\"").replace(/[\n\r]+/g,"")+"\";";
+ code = unescape(code).replace(/\{event\.([a-z]+)\}/g,function(all,mask){
+ return '"+ev.'+mask+'+"';
+ });
+ scheduler.templates[cs[1]]=Function("start","end","ev",code);
+ els[i].style.display='none';
+ }
+ };
+}) \ No newline at end of file