PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.4
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
← All changes | js/library.js +6 -61 3.10.143.3.4 View file →
@@ -1,7 +1,5 @@
1 1 /* global visualizer */
2 -/* global alert */
3 -
4 2 (function (wpmv) {
5 3 var vm, vmv;
6 4
7 5 vm = visualizer.media = {};
@@ -22,13 +20,9 @@
22 20 self.createIframeStates();
23 21 },
24 22
25 23 open: function () {
26 - try{
27 - wpmv.MediaFrame.prototype.open.apply(this, arguments);
28 - }catch(error){
29 - alert(visualizer.i10n.conflict);
30 - }
24 + wpmv.MediaFrame.prototype.open.apply(this, arguments);
31 25 this.$el.addClass('hide-menu');
32 26 }
33 27 });
34 28 })(wp.media.view);
@@ -41,17 +35,9 @@
41 35 var width = $('#visualizer-library').width(),
42 36 margin = width * 0.02;
43 37
44 38 width *= 0.305;
45 - $(this).prev( '.visualizer-chart-title' ).width(width - 14);
46 - var ChartHeight = width * 0.93;
47 - if ( $( '.visualizer-nochart-canvas' ).length === 0 ) {
48 - ChartHeight = width * 0.78;
49 - if ( $( '#visualizer-sidebar' ).hasClass('one-columns') ) {
50 - ChartHeight = width * 0.92;
51 - }
52 - }
53 - $(this).width(width).height( ChartHeight );
39 + $(this).width(width - 14).height(width * 0.75).parent().css('margin-right', margin + 'px').css('margin-bottom', margin + 'px');
54 40 });
55 41 };
56 42
57 43 $('.visualizer-chart-canvas').adjust();
@@ -56,27 +42,10 @@
56 42
57 43 $('.visualizer-chart-canvas').adjust();
58 44
59 45 $(document).ready(function () {
60 - // clears the filters in the library form and submits.
61 - $('#viz-lib-reset').on('click', function(e){
62 - e.preventDefault();
63 - $(this).parent('form')[0].reset();
64 - $(this).parent('form').find('.viz-filter').each(function(index, el){
65 - var tag = $(el).prop('tagName').toLowerCase() + (typeof $(el).attr('type') !== 'undefined' ? $(el).attr('type').toLowerCase() : '');
66 - switch(tag){
67 - case 'select':
68 - $(el).prop('selectedIndex', 0);
69 - break;
70 - case 'inputtext':
71 - $(el).val('');
72 - break;
73 - }
46 + $('.visualizer-chart, .visualizer-library-pagination').fadeIn(500);
74 47
75 - });
76 - $(this).parent('form').submit();
77 - });
78 -
79 48 $('.visualizer-chart-shortcode').click(function (e) {
80 49 var range, selection;
81 50
82 51 if (window.getSelection && document.createRange) {
@@ -91,22 +60,11 @@
91 60 range.select();
92 61 }
93 62 });
94 63
95 - $( '.visualizer-languages-list' ).on( 'click', '[data-lang_code]', function() {
96 - if ( $(this).find( 'i' ).hasClass( 'otgs-ico-add' ) ) {
97 - vu.create = vu.create + '&lang=' + $(this).data('lang_code') + '&parent_chart_id=' + $(this).data('chart');
98 - $('.add-new-chart').click();
99 - } else {
100 - vu.edit = vu.edit + '&lang=' + $(this).data('lang_code') + '&chart=' + $(this).data('chart');
101 - $('.visualizer-chart-edit').click();
102 - }
103 - } );
104 -
105 64 $('.add-new-chart').click(function () {
106 65 var wnd = window,
107 66 view = new vmv.Chart({action: vu.create});
108 - vu.create = vu.create.replace(/[\?&]lang=[^&]+/, '').replace(/[\?&]parent_chart_id=[^&]+/, '');
109 67
110 68 window.parent.addEventListener('message', function(event){
111 69 switch(event.data) {
112 70 case 'visualizer:mediaframe:close':
@@ -126,13 +84,10 @@
126 84 return false;
127 85 });
128 86
129 87 $('.visualizer-chart-edit').click(function () {
130 - var wnd = window;
131 - var view = new vmv.Chart( {
132 - action: vu.edit.indexOf('&chart') != -1 ? vu.edit : vu.edit + '&chart=' + $(this).attr('data-chart')
133 - } );
134 - vu.edit = vu.edit.replace(/[\?&]lang=[^&]+/, '');
88 + var wnd = window,
89 + view = new vmv.Chart({action: vu.edit + '&chart=' + $(this).attr('data-chart')});
135 90
136 91 wnd.send_to_editor = function () {
137 92 wnd.location.href = wnd.location.href.replace(/vaction/, '');
138 93 };
@@ -162,16 +117,11 @@
162 117 });
163 118 return false;
164 119 });
165 120
166 - $(".visualizer-chart-image").on("click", function () {
167 - $('body').trigger('visualizer:action:specificchart', {action: 'image', id: $(this).attr("data-chart"), data: null, dataObj: {name: $(this).attr("data-chart-title")}});
168 - return false;
169 - });
170 -
171 121 // if vaction=addnew is found as a GET request parameter, show the modal.
172 122 if(location.href.indexOf('vaction=addnew') !== -1){
173 - $('.add-new-chart').first().trigger('click');
123 + $('.add-new-chart').trigger('click');
174 124 }
175 125
176 126 $(window).resize(function () {
177 127 clearTimeout(resizeTimeout);
@@ -178,11 +128,6 @@
178 128 resizeTimeout = setTimeout(function () {
179 129 $('.visualizer-chart-canvas').adjust();
180 130 }, 100);
181 131 });
182 -
183 - $('.visualizer-error i.error').on('click', function(){
184 - alert( $(this).attr('data-viz-error') );
185 - });
186 - $('.visualizer-chart:not(.visualizer-chart-display), .visualizer-library-pagination').fadeIn(500);
187 132 });
188 133 })(jQuery, visualizer.media.view, visualizer.urls);