src/hdalab/templates/renkan_edit.html
changeset 675 d68e7b3a2e4f
parent 647 37220b1a35e2
child 676 111906d4c8b0
--- a/src/hdalab/templates/renkan_edit.html	Mon Apr 04 17:04:14 2016 +0200
+++ b/src/hdalab/templates/renkan_edit.html	Thu Mar 31 14:13:00 2016 +0200
@@ -11,10 +11,15 @@
         <link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/additionnal_renkan.css' %}" />
         <link rel="stylesheet" type="text/css" href="{% static 'hdalab/lib/bjqs.css' %}" />
         <link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/login.css' %}" />
+        <link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/renkan_video.css' %}" />
+        <link rel="stylesheet" type="text/css" href="{% static 'hdalab/lib/video-js-5.8.6/video-js.css' %}" />
 {% endblock %}
 
 {% block js_import %}
 {{block.super}}
+        <!-- video-js IE8 support -->
+        <script src="{% static 'hdalab/lib/video-js-5.8.6/ie8/videojs-ie8.min.js' %}"></script>
+        <script src="{% static 'hdalab/lib/video-js-5.8.6/video.min.js' %}"></script>
         <script src="{% static 'hdalab/lib/bjqs-1.3.min.js' %}"></script>
         <script src="{% static 'renkanmanager/lib/jquery-ui/jquery-ui.js' %}"></script>
         <script src="{% static 'renkanmanager/lib/jquery-mousewheel/jquery.mousewheel.js' %}"></script>
@@ -23,16 +28,16 @@
         <script src="{% static 'renkanmanager/lib/backbone-relational/backbone-relational.js' %}"></script>
         <script src="{% static 'renkanmanager/lib/paper/paper-full.js' %}"></script>
         <script type="text/javascript">
-            var require = {
-                baseUrl: "{% static 'renkanmanager/lib/' %}"
-            };
+             var require = {
+                 baseUrl: "{% static 'renkanmanager/lib/' %}"
+             };
         </script>
         <script src="{% static 'renkanmanager/lib/requirejs/require.js' %}"></script>
         <script src="{% static 'renkanmanager/lib/renkan/js/renkan.js' %}"></script>
         <script src="{% static 'hdalab/js/renkan-manual-save.js' %}"></script>
         <script src="{% static 'hdalab/js/hdalab-renkan-bins.js' %}"></script>
         <script type="text/javascript">
