Compare Page Revisions
« Older Revision - Back to Page History - Newer Revision »
/*===============================================================================================*/ (function ($) { /*-------------------------------------------------------------------------------------------*/ $.fn.showExt = function (show, fade) { if (fade == undefined) fade = false; if (show) { if (fade) this.fadeIn(); else this.show(); } else { if (fade) this.fadeOut(); else this.hide(); } return this; } /*-------------------------------------------------------------------------------------------*/ $.fn.enable = function (enabled, className) { if (enabled) { this.removeAttr('disabled'); if (className != undefined) this.removeClass(className); } else { this.attr('disabled', 'disabled'); if (className != undefined) this.addClass(className); } return this; } /*-------------------------------------------------------------------------------------------*/ $.fn.lockEdit = function (readOnly) { if (readOnly) this.removeAttr('readonly'); else this.attr('readonly', 'readonly'); return this; } /*-------------------------------------------------------------------------------------------*/ $.fn.setChecked = function (checked) { if (checked) this.attr('checked', 'checked'); else this.removeAttr('checked'); return this; } /*-------------------------------------------------------------------------------------------*/ $.fn.validateInt = function (errorClassName) { var input = $(this).val(); if ((input - 0) == input && Math.ceil(input) == Math.floor(input)) { $(this).removeClass(errorClassName); return true; } else { $(this).addClass(errorClassName); return false; } } /*-------------------------------------------------------------------------------------------*/ })(jQuery); /*===============================================================================================*/
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.