! function($) {
"use strict";
var numbersType = $.fn.dataTable.absoluteOrderNumber([{
value: "0",
position: "bottom"
}]),
currencyType = $.fn.dataTable.absoluteOrderNumber([{
value: "0.000000",
position: "bottom"
}]);
columnDefs: [{
targets: 3,
type: numbersType
}, {
targets: 4,
type: numbersType
}, {
targets: 6,
type: currencyType
}], $.fn.celpDatatable = function() {
var $celp_table = $(this),
coin_symbol = $celp_table.data("coin-symbol"),
coin_price = $celp_table.data("coin-price"),
prevLbl = $celp_table.data("prev"),
nextLbl = $celp_table.data("next"),
showEntriesLbl = $celp_table.data("show-entries"),
searchLbl = $celp_table.data("search"),
zeroRecords = $celp_table.data("zero-records"),
ShowingEntries = $celp_table.data("showing_entries"),
FilterEntries = $celp_table.data("filter_entries"),
loadingText = $celp_table.data("loading_records"),
perPage = $celp_table.data("per-page"),
defaultLogo = $celp_table.parents(".celp_container").data("default-logo"),
columns = [];
$celp_table.find("thead th").each(function(index) {
var index = $(this).data("index"),
thisTH = $(this),
classes = $(this).data("classes"),
fiatSymbol = "$";
var type = '';
if (index == "coin_supports" || index == "trading_pairs") {
type = numbersType
} else if (index == "name" || index == "official_website") {
type = "html"
} else if (index == "btc_price") {
type = currencyType
} else if (index == "id" || index == "volume_24h" || index == "alexa_rank") {
type = 'num-fmt'
} else {
type = "string"
}
columns.push({
data: index,
name: index,
type: type,
render: function(data, type, row, meta) {
if (void 0 === meta.settings.json) return data;
if ("display" === type) switch (index) {
case "id":
return row.id;
case "country":
return parseInt(data) <= 0 ? '
N/A
' : '' + data + "
";
case "established":
return parseInt(data) <= 0 ? 'N/A
' : '' + data + '
';
case "name":
var singleUrl, url = thisTH.data("single-page-url") + "/" + row.ex_id + '/',
html;
return html = '";
case "description":
return html = '' + data + '
';
case "volume_24h":
var formatedVal = coin_price * data,
btcVol = row.btc_volume,
formatedbtcVol = numeral(btcVol).format("0,0.00");
return formatedVal = numeral(formatedVal).format("0,0.00"), html = void 0 !== data && null != data ? '' + coin_symbol + formatedVal.toUpperCase() + "
" + formatedbtcVol + " BTC
" : '?
';
case "official_website":
var html;
return html = ''
}
return data
}
})
}), $celp_table.DataTable({
serverSide: true,
"deferRender": true,
ajax: {
url: ajax_object.ajax_url,
type: "POST",
dataType: "JSON",
async: true,
data: function(d) {
d.action = "celp_get_ex_list"
d.search = d['search']['value'];
},
error: function(xhr, error, thrown) {}
},
columns: columns,
ordering: false,
searching: true,
pageLength: perPage,
pagingType: "simple",
processing: true,
language: {
info: ShowingEntries,
infoFiltered: "(" + FilterEntries + ")",
loadingRecords: loadingText + "...",
processing: "",
loading: loadingText + "...",
paginate: {
next: nextLbl,
previous: prevLbl
},
lengthMenu: showEntriesLbl,
search: searchLbl,
zeroRecords: zeroRecords
},
drawCallback: function(settings) {
$celp_table.tableHeadFixer({
head: !1,
left: 2,
"z-index": 1
})
}
})
}, $(document).ready(function() {
$("#celp_main_list").celpDatatable()
})
new Tablesort(document.getElementById('celp_main_list'), {
descending: true
});
}(jQuery);
/* Do not modify this file directly. It is compiled from other files. */
/*global google:true*/
/*global _wp_google_translate_widget:true*/
/*exported googleTranslateElementInit*/
function googleTranslateElementInit(){var e,a="en",t=/[?]lang=([a-zA-Z\-_]+)/;"object"==typeof _wp_google_translate_widget&&"string"==typeof _wp_google_translate_widget.lang&&(a=_wp_google_translate_widget.lang),(e=window.location.href.match(t))&&(window.location.href=window.location.href.replace(t,"").replace(/#googtrans\([a-zA-Z\-_|]+\)/,"")+"#googtrans("+a+"|"+e[1]+")"),new google.translate.TranslateElement({pageLanguage:a,layout:_wp_google_translate_widget.layout,autoDisplay:!1},"google_translate_element")};