Browse code

Fix raw output

Benjamin Roth authored on11/01/2023 11:24:03
Showing1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
             var signpost;
5 5
 
6 6
             signpost = new jBox('Modal', {
7
-                {{ (modal_configuration.modal_title) ? 'title: \'' ~ modal_configuration.modal_title ~ '\',' : '' }}
7
+                {{ (modal_configuration.modal_title) ? ('title: \'' ~ modal_configuration.modal_title ~ '\',')|raw : '' }}
8 8
                 content: $('#modal-content-{{ modal_configuration.id }}').html(),
9 9
                 closeButton: '{{ (modal_configuration.modal_title) ? 'title' : 'box' }}',
10 10
                 width: 650,
Browse code

Add borderless option and also do not show title if modal title is empty

Benjamin Roth authored on11/01/2023 11:17:28
Showing1 changed files
... ...
@@ -4,11 +4,11 @@
4 4
             var signpost;
5 5
 
6 6
             signpost = new jBox('Modal', {
7
-                title: '{{ (modal_configuration.modal_title) ?: '' }}',
7
+                {{ (modal_configuration.modal_title) ? 'title: \'' ~ modal_configuration.modal_title ~ '\',' : '' }}
8 8
                 content: $('#modal-content-{{ modal_configuration.id }}').html(),
9
-                closeButton: 'title',
9
+                closeButton: '{{ (modal_configuration.modal_title) ? 'title' : 'box' }}',
10 10
                 width: 650,
11
-                theme: 'DurbachLight'{% if not modal_configuration.show_once is empty %},
11
+                theme: '{{ (modal_configuration.borderless) ? 'Borderless' : '' }}'{% if not modal_configuration.show_once is empty %},
12 12
                 onClose: function() {
13 13
                     localStorage.setItem('popState-{{ modal_configuration.id }}',Date.now());
14 14
                     sessionStorage.setItem('popState-{{ modal_configuration.id }}','shown');
Browse code

Finalize module and also provide content element

Benjamin Roth authored on10/01/2023 21:52:20
Showing1 changed files
... ...
@@ -0,0 +1,32 @@
1
+<script>
2
+    (function($) {
3
+        $(document).ready(function() {
4
+            var signpost;
5
+
6
+            signpost = new jBox('Modal', {
7
+                title: '{{ (modal_configuration.modal_title) ?: '' }}',
8
+                content: $('#modal-content-{{ modal_configuration.id }}').html(),
9
+                closeButton: 'title',
10
+                width: 650,
11
+                theme: 'DurbachLight'{% if not modal_configuration.show_once is empty %},
12
+                onClose: function() {
13
+                    localStorage.setItem('popState-{{ modal_configuration.id }}',Date.now());
14
+                    sessionStorage.setItem('popState-{{ modal_configuration.id }}','shown');
15
+                }
16
+                {% endif %}
17
+
18
+            });
19
+
20
+            {% if not modal_configuration.show_once is empty %}if((localStorage.getItem('popState-{{ modal_configuration.id }}') < Date.now()-3600 && sessionStorage.getItem('popState-{{ modal_configuration.id }}') != 'shown')){
21
+                {% endif %}setTimeout(function() {
22
+                    signpost.open();
23
+                },{{ modal_configuration.delay|number_format * 1000 }});
24
+            {% if not modal_configuration.show_once is empty %} } {% endif %}
25
+
26
+        });
27
+    })(jQuery);
28
+</script>
29
+
30
+<div style="display: none" id="modal-content-{{ modal_configuration.id }}">
31
+{{ details|raw }}
32
+</div>
Browse code

Change directory structure of bundle and add first draft of fragment controller module

Benjamin Roth authored on10/01/2023 14:11:33
Showing1 changed files
1 1
new file mode 100644