PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.11.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.11.10
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/library.js +1 -119 4.0.63.11.10 View file →
@@ -45,11 +45,8 @@
45 45 (function ($, vmv, vu) {
46 46 var resizeTimeout;
47 47
48 48 $.fn.adjust = function () {
49 - if ( $( '#visualizer-library' ).hasClass( 'view-list' ) ) {
50 - return this;
51 - }
52 49 return $(this).each(function () {
53 50 var width = $('#visualizer-library').width(),
54 51 margin = width * 0.02;
55 52
@@ -87,55 +84,8 @@
87 84 });
88 85 $(this).parent('form').submit();
89 86 });
90 87
91 - // Copy shortcode when clicking the code display in list view.
92 - $( document ).on( 'click', '.viz-shortcode-display', function () {
93 - var text = $( this ).text();
94 - var el = this;
95 -
96 - // Fallback copy method using a temporary textarea. Returns true on success.
97 - var fallbackCopy = function ( value ) {
98 - var ta = document.createElement( 'textarea' );
99 - ta.value = value;
100 - document.body.appendChild( ta );
101 - ta.select();
102 - var succeeded = false;
103 - try {
104 - succeeded = document.execCommand( 'copy' );
105 - } catch ( e ) {
106 - succeeded = false;
107 - }
108 - document.body.removeChild( ta );
109 - return succeeded;
110 - };
111 -
112 - // Apply temporary "copied" feedback.
113 - var showCopiedFeedback = function () {
114 - $( el ).addClass( 'viz-shortcode-copied' );
115 - setTimeout( function () {
116 - $( el ).removeClass( 'viz-shortcode-copied' );
117 - }, 1200 );
118 - };
119 -
120 - if ( navigator.clipboard && navigator.clipboard.writeText ) {
121 - navigator.clipboard.writeText( text ).then( function () {
122 - // Clipboard API succeeded.
123 - showCopiedFeedback();
124 - } ).catch( function () {
125 - // Clipboard API failed; fall back to textarea method.
126 - if ( fallbackCopy( text ) ) {
127 - showCopiedFeedback();
128 - }
129 - } );
130 - } else {
131 - // No Clipboard API; use fallback directly.
132 - if ( fallbackCopy( text ) ) {
133 - showCopiedFeedback();
134 - }
135 - }
136 - } );
137 -
138 88 $('.visualizer-chart-shortcode').click(function (event) {
139 89
140 90 if ( createPopupProBlocker( $, event ) ) {
141 91 event.preventDefault();
@@ -167,9 +117,9 @@
167 117 $('.visualizer-chart-edit').click();
168 118 }
169 119 } );
170 120
171 - function openClassicBuilder() {
121 + $('.add-new-chart').click(function () {
172 122 var wnd = window,
173 123 view = new vmv.Chart({action: vu.create});
174 124 vu.create = vu.create.replace(/[\?&]lang=[^&]+/, '').replace(/[\?&]parent_chart_id=[^&]+/, '');
175 125
@@ -187,84 +137,16 @@
187 137 wnd.send_to_editor = function () {
188 138 wnd.location.href = vu.base.replace(/type=[a-zA-Z]*/, '').replace(/vaction/, '');
189 139 };
190 140 view.open();
191 - }
192 141
193 - function closeAddNewMenus() {
194 - $('.viz-add-new-group').removeClass('is-open');
195 - $('.viz-add-new-toggle').attr('aria-expanded', 'false');
196 - $('.viz-add-new-menu').attr('aria-hidden', 'true');
197 - }
198 -
199 - $(document).on('click', function() {
200 - closeAddNewMenus();
201 - });
202 -
203 - $(document).on('click', '.viz-add-new-toggle', function(event) {
204 - event.preventDefault();
205 - event.stopPropagation();
206 - event.stopImmediatePropagation();
207 - var $group = $(this).closest('.viz-add-new-group');
208 - var isOpen = $group.hasClass('is-open');
209 - closeAddNewMenus();
210 - if ( ! isOpen ) {
211 - $group.addClass('is-open');
212 - $(this).attr('aria-expanded', 'true');
213 - $group.find('.viz-add-new-menu').attr('aria-hidden', 'false');
214 - }
215 142 return false;
216 143 });
217 144
218 - $(document).on('click', '.viz-add-new-item', function(event) {
219 - event.preventDefault();
220 - event.stopPropagation();
221 - event.stopImmediatePropagation();
222 - var builder = $(this).data('viz-builder');
223 - closeAddNewMenus();
224 -
225 - if ( builder === 'ai' ) {
226 - if ( typeof window.vizOpenAIBuilderNew === 'function' ) {
227 - window.vizOpenAIBuilderNew();
228 - return;
229 - }
230 - if ( typeof window.vizOpenChartChooser === 'function' ) {
231 - var classicCallback = function() {
232 - openClassicBuilder();
233 - };
234 - window.vizOpenChartChooser( classicCallback );
235 - return;
236 - }
237 - }
238 -
239 - openClassicBuilder();
240 - });
241 -
242 - $('.add-new-chart').click(function () {
243 - // Hook for the React chart builder chooser modal.
244 - // If the React app is loaded it sets window.vizOpenChartChooser and handles routing.
245 - // It will call the classicCallback if the user picks the Classic Builder.
246 - if (typeof window.vizOpenChartChooser === 'function') {
247 - var classicCallback = function() {
248 - openClassicBuilder();
249 - };
250 - window.vizOpenChartChooser(classicCallback);
251 - return false;
252 - }
253 - openClassicBuilder();
254 - return false;
255 - });
256 -
257 145 $('.visualizer-chart-edit').click(function (event) {
258 146
259 147 if ( createPopupProBlocker( $, event ) ) {
260 148 return;
261 - }
262 -
263 - // D3/AI charts open in the AI Builder instead of the classic modal.
264 - if ( $(this).data('library') === 'd3' && typeof window.vizOpenAIBuilderEdit === 'function' ) {
265 - window.vizOpenAIBuilderEdit( $(this).attr('data-chart') );
266 - return false;
267 149 }
268 150
269 151 var wnd = window;
270 152 var view = new vmv.Chart( {