url plugins on html
authorAnthony Ly <anthonyly.com@gmail.com>
Thu, 16 May 2013 17:42:41 +0200
changeset 16 c66274d0d850
parent 14 9fd6247d8c87
child 17 c72a9f9cb519
url plugins on html
integration/edition.html
integration/home.html
integration/js/edition.js
integration/js/projet.js
integration/liste-projet.html
integration/liste-ressource.html
integration/modal-video.html
--- a/integration/edition.html	Thu May 16 15:48:26 2013 +0200
+++ b/integration/edition.html	Thu May 16 17:42:41 2013 +0200
@@ -447,37 +447,20 @@
 	<script src="js/common.js"></script>
     <script src="js/edition.js"></script>
     <script>
+    var spinParam = {
+	    imageBasePath :'lib/spin/img/',
+	    max:60,
+	    min:0
+	};
+
     /* Initialisation du metadataplayer avec un projet vide */
-    
     var myDir = new IriSP.Model.Directory(),
         myProject = myDir.remoteSource({
                 url: "data/empty-project.json",
                 serializer: IriSP.serializers.ldt
-            });
-    
-    myProject.onLoad(function() {
-        
-        $(".project-title").text(myProject.title);
-        
-        var myMedia = myProject.getCurrentMedia();
-        
-        IriSP.htmlPlayer(
-            myMedia,
-            $(".main-video"),
-            {
-                width: 460,
-                height: 345,
-                controls: true,
-                autostart: true
-            }
-        );
-        
-        myMedia.on("timeupdate", function(t) {
-            var pos = $(".chapitre-cut-wrap").width() * t / myMedia.duration;
-            $(".indicateur-chapter").css("left",pos);
-        });
-        
-    });
+            }),
+        myMedia = null;
+
     </script>
 </body>
 </html>
\ No newline at end of file
--- a/integration/home.html	Thu May 16 15:48:26 2013 +0200
+++ b/integration/home.html	Thu May 16 17:42:41 2013 +0200
@@ -150,5 +150,13 @@
 	
 	<script src="js/common.js"></script>
 	<script src="js/home.js"></script>
+
+	<script>
+	var spinParam = {
+	    imageBasePath :'lib/spin/img/',
+	    max:60,
+	    min:0
+	};
+	</script>
 </body>
 </html>
\ No newline at end of file
--- a/integration/js/edition.js	Thu May 16 15:48:26 2013 +0200
+++ b/integration/js/edition.js	Thu May 16 17:42:41 2013 +0200
@@ -3,7 +3,47 @@
 var global = {
     diaporama : null,
     idAnnotation : null
-};
+},
+chapitres = {},
+annotations = {};
+
+//onLoad
+myProject.onLoad(function() {
+
+    $(".project-title").text(myProject.title);
+    
+    myMedia = myProject.getCurrentMedia();
+    
+    IriSP.htmlPlayer(
+        myMedia,
+        $(".main-video"),
+        {
+            width: 460,
+            height: 345,
+            controls: true,
+            autostart: true
+        }
+    );
+
+    myMedia.on("timeupdate", function(t) {
+
+        //curseur chapitre
+        var pos = $(".chapitre-cut-wrap").width() * t / myMedia.duration,
+            wContainer = $('.chapitre-cut-wrap').width(),
+            btnCutChapter = $('.btn-cut-chapter'),
+            wBtnCutChapter = btnCutChapter.outerWidth();
+            
+        $(".indicateur-chapter").css("left",pos);
+        if(pos+wBtnCutChapter>wContainer){
+            btnCutChapter.css("left",(pos - wBtnCutChapter));
+        }else{
+            btnCutChapter.css("left",pos);
+        }
+            
+    });
+    
+});//myProject.onLoad
+
 
 //modal
     $(document).on('click', 'a.open-modal', function(e){
@@ -109,6 +149,7 @@
     //nouveau chapitre
     $('.chapter-widget').on('click', '.btn-cut-chapter', function(e){
         e.preventDefault();
+
         var uniqId = 'id' + (new Date()).getTime();
         $.get('template.html', function(templates){
             var viewChapterRow = {
@@ -261,11 +302,7 @@
 });
 
 //annotation > diaporama (spin)
-var spinParam = {
-    imageBasePath :'lib/spin/img/',
-    max:60,
-    min:0
-};
+
 
 //config
 //CLEditor annotation > text (wysiwyg)
@@ -371,4 +408,4 @@
 
 $('#annotation-tab a:last-child').tab('show');
 
-});
\ No newline at end of file
+});//ready
\ No newline at end of file
--- a/integration/js/projet.js	Thu May 16 15:48:26 2013 +0200
+++ b/integration/js/projet.js	Thu May 16 17:42:41 2013 +0200
@@ -6,7 +6,7 @@
 
 //ZeroClipboard (fonctionne sous localhost)
     var clip = new ZeroClipboard( $('.clipboard'), {
-      moviePath: "lib/ZeroClipboard/ZeroClipboard.swf"
+      moviePath: ZeroClipboardMoviePath
     });
     clip.on( 'complete', function(client, args) {
       alert("Copied text to clipboard: " + args.text );
--- a/integration/liste-projet.html	Thu May 16 15:48:26 2013 +0200
+++ b/integration/liste-projet.html	Thu May 16 17:42:41 2013 +0200
@@ -150,6 +150,8 @@
 
 	<script src="js/common.js"></script>
 	<script src="js/projet.js"></script>
-
+	<script>
+		var ZeroClipboardMoviePath = "lib/ZeroClipboard/ZeroClipboard.swf";
+	</script>
 </body>
 </html>
\ No newline at end of file
--- a/integration/liste-ressource.html	Thu May 16 15:48:26 2013 +0200
+++ b/integration/liste-ressource.html	Thu May 16 17:42:41 2013 +0200
@@ -218,5 +218,12 @@
 
 	<script src="js/common.js"></script>
 	<script src="js/ressource.js"></script>
+	<script>
+	var spinParam = {
+	    imageBasePath :'lib/spin/img/',
+	    max:60,
+	    min:0
+	};
+	</script>
 </body>
 </html>
\ No newline at end of file
--- a/integration/modal-video.html	Thu May 16 15:48:26 2013 +0200
+++ b/integration/modal-video.html	Thu May 16 17:42:41 2013 +0200
@@ -44,9 +44,5 @@
 	</div>
 </div>
 <script type="text/javascript">
-$('.select-duration .number-spin').spin({
-    imageBasePath :'lib/spin/img/',
-    max:60,
-    min:0
-});
+$('.select-duration .number-spin').spin(spinParam);
 </script>
\ No newline at end of file