Sei sulla pagina 1di 3

/*

* Minified
* Version 1.6.1
*
* http://mosttw.wordpress.com/
*
* Licensed under MIT License: http://en.wikipedia.org/wiki/MIT_License
*
* Copyright (c) 2010 MostThingsWeb

Permission is hereby granted, free of charge, to any person obtaining a copy


of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

* Changelog:
*
* Version 1.6.1
* - Fixed issue where JS minifier failed to rename a variable properly
*
* Version 1.6
* - Fixed overlay overflow issues in IE
* - Fixed overlay fadeIn in IE
*
*
* Version 1.5
* - Release
*
*/
/*
*
* Portions of this software come from jQuery UI Dialog 1.8.4
* License (below):
*
* jQuery UI Dialog 1.8.4
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.button.js
* jquery.ui.draggable.js
* jquery.ui.mouse.js
* jquery.ui.position.js
* jquery.ui.resizable.js
*/

(function(a){function m(){for(var b="",c=1;c<=10;c+


+)b+=Math.floor(Math.random()*10)+1;return b}function n(b){var
c=0,d;b.each(function(){if(a(this).css("z-index")>c){d=a(this);c=a(this).css("z-
index")}});return d}var
k=a.ui.dialog.prototype,j,l=m(),o=/Opacity=(\d+)/;a("body").append("<div id='"+l+"'
class='ui-widget-overlay' style='display: none;'></div>");try{var
p=a("#"+l).css("filter");if(o.test(p))j=o.exec(p)[1]}catch(r){}j||
(j=0);a("#"+l).remove();var q=function()
{this.originalTitle=this.element.attr("title"); if(typeof this.originalTitle!
=="string")this.originalTitle="";var b=this,c=b.options,d=c.title||
b.originalTitle||"&#160;",i=a.ui.dialog.getTitleId(b.element),e=(b.uiDialog=a("<div
></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-
content ui-corner-all "+c.dialogClass).css({zIndex:c.zIndex}).attr("tabIndex",-
1).css("outline",0).keydown(function(g)
{if(c.closeOnEscape&&g.keyCode&&g.keyCode===a.ui.keyCode.ESCAPE)
{b.close(g);g.preventDefault()}}).attr({role:"dialog","aria-
labelledby":i}).mousedown(function(g){b.moveToTop(false,
g)});b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-
content").appendTo(e);var f=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-
dialog-titlebar ui-widget-header ui-corner-all ui-helper-
clearfix").prependTo(e);if(c.hasClose){var h=a('<a href="#"></a>').addClass("ui-
dialog-titlebar-close ui-corner-all").attr("role","button").hover(function()
{h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-
hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function()
{h.removeClass("ui-state-focus")}).click(function(g){b.close(g); return
false}).appendTo(f);(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-
icon ui-icon-
closethick").text(c.closeText).appendTo(h)}a("<span></span>").addClass("ui-dialog-
title").attr("id",i).html(d).prependTo(f);if(a.isFunction(c.beforeclose)&&!
a.isFunction(c.beforeClose))c.beforeClose=c.beforeclose;f.find("*").add(f).disableS
election();c.draggable&&a.fn.draggable&&b._makeDraggable();c.resizable&&a.fn.resiza
ble&&b._makeResizable();b._createButtons(c.buttons);b._isOpen=false;a.fn.bgiframe&&
e.bgiframe()};k.destroy=function()
{this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeCla
ss("ui-dialog-content ui-widget-
content").hide().appendTo("body");this.uiDialog.remove();this.originalTitle&&this.e
lement.attr("title",this.originalTitle);return this};k.close=function()
{a.hideDialog()};k.open=function(){if(!this._isOpen){var
b=this.options,c=this.uiDialog,d=a(".ui-widget-overlay:visible").size()!
=0;this.overlay=b.modal?new a.ui.dialog.overlay(this):null;c.next().length&&
c.appendTo("body");this._size();this._position(b.position);var
i=c.show(b.show);b.modal&&a(".ui-widget-
overlay").css("position","fixed");if(b.fadeIn){!d&&b.modal&&a(".ui-widget-
overlay").hide().css("filter","alpha(opacity="+j+")").fadeIn("normal");i.hide().fad
eIn("normal")}this.moveToTop(true);b.modal&&c.bind("keypress.ui-dialog",function(e)
{if(e.keyCode===a.ui.keyCode.TAB){var
f=a(":tabbable",this),h=f.filter(":first");f=f.filter(":last");if(e.target===f[0]&&
!e.shiftKey){h.focus(1);return false}else if(e.target=== h[0]&&e.shiftKey)
{f.focus(1);return
false}}});a(this.element.find(":tabbable").get().concat(c.find(".ui-dialog-
buttonpane
:tabbable").get().concat(c.get()))).eq(0).focus();this._trigger("open");this._isOpe
n=true;return this}};a.showDialog=function(b,c,d)
{b={resizable:false,draggable:true,closeOnEscape:false,moveToTop:true,title:b,hasCl
ose:true,fadeIn:true};a.extend(b,d);if(!b.hasClose)
$dialog._create=q;d=m();a("#dialogContainer").size()==0&&a("body").append("<div
id='dialogContainer'></div>");a("#dialogContainer").after("<div id='m"+
d+"'><p><div id='mp"+d+"'>"+c+"</div></p></div>");a("#m"+d).dialog(b);a(".ui-
widget-overlay").size()>1&&a(".ui-widget-overlay:first").remove();return
d};a.hideDialog=function(b,c){b=b||"#"+n(a(".ui-dialog")).find(".ui-dialog-
content").attr("id");c=c||true;a(b).parent().andSelf().remove();if(a(".ui-
dialog:visible").size()===0)c?a(".ui-widget-overlay").fadeOut("normal"):a(".ui-
widget-overlay").hide();else a(".ui-widget-overlay").css({"z-
index":parseInt(n(a(".ui-dialog:visible")).css("z-index"),10)-
1});a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d)
{a(document).unbind(d+".dialog-overlay")})};a.clearDialogs=function(b){b=b||
true;a(".ui-dialog").each(function(){a(this).find(".ui-dialog-
content").parent().andSelf().remove()});b?a(".ui-widget-
overlay").fadeOut("normal"):a(".ui-widget-
overlay").hide();a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),
function(c){a(document).unbind(c+".dialog-overlay")})};a.alert=function(b,c){var
d;d=a.extend(d,c,{buttons:{Ok:function(){a.hideDialog(this)}}}); return
a.showDialog("Info",b,d)};a.confirm=function(b,c,d,i){var e;e=a.extend(e,i,
{buttons:{No:function(){(d||a.noop).call();a.hideDialog(this)},Yes:function(){(c||
a.noop).call();a.hideDialog(this)}}});return a.showDialog("Confirm",b,e)}})
(jQuery);

Potrebbero piacerti anche