src/js/widgets/polemicWidget.js
branchpopcorn-port
changeset 631 70e6ec9d9f65
parent 624 177dfeacc7a6
child 648 431b3495f958
equal deleted inserted replaced
630:7c53857650b1 631:70e6ec9d9f65
   136         if (typeof(view_type) === "undefined") {
   136         if (typeof(view_type) === "undefined") {
   137           // default to guessing if nothing else works.
   137           // default to guessing if nothing else works.
   138           var view = json.views[0];
   138           var view = json.views[0];
   139           
   139           
   140           if(typeof(view.annotation_types) !== "undefined") {
   140           if(typeof(view.annotation_types) !== "undefined") {
   141             if (view.annotation_types.length > 1) {
   141             /* we need to be backward compatible with the old files which used to
       
   142                feature only two lines : Chapitrage and Tweets. We've added a
       
   143                "Contributions" line so we need to discriminate against that */
       
   144             if (view.annotation_types.length === 2 && typeof(this._serializer.getContributions()) === "undefined") {
   142               var view_type = view.annotation_types[1];
   145               var view_type = view.annotation_types[1];
   143             } else {
   146             } else {
   144               console.log("PolemicWidget: invalid file - minimizing");
   147               console.log("PolemicWidget: invalid file - minimizing");
   145               return;
   148               return;
   146             }
   149             }