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