Plugin Directory

Changeset 1955706


Ignore:
Timestamp:
10/12/2018 11:50:17 AM (7 years ago)
Author:
think201
Message:

Latest Update

Location:
data-dash/trunk
Files:
11 edited

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)}};
     1function 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  
    22/*
    33Plugin Name: Data Dash
    4 Plugin URI: http://labs.think201.com/plugins/data-dash
     4Plugin URI: https://github.com/Think201/wordpress-plugin-data-dash
    55Description: Data dash allows you to create dynamic counters for your website pages.
    66Author: Think201
    7 Version: 1.2.2
    8 Author URI: http://www.think201.com
     7Version: 1.2.3
     8Author URI: https://www.think201.com
    99License: GPL v1
    1010
     
    5353
    5454if ( !defined( 'DD_VERSION' ) )
    55 define('DD_VERSION', '1.2.2' );
     55define('DD_VERSION', '1.2.3' );
    5656
    5757if ( !defined( 'DD_PLUGIN_DIR' ) )
  • data-dash/trunk/includes/dd-admin.php

    r1186746 r1955706  
    11<?php
     2
    23class DDAdmin
    34{
     
    2021        add_action( 'init', array($this, 'userFiles'));
    2122
    22         //add_action('wp_footer', array($this, 'ddUserInlineJS'), 20);
     23        add_action('wp_footer', array($this, 'ddUserInlineJS'), 20);
    2324    }
    2425
  • data-dash/trunk/includes/dd-helper.php

    r1186746 r1955706  
    11<?php
    22
    3 function getDashCounter($id, $jstimeout = 60, $raw = false)
     3function getDashCounter($id, $raw = false)
    44{
    55  if($raw)
     
    1515  }
    1616
    17 
    18   $jstimeout = $jstimeout * 60000;
     17  $jstimeout = ddGetSchedulerNumeric($Counter->timeperiod);
    1918   
    2019    $Numbers = str_split(number_format($Counter->value));
    2120 
    2221    ?>   
    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; ?>">
    2423      <h2 id="<?php echo 'dd_counter_'.$id; ?>">
    2524        <?php
  • data-dash/trunk/includes/dd-shortcodes.php

    r1179730 r1955706  
    88    {
    99        $attr_store = shortcode_atts( array(
    10          'id' => null,
    11          'timeout' => 60,
     10         'id' => null
    1211      ), $atts );
    1312       
     
    1716      }
    1817 
    19       return getDashCounter(esc_attr( $attr_store['id'] ), esc_attr( $attr_store['timeout'] ));
     18      return getDashCounter(esc_attr( $attr_store['id'] ));
    2019    }
    2120}   
  • data-dash/trunk/js/dd-user.js

    r1186746 r1955706  
    22window.$ = jQuery.noConflict();
    33
    4 // function DataDash1(CounterId){
     4function DataDash(CounterId, CounterData){
    55
    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:
    771//   {
    8 //     CounterId  : null,
    9 //   };
    10 
    11 //   settings.CounterId = CounterId;
    12 
    13 //   init = function() {
    14 //       this.get();
     72//     formObj  : null,
    1573//   },
    1674
    17 //   get = function() {
    18 //     console.log('called');
    19 //     id = this.settings.CounterId;
    20 //     Obj = this;
    21 
     75//   get: function(id)
     76//   {   
    2277//     $.ajax({
    2378//       url: DDUserAjax.ajaxurl,
    2479//       type: 'post',
    2580//       data: {action: 'dd_get_all_counters', id: id},
    26 //       success: function(data, status) {
     81//       success: function(data, status)
     82//       {
    2783//         $(data.id).html(data.html);
    2884//         DataDash.flipTheNumber(data);
    29 
    30 //         setTimeout(Obj.get, 5000);
    3185//       },
    32 //       error: function() {   
     86//       error: function()
     87//       {   
    3388//        return false;
    3489//      }                       
    3590//    });
    36 //   };
     91//   },
    3792
    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//     });
    42104
    43 //   // set the timer
     105//     return html;
     106//   },
    44107
    45 //   // do the ajax thingy
     108//   flipTheNumber: function(data)
     109//   {
     110//     // Get the existing source
     111//     var existing = $(data.id);
    46112
    47 //   // on sucess call the timer
     113//     var current = $(data.html);
    48114
     115//     $.each($(data.id).find('span'), function(index, value){       
    49116
     117//       if($(value).text() !== $(current[index]).text()) {
    50118
     119//         $(current[index]).addClass('ddrotate');
     120
     121//       }     
     122
     123//     });
     124
     125//     return $(current);
     126//   }
    51127// };
    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 source
    99     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  
    1414        <div class="tbox-heading">
    1515            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>
    1717        </div>
    1818        <div class="tbox-body">
  • data-dash/trunk/pages/admin-dashboard.php

    r1186746 r1955706  
    88        <div class="tbox-heading">
    99            <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>
    1111        </div>
    1212        <div class="tbox-body">
  • data-dash/trunk/pages/admin-update-counter.php

    r1179730 r1955706  
    3030        <div class="tbox-heading">
    3131            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>
    3333        </div>
    3434        <div class="tbox-body">
  • data-dash/trunk/pages/user-footer.php

    r1186746 r1955706  
    11<script type='text/javascript'>
    2 $( document ).ready(function()
    3 {
    4    var Counters = Array();
     2   $( document ).ready(function()
     3   {
     4      var Counters = Array();
    55
    6    (function getCountersData() {
    7       var ddJSInverval = $('.dd_counter').data('ddjstimeout');     
     6      (function getCountersData() {
     7      //var ddJSInverval = $('.dd_counter').data('ddjstimeout');     
    88      var ddCounterObj = $('.dd_counter');
    99
    10       if(typeof ddJSInverval != 'undefined')
    11       {
    12          $.each($(ddCounterObj), function(index, value) {
    1310
    14             var dd_counterid = $(value).data('counterid');
     11      $.each($(ddCounterObj), function(index, value) {
    1512
    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');
    2014
    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);
    2227
    2328         });
    2429
    2530         //setInterval(getCountersData, ddJSInverval);
    26       }
    27    })();
    28 });
     31
     32      })();
     33   });
    2934</script>
    3035
  • data-dash/trunk/readme.txt

    r1186746 r1955706  
    33Tags: Data Dash, website counter, counter
    44Requires at least: 3.5.2
    5 Donate link: http://www.think201.com/
    6 Tested up to: 4.2.2
    7 Stable tag: 1.2.2
    8 Version: 1.2.2
     5Donate link: https://www.think201.com/
     6Tested up to: 4.9.8
     7Stable tag: 1.2.3
     8Version: 1.2.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525
    2626* 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)
    2828
    2929= Plugin Support =
     
    9393- Removed the Javascript client side request for counters.
    9494- Bug Fixes
     95
     96= 1.2.3 =
     97- Compatibility check
Note: See TracChangeset for help on using the changeset viewer.