mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-65751 lib: Replace deprecated jQuery functions
This commit is contained in:
parent
88d2bc81c8
commit
a6c735031a
10 changed files with 10 additions and 10 deletions
2
mod/lti/amd/build/contentitem.min.js
vendored
2
mod/lti/amd/build/contentitem.min.js
vendored
|
@ -1 +1 @@
|
|||
define(["jquery","core/notification","core/str","core/templates","mod_lti/form-field","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){var h,i,j={init:function(a,e,j){i=j;var k={url:a,postData:e},l=d.render("mod_lti/contentitem",k);return h?(h.setBody(l),void h.show()):void c.get_string("selectcontent","lti").then(function(a){return f.create({title:a,body:l,large:!0})}).then(function(a){h=a,a.getRoot().on(g.hidden,function(){a.setBody(""),b.fetchNotifications()}),a.show()})["catch"](b.exception)}},k=[new e("name",e.TYPES.TEXT,(!1),""),new e("introeditor",e.TYPES.EDITOR,(!1),""),new e("toolurl",e.TYPES.TEXT,(!0),""),new e("securetoolurl",e.TYPES.TEXT,(!0),""),new e("instructorchoiceacceptgrades",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendname",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendemailaddr",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorcustomparameters",e.TYPES.TEXT,(!0),""),new e("icon",e.TYPES.TEXT,(!0),""),new e("secureicon",e.TYPES.TEXT,(!0),""),new e("launchcontainer",e.TYPES.SELECT,(!0),0),new e("grade_modgrade_point",e.TYPES.TEXT,(!1),""),new e("cmidnumber",e.TYPES.TEXT,(!0),"")];return window.processContentItemReturnData=function(b){h&&h.hide();var c;for(c in k){var d=k[c],e=null;"undefined"!==a.type(b[d.name])&&(e=b[d.name]),d.setFieldValue(e)}i&&i()},j});
|
||||
define(["jquery","core/notification","core/str","core/templates","mod_lti/form-field","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){var h,i,j={init:function(a,e,j){i=j;var k={url:a,postData:e},l=d.render("mod_lti/contentitem",k);return h?(h.setBody(l),void h.show()):void c.get_string("selectcontent","lti").then(function(a){return f.create({title:a,body:l,large:!0})}).then(function(a){h=a,a.getRoot().on(g.hidden,function(){a.setBody(""),b.fetchNotifications()}),a.show()})["catch"](b.exception)}},k=[new e("name",e.TYPES.TEXT,(!1),""),new e("introeditor",e.TYPES.EDITOR,(!1),""),new e("toolurl",e.TYPES.TEXT,(!0),""),new e("securetoolurl",e.TYPES.TEXT,(!0),""),new e("instructorchoiceacceptgrades",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendname",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendemailaddr",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorcustomparameters",e.TYPES.TEXT,(!0),""),new e("icon",e.TYPES.TEXT,(!0),""),new e("secureicon",e.TYPES.TEXT,(!0),""),new e("launchcontainer",e.TYPES.SELECT,(!0),0),new e("grade_modgrade_point",e.TYPES.TEXT,(!1),""),new e("cmidnumber",e.TYPES.TEXT,(!0),"")];return window.processContentItemReturnData=function(a){h&&h.hide();var b;for(b in k){var c=k[b],d=null;"undefined"!=typeof a[c.name]&&(d=a[c.name]),c.setFieldValue(d)}i&&i()},j});
|
2
mod/lti/amd/build/form-field.min.js
vendored
2
mod/lti/amd/build/form-field.min.js
vendored
|
@ -1 +1 @@
|
|||
define(["jquery"],function(a){var b=function(a,b,c,d){this.name=a,this.id="id_"+this.name,this.selector="#"+this.id,this.type=b,this.resetIfUndefined=c,this.defaultValue=d};return b.TYPES={TEXT:1,SELECT:2,CHECKBOX:3,EDITOR:4},b.prototype.setFieldValue=function(c){if(null===c){if(!this.resetIfUndefined)return;c=this.defaultValue}switch(this.type){case b.TYPES.CHECKBOX:c?a(this.selector).prop("checked",!0):a(this.selector).prop("checked",!1);break;case b.TYPES.EDITOR:if("undefined"!==a.type(c.text)){var d=a(this.selector+"editable");d.length?d.html(c.text):"undefined"!=typeof tinyMCE&&tinyMCE.execInstanceCommand(this.id,"mceInsertContent",!1,c.text),a(this.selector).val(c.text)}break;default:a(this.selector).val(c)}},b});
|
||||
define(["jquery"],function(a){var b=function(a,b,c,d){this.name=a,this.id="id_"+this.name,this.selector="#"+this.id,this.type=b,this.resetIfUndefined=c,this.defaultValue=d};return b.TYPES={TEXT:1,SELECT:2,CHECKBOX:3,EDITOR:4},b.prototype.setFieldValue=function(c){if(null===c){if(!this.resetIfUndefined)return;c=this.defaultValue}switch(this.type){case b.TYPES.CHECKBOX:c?a(this.selector).prop("checked",!0):a(this.selector).prop("checked",!1);break;case b.TYPES.EDITOR:if("undefined"!=typeof c.text){var d=a(this.selector+"editable");d.length?d.html(c.text):"undefined"!=typeof tinyMCE&&tinyMCE.execInstanceCommand(this.id,"mceInsertContent",!1,c.text),a(this.selector).val(c.text)}break;default:a(this.selector).val(c)}},b});
|
|
@ -123,7 +123,7 @@ define(
|
|||
for (index in ltiFormFields) {
|
||||
var field = ltiFormFields[index];
|
||||
var value = null;
|
||||
if ($.type(returnData[field.name]) !== 'undefined') {
|
||||
if (typeof returnData[field.name] !== 'undefined') {
|
||||
value = returnData[field.name];
|
||||
}
|
||||
field.setFieldValue(value);
|
||||
|
|
|
@ -79,7 +79,7 @@ define(['jquery'],
|
|||
}
|
||||
break;
|
||||
case FormField.TYPES.EDITOR:
|
||||
if ($.type(value.text) !== 'undefined') {
|
||||
if (typeof value.text !== 'undefined') {
|
||||
/* global tinyMCE:false */
|
||||
|
||||
// Set text in editor's editable content, if applicable.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue