Changeset 19230


Ignore:
Timestamp:
09/19/18 09:02:05 (6 years ago)
Author:
tbretz
Message:
Now this also works on my mobile device and respects the changes which came with the new indico version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MobileIndico/indico.js

    r19229 r19230  
    11var default_url = "https://indico.scc.kit.edu/indico/";
    2 var default_event = 254;
     2var default_event = 390;
    33
    44function process(ID, result)
     
    1414
    1515    // Sort the days into the correct order
    16     var days = [];
     16    var days = new Array(0);
    1717    for (var day in conf)
    1818        days.push([ day, conf[day] ]);
     
    3434
    3535        // Sort all slots in a days by startDate/time
    36         var slots = [];
     36        var slots = new Array(0);
    3737        for (var slot in content)
    3838            slots.push([ content[slot].startDate.time, content[slot]]);
     
    7171
    7272            // Sort all entries in a session by startDate/time
    73             var entries = [];
     73            var entries = new Array(0);
    7474            for (var entry in e.entries)
    7575                entries.push([ e.entries[entry].startDate.time, e.entries[entry]]);
     
    9999                {
    100100                    list += p[j].name;
    101                     if (p[j].affiliation.length>0)
     101                    if (p[j].affiliation && p[j].affiliation.length>0)
    102102                        list += " ["+p[j].affiliation+"]";
    103                     if (p[j].email.length>0)
     103                    if (p[j].email && p[j].email.length>0)
    104104                        list += " <a class='email' href='email:"+p[j].email+"'>"+p[j].email+"</a>";
     105
    105106                    list += "<br/>";
    106107                }
     
    114115
    115116                // -------------------------------------------------------
     117                // Old version of Indico
     118
    116119                list +=    "<span class='material'>";
    117120                var m = e.material;
    118                 for (var j=0; j<m?m.length:0; j++)
     121                for (var j=0; j<(m?m.length:0); j++)
    119122                {
    120123                    list += "<span class='title'>"+m[j].title+": </span>";
     
    135138                }
    136139                list +=    "</span>"; // indico-contribution-material
     140
     141                // -------------------------------------------------------
     142                // Newer version of Indico
     143
     144                list +=    "<span class='material'>";
     145                var fi = e.attachments.files;
     146                for (var j=0; j<(fi?fi.length:0); j++)
     147                {
     148                    list += "<span class='resources'>";
     149                    list += "<a class='url' href='"+fi[j].download_url+"'>"+fi[j].title+"</a>";
     150                    list += "</span>";
     151                }
     152
     153                var fo = e.attachments.folders;
     154                //list += "<span class='title'>"+fo.title+": </span>";
     155                for (var j=0; j<(fo?fo.length:0); j++)
     156                {
     157                    var g = fo[j].attachments;
     158
     159                    for (var k=0; k<(g?g.length:0); k++)
     160                    {
     161                        list += "<span class='resources'>";
     162                        list += "<a class='url' href='"+g[k].download_url+"'>"+g[k].title+"</a>";
     163                        list += "</span>";
     164                    }
     165                }
     166                list +=    "</span>"; // indico-contribution-material
     167
    137168                // -------------------------------------------------------
    138169
Note: See TracChangeset for help on using the changeset viewer.