modal delete in html title update
authorAnthony Ly <anthonyly.com@gmail.com>
Tue, 28 May 2013 17:42:15 +0200
changeset 55 cedadc7d039a
parent 54 2a7064b70693
child 56 3725e93a2987
modal delete in html title update
integration/edition.html
integration/js/common.js
integration/js/edition.js
integration/liste-projet.html
integration/liste-ressource.html
--- a/integration/edition.html	Tue May 28 16:42:55 2013 +0200
+++ b/integration/edition.html	Tue May 28 17:42:15 2013 +0200
@@ -122,12 +122,12 @@
 								<table class="table">
 									<thead>
 										<tr>
-											<th>Titre</th>
-											<th>Tags</th>
-											<th>Début</th>
-											<th>Durée</th>
-											<th>Fin</th>
-											<th>Actions</th>
+											<th width="100px">Titre</th>
+											<th width="100px">Tags</th>
+											<th width="100px">Début</th>
+											<th width="100px">Durée</th>
+											<th width="100px">Fin</th>
+											<th width="100px">Actions</th>
 										</tr>
 									</thead>
 									<tbody class="list-chapter-rows-wrap">
@@ -504,7 +504,9 @@
 		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 			<h3><i class="icon-warning-sign"></i> Confirmation de la suppression</h3>
 		</div>
-		<div class="modal-body"></div>
+		<div class="modal-body">
+			<p>Êtes-vous sûr de vouloir supprimer <strong class="titleMedia"></strong> ?</p>
+		</div>
 		<div class="modal-footer">
 			<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
 			<button id="btn-delete-modal" class="btn btn-primary">Supprimer</button>
--- a/integration/js/common.js	Tue May 28 16:42:55 2013 +0200
+++ b/integration/js/common.js	Tue May 28 17:42:15 2013 +0200
@@ -42,10 +42,9 @@
     $(document).on('click','.btn-delete', function(e){
         e.preventDefault();
         var titleMedia = $(this).attr('data-title'),
-            textModal = $('<p>Êtes-vous sûr de vouloir supprimer <strong>'+titleMedia+'</strong> ?</p>'),
             urlDelete = $(this).attr('href');
         $("#modal-confirm #btn-delete-modal").attr('href', urlDelete).focus();
-        $("#modal-confirm .modal-body").empty().append(textModal); 
+        $("#modal-confirm .modal-body").find('.titleMedia').text(titleMedia);
         $("#modal-confirm").modal('show');
     });
 
--- a/integration/js/edition.js	Tue May 28 16:42:55 2013 +0200
+++ b/integration/js/edition.js	Tue May 28 17:42:15 2013 +0200
@@ -17,14 +17,38 @@
 };
 
 
+
+
 myProject.onLoad(function() {
 
+
+
+
+//load Annotations
+myProject.getAnnotationsByTypeTitle("annotations");
+
+
     $(".project-title").text(myProject.title);
     
     myMedia = myProject.getCurrentMedia();
-    
+
+//load Chapitre
+var _chapters = myProject.getAnnotationsByTypeTitle("chapitrage");
+if(_chapters.length){
+    $.each(_chapters, function(k, v){
+        var render = false;
+        if((k+1) == _chapters.length){
+            render = true;
+        }
+        newChapter(v, render);
+    });
+}
+
+
+
+
     //chargement des chapitres et annotations existants
-    loadInitChapters();
+  //  loadInitChapters();
     loadInitAnnotation();
 
     IriSP.htmlPlayer(
@@ -266,7 +290,7 @@
 });
 
 //nouveau chapitre
-    function newChapter(dataChapter){
+    function newChapter(dataChapter, render){
         var chapter = new IriSP.Model.Annotation(false, myProject);
             chapter.setMedia(myMedia.id);
             chapter.setBegin(dataChapter.begin);
@@ -277,7 +301,7 @@
             chapter.color = global.colors[(global.colorsIndex<global.colors.length) ? global.colorsIndex++ : (global.colorsIndex=0)];
     
         chapters.push(chapter);
-        renderChapter();
+        if(render){renderChapter();}
         loadFormChapter(chapter.id);
     }
 
@@ -292,7 +316,7 @@
                 keywords : ['tag1','tag2']
             };
 
-        newChapter(dataChapter);
+        newChapter(dataChapter, true);
 
     });
     
--- a/integration/liste-projet.html	Tue May 28 16:42:55 2013 +0200
+++ b/integration/liste-projet.html	Tue May 28 17:42:15 2013 +0200
@@ -136,7 +136,9 @@
 		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 			<h3><i class="icon-warning-sign"></i> Confirmation de la suppression</h3>
 		</div>
-		<div class="modal-body"></div>
+		<div class="modal-body">
+			<p>Êtes-vous sûr de vouloir supprimer <strong class="titleMedia"></strong> ?</p>
+		</div>
 		<div class="modal-footer">
 			<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
 			<a id="btn-delete-modal" class="btn btn-primary">Supprimer</a>
--- a/integration/liste-ressource.html	Tue May 28 16:42:55 2013 +0200
+++ b/integration/liste-ressource.html	Tue May 28 17:42:15 2013 +0200
@@ -204,7 +204,9 @@
 		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 			<h3><i class="icon-warning-sign"></i> Confirmation de la suppression</h3>
 		</div>
-		<div class="modal-body"></div>
+		<div class="modal-body">
+			<p>Êtes-vous sûr de vouloir supprimer <strong class="titleMedia"></strong> ?</p>
+		</div>
 		<div class="modal-footer">
 			<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
 			<a id="btn-delete-modal" class="btn btn-primary">Supprimer</a>