PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.6.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.6.0
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 +75 -162 3.0.91.6.0 View file →
@@ -1,171 +1,68 @@
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 + if (url.substr(url.length - 8) == '/pubhtml') {
25 + url = url.substring(0, url.length - 8) + '/export?format=csv';
26 + }
31 27
32 - return false;
33 - });
34 - $('.viz-group-title').click(function () {
35 - var parent = $(this).parent();
28 + $('#remote-data').val(url);
29 + $('#csv-file').val('');
30 + $('#canvas').lock();
31 + $('#csv-form').submit();
32 + } else {
33 + alert(visualizer.l10n.invalid_source);
34 + }
35 + }
36 + });
36 37
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();
38 + $('#csv-file').change(function() {
39 + if ($.trim($(this).val()) != '') {
40 + $('#remote-data').val('');
41 + $('#canvas').lock();
42 + $('#csv-form').submit();
43 + }
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 + $('#thehole').load(function() {
47 + $('#canvas').unlock();
48 + });
52 49
53 - $('#canvas').lock();
54 - $(this).parent().submit();
55 - } else {
56 - alert(visualizer.l10n.invalid_source);
57 - }
58 - }
59 - });
50 + $('.section-title').click(function() {
51 + $(this).toggleClass('open').parent().find('.section-items').toggle();
52 + });
60 53
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 - });
54 + $('.more-info').click(function() {
55 + $(this).parent().find('.section-description:first').toggle();
56 + return false;
57 + });
68 58
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 - }
59 + });
163 60 })(jQuery);
164 61
165 -(function ($) {
166 - $.fn.lock = function () {
167 - $(this).each(function () {
62 +(function($) {
63 + $.fn.lock = function() {
64 + $(this).each(function() {
168 65 var $this = $(this);
169 66 var position = $this.css('position');
170 67
171 68 if (!position) {
@@ -171,9 +68,9 @@
171 68 if (!position) {
172 69 position = 'static';
173 70 }
174 71
175 - switch (position) {
72 + switch(position) {
176 73 case 'absolute':
177 74 case 'relative':
178 75 break;
179 76 default:
@@ -192,21 +89,37 @@
192 89 loader.width(width).height(height);
193 90
194 91 locker.append(loader);
195 92 $this.append(locker);
196 - $(window).resize(function () {
93 + $(window).resize(function() {
197 94 $this.find('.locker,.locker-loader').width($this.width()).height($this.height());
198 95 });
199 96 });
200 97
201 98 return $(this);
202 - };
99 + }
203 100
204 - $.fn.unlock = function () {
205 - $(this).each(function () {
101 + $.fn.unlock = function() {
102 + $(this).each(function() {
206 103 $(this).find('.locker').remove();
207 104 $(this).css('position', $(this).data('position'));
208 105 });
209 106
210 107 return $(this);
211 - };
212 -})(jQuery);
108 + }
109 +})(jQuery);
110 +
111 +//Hide / show settings in sidebar
112 +(function($) {
113 + $(document).ready(function() {
114 +
115 + $('.advanced-settings-btn').click(function(){
116 + $('.second-screen, .return-settings-btn').removeClass("hidden-setting");
117 + $('.initial-screen').addClass("hidden-setting");
118 + });
119 +
120 + $('.return-settings-btn').click(function(){
121 + $('.second-screen, .return-settings-btn').addClass("hidden-setting");
122 + $('.initial-screen').removeClass("hidden-setting");
123 + });
124 + });
125 +})(jQuery);