PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.7.6
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.7.6
4.0.8 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 All 149 releases
visualizer / js / frame.js

frame.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 1.7.6, at js/frame.js

130 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global prompt */
2 /* global visualizer */
3 /* global alert */
4
5 (function($) {
6 $(document).ready(function() {
7 $('.type-radio').change(function() {
8 $('.type-label-selected').removeClass('type-label-selected');
9 $(this).parent().addClass('type-label-selected');
10 });
11
12 $('.group-title').click(function() {
13 var parent = $(this).parent();
14
15 if (parent.hasClass('open')) {
16 parent.removeClass('open');
17 } else {
18 $('.group.open').removeClass('open');
19 parent.addClass('open');
20 }
21 });
22
23 $('#remote-file').click(function() {
24 var url = $.trim(prompt(visualizer.l10n.remotecsv_prompt));
25
26 if (url !== '') {
27 if (/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(url)) {
28 if (url.substr(url.length - 8) === '/pubhtml') {
29 url = url.substring(0, url.length - 8) + '/export?format=csv';
30 }
31
32 $('#remote-data').val(url);
33 $('#csv-file').val('');
34 $('#canvas').lock();
35 $('#csv-form').submit();
36 } else {
37 alert(visualizer.l10n.invalid_source);
38 }
39 }
40 });
41
42 $('#csv-file').change(function() {
43 if ($.trim($(this).val()) !== '') {
44 $('#remote-data').val('');
45 $('#canvas').lock();
46 $('#csv-form').submit();
47 }
48 });
49
50 $('#thehole').load(function() {
51 $('#canvas').unlock();
52 });
53
54 $('.section-title').click(function() {
55 $(this).toggleClass('open').parent().find('.section-items').toggle();
56 });
57
58 $('.more-info').click(function() {
59 $(this).parent().find('.section-description:first').toggle();
60 return false;
61 });
62
63 });
64 })(jQuery);
65
66 (function($) {
67 $.fn.lock = function() {
68 $(this).each(function() {
69 var $this = $(this);
70 var position = $this.css('position');
71
72 if (!position) {
73 position = 'static';
74 }
75
76 switch(position) {
77 case 'absolute':
78 case 'relative':
79 break;
80 default:
81 $this.css('position', 'relative');
82 break;
83 }
84 $this.data('position', position);
85
86 var width = $this.width(),
87 height = $this.height();
88
89 var locker = $('<div class="locker"></div>');
90 locker.width(width).height(height);
91
92 var loader = $('<div class="locker-loader"></div>');
93 loader.width(width).height(height);
94
95 locker.append(loader);
96 $this.append(locker);
97 $(window).resize(function() {
98 $this.find('.locker,.locker-loader').width($this.width()).height($this.height());
99 });
100 });
101
102 return $(this);
103 };
104
105 $.fn.unlock = function() {
106 $(this).each(function() {
107 $(this).find('.locker').remove();
108 $(this).css('position', $(this).data('position'));
109 });
110
111 return $(this);
112 };
113 })(jQuery);
114
115 //Hide / show settings in sidebar
116 (function($) {
117 $(document).ready(function() {
118
119 $('.advanced-settings-btn').click(function(){
120 $('.second-screen, .return-settings-btn').removeClass("hidden-setting");
121 $('.initial-screen').addClass("hidden-setting");
122 });
123
124 $('.return-settings-btn').click(function(){
125 $('.second-screen, .return-settings-btn').addClass("hidden-setting");
126 $('.initial-screen').removeClass("hidden-setting");
127 });
128 });
129 })(jQuery);
130