tutorial in editor (mechanics only)
authorJan Szejko <janek37@gmail.com>
Wed, 22 Mar 2017 16:03:29 +0000 (17:03 +0100)
committerJan Szejko <janek37@gmail.com>
Wed, 22 Mar 2017 16:03:52 +0000 (17:03 +0100)
apps/wiki/static/wiki/editor
apps/wiki/templates/wiki/bootstrap.html
redakcja/static/js/catalogue/catalogue.js

index 18d3b92..75e12ca 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 18d3b922d43d185d122e1ac9d86e827c67f9e126
+Subproject commit 75e12ca1b25cdcdb457ee2a159a0bf4287841c63
index b6fdf06..cdbb426 100644 (file)
             <script type="text/javascript">less = {relativeUrls: true};</script>
             <script src="{% static 'wiki/editor/libs/less-1.3.3.min.js' %}"></script>
             <script src="{% static 'wiki/editor/libs/require.js' %}" data-main="{% static 'wiki/editor/src/editor/entrypoint.js' %}" ></script>
+            <script src="{% static 'wiki/editor/libs/jquery-1.9.1.min.js' %}"></script>
+            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
         {% else %}
             <link href="{% static 'wiki/build/rng.css' %}" rel="stylesheet">
             <script src="{% static 'wiki/build/rng.js' %}"></script>
         {% endif %}
+        <script src="{% static 'js/catalogue/catalogue.js' %}"></script> {# for tutorial #}
     </head>
     <body>
         <script type="text/javascript">
                     fields: [
                     ],
                     revision_field_name: '{{forms.text_publish.revision.html_name}}'
-                }
+                },
 
+                tutorial: [
+                    {name: 'editor', text: 'e'},
+                    {name: 'sourceEditor', text: 's'},
+                    {name: 'history', text: 's'},
+                    {name: 'switchToHeader', text: 's'},
+                    {name: 'switchToParagraph', text: 's'},
+                    {name: 'switchToImage', text: 's'},
+                    {name: 'switchToVideo', text: 's'},
+                    {name: 'toggleBulletList', text: 's'},
+                    {name: 'toggleEnumList', text: 's'},
+                    {name: 'emphasis', text: 's'},
+                    {name: 'cite', text: 's'},
+                    {name: 'link', text: 's'},
+                    {name: 'showMetadataEditor', text: 's'},
+                    {name: 'preview', text: 's'},
+                    {name: 'attachments', text: 's'},
+                    {name: 'draft', text: 's'},
+                    {name: 'comment', text: 's'}, // needs to be set manually in comments.html :(
+                    {name: 'save', text: 's'},
+                    {name: 'mainpage', text: 's'},
+                    {name: 'exit', text: 's'}
+                ]
             };
 
             {% if can_pubmark %}
index cb96d11..33764a7 100755 (executable)
             start = null;
             var all_tutorial = $('[data-toggle="tutorial"]');
 
+            function sortKey(a) {
+                return parseInt($(a).attr('data-tutorial'));
+            }
             tutorial = $.makeArray(all_tutorial.sort(
-                function(a, b) {return $(a).attr('data-tutorial') < $(b).attr('data-tutorial') ? -1 : 1}
+                function(a, b) {return sortKey(a) < sortKey(b) ? -1 : 1}
             ));
 
+            console.log($(tutorial[0]).data('popover'));
+            console.log($(tutorial[16]).data('popover'));
             if (first_reset) {
                 $.each(tutorial, function(i, e) {
                     var but = (i < tutorial.length - 1) ? '>>' : 'OK';
         function tuton() {
             sessionStorage.setItem("tutorial", "on");
             tutreset();
-            $('#tutModal').modal('show');
+            var $tutModal = $('#tutModal');
+            if($tutModal.length === 0) {
+                tut();
+            } else {
+                $tutModal.modal('show');
+            }
             return false;
         }
         function tutoff() {