integration/js/edition.js
changeset 38 0e6e631718ee
parent 36 4c2428524c22
child 42 95e64fb6730f
--- a/integration/js/edition.js	Fri May 24 17:24:11 2013 +0200
+++ b/integration/js/edition.js	Mon May 27 15:24:46 2013 +0200
@@ -139,8 +139,9 @@
         e.preventDefault();
         $('.popup').modal('hide');
         $.get('template.html', function(templates){
-            var videoWrap = $('#'+global.idAnnotation).find('.annotation-video-content'),
+            var videoWrap = $('#tab-'+global.idAnnotation).find('.annotation-video-content'),
                 tplVideo = $(templates).filter('#tpl-video-row').html();
+                console.log(videoWrap)
             videoWrap.empty().append(tplVideo);
         });
         
@@ -523,10 +524,13 @@
                 case 'video':
                     break;
                 case 'text': 
-                    $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig);
+                    var cledit = $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig)[0];
+
                     break;
                 case 'html': 
                     break;
+                case 'lien': 
+                    break;
                 case 'diaporama': 
                     $(tabContent).find('.number-spin').spin(spinParam);
                     $(tabContent).find('.ui-sortable').sortable({
@@ -556,7 +560,9 @@
             case 'text': 
                 icon = 'align-left';
                 break;
-            case 'html': icon = 'link';
+            case 'html': icon = 'code';
+                break;
+            case 'lien': icon = 'link';
                 break;
             case 'diaporama': icon = 'picture';
                 break;
@@ -640,6 +646,12 @@
     apercuWrap.empty().html(htmlTextarea.val());
 });
 
+//annotation texte
+$(document).on('keyup', ".cleditorMain iframe", function(){
+
+    var v = $(this).text(); // or .html() if desired
+    $('#x').html(v);
+});
 //annotation > diaporama (spin)
 
 
@@ -671,7 +683,7 @@
     width:        456, 
     height:       250, 
     controls:     "bold italic underline strikethrough | font size " +
-                    "style | color highlight removeformat | bullets numbering | outdent ",
+                    "style | color highlight removeformat | bullets numbering | source",
     fonts:        "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
                     "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
     sizes:        "1,2,3,4,5,6,7",
@@ -679,7 +691,15 @@
                     ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
                     ["Header 6","<h6>"]],
     docType:      '<!DOCTYPE HTML>',
-    bodyStyle:    "margin:0; font-family: 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;"
+    bodyStyle:    "margin:0; font-family: 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;",
+    updateTextArea : function(text){
+
+        return text;
+    },
+    updateFrame: function(text){
+  
+        return text;
+    }
 };
 
 //slider
@@ -715,8 +735,41 @@
 
 }
 
+//content annotations
+var contentAnnotationText = {
+    mimetype : "application/x-ldt-text",
+    markup : "html",
+    text : ""
+};
+
+var contentAnnotationLinks = {
+    mimetype : "application/x-ldt-links",
+    markup : "html",
+    links : []
+};
+
+var contentAnnotationVideo = {
+    mimetype : "application/x-ldt-video",
+    url : "",
+    embedcode : ""
+};
+
+var contentAnnotationSon = {
+    mimetype : "application/x-ldt-sound",
+    url : "",
+    embedcode : ""
+};
+
+var contentAnnotationDiaporama = {
+    mimetype : "application/x-ldt-slideshow",
+    duration : 1,
+    autostart : false,
+    images : []
+};
+
 //test
-$(".wysiwyg").cleditor(wysiwygConfig);
+a = $(".wysiwyg").cleditor(wysiwygConfig);
+
 
 $('.number-spin').spin(spinParam);