window.usernoise = {} jQuery ($) -> UsernoiseButton = -> self = this self.show = -> $button = $("").appendTo($("body")) property = undefined $button.html usernoiseButton.text $button.addClass usernoiseButton["class"] $button.attr "style", usernoiseButton.style $button.click (event) -> self.showWindow() event.preventDefault() false if browser.msie7 $button.css "margin-top", "-" + $button.width() / 2 + "px" if $button.is(".un-left") or $button.is(".un-right") $button.addClass "ie7" else if browser.msie8 $button.css "right", "-" + $button.outerWidth() + "px" if $button.is(".un-right") $button.css "margin-top", "-" + $button.width() / 2 + "px" if $button.is(".un-left") or $button.is(".un-right") $button.addClass "ie8" else $button.addClass "css3" $button.css "margin-left", "-" + ($("#un-button").width() / 2) + "px" if $button.is(".un-bottom") or $button.is(".un-top") if $button.is(".un-left") property = "left" else if $button.is(".un-right") property = "right" else if $button.is(".un-bottom") property = "bottom" else property = "top" $button.css "margin-top", ($button.width() / 2) + "px" if $button.is(".un-left.css3") $button.css "margin-top", "-" + ($button.width() / 2) + "px" if $button.is(".un-right.css3") propOnStart = {} propOnIn = opacity: 1 propOnOut = opacity: 0.96 propOnStart[property] = "+=40px" propOnIn[property] = "+=3px" propOnOut[property] = "-=3px" $button.animate(propOnStart).hover (-> $button.animate propOnIn, 100 return ), -> $button.animate propOnOut, 100 return return self.showWindow = -> $overlay = $("
").prependTo($("body")) $overlay.fadeIn "fast" $loading = $("
").prependTo($("body")) $iframe = $("