Skip to content

Commit 8869068

Browse files
Merge pull request #330 from contactashish13/testing3.1.0
Testing3.1.0
2 parents 9cd10fd + a63717a commit 8869068

File tree

9 files changed

+26
-18
lines changed

9 files changed

+26
-18
lines changed

classes/Visualizer/Module.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,15 @@ protected function load_chart_type( $chart_id ) {
452452
$type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
453453
$name = 'Visualizer_Render_Sidebar_Type_' . ucwords( $type );
454454
$class = null;
455-
if ( class_exists( $name ) ) {
455+
if ( class_exists( $name ) || true === apply_filters( 'visualizer_load_chart', false, $name ) ) {
456456
$class = new $name;
457-
} elseif ( true === apply_filters( 'visualizer_load_chart', false, $name ) ) {
458-
$class = new $name;
459457
}
458+
459+
if ( is_null( $class ) && VISUALIZER_PRO ) {
460+
// lets see if this type exists in pro. New Lite(3.1.0+) & old Pro(1.8.0-).
461+
$class = apply_filters( 'visualizer_pro_chart_type_sidebar', null, array( 'type' => $type, 'settings' => get_post_meta( $chart_id, Visualizer_Plugin::CF_SETTINGS, true ) ) );
462+
}
463+
460464
return is_null( $class ) ? null : $class->getLibrary();
461465
}
462466

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '3.0.12';
31+
const VERSION = '3.1.0';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Layout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ public static function _renderDbQuery( $args ) {
7171
<form id='db-query-form'>
7272
<textarea name='query' class='visualizer-db-query' placeholder="<?php _e( 'Your query goes here', 'visualizer' ); ?>"><?php echo $query; ?></textarea>
7373
</form>
74+
<div class='db-wizard-error'></div>
7475
</div>
7576
<div>
7677
<input type="button" class="button button-primary" id='visualizer-query-fetch' value='<?php _e( 'Show Results', 'visualizer' ); ?>'>
7778
</div>
7879
</div>
7980
<div class='db-wizard-hints'>
8081
<ul>
81-
<li><?php echo sprintf( __( 'For examples of pre-built queries that you can use, please click %1$shere%2$s', 'visualizer' ), '<a href="' . VISUALIZER_DB_QUERY_DOC_URL . '" target="_blank">', '</a>' ); ?></li>
82-
<li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or tables/columns.', 'visualizer' ), '<span class="visualizer-emboss">', '</span>' ); ?></li>
82+
<li><?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', 'visualizer' ), '<a href="' . VISUALIZER_DB_QUERY_DOC_URL . '" target="_blank">', '</a>' ); ?></li>
83+
<li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'visualizer' ), '<span class="visualizer-emboss">', '</span>' ); ?></li>
8384
</ul>
8485
</div>
85-
<div class='db-wizard-error'></div>
8686
<div class='db-wizard-results'></div>
8787

8888
</div>

css/frame.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
right: 0;
77
bottom: 60px;
88
left: 0;
9-
width: calc(100% - 300px);
9+
width: auto;
1010
background-color: white;
1111
}
1212

css/media.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version: 3.0.12
2+
Version: 3.1.0
33
*/
44
#visualizer-library-view {
55
padding: 30px 10px 10px 30px;

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Visualizer: Tables and Charts Manager for WordPress (Lite)
55
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
66
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7-
Version: 3.0.12
7+
Version: 3.1.0
88
Author: Themeisle
99
Author URI: http://themeisle.com
1010
License: GPL v2.0 or later

js/frame.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
init_permissions();
2121

22-
if(visualizer.is_pro) {
22+
if(typeof visualizer !== 'undefined' && visualizer.is_pro) {
2323
init_db_import();
2424
}
2525

@@ -261,6 +261,7 @@
261261
});
262262

263263
$( '#db-chart-button' ).on( 'click', function(){
264+
$('#content').css('width', 'calc(100% - 300px)');
264265
if( $(this).attr( 'data-current' ) === 'chart'){
265266
$(this).val( $(this).attr( 'data-t-filter' ) );
266267
$(this).html( $(this).attr( 'data-t-filter' ) );

js/render-datatables.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
return;
2424
}
2525

26-
if($('#' + id).find('table.dataTable').length === 0){
27-
$('#' + id).append($('<table class="dataTable table table-striped"></table>'));
26+
if($('#' + id).find('table.visualizer-data-table').length > 0){
27+
$('#' + id).empty();
2828
}
29+
$('#' + id).append($('<table class="dataTable visualizer-data-table table table-striped"></table>'));
2930

3031
settings = {
3132
destroy: true,
@@ -121,7 +122,7 @@
121122
break;
122123
}
123124

124-
render = addRenderer(series[j].type, settings.series[j]);
125+
render = addRenderer(series[j].type, settings.series, j);
125126

126127
var col = { title: series[j].label, data: series[j].label, type: type, render: render };
127128
if(typeof chart.settings['cssClassNames'] !== 'undefined' && typeof chart.settings['cssClassNames']['tableCell'] !== 'undefined'){
@@ -143,7 +144,7 @@
143144
// allow user to extend the settings.
144145
$('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings});
145146

146-
table = $('#' + id + ' table.dataTable');
147+
table = $('#' + id + ' table.visualizer-data-table');
147148
table.DataTable( {
148149
data: rows,
149150
columns: cols,
@@ -152,12 +153,14 @@
152153
$('.loader').remove();
153154
}
154155

155-
function addRenderer(type, series){
156+
function addRenderer(type, series, index){
156157
var render = null;
157-
if(typeof series === 'undefined' || typeof series.format === 'undefined'){
158+
if(typeof series === 'undefined' || typeof series[index] === 'undefined' || typeof series[index].format === 'undefined' ){
158159
return render;
159160
}
160161

162+
series = series[index];
163+
161164
/* jshint ignore:start */
162165
switch(type){
163166
case 'number':

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "visualizer",
3-
"version": "3.0.12",
3+
"version": "3.1.0",
44
"description": "Visualizer Lite",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)