integration/js/edition.js
changeset 38 0e6e631718ee
parent 36 4c2428524c22
child 42 95e64fb6730f
equal deleted inserted replaced
37:d6fa8041a90b 38:0e6e631718ee
   137     //video
   137     //video
   138     $('.popup').on('click', '.bibliotheque-video a', function(e){
   138     $('.popup').on('click', '.bibliotheque-video a', function(e){
   139         e.preventDefault();
   139         e.preventDefault();
   140         $('.popup').modal('hide');
   140         $('.popup').modal('hide');
   141         $.get('template.html', function(templates){
   141         $.get('template.html', function(templates){
   142             var videoWrap = $('#'+global.idAnnotation).find('.annotation-video-content'),
   142             var videoWrap = $('#tab-'+global.idAnnotation).find('.annotation-video-content'),
   143                 tplVideo = $(templates).filter('#tpl-video-row').html();
   143                 tplVideo = $(templates).filter('#tpl-video-row').html();
       
   144                 console.log(videoWrap)
   144             videoWrap.empty().append(tplVideo);
   145             videoWrap.empty().append(tplVideo);
   145         });
   146         });
   146         
   147         
   147     });
   148     });
   148     //image
   149     //image
   521                 case 'son':
   522                 case 'son':
   522                     break;
   523                     break;
   523                 case 'video':
   524                 case 'video':
   524                     break;
   525                     break;
   525                 case 'text': 
   526                 case 'text': 
   526                     $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig);
   527                     var cledit = $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig)[0];
       
   528 
   527                     break;
   529                     break;
   528                 case 'html': 
   530                 case 'html': 
       
   531                     break;
       
   532                 case 'lien': 
   529                     break;
   533                     break;
   530                 case 'diaporama': 
   534                 case 'diaporama': 
   531                     $(tabContent).find('.number-spin').spin(spinParam);
   535                     $(tabContent).find('.number-spin').spin(spinParam);
   532                     $(tabContent).find('.ui-sortable').sortable({
   536                     $(tabContent).find('.ui-sortable').sortable({
   533                         stop : function(event, ui){
   537                         stop : function(event, ui){
   554             case 'video': icon = 'film';
   558             case 'video': icon = 'film';
   555                 break;
   559                 break;
   556             case 'text': 
   560             case 'text': 
   557                 icon = 'align-left';
   561                 icon = 'align-left';
   558                 break;
   562                 break;
   559             case 'html': icon = 'link';
   563             case 'html': icon = 'code';
       
   564                 break;
       
   565             case 'lien': icon = 'link';
   560                 break;
   566                 break;
   561             case 'diaporama': icon = 'picture';
   567             case 'diaporama': icon = 'picture';
   562                 break;
   568                 break;
   563         }
   569         }
   564         return icon;
   570         return icon;
   638         htmlTextarea = $(this).parents('.edit-annotation-html').find('textarea');
   644         htmlTextarea = $(this).parents('.edit-annotation-html').find('textarea');
   639 
   645 
   640     apercuWrap.empty().html(htmlTextarea.val());
   646     apercuWrap.empty().html(htmlTextarea.val());
   641 });
   647 });
   642 
   648 
       
   649 //annotation texte
       
   650 $(document).on('keyup', ".cleditorMain iframe", function(){
       
   651 
       
   652     var v = $(this).text(); // or .html() if desired
       
   653     $('#x').html(v);
       
   654 });
   643 //annotation > diaporama (spin)
   655 //annotation > diaporama (spin)
   644 
   656 
   645 
   657 
   646 //################ config
   658 //################ config
   647 
   659 
   669 //http://premiumsoftware.net/cleditor/docs/GettingStarted.html#optionalParameters
   681 //http://premiumsoftware.net/cleditor/docs/GettingStarted.html#optionalParameters
   670 var wysiwygConfig = {
   682 var wysiwygConfig = {
   671     width:        456, 
   683     width:        456, 
   672     height:       250, 
   684     height:       250, 
   673     controls:     "bold italic underline strikethrough | font size " +
   685     controls:     "bold italic underline strikethrough | font size " +
   674                     "style | color highlight removeformat | bullets numbering | outdent ",
   686                     "style | color highlight removeformat | bullets numbering | source",
   675     fonts:        "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
   687     fonts:        "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
   676                     "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
   688                     "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
   677     sizes:        "1,2,3,4,5,6,7",
   689     sizes:        "1,2,3,4,5,6,7",
   678     styles:       [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
   690     styles:       [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
   679                     ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
   691                     ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
   680                     ["Header 6","<h6>"]],
   692                     ["Header 6","<h6>"]],
   681     docType:      '<!DOCTYPE HTML>',
   693     docType:      '<!DOCTYPE HTML>',
   682     bodyStyle:    "margin:0; font-family: 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;"
   694     bodyStyle:    "margin:0; font-family: 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;",
       
   695     updateTextArea : function(text){
       
   696 
       
   697         return text;
       
   698     },
       
   699     updateFrame: function(text){
       
   700   
       
   701         return text;
       
   702     }
   683 };
   703 };
   684 
   704 
   685 //slider
   705 //slider
   686 function configSlider(data){
   706 function configSlider(data){
   687 
   707 
   713         }
   733         }
   714     };
   734     };
   715 
   735 
   716 }
   736 }
   717 
   737 
       
   738 //content annotations
       
   739 var contentAnnotationText = {
       
   740     mimetype : "application/x-ldt-text",
       
   741     markup : "html",
       
   742     text : ""
       
   743 };
       
   744 
       
   745 var contentAnnotationLinks = {
       
   746     mimetype : "application/x-ldt-links",
       
   747     markup : "html",
       
   748     links : []
       
   749 };
       
   750 
       
   751 var contentAnnotationVideo = {
       
   752     mimetype : "application/x-ldt-video",
       
   753     url : "",
       
   754     embedcode : ""
       
   755 };
       
   756 
       
   757 var contentAnnotationSon = {
       
   758     mimetype : "application/x-ldt-sound",
       
   759     url : "",
       
   760     embedcode : ""
       
   761 };
       
   762 
       
   763 var contentAnnotationDiaporama = {
       
   764     mimetype : "application/x-ldt-slideshow",
       
   765     duration : 1,
       
   766     autostart : false,
       
   767     images : []
       
   768 };
       
   769 
   718 //test
   770 //test
   719 $(".wysiwyg").cleditor(wysiwygConfig);
   771 a = $(".wysiwyg").cleditor(wysiwygConfig);
       
   772 
   720 
   773 
   721 $('.number-spin').spin(spinParam);
   774 $('.number-spin').spin(spinParam);
   722 
   775 
   723 disabledBtnSortable($('.ui-sortable'))
   776 disabledBtnSortable($('.ui-sortable'))
   724 $('.ui-sortable').sortable({
   777 $('.ui-sortable').sortable({