Changeset 735258
- Timestamp:
- 07/03/2013 01:27:21 AM (13 years ago)
- Location:
- rj-quickcharts/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
admin/rjqc-admin-new.php (modified) (6 diffs)
-
ajax/ajax.js (modified) (2 diffs)
-
ajax/init.php (modified) (6 diffs)
-
rj_charts.php (modified) (6 diffs)
-
shortcode/init.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rj-quickcharts/trunk/README.txt
r734808 r735258 7 7 Requires at least: 3.3 8 8 Tested up to: 3.5 9 Stable tag: 0.4. 29 Stable tag: 0.4.3 10 10 11 11 Create incredible HTML5/JavaScript charts right inside WordPress with a few clicks. … … 44 44 == Changelog == 45 45 46 = 0.4.3 = 47 * Ability to set the chart height 48 46 49 = 0.4.2 = 47 50 * Only Admins and Editors can edit charts now -
rj-quickcharts/trunk/admin/rjqc-admin-new.php
r732254 r735258 1 1 <? 2 //wp_enqueue_script('ajax-script', plugins_url( '/main.js?v='.rand() ), array('jquery'));3 4 2 $type = ''; 5 3 $title = ''; … … 7 5 $tooltip_suffix = ''; 8 6 $y_axis_title = ''; 7 $chart_height = '300'; 9 8 10 9 $id = $_GET['id']; … … 24 23 $series = $chart[0]->series; 25 24 $hotSeries = $chart[0]->hotSeries; 25 $opts = json_decode($chart[0]->opts); 26 $chart_height = $opts->height; 26 27 27 28 echo '<input id="rjqc-chart-id" type="hidden" value="'.$id.'" />'; … … 64 65 <label id="chart-tooltip-suffix"><span>Tooltip Suffix</span><br /> 65 66 <input type="text" placeholder="°C" value="'.$tooltip_suffix.'" /> 67 </label> 68 <label id="chart-height"><span>Chart Height (leave empty for default)</span><br /> 69 <input type="text" placeholder="300" value="'.$chart_height.'" />px 66 70 </label> 67 71 </form> … … 90 94 <h3 class="hndle"><span>Step 3: Preview</span></h3> 91 95 <div class="inside"> 92 <div id="rjqc-chart" style="height: 300px;"></div>96 <div id="rjqc-chart" style="height:'.$chart_height.'px;"></div> 93 97 <div class="cf"></div> 94 98 </div> … … 387 391 }); 388 392 393 // Change the chart Height 394 jQuery('#chart-height input').keyup(function() { 395 chartHeight = jQuery(this).val(); 396 if (chartHeight === '') { 397 jQuery('#rjqc-chart').height('300px'); 398 } else { 399 jQuery('#rjqc-chart').height(chartHeight+'px'); 400 } 401 chart.replot(); 402 }); 403 389 404 <? if ($_GET['id']) { ?> 390 405 if (<? echo $legend ?> === 0) { -
rj-quickcharts/trunk/ajax/ajax.js
r732243 r735258 72 72 tooltip_suffix = $('#chart-tooltip-suffix input').val(), 73 73 y_axis_title = $('#chart-yaxis-title input').val(), 74 height = $('#chart-height input').val(), 74 75 y_axis_cats = theYCats, 75 76 series = theYData, 76 77 hotSeries = theData; 78 79 if (height === '') { 80 height = 300; 81 } 77 82 78 83 var data = { … … 85 90 y_axis_cats: y_axis_cats, 86 91 series: series, 87 hotSeries: theData 92 hotSeries: theData, 93 opts: { 94 height: height 95 } 88 96 }; 89 97 -
rj-quickcharts/trunk/ajax/init.php
r727478 r735258 56 56 $y_axis_title = $_POST['y_axis_title']; 57 57 $y_axis_cats = json_encode($_POST['y_axis_cats']); 58 //$series = json_encode($_POST['series'], JSON_NUMERIC_CHECK);59 //$hotSeries = json_encode($_POST['hotSeries'], JSON_NUMERIC_CHECK);60 58 $series = json_encode($full_series); 61 59 $hotSeries = json_encode($full_hot_series); 60 $opts = json_encode($_POST['opts']); 62 61 63 62 $rows = $wpdb->insert( … … 72 71 'legendOn' => $legend, 73 72 'series' => $series, 74 'hotSeries' => $hotSeries ) 73 'hotSeries' => $hotSeries, 74 'opts' => $opts ) 75 75 ); 76 76 … … 103 103 $series = $chart[0]->series; 104 104 $hotSeries = $chart[0]->hotSeries; 105 $opts = $chart[0]->opts; 105 106 106 107 $wpdb->insert( … … 115 116 'legendOn' => $legend, 116 117 'series' => $series, 117 'hotSeries' => $hotSeries 118 'hotSeries' => $hotSeries, 119 'opts' => $opts 118 120 ) 119 121 ); … … 131 133 "legendOn":'.json_encode($legend).', 132 134 "series":'.json_encode($series).', 133 "hotSeries":'.json_encode($hotSeries).' 135 "hotSeries":'.json_encode($hotSeries).', 136 "opts":'.json_encode($opts).' 134 137 }'; 135 138 die; … … 177 180 'xAxisCats' => json_encode($_POST['y_axis_cats']), 178 181 'legendOn' => (int)$_POST['legend'], 179 //'series' => json_encode($_POST['series'], JSON_NUMERIC_CHECK),180 //'hotSeries' => json_encode($_POST['hotSeries'], JSON_NUMERIC_CHECK)181 182 'series' => json_encode($full_series), 182 'hotSeries' => json_encode($full_hot_series) 183 'hotSeries' => json_encode($full_hot_series), 184 'opts' => json_encode($_POST['opts']) 183 185 ), 184 186 array('id'=>$id) -
rj-quickcharts/trunk/rj_charts.php
r734806 r735258 4 4 Plugin URI: http://www.randyjensen.com 5 5 Description: Easily create charts for your WordPress site. Line charts, bar charts and pie charts currently supported. 6 Version: 0.4. 26 Version: 0.4.3 7 7 Author: Randy Jensen 8 8 Author URI: http://www.randyjensen.com … … 15 15 global $table_name; 16 16 17 $rjqc_db_version = '0.4. 2';17 $rjqc_db_version = '0.4.3'; 18 18 $table_name = $wpdb->prefix . 'rj_quickcharts'; 19 19 … … 53 53 { 54 54 global $table_name; 55 global $rjqc_db_version; 55 56 56 57 $sql = "CREATE TABLE $table_name ( … … 66 67 series longtext NOT NULL, 67 68 hotSeries longtext NOT NULL, 69 opts longtext NOT NULL, 68 70 UNIQUE KEY id (id) 69 71 );"; … … 71 73 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 72 74 dbDelta( $sql ); 75 76 // Is there an upgrade? Make sure they have the latest database 77 $installed_ver = get_option("rjqc_db_version"); 78 79 if($installed_ver != $rjqc_db_version) { 80 81 $sql = "CREATE TABLE $table_name ( 82 id int(16) NOT NULL AUTO_INCREMENT, 83 created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 84 type char(50) NOT NULL DEFAULT 'line', 85 title varchar(200) NOT NULL, 86 subtitle varchar(200) NOT NULL, 87 tooltipSuffix varchar(200) NOT NULL, 88 yAxisTitleText varchar(200) NOT NULL, 89 xAxisCats longtext NOT NULL, 90 legendOn int(0) NOT NULL, 91 series longtext NOT NULL, 92 hotSeries longtext NOT NULL, 93 opts longtext NOT NULL, 94 UNIQUE KEY id (id) 95 );"; 96 97 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 98 dbDelta($sql); 99 100 update_option("rjqc_db_version", $rjqc_db_version); 101 } 73 102 } 74 103 … … 96 125 register_deactivation_hook(__FILE__, array('RJ_Quickcharts', 'deactivate')); 97 126 98 $rj_quickcharts = new RJ_Quickcharts(); 127 function rjqc_update_db_check() { 128 global $rjqc_db_version; 129 if (get_site_option( 'rjqc_db_version' ) != $rjqc_db_version) { 130 RJ_Quickcharts::activate(); 131 } 132 } 133 add_action( 'plugins_loaded', 'rjqc_update_db_check' ); 134 135 $rj_quickcharts = new RJ_Quickcharts(); 99 136 100 137 // Add a link to the settings page onto the plugin page -
rj-quickcharts/trunk/shortcode/init.php
r732243 r735258 41 41 $hotSeries = $chart[0]->hotSeries; 42 42 $chartFill = false; 43 $opts = json_decode($chart[0]->opts); 44 $chartHeight= $opts->height; 43 45 44 46 if ($type == "pie") { … … 95 97 } 96 98 97 $return_string .= "<div id='rjqc_container_$id' ></div>";99 $return_string .= "<div id='rjqc_container_$id' style='height:".$chartHeight."px'></div>"; 98 100 $return_string .= "<script>"; 99 101 $return_string .= "(function ($) {
Note: See TracChangeset
for help on using the changeset viewer.