text: define(["jquery","js/lib/modals"],function($,Modal){var signatureAuthModal=function($,Modal){var _private={defaults:{type:"quiz",submissionid:0,url:""},makeModal:function($el){if($el.addClass("modal"),!this.modal)this.modal=new Modal($el,{"overlay.class":"coursera-signature-modal-overlay-darker","overlay.close":!1,"bind.esc":!1});return this.modal},minHeight:461},AuthModal=function(el,options){this.$el=$(el),this.options=$.extend({},_private.defaults,"object"==typeof options&&options)};return AuthModal.prototype.open=function(){var self=this;return self.modal=_private.makeModal(self.$el),self.$iframe=$("<iframe>"),self.$iframe.attr("src",self.options.url+"?submission_id="+self.options.submissionid+"&type="+self.options.type),self.$el.append(self.$iframe),self.$iframe.height(_private.minHeight+"px"),self.modal.open(),self.modal.reposition(),self.$iframe.load(function(){var $innerEl=self.$iframe.contents(),$_body=$innerEl.find("html").find("body");window.parent.$("body").on("change.signature",function(){self.modal.open(),self.$iframe.height(Math.max(_private.minHeight,$_body.outerHeight())),self.modal.reposition()}),window.parent.$("body").on("close.signature",function(){if(self.$iframe.attr("src","about:blank"),self.$iframe.remove(),self.modal.close(),self.deferred.resolve(),"quiz"==self.options.type)window.location.search+="&sig_reload=1";else if("assignment"==self.options.type)window.location.reload()})}),self.deferred=$.Deferred(),self.deferred.promise()},AuthModal};return signatureAuthModal($,Modal)});