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.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 +77 -76 3.1.31.7.1 View file →
@@ -1,106 +1,106 @@
1 1 /* global visualizer */
2 -(function (wpmv) {
3 - var vm, vmv;
2 +(function(wpmv) {
3 + var vm, vmv;
4 4
5 - vm = visualizer.media = {};
6 - vmv = vm.view = {};
5 + vm = visualizer.media = {};
6 + vmv = vm.view = {};
7 7
8 - vmv.Chart = wpmv.MediaFrame.extend({
9 - initialize: function () {
10 - var self = this;
8 + vmv.Chart = wpmv.MediaFrame.extend({
9 + initialize: function() {
10 + var self = this;
11 11
12 - _.defaults(self.options, {
13 - action: '',
14 - state: 'iframe:visualizer'
15 - });
12 + _.defaults(self.options, {
13 + action: '',
14 + state: 'iframe:visualizer'
15 + });
16 16
17 - wpmv.MediaFrame.prototype.initialize.apply(self, arguments);
17 + wpmv.MediaFrame.prototype.initialize.apply(self, arguments);
18 18
19 - wpmv.settings.tabUrl = self.options.action;
20 - self.createIframeStates();
21 - },
19 + wpmv.settings.tabUrl = self.options.action;
20 + self.createIframeStates();
21 + },
22 22
23 - open: function () {
24 - wpmv.MediaFrame.prototype.open.apply(this, arguments);
25 - this.$el.addClass('hide-menu');
26 - }
27 - });
23 + open: function() {
24 + wpmv.MediaFrame.prototype.open.apply(this, arguments);
25 + this.$el.addClass('hide-menu');
26 + }
27 + });
28 28 })(wp.media.view);
29 29
30 -(function ($, vmv, vu) {
31 - var resizeTimeout;
30 +(function($, vmv, vu) {
31 + var resizeTimeout;
32 32
33 - $.fn.adjust = function () {
34 - return $(this).each(function () {
35 - var width = $('#visualizer-library').width(),
36 - margin = width * 0.02;
33 + $.fn.adjust = function() {
34 + return $(this).each(function() {
35 + var width = $('#visualizer-library').width(),
36 + margin = width * 0.02;
37 37
38 - width *= 0.305;
39 - $(this).width(width - 14).height(width * 0.75).parent().css('margin-right', margin + 'px').css('margin-bottom', margin + 'px');
40 - });
41 - };
38 + width *= 0.305;
39 + $(this).width(width - 14).height(width * 0.75).parent().css('margin-right', margin + 'px').css('margin-bottom', margin + 'px');
40 + });
41 + };
42 42
43 - $('.visualizer-chart-canvas').adjust();
43 + $('.visualizer-chart-canvas').adjust();
44 44
45 - $(document).ready(function () {
46 - $('.visualizer-chart, .visualizer-library-pagination').fadeIn(500);
45 + $(document).ready(function() {
46 + $('.visualizer-chart, .visualizer-library-pagination').fadeIn(500);
47 47
48 - $('.visualizer-chart-shortcode').click(function (e) {
49 - var range, selection;
48 + $('.visualizer-chart-shortcode').click(function(e) {
49 + var range, selection;
50 50
51 - if (window.getSelection && document.createRange) {
52 - selection = window.getSelection();
53 - range = document.createRange();
54 - range.selectNodeContents(e.target);
55 - selection.removeAllRanges();
56 - selection.addRange(range);
57 - } else if (document.selection && document.body.createTextRange) {
58 - range = document.body.createTextRange();
59 - range.moveToElementText(e.target);
60 - range.select();
61 - }
62 - });
51 + if (window.getSelection && document.createRange) {
52 + selection = window.getSelection();
53 + range = document.createRange();
54 + range.selectNodeContents(e.target);
55 + selection.removeAllRanges();
56 + selection.addRange(range);
57 + } else if (document.selection && document.body.createTextRange) {
58 + range = document.body.createTextRange();
59 + range.moveToElementText(e.target);
60 + range.select();
61 + }
62 + });
63 63
64 - $('.add-new-h2').click(function () {
65 - var wnd = window,
66 - view = new vmv.Chart({action: vu.create});
64 + $('.add-new-h2').click(function() {
65 + var wnd = window,
66 + view = new vmv.Chart({action: vu.create});
67 67
68 - wnd.send_to_editor = function () {
69 - wnd.location.href = vu.base;
70 - };
71 - view.open();
68 + wnd.send_to_editor = function() {
69 + wnd.location.href = vu.base;
70 + };
71 + view.open();
72 72
73 - return false;
74 - });
73 + return false;
74 + });
75 75
76 - $('.visualizer-chart-edit').click(function () {
77 - var wnd = window,
78 - view = new vmv.Chart({action: vu.edit + '&chart=' + $(this).attr('data-chart')});
76 + $('.visualizer-chart-edit').click(function() {
77 + var wnd = window,
78 + view = new vmv.Chart({action: vu.edit + '&chart=' + $(this).attr('data-chart')});
79 79
80 - wnd.send_to_editor = function () {
81 - wnd.location.reload();
82 - };
80 + wnd.send_to_editor = function() {
81 + wnd.location.reload();
82 + };
83 83
84 - view.open();
84 + view.open();
85 85
86 - return false;
87 - });
86 + return false;
87 + });
88 88
89 - $(".visualizer-chart-export").on("click", function () {
89 + $(".visualizer-chart-export").on("click", function() {
90 90 $.ajax({
91 91 url: $(this).attr("data-chart"),
92 92 method: "get",
93 - success: function (data, textStatus, jqXHR) {
93 + success: function( data, textStatus, jqXHR ){
94 94 var a = document.createElement("a");
95 95 document.body.appendChild(a);
96 96 a.style = "display: none";
97 97 var blob = new Blob([data.data.csv], {type: "application/csv"}),
98 - url = window.URL.createObjectURL(blob);
98 + url = window.URL.createObjectURL(blob);
99 99 a.href = url;
100 100 a.download = data.data.name;
101 101 a.click();
102 - setTimeout(function () {
102 + setTimeout(function(){
103 103 window.URL.revokeObjectURL(url);
104 104 }, 100);
105 105 }
106 106 });
@@ -105,12 +105,13 @@
105 105 }
106 106 });
107 107 return false;
108 108 });
109 - $(window).resize(function () {
110 - clearTimeout(resizeTimeout);
111 - resizeTimeout = setTimeout(function () {
112 - $('.visualizer-chart-canvas').adjust();
113 - }, 100);
114 - });
115 - });
109 +
110 + $(window).resize(function() {
111 + clearTimeout(resizeTimeout);
112 + resizeTimeout = setTimeout(function() {
113 + $('.visualizer-chart-canvas').adjust();
114 + }, 100);
115 + });
116 + });
116 117 })(jQuery, visualizer.media.view, visualizer.urls);