<script type="text/javascript">
$(function() {
if ($('#ctl00_ContentPlaceHolder1_hdnIsPostBack').val() == '1') {
OpenWordList();
}
$('#<%= FileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= SheKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= tbnSheKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= BenHeKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnBenHeKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= BenSheKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnBenSheKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
});
function IsConfirmationExist() {
var msg = confirm("The entered word is already there in the Blocked Word(s) List and you cannot add it here. \n Do you want to Delete from the Blocked Word(s) List to add here.");
if (msg == true) {
$('#ctl00_ContentPlaceHolder1_hdnIsExist').val(1);
}
else {
$('#ctl00_ContentPlaceHolder1_hdnIsExist').val(0);
}
$('#<%= btnUpdateImportData.ClientID%>').trigger('click');
}
function getFile(FileUploadType) {
if (FileUploadType == 'He') {
$('#<%= FileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'She') {
$('#<%= SheKeyFileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'BenHe') {
$('#<%= BenHeKeyFileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'BenShe') {
$('#<%= BenSheKeyFileUploadToServer.ClientID%>').click();
}
}
var tr = '<table id="testTable"><tr><td style="font-size:16px; font-weight:bold; color:blue;" id="PageTitle"></td></tr>';
function ExportPick_Words_Male(fileName) {
$('#HEwordlist table td:has(:input[type=text])').each(function() {
//tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Pick Words - Male');
tableToExcel('testTable', fileName)
}
function ExportPick_Words_Female(fileName) {
$('#SHEwordlist table td:has(:input[type=text])').each(function() {
// tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Pick Words - Female');
tableToExcel('testTable', fileName)
}
function ExportStop_Words(fileName) {
$('#HEBlock_wordlist table td:has(:input[type=text])').each(function() {
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Stop Words');
tableToExcel('testTable', fileName)
}
function ExportObscene_Words(fileName) {
$('#SHEBlock_wordlist table td:has(:input[type=text])').each(function() {
//tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Obscene Words');
tableToExcel('testTable', fileName)
}
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
window.location.href = uri + base64(format(template, ctx))
}
})()
</script>
$(function() {
if ($('#ctl00_ContentPlaceHolder1_hdnIsPostBack').val() == '1') {
OpenWordList();
}
$('#<%= FileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= SheKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= tbnSheKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= BenHeKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnBenHeKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
$('#<%= BenSheKeyFileUploadToServer.ClientID %>').on('change', function(e) {
$('#<%= btnBenSheKeyUpload.ClientID%>').trigger('click'); // trigger the btn button click which i have hidden using style='display:none'
});
});
function IsConfirmationExist() {
var msg = confirm("The entered word is already there in the Blocked Word(s) List and you cannot add it here. \n Do you want to Delete from the Blocked Word(s) List to add here.");
if (msg == true) {
$('#ctl00_ContentPlaceHolder1_hdnIsExist').val(1);
}
else {
$('#ctl00_ContentPlaceHolder1_hdnIsExist').val(0);
}
$('#<%= btnUpdateImportData.ClientID%>').trigger('click');
}
function getFile(FileUploadType) {
if (FileUploadType == 'He') {
$('#<%= FileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'She') {
$('#<%= SheKeyFileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'BenHe') {
$('#<%= BenHeKeyFileUploadToServer.ClientID%>').click();
}
if (FileUploadType == 'BenShe') {
$('#<%= BenSheKeyFileUploadToServer.ClientID%>').click();
}
}
var tr = '<table id="testTable"><tr><td style="font-size:16px; font-weight:bold; color:blue;" id="PageTitle"></td></tr>';
function ExportPick_Words_Male(fileName) {
$('#HEwordlist table td:has(:input[type=text])').each(function() {
//tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Pick Words - Male');
tableToExcel('testTable', fileName)
}
function ExportPick_Words_Female(fileName) {
$('#SHEwordlist table td:has(:input[type=text])').each(function() {
// tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Pick Words - Female');
tableToExcel('testTable', fileName)
}
function ExportStop_Words(fileName) {
$('#HEBlock_wordlist table td:has(:input[type=text])').each(function() {
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Stop Words');
tableToExcel('testTable', fileName)
}
function ExportObscene_Words(fileName) {
$('#SHEBlock_wordlist table td:has(:input[type=text])').each(function() {
//tr = tr + '<tr><td>' + $(this).find("input").val() + '</td></tr>';
tr = tr + '<tr><td>' + $(this).find("span").html() + '</td></tr>';
});
tr = tr + '</table>';
$('#tblExportList').empty();
$('#tblExportList').append(tr);
$('#PageTitle').html('Obscene Words');
tableToExcel('testTable', fileName)
}
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
window.location.href = uri + base64(format(template, ctx))
}
})()
</script>
No comments:
Post a Comment