text stringlengths 0 14.1k |
|---|
} |
function order(prop, asc) { |
json = json.sort(function(a, b) { |
if (asc) return (a[prop] > b[prop]) ? 1 : ((a[prop] < b[prop]) ? -1 : 0); |
else return (b[prop] > a[prop]) ? 1 : ((b[prop] < a[prop]) ? -1 : 0); |
}); |
contenedor.html(''); |
load_content(json); |
} |
function search() { |
var list = table.find(""th[rel]""); |
var data = []; |
var serch = $(""#buscador"").val(); |
json.forEach(function(element, index, array) { |
$.each(list, function(index) { |
valor = $(this).attr('rel'); |
if (element[valor]) { |
if (element[valor].like('%' + serch + '%')) { |
data.push(element); |
return false; |
} |
} |
}); |
}); |
contenedor.html(''); |
load_content(data); |
} |
String.prototype.like = function(search) { |
if (typeof search !== 'string' || this === null) { |
return false; |
} |
search = search.replace(new RegExp(""([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:\\-])"", ""g""), ""\\$1""); |
search = search.replace(/%/g, '.*').replace(/_/g, '.'); |
return RegExp('^' + search + '$', 'gi').test(this); |
} |
function export_csv(JSONData, ReportTitle, ShowLabel) { |
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; |
var CSV = ''; |
// CSV += ReportTitle + '\r\n\n'; |
if (ShowLabel) { |
var row = """"; |
for (var index in arrData[0]) { |
row += index + ';'; |
} |
row = row.slice(0, -1); |
CSV += row + '\r\n'; |
} |
for (var i = 0; i < arrData.length; i++) { |
var row = """"; |
for (var index in arrData[i]) { |
row += '""' + arrData[i][index] + '"";'; |
} |
row.slice(0, row.length - 1); |
CSV += row + '\r\n'; |
} |
if (CSV == '') { |
alert(""Invalid data""); |
return; |
} |
// var fileName = ""Report_""; |
//fileName += ReportTitle.replace(/ /g,""_""); |
var uri = 'data:text/csv;charset=utf-8,' + escape(CSV); |
var link = document.createElement(""a""); |
link.href = uri; |
link.style = ""visibility:hidden""; |
link.download = ReportTitle + "".csv""; |
document.body.appendChild(link); |
link.click(); |
document.body.removeChild(link); |
}" mit |
levfurtado/scoops vendor/bombayworks/zendframework1/library/Zend/Gdata/YouTube/Extension/Username.php 1488 "<?php |
/** |
* Zend Framework |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.