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