PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / js / simple-editor.js

simple-editor.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.2, at js/simple-editor.js

84 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global visualizer1 */
2
3 (function($, v) {
4
5 $(document).ready(function(){
6 onReady();
7 initTable();
8 });
9
10 function onReady() {
11 $( '#editor-button' ).on( 'click', function(e){
12 switch($("#viz-editor-type").val()) {
13 case 'text':
14 showTextEditor($(this));
15 break;
16 case 'table':
17 showTableEditor($(this));
18 break;
19 default:
20 $('body').trigger('visualizer:chart:edit');
21 }
22 });
23 }
24
25 function showTextEditor(button) {
26 if( button.attr( 'data-current' ) === 'chart'){
27 // showing the editor
28 button.val( button.attr( 'data-t-editor' ) );
29 button.html( button.attr( 'data-t-editor' ) );
30 button.attr( 'data-current', 'editor' );
31 $('p.viz-editor-selection').hide();
32 $('.viz-text-editor').css('z-index', '9999').show();
33 $('.viz-simple-editor').css('z-index', '9999').show();
34 $( '#canvas' ).css('z-index', '-100').hide();
35 }else{
36 // showing the chart
37 $('#chart-data').val($('#edited_text').val());
38 $('#canvas').lock();
39 $('#editor-form').submit();
40
41 button.val( button.attr( 'data-t-chart' ) );
42 button.html( button.attr( 'data-t-chart' ) );
43 button.attr( 'data-current', 'chart' );
44 $('p.viz-editor-selection').show();
45 $('.viz-text-editor').hide();
46 $('.viz-simple-editor').hide();
47 $( '#canvas' ).css('z-index', '1').show();
48 }
49 }
50
51 function initTable() {
52 setTimeout(function(){
53 $('body').trigger('visualizer:db:editor:table:init', {config: { buttons: [] } });
54 $( '#canvas' ).unlock();
55 }, 1000);
56 }
57
58 function showTableEditor(button) {
59 if( button.attr( 'data-current' ) === 'chart'){
60 // showing the editor
61 button.val( button.attr( 'data-t-editor' ) );
62 button.html( button.attr( 'data-t-editor' ) );
63 button.attr( 'data-current', 'editor' );
64 $('p.viz-editor-selection').hide();
65 $( '.viz-table-editor' ).css("z-index", "9999").show();
66 $('.viz-simple-editor').css('z-index', '9999').show();
67 $('body').trigger('visualizer:db:editor:table:redraw', {});
68 $( '#canvas' ).css("z-index", "-100").hide();
69 }else{
70 $('#canvas').lock();
71 $('#table-editor-form').submit();
72
73 // showing the chart
74 button.val( button.attr( 'data-t-chart' ) );
75 button.html( button.attr( 'data-t-chart' ) );
76 button.attr( 'data-current', 'chart' );
77 $('p.viz-editor-selection').show();
78 $('.viz-table-editor').hide();
79 $('.viz-simple-editor').hide();
80 $( '#canvas' ).css('z-index', '1').show();
81 }
82 }
83
84 })(jQuery, visualizer1);