JezK
Edit File: main.custom.min.js
$(document).ready(function() { $('#selectAll').click(function() { $('.chkselect').prop('checked', this.checked); }); //$("img").addClass("img-responsive"); // $(this).bind("contextmenu", function(e) {e.preventDefault();}); }); function check_perform_add(target) { show_modal(target); } function check_perform_sdelete(id) { if (confirm(getLocale("Do you want to delete selected record"))) { $(document).ready(function() { $('.chkselect').prop('checked', false); $("#DeleteCheckbox" + id).prop("checked", true); document.deleteallfrm.submit(); }); } } function check_perform_delete() { var numberOfChecked = $('.chkselect:checked').length; if (numberOfChecked == 0) alert(getLocale("Please Select Any Record")); else { if (confirm(getLocale("Do You Want To Delete") + " " + numberOfChecked + " " + getLocale("Record"))) document.deleteallfrm.submit(); } } function check_perform_edit(id) { var numberOfChecked = $('.chkselect:checked').length; var SelectedItem = new Array(); if (numberOfChecked == 0) alert(getLocale("Please Select Any Record")); else { $('.chkselect:checked').each(function() { if ($('.chkselect').is(':checked')) SelectedItem.push($(this).val()); }); var target = id + "/edit/" + SelectedItem; show_modal(target); } } function check_perform_editfull(id) { var numberOfChecked = $('.chkselect:checked').length; var SelectedItem = new Array(); if (numberOfChecked == 0) alert(getLocale("Please Select Any Record")); else { $('.chkselect:checked').each(function() { if ($('.chkselect').is(':checked')) SelectedItem.push($(this).val()); }); var target = id + "/edit/" + SelectedItem; window.location = target; } } function check_perform_sedit(controller, id) { var target = controller + "/edit/" + id; show_modal(target); } function check_perform_sedit_new(target) { show_modal(target); } function check_perform_select(id, controller) { var numberOfChecked = $('.chkselect:checked').length; var SelectedItem = new Array(); if (numberOfChecked == 0) alert(getLocale("Please Select Any Record")); else { $('.chkselect:checked').each(function() { if ($('.chkselect').is(':checked')) SelectedItem.push($(this).val()); }); var target = id + "/" + controller + "/" + SelectedItem; show_modal(target); } } function single_question(action, id) { $(document).ready(function() { $("#DeleteCheckbox" + id).prop("checked", true); document.deleteallfrm.action.value = action; document.deleteallfrm.submit(); }); } function all_question(action) { var numberOfChecked = $('.chkselect:checked').length; if (numberOfChecked == 0) alert(getLocale("Please Select Any Record")); else { document.deleteallfrm.action.value = action; document.deleteallfrm.submit(); } } function show_modal(target) { waitingDialog.show(); $('#targetModal').load(target, function() { $('#targetModal').modal('show'); waitingDialog.hide(); }); } $(document).ready(function() { $('.table-responsive .dropdown-toggle').on('click', function() { var button = $(this), menu = button.next('.dropdown-menu'); menu.css({ position: 'fixed', top: button.offset().top + button.outerHeight() - $(window).scrollTop(), right: $(window).width() - (button.offset().left + button.outerWidth()) }); $(window).on('scroll', function() { menu.css({ top: button.offset().top + button.outerHeight() - $(window).scrollTop() }); }); $(window).on('resize', function() { $('.dropdown-backdrop').trigger('click'); button.blur(); $(window).off('resize scroll'); }); }); }); $(document).ready(function() { $('.multiselectgrp').multiselect({ includeSelectAllOption: true, allSelectedText: getLocale('All Selected'), filterPlaceholder: getLocale('Search'), nonSelectedText: getLocale('None selected'), selectAllText: getLocale('Select All'), enableFiltering: true, enableCaseInsensitiveFiltering: true, maxHeight: 200, buttonWidth: '220px' }); $('#characterLeft').text(getLocale(' 0 character (1 sms)')); }); function sms_character_count() { var len = $('#SendsmsMessage').val().length; if (len < 160) sms = 1; else { var sms = Math.floor(len / 160) + 1; } var ch = len; $('#characterLeft').text(ch + getLocale(' characters ') + '(' + sms + getLocale(' sms)')); } function escapeRegExp(mstring) { return mstring.replace(/([.*+?^=!:${}()|\[\]\/\\ & %@#<>])/g, "-"); } function getLocale(message) { if(message=="Do you want to delete selected record") return"Do you want to delete selected record"; if(message=="Please Select Any Record") return"Please Select Any Record"; if(message=="Do You Want To Delete") return"Do You Want To Delete"; if(message=="Record") return"Record"; if(message=="All Selected") return"All Selected"; if(message=="Select All") return"Select All"; if(message=="Search") return"Search"; if(message=="None selected") return"None selected"; if(message==" 0 character (1 sms)") return" 0 character (1 sms)"; if(message==" characters ") return" characters "; if(message==" sms)") return" sms)"; if(message=="Searching\u2026") return"Searching..."; if(message=="No matches found") return"No matches found"; if(message=="Please enter") return"Please enter"; if(message==" or more character") return" or more character"; if(message=="Loading failed") return"Loading failed"; if(message=="Remove") return"Remove"; return""; }