This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Display Table based on User Location*/ | |
$(document).ready(function(){ | |
fetch('https://api.ipregistry.co/?key=tryout') | |
.then(function (response) { | |
return response.json(); | |
}) | |
.then(function (payload) { | |
if(payload.location.city == 'Dhaka'){ | |
$('#footable_parent_660').css('display', 'none'); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Count rows of the table (it will work if filter is applied)*/ | |
function runAll(){ | |
var rowCount = FooTable.get('#footable_534').toJSON().rows.length; | |
var fixCount = FooTable.get('#footable_534').toJSON().rows.length; | |
var $countWrapper = $table.parent(); | |
$countWrapper.prepend('<div class="remove">Total <span>' + rowCount + "</span> data found</p>"); | |
$table.on('postdraw.ft.table', function(e, ft) { | |
jQuery('.remove').remove(); | |
var rowsCount = ft.rows.array.length; | |
$countWrapper.find('.table_info_count .current_count').html(rowsCount + " of " + fixCount); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*replace an attribute based on site language */ | |
let siteLan = document.documentElement.lang; | |
let findAreaLabel = document.querySelector('.btn-primary').getAttribute("aria-label"); | |
if(siteLan == "zh-TW") | |
{ | |
document.querySelector('.btn-primary').removeAttribute("aria-label"); | |
document.querySelector('.btn-primary').setAttribute("aria-label", "搜尋"); | |
}else if(siteLan == "en") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Ninja Table hide some rows and display them on click at first cell*/ | |
jQuery('tbody tr:nth-child(n+2):nth-child(-n+4)').hide(); | |
jQuery('tbody tr:nth-child(n+6):nth-child(-n+8)').hide(); | |
$(document).ready(function() { | |
jQuery('.footable > tbody > tr:first-child > td:first-child').click(function() { | |
jQuery('tbody tr:nth-child(n+2):nth-child(-n+4)').toggle(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
var btnn = document.querySelector('.footable_parent'); | |
let btn = document.createElement("button"); | |
btn.classList.add('mybtn'); | |
btn.innerHTML = "DISPLAY FILTERS"; | |
btnn.prepend(btn); | |
$('tr.footable-filtering').hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var btnn = document.querySelector('.footable-filtering'); | |
let btn = document.createElement("button"); | |
btn.classList.add('mybtn'); | |
btn.innerHTML = "DISPLAY TABLE BODY"; | |
btnn.append(btn); | |
$('.footable tbody').hide(); | |
document.querySelector('button.mybtn').addEventListener('click', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform_validate_input_item_input_email', function($errorMessage, $field, $formData, $fields, $form) { | |
$target_id = [59,60]; | |
$target_form_id = 0; | |
foreach($target_id as $id){ | |
if($form->id == $id){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('ninja_tables_get_public_data', function ($data, $tableId) { | |
if ($tableId == 3156) { | |
for($i = 0; $i < count($data); $i++){ | |
$val = $data[$i]['player_ranking']; | |
$arr = []; | |
$icon = '[nt_icon icon="star" color="orange"]'; | |
for($j = 1; $j<= $val; $j++){ | |
array_push($arr, $icon); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
//Shuffle all rows, while keeping the first column | |
//Requires: Shuffle | |
$.fn.shuffleRows = function(){ | |
return this.each(function(){ | |
var main = $(/table/i.test(this.tagName) ? this.tBodies[0] : this); | |
var firstElem = [], counter=0; | |
main.children().each(function(){ | |
firstElem.push(this.firstChild); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('ninja_table_rendering_table_vars',function($table_vars, $table_id, $tableArray){ | |
$target_id = [2607,2608];//add all tables ID here | |
$tableId = 0; | |
foreach($target_id as $id){ | |
if($table_id == $id){ | |
$tableId = $id; | |
} | |
} |
OlderNewer