2011-08-03 14:09:14 +00:00
|
|
|
/*
|
|
|
|
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
|
2012-10-24 13:48:59 +00:00
|
|
|
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
|
2011-08-03 14:09:14 +00:00
|
|
|
*/
|
2011-04-07 16:41:06 +00:00
|
|
|
scheduler.attachEvent("onTemplatesReady",function(){
|
|
|
|
var first = true;
|
|
|
|
var s2d = scheduler.date.str_to_date("%Y-%m-%d");
|
|
|
|
var d2s = scheduler.date.date_to_str("%Y-%m-%d");
|
|
|
|
scheduler.attachEvent("onBeforeViewChange",function(om,od,m,d){
|
|
|
|
if (first){
|
|
|
|
first = false;
|
|
|
|
var p={};
|
|
|
|
var data=(document.location.hash||"").replace("#","").split(",");
|
|
|
|
for (var i=0; i < data.length; i++) {
|
|
|
|
var s = data[i].split("=");
|
|
|
|
if (s.length==2)
|
|
|
|
p[s[0]]=s[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p.date || p.mode){
|
|
|
|
try{
|
|
|
|
this.setCurrentView((p.date?s2d(p.date):null),(p.mode||null));
|
|
|
|
} catch(e){
|
|
|
|
//assuming that mode is not available anymore
|
|
|
|
this.setCurrentView((p.date?s2d(p.date):null),m);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var text = "#date="+d2s(d||od)+",mode="+(m||om);
|
|
|
|
document.location.hash = text;
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
});
|