Changeset 1955706
- Timestamp:
- 10/12/2018 11:50:17 AM (7 years ago)
- Location:
- data-dash/trunk
- Files:
-
- 11 edited
-
assets/js/dd-user.js (modified) (1 diff)
-
data-dash.php (modified) (2 diffs)
-
includes/dd-admin.php (modified) (2 diffs)
-
includes/dd-helper.php (modified) (2 diffs)
-
includes/dd-shortcodes.php (modified) (2 diffs)
-
js/dd-user.js (modified) (1 diff)
-
pages/admin-create-counter.php (modified) (1 diff)
-
pages/admin-dashboard.php (modified) (1 diff)
-
pages/admin-update-counter.php (modified) (1 diff)
-
pages/user-footer.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
data-dash/trunk/assets/js/dd-user.js
r1186746 r1955706 1 window.$=jQuery.noConflict();var DataDash={settings:{formObj:null},get:function(t){$.ajax({url:DDUserAjax.ajaxurl,type:"post",data:{action:"dd_get_all_counters",id:t},success:function(t){$(t.id).html(t.html),DataDash.flipTheNumber(t)},error:function(){return!1}})},filterNumbersIntoSpan:function(t){var n="";return $.each($(t),function(t,a){n+=","===a?'<span class="dd_comma">'+a+"</span>":'<span class="dd_number">'+a+"</span>"}),n},flipTheNumber:function(t){var n=($(t.id),$(t.html));return $.each($(t.id).find("span"),function(t,a){$(a).text()!==$(n[t]).text()&&$(n[t]).addClass("ddrotate")}),$(n)}};1 function DataDash1(n,t){var e={CounterId:null,CounterStartValue:0,CounterIncValue:0,CounterIncTime:0,incTimeOut:0};return e.CounterId=n,e.CounterStartValue=t.value,e.CounterIncValue=t.increment,e.CounterIncTime=1e3*t.time,init=function(){get()},get=function(){e.incTimeOut=Math.floor(e.CounterIncTime/e.CounterIncValue),incrementCounter()},incrementCounter=function(){e.CounterStartValue+=e.CounterIncValue,console.log(e.CounterStartValue),$("#"+e.CounterId).html(numberWithCommas(e.CounterStartValue)),setTimeout("incrementCounter()",e.incTimeOut)},numberWithCommas=function(n){return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},{init:init}}window.$=jQuery.noConflict();var DataDash={settings:{formObj:null},get:function(n){$.ajax({url:DDUserAjax.ajaxurl,type:"post",data:{action:"dd_get_all_counters",id:n},success:function(n){$(n.id).html(n.html),DataDash.flipTheNumber(n)},error:function(){return!1}})},filterNumbersIntoSpan:function(n){var t="";return $.each($(n),function(n,e){t+=","===e?'<span class="dd_comma">'+e+"</span>":'<span class="dd_number">'+e+"</span>"}),t},flipTheNumber:function(n){var t=($(n.id),$(n.html));return $.each($(n.id).find("span"),function(n,e){$(e).text()!==$(t[n]).text()&&$(t[n]).addClass("ddrotate")}),$(t)}}; -
data-dash/trunk/data-dash.php
r1186746 r1955706 2 2 /* 3 3 Plugin Name: Data Dash 4 Plugin URI: http ://labs.think201.com/plugins/data-dash4 Plugin URI: https://github.com/Think201/wordpress-plugin-data-dash 5 5 Description: Data dash allows you to create dynamic counters for your website pages. 6 6 Author: Think201 7 Version: 1.2. 28 Author URI: http ://www.think201.com7 Version: 1.2.3 8 Author URI: https://www.think201.com 9 9 License: GPL v1 10 10 … … 53 53 54 54 if ( !defined( 'DD_VERSION' ) ) 55 define('DD_VERSION', '1.2. 2' );55 define('DD_VERSION', '1.2.3' ); 56 56 57 57 if ( !defined( 'DD_PLUGIN_DIR' ) ) -
data-dash/trunk/includes/dd-admin.php
r1186746 r1955706 1 1 <?php 2 2 3 class DDAdmin 3 4 { … … 20 21 add_action( 'init', array($this, 'userFiles')); 21 22 22 //add_action('wp_footer', array($this, 'ddUserInlineJS'), 20);23 add_action('wp_footer', array($this, 'ddUserInlineJS'), 20); 23 24 } 24 25 -
data-dash/trunk/includes/dd-helper.php
r1186746 r1955706 1 1 <?php 2 2 3 function getDashCounter($id, $ jstimeout = 60, $raw = false)3 function getDashCounter($id, $raw = false) 4 4 { 5 5 if($raw) … … 15 15 } 16 16 17 18 $jstimeout = $jstimeout * 60000; 17 $jstimeout = ddGetSchedulerNumeric($Counter->timeperiod); 19 18 20 19 $Numbers = str_split(number_format($Counter->value)); 21 20 22 21 ?> 23 <div class="dd_counter" data-counterid="<?php echo 'dd_counter_'.$id; ?>" data- ddjstimeout="<?php echo $jstimeout; ?>">22 <div class="dd_counter" data-counterid="<?php echo 'dd_counter_'.$id; ?>" data-value="<?php echo $Counter->value;?>" data-incvalue="<?php echo $Counter->inc_range_start; ?>" data-time="<?php echo $jstimeout; ?>"> 24 23 <h2 id="<?php echo 'dd_counter_'.$id; ?>"> 25 24 <?php -
data-dash/trunk/includes/dd-shortcodes.php
r1179730 r1955706 8 8 { 9 9 $attr_store = shortcode_atts( array( 10 'id' => null, 11 'timeout' => 60, 10 'id' => null 12 11 ), $atts ); 13 12 … … 17 16 } 18 17 19 return getDashCounter(esc_attr( $attr_store['id'] ) , esc_attr( $attr_store['timeout'] ));18 return getDashCounter(esc_attr( $attr_store['id'] )); 20 19 } 21 20 } -
data-dash/trunk/js/dd-user.js
r1186746 r1955706 2 2 window.$ = jQuery.noConflict(); 3 3 4 // function DataDash1(CounterId){4 function DataDash(CounterId, CounterData){ 5 5 6 // var settings = 6 var settings = 7 { 8 CounterId : null, 9 CounterStartValue : 0, 10 CounterIncValue : 0, 11 CounterIncTime : 0, 12 incTimeOut : 0 13 }; 14 15 settings.CounterId = CounterId; 16 settings.CounterStartValue = CounterData['value']; 17 settings.CounterIncValue = CounterData['increment']; 18 settings.CounterIncTime = CounterData['time']*1000; 19 20 init = function() { 21 get(); 22 }, 23 24 get = function() { 25 26 // Calculation for incrementing value 27 settings.incTimeOut = Math.floor(settings.CounterIncTime / settings.CounterIncValue); 28 29 incrementCounter(); 30 31 }, 32 33 incrementCounter = function() { 34 settings.CounterStartValue += getRandomInt(1,5); 35 36 $('#'+settings.CounterId).html(numberWithCommas(settings.CounterStartValue)); 37 38 setTimeout("incrementCounter()", settings.incTimeOut) 39 40 }, 41 42 numberWithCommas = function(x) { 43 return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); 44 }, 45 46 getRandomInt = function (min, max) { 47 return Math.floor(Math.random() * (max - min + 1)) + min; 48 }; 49 50 return { 51 init : init 52 }; 53 // get the id 54 55 // set the timer 56 57 // do the ajax thingy 58 59 // on sucess call the timer 60 61 62 63 }; 64 65 66 67 68 // var DataDash = { 69 70 // settings: 7 71 // { 8 // CounterId : null, 9 // }; 10 11 // settings.CounterId = CounterId; 12 13 // init = function() { 14 // this.get(); 72 // formObj : null, 15 73 // }, 16 74 17 // get = function() { 18 // console.log('called'); 19 // id = this.settings.CounterId; 20 // Obj = this; 21 75 // get: function(id) 76 // { 22 77 // $.ajax({ 23 78 // url: DDUserAjax.ajaxurl, 24 79 // type: 'post', 25 80 // data: {action: 'dd_get_all_counters', id: id}, 26 // success: function(data, status) { 81 // success: function(data, status) 82 // { 27 83 // $(data.id).html(data.html); 28 84 // DataDash.flipTheNumber(data); 29 30 // setTimeout(Obj.get, 5000);31 85 // }, 32 // error: function() { 86 // error: function() 87 // { 33 88 // return false; 34 89 // } 35 90 // }); 36 // } ;91 // }, 37 92 38 // return { 39 // init : init 40 // }; 41 // // get the id 93 // filterNumbersIntoSpan: function(Numbers) 94 // { 95 // var html = ''; 96 // $.each($(Numbers), function(index, value){ 97 // if(value === ',') { 98 // html += '<span class="dd_comma">'+value+'</span>'; 99 // } 100 // else { 101 // html += '<span class="dd_number">'+value+'</span>'; 102 // } 103 // }); 42 104 43 // // set the timer 105 // return html; 106 // }, 44 107 45 // // do the ajax thingy 108 // flipTheNumber: function(data) 109 // { 110 // // Get the existing source 111 // var existing = $(data.id); 46 112 47 // // on sucess call the timer113 // var current = $(data.html); 48 114 115 // $.each($(data.id).find('span'), function(index, value){ 49 116 117 // if($(value).text() !== $(current[index]).text()) { 50 118 119 // $(current[index]).addClass('ddrotate'); 120 121 // } 122 123 // }); 124 125 // return $(current); 126 // } 51 127 // }; 52 53 54 55 56 var DataDash = {57 58 settings:59 {60 formObj : null,61 },62 63 get: function(id)64 {65 $.ajax({66 url: DDUserAjax.ajaxurl,67 type: 'post',68 data: {action: 'dd_get_all_counters', id: id},69 success: function(data, status)70 {71 $(data.id).html(data.html);72 DataDash.flipTheNumber(data);73 },74 error: function()75 {76 return false;77 }78 });79 },80 81 filterNumbersIntoSpan: function(Numbers)82 {83 var html = '';84 $.each($(Numbers), function(index, value){85 if(value === ',') {86 html += '<span class="dd_comma">'+value+'</span>';87 }88 else {89 html += '<span class="dd_number">'+value+'</span>';90 }91 });92 93 return html;94 },95 96 flipTheNumber: function(data)97 {98 // Get the existing source99 var existing = $(data.id);100 101 var current = $(data.html);102 103 $.each($(data.id).find('span'), function(index, value){104 105 if($(value).text() !== $(current[index]).text()) {106 107 $(current[index]).addClass('ddrotate');108 109 }110 111 });112 113 return $(current);114 }115 }; -
data-dash/trunk/pages/admin-create-counter.php
r1179730 r1955706 14 14 <div class="tbox-heading"> 15 15 Add the details to create the counter. 16 <a href="http ://labs.think201.com/plugins/data-dash" target="_blank" class="pull-right">Need help?</a>16 <a href="https://github.com/Think201/wordpress-plugin-data-dash" target="_blank" class="pull-right">Need help?</a> 17 17 </div> 18 18 <div class="tbox-body"> -
data-dash/trunk/pages/admin-dashboard.php
r1186746 r1955706 8 8 <div class="tbox-heading"> 9 9 <h3>Quick Overview</h3> 10 <a href="http ://labs.think201.com/plugins/data-dash" target="_blank" class="pull-right">Need help?</a>10 <a href="https://github.com/Think201/wordpress-plugin-data-dash" target="_blank" class="pull-right">Need help?</a> 11 11 </div> 12 12 <div class="tbox-body"> -
data-dash/trunk/pages/admin-update-counter.php
r1179730 r1955706 30 30 <div class="tbox-heading"> 31 31 Edit Counter Details 32 <a href="http ://labs.think201.com/plugins/data-dash" target="_blank" class="pull-right">Need help?</a>32 <a href="https://github.com/Think201/wordpress-plugin-data-dash" target="_blank" class="pull-right">Need help?</a> 33 33 </div> 34 34 <div class="tbox-body"> -
data-dash/trunk/pages/user-footer.php
r1186746 r1955706 1 1 <script type='text/javascript'> 2 $( document ).ready(function()3 {4 var Counters = Array();2 $( document ).ready(function() 3 { 4 var Counters = Array(); 5 5 6 (function getCountersData() {7 var ddJSInverval = $('.dd_counter').data('ddjstimeout');6 (function getCountersData() { 7 //var ddJSInverval = $('.dd_counter').data('ddjstimeout'); 8 8 var ddCounterObj = $('.dd_counter'); 9 9 10 if(typeof ddJSInverval != 'undefined')11 {12 $.each($(ddCounterObj), function(index, value) {13 10 14 var dd_counterid = $(value).data('counterid');11 $.each($(ddCounterObj), function(index, value) { 15 12 16 // Counters[index] = new DataDash1(dd_counterid); 17 // Counters[index].init(); 18 19 dd_counterid = dd_counterid.split("_").pop(); 13 var dd_counterid = $(value).data('counterid'); 20 14 21 DataDash.get(dd_counterid); 15 Data = new Array(); 16 17 Data['value'] = $(value).data('value'); 18 Data['increment'] = $(value).data('incvalue'); 19 Data['time'] = $(value).data('time'); 20 21 Counters[index] = new DataDash(dd_counterid, Data); 22 Counters[index].init(); 23 24 //dd_counterid = dd_counterid.split("_").pop(); 25 26 //DataDash.get(dd_counterid); 22 27 23 28 }); 24 29 25 30 //setInterval(getCountersData, ddJSInverval); 26 } 27 })();28 });31 32 })(); 33 }); 29 34 </script> 30 35 -
data-dash/trunk/readme.txt
r1186746 r1955706 3 3 Tags: Data Dash, website counter, counter 4 4 Requires at least: 3.5.2 5 Donate link: http ://www.think201.com/6 Tested up to: 4. 2.27 Stable tag: 1.2. 28 Version: 1.2. 25 Donate link: https://www.think201.com/ 6 Tested up to: 4.9.8 7 Stable tag: 1.2.3 8 Version: 1.2.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 26 26 * Like the plugin or want features? Tweet to us [@think201](https://twitter.com/think201) 27 * Also you can read more about the plugin & its development at [Think201 Labs](http ://labs.think201.com)27 * Also you can read more about the plugin & its development at [Think201 Labs](https://github.com/Think201/wordpress-plugin-data-dash) 28 28 29 29 = Plugin Support = … … 93 93 - Removed the Javascript client side request for counters. 94 94 - Bug Fixes 95 96 = 1.2.3 = 97 - Compatibility check
Note: See TracChangeset
for help on using the changeset viewer.