PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.7.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.7.1
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
← All changes | js/frame.js +73 -145 3.0.51.7.1 View file →
@@ -1,160 +1,72 @@
1 1 /* global prompt */
2 2 /* global visualizer */
3 3 /* global alert */
4 4
5 -(function ($) {
6 - $(document).ready(function () {
7 - init_permissions();
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 + });
8 11
9 - $('.type-radio').change(function () {
10 - $('.type-label-selected').removeClass('type-label-selected');
11 - $(this).parent().addClass('type-label-selected');
12 - });
12 + $('.group-title').click(function() {
13 + var parent = $(this).parent();
13 14
14 - $('#vz-chart-settings h2').click(function () {
15 - $("#vz-chart-source").hide();
16 - $("#vz-chart-permissions").removeClass('open').addClass('bottom-fixed');
17 - $(this).parent().removeClass('bottom-fixed').addClass('open');
18 - $("#vz-chart-permissions .viz-group-header").hide();
19 - return false;
20 - });
21 - $('#vz-chart-settings .customize-section-back').click(function () {
22 - $("#vz-chart-source").show();
23 - $(this).parent().parent().removeClass('open').addClass('bottom-fixed');
15 + if (parent.hasClass('open')) {
16 + parent.removeClass('open');
17 + } else {
18 + $('.group.open').removeClass('open');
19 + parent.addClass('open');
20 + }
21 + });
24 22
25 - return false;
26 - });
27 - $('.viz-group-title').click(function () {
28 - var parent = $(this).parent();
23 + $('#remote-file').click(function() {
24 + var url = $.trim(prompt(visualizer.l10n.remotecsv_prompt));
29 25
30 - if (parent.hasClass('open')) {
31 - parent.removeClass('open');
32 - } else {
33 - parent.parent().find('.viz-group.open').removeClass('open');
34 - parent.addClass('open');
35 - }
36 - });
37 - $('#view-remote-file').click(function () {
38 - var url = $(this).parent().find('#remote-data').val();
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 + }
39 31
40 - if (url !== '') {
41 - 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)) {
42 - if (url.substr(url.length - 8) === '/pubhtml') {
43 - url = url.substring(0, url.length - 8) + '/export?format=csv';
44 - }
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 + });
45 41
46 - $('#canvas').lock();
47 - $(this).parent().submit();
48 - } else {
49 - alert(visualizer.l10n.invalid_source);
50 - }
51 - }
52 - });
42 + $('#csv-file').change(function() {
43 + if ($.trim($(this).val()) !== '') {
44 + $('#remote-data').val('');
45 + $('#canvas').lock();
46 + $('#csv-form').submit();
47 + }
48 + });
53 49
54 - $('#vz-import-file').click(function (e) {
55 - e.preventDefault();
56 - if ($.trim($(this).parent().find("#csv-file").val()) !== '') {
57 - $('#canvas').lock();
58 - $(this).parent().submit();
59 - }
60 - });
50 + $('#thehole').load(function() {
51 + $('#canvas').unlock();
52 + });
61 53
62 - $('#thehole').load(function () {
63 - $('#canvas').unlock();
64 - });
54 + $('.section-title').click(function() {
55 + $(this).toggleClass('open').parent().find('.section-items').toggle();
56 + });
65 57
66 - $('.viz-section-title').click(function () {
67 - $(this).toggleClass('open').parent().find('.viz-section-items').toggle();
68 - });
58 + $('.more-info').click(function() {
59 + $(this).parent().find('.section-description:first').toggle();
60 + return false;
61 + });
69 62
70 - $('.more-info').click(function () {
71 - $(this).parent().find('.viz-section-description:first').toggle();
72 - return false;
73 - });
74 -
75 - });
76 -
77 - function init_permissions(){
78 - $('#vz-chart-permissions h2').click(function () {
79 - $("#vz-chart-source").hide();
80 - $("#vz-chart-permissions .viz-group-header").show();
81 - $("#vz-chart-settings").removeClass('open').addClass('bottom-fixed');
82 -
83 - $('#settings-button').click(function(e) {
84 - e.preventDefault();
85 - $('#permissions-form').submit();
86 - $('#settings-form').submit();
87 - });
88 -
89 - $(this).parent().removeClass('bottom-fixed').addClass('open');
90 -
91 - return false;
92 - });
93 - $('#vz-chart-permissions .customize-section-back').click(function () {
94 - $("#vz-chart-source").show();
95 -
96 - $("#vz-chart-permissions .viz-group-header").hide();
97 - $('#settings-button').click(function(e) {
98 - e.preventDefault();
99 - $('#settings-form').submit();
100 - });
101 -
102 - $(this).parent().parent().removeClass('open').addClass('bottom-fixed');
103 -
104 - return false;
105 - });
106 -
107 - $('.visualizer-permission').chosen({
108 - width : '50%',
109 - search_contains : true
110 - });
111 -
112 - $('.visualizer-permission-type').each(function(x, y){
113 - var type = $(y).attr('data-visualizer-permission-type');
114 - var child = $('.visualizer-permission-' + type + '-specific');
115 - if($(y).val() === 'all'){
116 - child.next('div.chosen-container').hide();
117 - return;
118 - }
119 - });
120 -
121 - $('.visualizer-permission-type').on('change', function(evt, params) {
122 - var type = $(this).attr('data-visualizer-permission-type');
123 - var child = $('.visualizer-permission-' + type + '-specific');
124 - child.empty();
125 - if(params.selected === 'all'){
126 - child.next('div.chosen-container').hide();
127 - return;
128 - } else {
129 - child.next('div.chosen-container').show();
130 - }
131 - child.append('<option value="">' + visualizer.l10n['loading'] + '</option>').trigger('chosen:updated');
132 - $.ajax({
133 - url : visualizer.ajax['url'],
134 - method : 'post',
135 - data : {
136 - 'action' : visualizer.ajax['actions']['permissions'],
137 - 'nonce' : visualizer.ajax['nonces']['permissions'],
138 - 'type' : params.selected
139 - },
140 - success : function(d, textStatus, XMLHttpRequest){
141 - if(d.success) {
142 - child.empty();
143 - $.each(d.data, function(k, v){
144 - child.append('<option value="' + k + '">' + v + '</option>');
145 - });
146 - child.trigger('chosen:updated');
147 - }
148 - }
149 - });
150 - });
151 - }
63 + });
152 64 })(jQuery);
153 65
154 -(function ($) {
155 - $.fn.lock = function () {
156 - $(this).each(function () {
66 +(function($) {
67 + $.fn.lock = function() {
68 + $(this).each(function() {
157 69 var $this = $(this);
158 70 var position = $this.css('position');
159 71
160 72 if (!position) {
@@ -160,9 +72,9 @@
160 72 if (!position) {
161 73 position = 'static';
162 74 }
163 75
164 - switch (position) {
76 + switch(position) {
165 77 case 'absolute':
166 78 case 'relative':
167 79 break;
168 80 default:
@@ -181,9 +93,9 @@
181 93 loader.width(width).height(height);
182 94
183 95 locker.append(loader);
184 96 $this.append(locker);
185 - $(window).resize(function () {
97 + $(window).resize(function() {
186 98 $this.find('.locker,.locker-loader').width($this.width()).height($this.height());
187 99 });
188 100 });
189 101
@@ -189,10 +101,10 @@
189 101
190 102 return $(this);
191 103 };
192 104
193 - $.fn.unlock = function () {
194 - $(this).each(function () {
105 + $.fn.unlock = function() {
106 + $(this).each(function() {
195 107 $(this).find('.locker').remove();
196 108 $(this).css('position', $(this).data('position'));
197 109 });
198 110
@@ -197,5 +109,21 @@
197 109 });
198 110
199 111 return $(this);
200 112 };
201 -})(jQuery);
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);