-            var io_options = {}, dialog=false, _rkn;
+        	var io_options = {}, dialog=false, _rkn;
             _.extend(Rkns.i18n.fr, {"Search in Bins": "Rechercher dans les résultats"});
             function startRenkan(){
                 var _renkan = new Rkns.Renkan({
@@ -107,94 +112,123 @@
 
                 _rkn = _renkan;
             };
-
-            $(function() {
-                var form;
-
-                dialog = $( "#dialog-form" ).dialog({
-                    autoOpen: false,
-                    width: 520,
-                    modal: true,
-                    create: function (event, ui) {
-                        $("#login-popup-close").click(function(){
-                            dialog.dialog("close");
-                        });
-                    }
-                });
+            
+            // Closure to fix require.js import mismatch
+			//(function($){
+			    $(function() {
+	                var form;
+	                dialog = $( "#dialog-form" ).dialog({
+	                    autoOpen: false,
+	                    width: 520,
+	                    modal: true,
+	                    create: function (event, ui) {
+	                        $("#login-popup-close").click(function(){
+	                            dialog.dialog("close");
+	                        });
+	                    }
+	                });
 
-                function manageLoginForm(e, form){
-                    e.preventDefault();
-                    f = $(form);
-                    $.ajax({
-                        type: f.attr("method"),
-                        url: f.attr("action"),
-                        data: f.serialize(),
-                        success: function(data, textStatus, jqXHR) {
-                            var d = $(data);
-                            if(d.hasClass("ok")){
-                                io_options.login_user = true;
-                                io_options.user_id= d.attr("id");
-                                io_options.user_name= $("#username",d).html();
-                                io_options.user_authenticated = true;
+	                function manageLoginForm(e, form){
+	                    e.preventDefault();
+	                    f = $(form);
+	                    $.ajax({
+	                        type: f.attr("method"),
+	                        url: f.attr("action"),
+	                        data: f.serialize(),
+	                        success: function(data, textStatus, jqXHR) {
+	                            var d = $(data);
+	                            if(d.hasClass("ok")){
+	                                io_options.login_user = true;
+	                                io_options.user_id= d.attr("id");
+	                                io_options.user_name= $("#username",d).html();
+	                                io_options.user_authenticated = true;
+
+	                                _rkn.setCurrentUser(io_options.user_id, io_options.user_name);
+	                                $("#menu.profile").html(d.html());
+	                                $(".Rk-Save-Button").click();
+	                                dialog.dialog( "close" );
+	                                return true;
+	                            }
+	                            $("#dialog-form").html(data);
+	                            // in case, login failed, we reassign the behaviour
+	                            form = dialog.find( "form" ).on( "submit", function( event ) {
+	                                manageLoginForm(event, this);
+	                            });
+	                            $("#login-popup-close").click(function(){
+	                                dialog.dialog("close");
+	                            });
+	                        }
+	                    });
+	                }
+
+	                form = dialog.find( "form" ).on( "submit", function( event ) {
+	                    manageLoginForm(event, this);
+	                });
 
-                                _rkn.setCurrentUser(io_options.user_id, io_options.user_name);
-                                $("#menu.profile").html(d.html());
-                                $(".Rk-Save-Button").click();
-                                dialog.dialog( "close" );
-                                return true;
-                            }
-                            $("#dialog-form").html(data);
-                            // in case, login failed, we reassign the behaviour
-                            form = dialog.find( "form" ).on( "submit", function( event ) {
-                                manageLoginForm(event, this);
-                            });
-                            $("#login-popup-close").click(function(){
-                                dialog.dialog("close");
-                            });
-                        }
-                    });
-                }
-
-                form = dialog.find( "form" ).on( "submit", function( event ) {
-                    manageLoginForm(event, this);
-                });
+	              //help dialog init
+	                var help_dialog = $( "#help-container" ).dialog({
+	                    autoOpen: false,
+	                    height: 330,
+	                    width: 880,
+	                    resizable: false,
+	                    draggable: false,
+	                    create: function (event, ui) {
+	                        var help_slideshow = $('#help-slideshow').bjqs({
+	                            responsive:false,
+	                            height: 320,
+	                            width: 870,
+	                            animtype: 'slide',
+	                            showcontrols: true,
+	                            centercontrols: false,
+	                             nexttext: "",
+	                             prevtext: "",
+	                             showmarkers : false,
+	                             automatic: false
+	                        });
 
-              //help dialog init
-                var help_dialog = $( "#help-container" ).dialog({
-                    autoOpen: false,
-                    height: 330,
-                    width: 880,
-                    resizable: false,
-                    draggable: false,
-                    create: function (event, ui) {
-                        var help_slideshow = $('#help-slideshow').bjqs({
-                            responsive:false,
-                            height: 320,
-                            width: 870,
-                            animtype: 'slide',
-                            showcontrols: true,
-                            centercontrols: false,
-                             nexttext: "",
-                             prevtext: "",
-                             showmarkers : false,
-                             automatic: false
-                        });
+	                        $("#toggle-help").click(function(){
+	                            if (help_dialog.dialog("isOpen")){
+	                                help_dialog.dialog("close");
+	                            }
+	                            else{
+	                                help_dialog.dialog("open");
+	                            }
+	                        });
+	                        
+	                        
+	                        
+	                        $(".img-close").click(function(){
+	                            help_dialog.dialog("close");
+	                        });
+	                    }
+	                });
+	              
+	              //video dialog init
+	                var video_dialog = $("#video-container").dialog({
+	                    autoOpen: false,
+	                    height: 680,
+	                    width: 820,
+	                    resizable: false,
+	                    draggable: false,
+	                    create: function (event, ui) {
+	                        $("#toggle-video").click(function(){
+	                            if (video_dialog.dialog("isOpen")){
+	                                video_dialog.dialog("close");
+	                            }
+	                            else{
+	                                video_dialog.dialog("open");
+	                            }
+	                        });
+	                        
+	                        $(".video-close").click(function(){
+	                            video_dialog.dialog("close");
+	                        });
+	                    }
+	                });
 
-                        $("#toggle-help").click(function(){
-                            if (help_dialog.dialog("isOpen")){
-                                help_dialog.dialog("close");
-                            }
-                            else{
-                                help_dialog.dialog("open");
-                            }
-                        });
-                        $(".img-close").click(function(){
-                            help_dialog.dialog("close");
-                        });
-                    }
-                });
-            });
-
+	            });
+			//})($.noConflict());
+            // end closure
         </script>
 {% endblock %}
 
@@ -225,6 +259,7 @@
             </li>
         </ul>
         {% endif %}
+        <a id="toggle-video" href="#"></a>
         <a id="toggle-help" href="#"></a>
     </div>
 </div>
@@ -236,6 +271,10 @@
     {% include 'help_popup.html' %}
 </div>
 
+<div id="video-container" class="">
+    {% include 'video_popup.html' %}
+</div>
+
 <div class="rnk-wrapper">
   <div class="rnk-container">
     <div id="renkan"></div>