Hi everybody,
IE11 crashes when i have a long time json request with multisources events.
The browser says :
XXXX doesn’t answer because of a long time script (maybe the translation is not correct…)
Each json request can make a long time to (5 or 6 seconds) come…
All is fine on all others modern browsers
Here’s the code used :
<script>
function show_minical(){
if (scheduler.isCalendarVisible())
scheduler.destroyCalendar();
else
scheduler.renderCalendar({
position:"dhx_minical_icon",
date:scheduler._date,
navigation:true,
handler:function(date,calendar){
scheduler.setCurrentView(date);
scheduler.destroyCalendar();
}
});
}
function schedulerInit() {
scheduler.form_blocks.textarea.set_value=function(node,value,ev){
node.firstChild.value=value||"";
node.firstChild.disabled = true;
}
scheduler.config.lightbox.sections=[
{name:"objet", height:30, map_to:"text", type:"textarea" , focus:true},
{name: "location", height: 30, type: "textarea", map_to: "location", default_value: "" },
/* {name: "description", height: 200, type: "textarea", map_to: "description", default_value: "" }, */
{name: "priority", height: 22, map_to: "importance", type: "select", options: [{key:"low", label: "Basse"},{key:"normal", label: "Normale"},{key:"high", label: "Haute"} ], default_value: "normal"},
{name: "status", height: 22, map_to: "status", type: "select", options: [{key:"oof", label: "Absent du bureau"},{key:"busy", label: "Occupé"},{key:"free", label: "Libre"} ], default_value: "busy"},
{name:"time", height:72, type:"time", map_to:"auto", time_format:["%d", "%m", "%Y", "%H:%i"]}
];
scheduler.locale.labels.section_objet = "Objet";
scheduler.locale.labels.section_location = "Lieu";
scheduler.locale.labels.section_description = "Description";
scheduler.locale.labels.section_priority = "Importance";
scheduler.locale.labels.section_status = "Disponibilité";
var sections=[
{key:"58032511a4cd133adc4fa1be5b9d7283", label:"Calendrier Changements Config SI"}
,
{key:"5770dda8e06f8481dab7fb7c3126a6a0", label:"Calendrier DSTI"}
];
scheduler.createUnitsView({
name:"unit",
property:"section_id",
list:sections,
size:10,
step:5
});
scheduler.locale.labels.unit_tab = "Agendas";
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_date: "%H:%i",
x_step: 60,
x_size: 12,
x_start: 8,
x_length: 24,
y_unit: sections,
y_property: "section_id",
render:"bar"
});
scheduler.locale.labels.timeline_tab = "Chrono";
scheduler.locale.labels.grid_tab = "Tableau";
scheduler.locale.labels.agenda_tab = "Agenda";
scheduler.setLoadMode("week");
scheduler.locale.labels.section_custom="Assigné à";
scheduler.locale.labels.section_subject = "Objet";
scheduler.config.full_day = true;
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
var a = new Date(1435276686254);
scheduler.config.first_hour = 7;
scheduler.config.last_hour = 19;
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.server_utc = false;
scheduler.config.wide_form = true;
scheduler.config.time_step = 15;
scheduler.config.day_date = "%l %j %M %Y";
var format=scheduler.date.date_to_str("%H:%i");
scheduler.templates.tooltip_text = function(start,end,event) {
var html = '';
if (event.thumbnail){
html += "<div class=\"icarItemPicture\" style=\"background-image:url("+event.thumbnail+");width:32px\"></div>";
}
html += event.text;
if (event.details){
html += '<br/>'+event.details;
}
/* if (event.location){
html += " ("+event.location+")";
}
if (event.organizer){
html += " ; Organisé par "+event.organizer;
}*/
/* if (event.attendees.length>0){
html += " avec "+event.attendees;
} */
return html;
};
scheduler.config.max_month_events = 3;
scheduler.config.container_autoresize = true;
scheduler.config.show_loading = true;
scheduler.config.mark_now = true;
scheduler.config.start_on_monday = true;
scheduler.config.drag_lightbox = true;
scheduler.config.event_duration = 30;
scheduler.config.auto_end_date = true;
scheduler.templates.event_text=function(start,end,item){
var html = '';
if (item.thumbnail){
html += "<a target=\"_blank\" class=\"icarItemPicture lightview\" href=\""+item.media+"\" style=\"background-image:url("+item.thumbnail+");width:32px\" data-lightview-title=\""+item.text+"\" data-lightview-type=\"image\"></a>";
}
if (item.url){
html += "<a href=\""+item.url+"\" target=\"_blank\">"+item.text;
if (item.location){
html += " ("+item.location+")";
}
/* if (task.organizer){
html += " ; Organisé par "+organizer;
} */
html += "</a>";
}else{
html += item.text;
if (item.location){
html += " ("+item.location+")";
}
}
return html;
};
scheduler.templates.event_class=function(start,end,event){
var cssClassNames = "";
if (event.section_id != ''){
cssClassNames = "agenda-"+event.section_id;
}
if (event.categories){
for (var categorie in event.categories) {
cssClassNames += " exch-"+categorie;
}
}
return cssClassNames;
};
scheduler.init('_132_WAR_icar_scheduler', a, "unit");
scheduler.setCurrentView(a, "unit");
scheduler.clearAll();
scheduler.load(["http://icar.agglo-larochelle.fr/group/dsti/accueil?p_p_id=132_WAR_icar&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=load-data&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_132_WAR_icar_agentUid=j.rautureau&_132_WAR_icar_view=week&_132_WAR_icar_publicFolderIds=AQEuAAADGkRzkKpmEc2byACqAC%2FEWgMAOBET9tvnPkCLIRVx91C%2BQAAAAVx78gAAAA%3D%3D&_132_WAR_icar_type=publicFolder","http://icar.agglo-larochelle.fr/group/dsti/accueil?p_p_id=132_WAR_icar&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=load-data&p_p_cacheability=cacheLevelPage&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2&_132_WAR_icar_agentUid=j.rautureau&_132_WAR_icar_view=week&_132_WAR_icar_publicFolderIds=AQEuAAADGkRzkKpmEc2byACqAC%2FEWgMAOBET9tvnPkCLIRVx91C%2BQAAAAVx79QAAAA%3D%3D&_132_WAR_icar_type=publicFolder"], "json");
scheduler.config.readonly = true;
function block_readonly(id){
if (!id) return true;
return !this.getEvent(id).readonly;
}
scheduler.attachEvent("onBeforeDrag",block_readonly);
scheduler.attachEvent("onClick",block_readonly);
}
jQuery(function($){
schedulerInit();
});
</script>
Something wrong ?
Thanks in advance.