integration/js/edition.js
changeset 42 95e64fb6730f
parent 38 0e6e631718ee
child 48 827066f875c7
equal deleted inserted replaced
41:cc2a710abeaf 42:95e64fb6730f
   384             annotation.title = dataAnnotation.title;
   384             annotation.title = dataAnnotation.title;
   385             annotation.description = dataAnnotation.description;
   385             annotation.description = dataAnnotation.description;
   386             annotation.type = dataAnnotation.type;
   386             annotation.type = dataAnnotation.type;
   387             annotation.color = global.colors[(global.colorsIndex<global.colors.length) ? global.colorsIndex++ : (global.colorsIndex=0)];
   387             annotation.color = global.colors[(global.colorsIndex<global.colors.length) ? global.colorsIndex++ : (global.colorsIndex=0)];
   388             annotation.keywords = dataAnnotation.keywords;
   388             annotation.keywords = dataAnnotation.keywords;
       
   389             annotation.content = getContentAnnotationByType(dataAnnotation.type);
   389 
   390 
   390         annotations.push(annotation);
   391         annotations.push(annotation);
   391         
   392         
   392         return annotation;
   393         return annotation;
   393     }
   394     }
   517             $(tabContent).append(tpl);
   518             $(tabContent).append(tpl);
   518             $('.tab-content').append(tabContent);
   519             $('.tab-content').append(tabContent);
   519 
   520 
   520             //particularité selon type
   521             //particularité selon type
   521             switch(type){
   522             switch(type){
   522                 case 'son':
   523                 case 'sound':
   523                     break;
   524                     break;
   524                 case 'video':
   525                 case 'video':
   525                     break;
   526                     break;
   526                 case 'text': 
   527                 case 'text': 
   527                     var cledit = $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig)[0];
   528                     var cledit = $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig)[0];
   528 
       
   529                     break;
   529                     break;
   530                 case 'html': 
   530                 case 'links': 
   531                     break;
   531                     break;
   532                 case 'lien': 
   532                 case 'slideshow': 
   533                     break;
       
   534                 case 'diaporama': 
       
   535                     $(tabContent).find('.number-spin').spin(spinParam);
   533                     $(tabContent).find('.number-spin').spin(spinParam);
   536                     $(tabContent).find('.ui-sortable').sortable({
   534                     $(tabContent).find('.ui-sortable').sortable({
   537                         stop : function(event, ui){
   535                         stop : function(event, ui){
   538                             disabledBtnSortable($(this));
   536                             disabledBtnSortable($(this));
   539                         }
   537                         }
   551     }//openTab()
   549     }//openTab()
   552 
   550 
   553     function getIcon(type){
   551     function getIcon(type){
   554         var icon;
   552         var icon;
   555         switch(type){
   553         switch(type){
   556             case 'son': icon = 'volume-up';
   554             case 'sound': icon = 'volume-up';
   557                 break;
   555                 break;
   558             case 'video': icon = 'film';
   556             case 'video': icon = 'film';
   559                 break;
   557                 break;
   560             case 'text': 
   558             case 'text': 
   561                 icon = 'align-left';
   559                 icon = 'align-left';
   562                 break;
   560                 break;
   563             case 'html': icon = 'code';
   561             case 'html': icon = 'code';
   564                 break;
   562                 break;
   565             case 'lien': icon = 'link';
   563             case 'links': icon = 'link';
   566                 break;
   564                 break;
   567             case 'diaporama': icon = 'picture';
   565             case 'slideshow': icon = 'picture';
   568                 break;
   566                 break;
   569         }
   567         }
   570         return icon;
   568         return icon;
   571     }
   569     }
   572 
   570 
   733         }
   731         }
   734     };
   732     };
   735 
   733 
   736 }
   734 }
   737 
   735 
   738 //content annotations
   736 function getContentAnnotationByType(type){
   739 var contentAnnotationText = {
   737     var content;
   740     mimetype : "application/x-ldt-text",
   738     switch(type){
   741     markup : "html",
   739         case 'sound':
   742     text : ""
   740             content = {
   743 };
   741                 mimetype : "application/x-ldt-sound",
   744 
   742                 url : "",
   745 var contentAnnotationLinks = {
   743                 embedcode : ""
   746     mimetype : "application/x-ldt-links",
   744             };
   747     markup : "html",
   745             break;
   748     links : []
   746         case 'video':
   749 };
   747             content = {
   750 
   748                 mimetype : "application/x-ldt-video",
   751 var contentAnnotationVideo = {
   749                 url : "",
   752     mimetype : "application/x-ldt-video",
   750                 embedcode : ""
   753     url : "",
   751             };
   754     embedcode : ""
   752             break;
   755 };
   753         case 'text': 
   756 
   754             content = {
   757 var contentAnnotationSon = {
   755                 mimetype : "application/x-ldt-text",
   758     mimetype : "application/x-ldt-sound",
   756                 markup : "html",
   759     url : "",
   757                 text : ""
   760     embedcode : ""
   758             };
   761 };
   759             break;
   762 
   760         case 'links': 
   763 var contentAnnotationDiaporama = {
   761             content = {
   764     mimetype : "application/x-ldt-slideshow",
   762                 mimetype : "application/x-ldt-links",
   765     duration : 1,
   763                 markup : "html",
   766     autostart : false,
   764                 links : []
   767     images : []
   765             };
   768 };
   766             break;
       
   767         case 'slideshow': 
       
   768             content = {
       
   769                 mimetype : "application/x-ldt-slideshow",
       
   770                 duration : 1,
       
   771                 autostart : false,
       
   772                 images : []
       
   773             };
       
   774             break;
       
   775     }
       
   776     return content;
       
   777 }//getContentAnnotationByType
       
   778 
   769 
   779 
   770 //test
   780 //test
   771 a = $(".wysiwyg").cleditor(wysiwygConfig);
   781 a = $(".wysiwyg").cleditor(wysiwygConfig);
   772 
   782 
   773 
   783