From 8d9827c9afe92caaca5615713f26d46475346dd3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 1 Jul 2009 13:46:32 -0400 Subject: [PATCH] add the readable source for joverlay --- js/jquery.joverlay.js | 271 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 js/jquery.joverlay.js diff --git a/js/jquery.joverlay.js b/js/jquery.joverlay.js new file mode 100644 index 0000000000..e4effec8e7 --- /dev/null +++ b/js/jquery.joverlay.js @@ -0,0 +1,271 @@ +/* Copyright (c) 2009 Alvaro A. Lima Jr http://alvarojunior.com/jquery/joverlay.html + * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * Version: 0.7.1 (JUN 15, 2009) + * Requires: jQuery 1.3+ + */ + +(function($) { + + // Global vars + var isIE6 = $.browser.msie && $.browser.version == 6.0; // =( + var JOVERLAY_TIMER = null; + var JOVERLAY_ELEMENT_PREV = null; + + $.fn.jOverlay = function(options) { + + // Element exist? + if ( $('#jOverlay').length ) {$.closeOverlay();} + + // Clear Element Prev + JOVERLAY_ELEMENT_PREV = null; + + // Clear Timer + if (JOVERLAY_TIMER !== null) { + clearTimeout( JOVERLAY_TIMER ); + } + + // Set Options + var options = $.extend({}, $.fn.jOverlay.options, options); + + // private function + function center(id) { + if (options.center) { + $.center(id); + } + } + + var element = this.is('*') ? this : '#jOverlayContent'; + var position = isIE6 ? 'absolute' : 'fixed'; + var isImage = /([^\/\\]+)\.(png|gif|jpeg|jpg|bmp)$/i.test( options.url ); + + var imgLoading = options.imgLoading ? "" : ''; + + $('body').prepend(imgLoading + "
" + + "