var default_url = "https://indico.scc.kit.edu/indico/"; var default_event = 390; function process(ID, result) { if (window.location.href.indexOf("debug")>=0) $('#debug').append("
"+JSON.stringify(result,null,2)+"
"); $("#indico-link").attr("href", default_url+"/event/"+ID) var conf = result['results'][ID]; var list = ""; // Sort the days into the correct order var days = new Array(0); for (var day in conf) days.push([ day, conf[day] ]); days.sort(function(a, b) { return a[0] > b[0]; }); for (var d=0; d "2016/12/06" var date = day.substr(0, 4)+" / "+day.substr(4, 2)+" / "+day.substr(6,2); // Date accordion list += "
"; list += "

"+date+"

"; //list += "
"; var content = days[d][1]; // Sort all slots in a days by startDate/time var slots = new Array(0); for (var slot in content) slots.push([ content[slot].startDate.time, content[slot]]); slots.sort(function(a, b) { return a[0]==b[0] ? 0 : (a[0] > b[0] ? 1 : -1) }); // Loop over all slots (sessions) for (var s=0; s"; //list += "

"+e.startDate.time.substr(0,5)+" ["+e.duration+"'] "+e.title+"

"; //list += "

"+e.startDate.time.substr(0,5)+" - "+e.endDate.time.substr(0,5)+" ["+e.duration+"'] "+e.title+"

"; // ======================================================= list += "
"; // ------------------------------------------------------- list += ""+e.entryType; if (e.location.length+e.room.length>0) { list += ""; list += " ["+e.room; if (e.location.length>0 && e.room.length>0) list += ", "; list += e.location+"]"; list += "" } list += ""; // ------------------------------------------------------- // Sort all entries in a session by startDate/time var entries = new Array(0); for (var entry in e.entries) entries.push([ e.entries[entry].startDate.time, e.entries[entry]]); entries.sort(function(a, b) { return a[0] > b[0]; }); // description, title, material, url, entryType, presenters [] for (var i=0; i"+e.title+""; list += ""; // ------------------------------------------------------- // ------------------------------------------------------- list += ""; var p = e.presenters; for (var j=0; j0) list += " ["+p[j].affiliation+"]"; if (p[j].email && p[j].email.length>0) list += " "; list += "
"; } list += "
"; // presenters list += ""; // ------------------------------------------------------- list += ""+e.description+""; // Abstract // ------------------------------------------------------- // Old version of Indico list += ""; var m = e.material; for (var j=0; j<(m?m.length:0); j++) { list += ""+m[j].title+": "; list += ""; var r = m[j].resources; for (var k=0; k"+r[k].name+""; if (r[k].description.length>0) list += "" + m[k].description + ""; } list += ""; if (m[j].description.length>0) list += " ["+m[j].description+"]"; } list += ""; // indico-contribution-material // ------------------------------------------------------- // Newer version of Indico list += ""; var fi = e.attachments.files; for (var j=0; j<(fi?fi.length:0); j++) { list += ""; list += ""+fi[j].title+""; list += ""; } var fo = e.attachments.folders; //list += ""+fo.title+": "; for (var j=0; j<(fo?fo.length:0); j++) { var g = fo[j].attachments; for (var k=0; k<(g?g.length:0); k++) { list += ""; list += ""+g[k].title+""; list += ""; } } list += ""; // indico-contribution-material // ------------------------------------------------------- list += "
"; // indico-contribution // ======================================================= } list += "
"; // indico-session-body // ======================================================= list += "
"; // collapsible "indico-session" /* "material": [ { "_type": "Slides", "description": "", "title": "Slides", "_fossil": "materialMinimal", "protectionURL": "https://indico.scc.kit.edu/indico/event/215/manage/session/3/contribution/28/material/?returnURL=", "type": "", "id": "slides", "resources": [ { "_type": "LocalFile", "name": "Auger-HEAT.pdf", "url": "https://indico.scc.kit.edu/indico/event/215/session/3/contribution/28/material/slides/0.pdf", "_fossil": "localFileMinimal", "protectionURL": "https://indico.scc.kit.edu/indico/event/215/manage/session/3/contribution/28/material/?returnURL=", "description": "" }*/ // HERE WE NEED TO LOOP OVER THE CONTRIBUTIONS //alert(JSON.stringify(slots[s][1])); //break; // entryType "Session" "Contribution" "Break" // isPoster, // startDate { date, tz } // endDate { date, tz } // duration // contribDuration, // color // textColor, // title // slotTitle // location // room, // conveners [] // material [] // entries { } // url, // pdf // // sessionSlotId // conferenceId // inheritRoom // uniqueid // _fossil "linedTimeSchEntry" // _type "LinkedTimeSchEntry" // sessionCode, // sessionid, // inheritLoc, } //list += ""; // collapsible-set "day" list += ""; // collapsible } $('#list').append(list); $('#list').collapsibleset('refresh'); } function read(json) { var ID = Object.keys(json.results); process(ID, json); $('#footer').css("position", "relative"); $.mobile.loading('hide'); } function onReady() { $.mobile.loading('show', { text: "Loading timetable...", textVisible: true, /* theme: "a", */ }); /*--------------------------------------------------------------------------------------------- Request the timetabel of the indico event we are interested in ----------------------------------------------------------------------------------------------*/ var cmd = window.location.href.split("?")[1]; var ID = cmd ? cmd.split("&").find(function(str){ return str.split("=")[0]=="id"; }) : null; var URL = cmd ? cmd.split("&").find(function(str){ return str.split("=")[0]=="url"; }) : null; if (ID) default_event = ID.split("=")[1]; if (URL) default_url = URL.split("=")[1]; $.getJSON(default_url+"/export/timetable/"+default_event+".jsonp?callback=?"); //$.getJSON(indico_url+"/export/event/"+ID+".jsonp?callback=?"); // json.results[0].title } $('document').ready(onReady);