MDL-56196 mod_lti: Fix popups and secret form in boost

This commit is contained in:
Damyon Wiese 2016-11-08 14:27:26 +08:00
parent 3d979f9676
commit 9280f62e38
10 changed files with 20 additions and 32 deletions

View File

@ -64,11 +64,11 @@ Y.extend(ALERT, M.core.notification.info, {
initializer: function() {
this._closeEvents = [];
this.publish('complete');
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
var yes = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
'value="' + this.get(CONFIRMYES) + '" />'),
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(Y.Node.create('<div class="confirmation-message">' + this.get('message') + '</div>'))
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons text-xs-right"></div>')
.append(yes));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);

View File

@ -1 +1 @@
YUI.add("moodle-core-notification-alert",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle alert",l;l=function(e){e.closeButton=!1,l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{_closeEvents:null,initializer:function(){this._closeEvents=[],this.publish("complete");var t=e.Node.create('<input type="button" id="id_yuialertconfirm-'+this.get("COUNT")+'"'+'value="'+this.get(i)+'" />'),n=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="confirmation-buttons"></div>').append(t));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this._closeEvents.push(e.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this));var s=this.get("boundingBox").one(".closebutton");s&&this._closeEvents.push(s.on("click",this.submit,this))},submit:function(){(new e.EventHandle(this._closeEvents)).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{title:{validator:e.Lang.isString,value:"Alert"},message:{validator:e.Lang.isString,value:"Confirm"},yesLabel:{validator:e.Lang.isString,setter:function(e){return e||(e="Ok"),e},value:"Ok"}}}),M.core.alert=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
YUI.add("moodle-core-notification-alert",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle alert",l;l=function(e){e.closeButton=!1,l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{_closeEvents:null,initializer:function(){this._closeEvents=[],this.publish("complete");var t=e.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-'+this.get("COUNT")+'"'+'value="'+this.get(i)+'" />'),n=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="confirmation-buttons text-xs-right"></div>').append(t));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this._closeEvents.push(e.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this));var s=this.get("boundingBox").one(".closebutton");s&&this._closeEvents.push(s.on("click",this.submit,this))},submit:function(){(new e.EventHandle(this._closeEvents)).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{title:{validator:e.Lang.isString,value:"Alert"},message:{validator:e.Lang.isString,value:"Confirm"},yesLabel:{validator:e.Lang.isString,setter:function(e){return e||(e="Ok"),e},value:"Ok"}}}),M.core.alert=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});

View File

@ -64,11 +64,11 @@ Y.extend(ALERT, M.core.notification.info, {
initializer: function() {
this._closeEvents = [];
this.publish('complete');
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
var yes = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
'value="' + this.get(CONFIRMYES) + '" />'),
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(Y.Node.create('<div class="confirmation-message">' + this.get('message') + '</div>'))
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons text-xs-right"></div>')
.append(yes));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);

View File

@ -93,14 +93,14 @@ Y.extend(CONFIRM, M.core.notification.info, {
this.publish('complete');
this.publish('complete-yes');
this.publish('complete-no');
this._yesButton = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' +
this._yesButton = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMYES) + '" />');
this._noButton = Y.Node.create('<input type="button" id="id_yuiconfirmno-' +
this._noButton = Y.Node.create('<input type="button" class="btn btn-secondary m-l-1" id="id_yuiconfirmno-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMNO) + '" />');
this._question = Y.Node.create('<div class="confirmation-message">' + this.get(QUESTION) + '</div>');
var content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(this._question)
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons form-inline text-xs-right"></div>')
.append(this._yesButton)
.append(this._noButton));
this.get(BASE).addClass('moodle-dialogue-confirm');

View File

@ -1 +1 @@
YUI.add("moodle-core-notification-confirm",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle confirmation dialogue",l;l=function(e){l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=e.Node.create('<input type="button" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get(i)+'" />'),this._noButton=e.Node.create('<input type="button" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get(s)+'" />'),this._question=e.Node.create('<div class="confirmation-message">'+this.get(u)+"</div>");var t=e.Node.create('<div class="confirmation-dialogue"></div>').append(this._question).append(e.Node.create('<div class="confirmation-buttons"></div>').append(this._yesButton).append(this._noButton));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,t,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this._closeEvents.push(e.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1));var n=this.get("boundingBox").one(".closebutton");n&&this._closeEvents.push(n.on("click",this.submit,this))},submit:function(t,n){(new e.EventHandle(this._closeEvents)).detach(),this.fire("complete",n),n?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{yesLabel:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(e){return this._yesButton&&this._yesButton.set("value",e),e}},noLabel:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(e){return this._noButton&&this._noButton.set("value",e),e}},title:{validator:e.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(e){return this._question&&this._question.set("value",e),e}}}}),e.augment(l,e.EventTarget),M.core.confirm=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
YUI.add("moodle-core-notification-confirm",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle confirmation dialogue",l;l=function(e){l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=e.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get(i)+'" />'),this._noButton=e.Node.create('<input type="button" class="btn btn-secondary m-l-1" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get(s)+'" />'),this._question=e.Node.create('<div class="confirmation-message">'+this.get(u)+"</div>");var t=e.Node.create('<div class="confirmation-dialogue"></div>').append(this._question).append(e.Node.create('<div class="confirmation-buttons form-inline text-xs-right"></div>').append(this._yesButton).append(this._noButton));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,t,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this._closeEvents.push(e.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1));var n=this.get("boundingBox").one(".closebutton");n&&this._closeEvents.push(n.on("click",this.submit,this))},submit:function(t,n){(new e.EventHandle(this._closeEvents)).detach(),this.fire("complete",n),n?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{yesLabel:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(e){return this._yesButton&&this._yesButton.set("value",e),e}},noLabel:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(e){return this._noButton&&this._noButton.set("value",e),e}},title:{validator:e.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:e.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(e){return this._question&&this._question.set("value",e),e}}}}),e.augment(l,e.EventTarget),M.core.confirm=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});

