dokuwiki-template-sprintdoc.../js/base/utility.js

30 lines
849 B
JavaScript
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file utility funcs and polyfills
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// object literal with funcs for jquery plug-ins
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
var utility = {};
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// js trim func for ie
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
};
}
/**
* custom event handler show/hide events for using .on()
*/
(function ($) {
$.each(['show', 'hide'], function (i, e) {
var el = $.fn[e];
$.fn[e] = function () {
this.trigger(e);
return el.apply(this, arguments);
};
});
})(jQuery);