View File

@ -93,14 +93,14 @@ Y.extend(CONFIRM, M.core.notification.info, {
this.publish('complete');
this.publish('complete-yes');
this.publish('complete-no');
this._yesButton = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' +
this._yesButton = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMYES) + '" />');
this._noButton = Y.Node.create('<input type="button" id="id_yuiconfirmno-' +
this._noButton = Y.Node.create('<input type="button" class="btn btn-secondary m-l-1" id="id_yuiconfirmno-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMNO) + '" />');
this._question = Y.Node.create('<div class="confirmation-message">' + this.get(QUESTION) + '</div>');
var content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(this._question)
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons form-inline text-xs-right"></div>')
.append(this._yesButton)
.append(this._noButton));
this.get(BASE).addClass('moodle-dialogue-confirm');

View File

@ -34,11 +34,11 @@ Y.extend(ALERT, M.core.notification.info, {
initializer: function() {
this._closeEvents = [];
this.publish('complete');
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
var yes = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-' + this.get('COUNT') + '"' +
'value="' + this.get(CONFIRMYES) + '" />'),
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(Y.Node.create('<div class="confirmation-message">' + this.get('message') + '</div>'))
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons text-xs-right"></div>')
.append(yes));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);

View File

@ -63,14 +63,14 @@ Y.extend(CONFIRM, M.core.notification.info, {
this.publish('complete');
this.publish('complete-yes');
this.publish('complete-no');
this._yesButton = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' +
this._yesButton = Y.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMYES) + '" />');
this._noButton = Y.Node.create('<input type="button" id="id_yuiconfirmno-' +
this._noButton = Y.Node.create('<input type="button" class="btn btn-secondary m-l-1" id="id_yuiconfirmno-' +
this.get('COUNT') + '" value="' + this.get(CONFIRMNO) + '" />');
this._question = Y.Node.create('<div class="confirmation-message">' + this.get(QUESTION) + '</div>');
var content = Y.Node.create('<div class="confirmation-dialogue"></div>')
.append(this._question)
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
.append(Y.Node.create('<div class="confirmation-buttons form-inline text-xs-right"></div>')
.append(this._yesButton)
.append(this._noButton));
this.get(BASE).addClass('moodle-dialogue-confirm');

View File

@ -52,7 +52,7 @@
</div>
<div class="controls">
<input name="tool-key"
class="input-block-level"
class="input-block-level form-control"
type="text"
id="registration-key">
</div>
@ -66,12 +66,12 @@
</div>
<div class="controls">
<input name="tool-secret"
class="input-block-level"
class="input-block-level form-control"
type="text"
id="registration-secret">
</div>
</div>
<div class="control-group">
<div class="control-group m-t-1">
<div class="controls">
<button id="cartridge-registration-submit" type="submit" class="btn btn-success">
<span class="btn-text">{{#str}} savechanges {{/str}}</span>

View File

@ -1293,18 +1293,6 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
border: 0;
}
.moodle-dialogue-confirm .confirmation-dialogue {
text-align: center;
}
.moodle-dialogue-confirm .confirmation-dialogue input {
text-align: center;
}
.moodle-dialogue-exception .moodle-exception-message {
text-align: center;
}
.moodle-dialogue-exception .moodle-exception-param label {
font-weight: bold;
}