MDL-48620 JavaScript: Updated shifted files to comply with coding style

This commit is contained in:
Andrew Nicols 2015-01-09 13:23:00 +08:00
parent 2357166901
commit 557f44d970
220 changed files with 892 additions and 581 deletions

View File

@ -34,7 +34,8 @@ M.availability_completion.form.getNode = function(json) {
// String has already been escaped using format_string.
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
}
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
html += '</select></label> <label><span class="accesshide">' +
M.util.get_string('label_completion', 'availability_completion') +
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +

View File

@ -34,7 +34,8 @@ M.availability_completion.form.getNode = function(json) {
// String has already been escaped using format_string.
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
}
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
html += '</select></label> <label><span class="accesshide">' +
M.util.get_string('label_completion', 'availability_completion') +
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +

View File

@ -32,7 +32,8 @@ M.availability_completion.form.getNode = function(json) {
// String has already been escaped using format_string.
html += '<option value="' + cm.id + '">' + cm.name + '</option>';
}
html += '</select></label> <label><span class="accesshide">' + M.util.get_string('label_completion', 'availability_completion') +
html += '</select></label> <label><span class="accesshide">' +
M.util.get_string('label_completion', 'availability_completion') +
' </span><select name="e" title="' + M.util.get_string('label_completion', 'availability_completion') + '">' +
'<option value="1">' + M.util.get_string('option_complete', 'availability_completion') + '</option>' +
'<option value="0">' + M.util.get_string('option_incomplete', 'availability_completion') + '</option>' +

View File

@ -731,6 +731,7 @@ M.core_availability.List.prototype.clickAdd = function() {
*/
M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
return function() {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
@ -926,7 +927,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
value = { 'type' : this.pluginType };
var value = { 'type' : this.pluginType };
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}

File diff suppressed because one or more lines are too long

View File

@ -731,6 +731,7 @@ M.core_availability.List.prototype.clickAdd = function() {
*/
M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
return function() {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
@ -926,7 +927,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
value = { 'type' : this.pluginType };
var value = { 'type' : this.pluginType };
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}

View File

@ -729,6 +729,7 @@ M.core_availability.List.prototype.clickAdd = function() {
*/
M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
return function() {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
@ -924,7 +925,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
value = { 'type' : this.pluginType };
var value = { 'type' : this.pluginType };
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}

View File

@ -435,7 +435,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, {
* @constructor
* @extends Base
*/
BRANCH = function() {
var BRANCH = function() {
BRANCH.superclass.constructor.apply(this, arguments);
};
BRANCH.prototype = {
@ -634,7 +634,7 @@ BRANCH.prototype = {
Y.io(M.cfg.wwwroot + ajaxfile, {
method:'POST',
data: build_querystring(params),
data: params,
on: {
complete: this.ajaxProcessResponse
},
@ -672,8 +672,10 @@ BRANCH.prototype = {
this.addChild(object.children[i]);
}
}
if ((this.get('type') === NODETYPE.CATEGORY || this.get('type') === NODETYPE.ROOTNODE || this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
if ((this.get('type') === NODETYPE.CATEGORY ||
this.get('type') === NODETYPE.ROOTNODE ||
this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
this.addViewAllCoursesChild(this);
}
Y.log('AJAX loading complete.', 'note', 'moodle-block_navigation');

View File

@ -434,7 +434,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, {
* @constructor
* @extends Base
*/
BRANCH = function() {
var BRANCH = function() {
BRANCH.superclass.constructor.apply(this, arguments);
};
BRANCH.prototype = {
@ -632,7 +632,7 @@ BRANCH.prototype = {
Y.io(M.cfg.wwwroot + ajaxfile, {
method:'POST',
data: build_querystring(params),
data: params,
on: {
complete: this.ajaxProcessResponse
},
@ -670,8 +670,10 @@ BRANCH.prototype = {
this.addChild(object.children[i]);
}
}
if ((this.get('type') === NODETYPE.CATEGORY || this.get('type') === NODETYPE.ROOTNODE || this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
if ((this.get('type') === NODETYPE.CATEGORY ||
this.get('type') === NODETYPE.ROOTNODE ||
this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
this.addViewAllCoursesChild(this);
}
// If this block can dock tell the dock to resize if required and check

View File

@ -433,7 +433,7 @@ Y.extend(TREE, Y.Base, TREE.prototype, {
* @constructor
* @extends Base
*/
BRANCH = function() {
var BRANCH = function() {
BRANCH.superclass.constructor.apply(this, arguments);
};
BRANCH.prototype = {
@ -632,7 +632,7 @@ BRANCH.prototype = {
Y.io(M.cfg.wwwroot + ajaxfile, {
method:'POST',
data: build_querystring(params),
data: params,
on: {
complete: this.ajaxProcessResponse
},
@ -670,8 +670,10 @@ BRANCH.prototype = {
this.addChild(object.children[i]);
}
}
if ((this.get('type') === NODETYPE.CATEGORY || this.get('type') === NODETYPE.ROOTNODE || this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
if ((this.get('type') === NODETYPE.CATEGORY ||
this.get('type') === NODETYPE.ROOTNODE ||
this.get('type') === NODETYPE.MYCATEGORY)
&& coursecount >= M.block_navigation.courselimit) {
this.addViewAllCoursesChild(this);
}
Y.log('AJAX loading complete.', 'note', 'moodle-block_navigation');

View File

@ -194,6 +194,7 @@ NS._toggle_category_expansion = function(e) {
* @param {Object} config
*/
NS._toggle_generic_expansion = function(config) {
var spinner;
if (config.spinnerhandle) {
// Add a spinner to give some feedback to the user.
spinner = M.util.add_spinner(Y, config.parentnode.one(config.spinnerhandle)).show();

File diff suppressed because one or more lines are too long

View File

@ -193,6 +193,7 @@ NS._toggle_category_expansion = function(e) {
* @param {Object} config
*/
NS._toggle_generic_expansion = function(config) {
var spinner;
if (config.spinnerhandle) {
// Add a spinner to give some feedback to the user.
spinner = M.util.add_spinner(Y, config.parentnode.one(config.spinnerhandle)).show();

View File

@ -126,9 +126,11 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
// Get our drag object
var drag = e.target;
// Creat a dummy structure of the outer elemnents for clean styles application
var containernode = Y.Node.create('<' + M.course.format.get_containernode() + '></' + M.course.format.get_containernode() + '>');
var containernode = Y.Node.create('<' + M.course.format.get_containernode() +
'></' + M.course.format.get_containernode() + '>');
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() + '></' + M.course.format.get_sectionwrappernode() + '>');
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
@ -303,7 +305,8 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
this.groups = ['resource'];
this.samenodeclass = CSS.ACTIVITY;
this.parentnodeclass = CSS.SECTION;
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'),
CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.samenodelabel = {
identifier: 'afterresource',

View File

@ -126,9 +126,11 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
// Get our drag object
var drag = e.target;
// Creat a dummy structure of the outer elemnents for clean styles application
var containernode = Y.Node.create('<' + M.course.format.get_containernode() + '></' + M.course.format.get_containernode() + '>');
var containernode = Y.Node.create('<' + M.course.format.get_containernode() +
'></' + M.course.format.get_containernode() + '>');
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() + '></' + M.course.format.get_sectionwrappernode() + '>');
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
@ -299,7 +301,8 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
this.groups = ['resource'];
this.samenodeclass = CSS.ACTIVITY;
this.parentnodeclass = CSS.SECTION;
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'),
CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.samenodelabel = {
identifier: 'afterresource',

View File

@ -439,7 +439,7 @@ Console.prototype = {
handleBulkSortByaction : function(e) {
var sortcategoryby = this.get('categorylisting').one('#menuresortcategoriesby'),
sortcourseby = this.get('categorylisting').one('#menuresortcoursesby'),
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]');
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]'),
sortby = e;
if (!sortby) {
@ -567,7 +567,7 @@ Console.prototype = {
complete : callback
},
context : context,
data : build_querystring(args),
data : args,
'arguments' : args
});
}
@ -997,7 +997,8 @@ Item.prototype = {
} else {
// Aha it succeeded but this is the top item in the list. Pagination is in play!
// Refresh to update the state of things.
Y.log(this.get('itemname')+' cannot be moved up as its the top item on this page.', 'info', 'moodle-course-management');
Y.log(this.get('itemname') + ' cannot be moved up as its the top item on this page.',
'info', 'moodle-course-management');
window.location.reload();
}
},
@ -1065,7 +1066,8 @@ Item.prototype = {
} else {
// Aha it succeeded but this is the bottom item in the list. Pagination is in play!
// Refresh to update the state of things.
Y.log(this.get('itemname')+' cannot be moved down as its the top item on this page.', 'info', 'moodle-course-management');
Y.log(this.get('itemname') + ' cannot be moved down as its the top item on this page.',
'info', 'moodle-course-management');
window.location.reload();
}
},
@ -1459,7 +1461,8 @@ Category.prototype = {
Y.log('Course was moved but the course listing could not be found to reflect this', 'warn', 'moodle-course-management');
return false;
}
Y.log('Moved the course ('+course.getName()+') into this category ('+this.getName()+')', 'info', 'moodle-course-management');
Y.log('Moved the course (' + course.getName() + ') into this category (' + this.getName() + ')',
'debug', 'moodle-course-management');
this.highlight();
if (course) {
if (outcome.paginationtotals) {

File diff suppressed because one or more lines are too long

View File

@ -433,7 +433,7 @@ Console.prototype = {
handleBulkSortByaction : function(e) {
var sortcategoryby = this.get('categorylisting').one('#menuresortcategoriesby'),
sortcourseby = this.get('categorylisting').one('#menuresortcoursesby'),
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]');
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]'),
sortby = e;
if (!sortby) {
@ -560,7 +560,7 @@ Console.prototype = {
complete : callback
},
context : context,
data : build_querystring(args),
data : args,
'arguments' : args
});
}

View File

@ -343,7 +343,6 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
case 'groupsvisible':
case 'groupsnone':
// The user is changing the group mode.
callback = 'change_groupmode';
this.change_groupmode(ev, node, activity, action);
break;
case 'move':
@ -773,7 +772,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Force the editing instruction to match the mod-indent position.
var padside = 'left';
if (right_to_left()) {
if (window.right_to_left()) {
padside = 'right';
}

File diff suppressed because one or more lines are too long

View File

@ -343,7 +343,6 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
case 'groupsvisible':
case 'groupsnone':
// The user is changing the group mode.
callback = 'change_groupmode';
this.change_groupmode(ev, node, activity, action);
break;
case 'move':
@ -773,7 +772,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Force the editing instruction to match the mod-indent position.
var padside = 'left';
if (right_to_left()) {
if (window.right_to_left()) {
padside = 'right';
}

View File

@ -192,6 +192,7 @@ NS._toggle_category_expansion = function(e) {
* @param {Object} config
*/
NS._toggle_generic_expansion = function(config) {
var spinner;
if (config.spinnerhandle) {
// Add a spinner to give some feedback to the user.
spinner = M.util.add_spinner(Y, config.parentnode.one(config.spinnerhandle)).show();

View File

@ -14,7 +14,8 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
this.groups = ['resource'];
this.samenodeclass = CSS.ACTIVITY;
this.parentnodeclass = CSS.SECTION;
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'), CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.resourcedraghandle = this.get_drag_handle(M.util.get_string('movecoursemodule', 'moodle'),
CSS.EDITINGMOVE, CSS.ICONCLASS, true);
this.samenodelabel = {
identifier: 'afterresource',

View File

@ -95,9 +95,11 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
// Get our drag object
var drag = e.target;
// Creat a dummy structure of the outer elemnents for clean styles application
var containernode = Y.Node.create('<' + M.course.format.get_containernode() + '></' + M.course.format.get_containernode() + '>');
var containernode = Y.Node.create('<' + M.course.format.get_containernode() +
'></' + M.course.format.get_containernode() + '>');
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() + '></' + M.course.format.get_sectionwrappernode() + '>');
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));

View File

@ -286,7 +286,8 @@ Category.prototype = {
Y.log('Course was moved but the course listing could not be found to reflect this', 'warn', 'moodle-course-management');
return false;
}
Y.log('Moved the course ('+course.getName()+') into this category ('+this.getName()+')', 'info', 'moodle-course-management');
Y.log('Moved the course (' + course.getName() + ') into this category (' + this.getName() + ')',
'debug', 'moodle-course-management');
this.highlight();
if (course) {
if (outcome.paginationtotals) {

View File

@ -437,7 +437,7 @@ Console.prototype = {
handleBulkSortByaction : function(e) {
var sortcategoryby = this.get('categorylisting').one('#menuresortcategoriesby'),
sortcourseby = this.get('categorylisting').one('#menuresortcoursesby'),
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]');
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]'),
sortby = e;
if (!sortby) {
@ -565,7 +565,7 @@ Console.prototype = {
complete : callback
},
context : context,
data : build_querystring(args),
data : args,
'arguments' : args
});
}

View File

@ -138,7 +138,8 @@ Item.prototype = {
} else {
// Aha it succeeded but this is the top item in the list. Pagination is in play!
// Refresh to update the state of things.
Y.log(this.get('itemname')+' cannot be moved up as its the top item on this page.', 'info', 'moodle-course-management');
Y.log(this.get('itemname') + ' cannot be moved up as its the top item on this page.',
'info', 'moodle-course-management');
window.location.reload();
}
},
@ -206,7 +207,8 @@ Item.prototype = {
} else {
// Aha it succeeded but this is the bottom item in the list. Pagination is in play!
// Refresh to update the state of things.
Y.log(this.get('itemname')+' cannot be moved down as its the top item on this page.', 'info', 'moodle-course-management');
Y.log(this.get('itemname') + ' cannot be moved down as its the top item on this page.',
'info', 'moodle-course-management');
window.location.reload();
}
},

View File

@ -139,7 +139,6 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
case 'groupsvisible':
case 'groupsnone':
// The user is changing the group mode.
callback = 'change_groupmode';
this.change_groupmode(ev, node, activity, action);
break;
case 'move':
@ -569,7 +568,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Force the editing instruction to match the mod-indent position.
var padside = 'left';
if (right_to_left()) {
if (window.right_to_left()) {
padside = 'right';
}

View File

@ -26,7 +26,9 @@ Y.extend(AUTOLINKER, Y.Base, {
//display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" /></div>'),
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
@ -61,7 +63,8 @@ Y.extend(AUTOLINKER, Y.Base, {
display_callback : function(content) {
var data,
key,
alertpanel;
alertpanel,
definition;
try {
data = Y.JSON.parse(content);
if (data.success){

View File

@ -1 +1 @@
YUI.add("moodle-filter_glossary-autolinker",function(e,t){var n="Glossary filter autolinker",r="width",i="height",s="menubar",o="location",u="scrollbars",a="resizable",f="toolbar",l="status",c="directories",h="fullscreen",p="dependent",d;d=function(){d.superclass.constructor.apply(this,arguments)},e.extend(d,e.Base,{overlay:null,initializer:function(){var t=this;e.delegate("click",function(n){n.preventDefault();var r="",i=e.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" /></div>'),s=new e.Overlay({headerContent:r,bodyContent:i}),o,u;t.overlay=s,s.render(e.one(document.body)),o=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),u={method:"get",context:t,on:{success:function(e,t){this.display_callback(t.responseText)},failure:function(e,t){var n=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+o+")"),this.display_callback("bodyContent",n)}}},e.io(o,u)},e.one(document.body),"a.glossary.autolink.concept")},display_callback:function(t){var n,r,i;try{n=e.JSON.parse(t);if(n.success){this.overlay.hide();for(r in n.entries)definition=n.entries[r].definition+n.entries[r].attachments,i=new M.core.alert({title:n.entries[r].concept,message:definition,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),i.show(),e.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:new e.NodeList(i.get("boundingBox"))}),e.Node.one("#id_yuialertconfirm-"+i.get("COUNT")).focus();return!0}n.error&&new M.core.ajaxException(n)}catch(s){new M.core.exception(s)}return!1}},{NAME:n,ATTRS:{url:{validator:e.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:e.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get(r),height:this.get(i),menubar:this.get(s),location:this.get(o),scrollbars:this.get(u),resizable:this.get(a),toolbar:this.get(f),status:this.get(l),directories:this.get(c),fullscreen:this.get(h),dependent:this.get(p)}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new d(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert"]});
YUI.add("moodle-filter_glossary-autolinker",function(e,t){var n="Glossary filter autolinker",r="width",i="height",s="menubar",o="location",u="scrollbars",a="resizable",f="toolbar",l="status",c="directories",h="fullscreen",p="dependent",d;d=function(){d.superclass.constructor.apply(this,arguments)},e.extend(d,e.Base,{overlay:null,initializer:function(){var t=this;e.delegate("click",function(n){n.preventDefault();var r="",i=e.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" />'+"</div>"),s=new e.Overlay({headerContent:r,bodyContent:i}),o,u;t.overlay=s,s.render(e.one(document.body)),o=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),u={method:"get",context:t,on:{success:function(e,t){this.display_callback(t.responseText)},failure:function(e,t){var n=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+o+")"),this.display_callback("bodyContent",n)}}},e.io(o,u)},e.one(document.body),"a.glossary.autolink.concept")},display_callback:function(t){var n,r,i,s;try{n=e.JSON.parse(t);if(n.success){this.overlay.hide();for(r in n.entries)s=n.entries[r].definition+n.entries[r].attachments,i=new M.core.alert({title:n.entries[r].concept,message:s,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),i.show(),e.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:new e.NodeList(i.get("boundingBox"))}),e.Node.one("#id_yuialertconfirm-"+i.get("COUNT")).focus();return!0}n.error&&new M.core.ajaxException(n)}catch(o){new M.core.exception(o)}return!1}},{NAME:n,ATTRS:{url:{validator:e.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:e.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get(r),height:this.get(i),menubar:this.get(s),location:this.get(o),scrollbars:this.get(u),resizable:this.get(a),toolbar:this.get(f),status:this.get(l),directories:this.get(c),fullscreen:this.get(h),dependent:this.get(p)}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new d(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert"]});

View File

@ -26,7 +26,9 @@ Y.extend(AUTOLINKER, Y.Base, {
//display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" /></div>'),
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
@ -61,7 +63,8 @@ Y.extend(AUTOLINKER, Y.Base, {
display_callback : function(content) {
var data,
key,
alertpanel;
alertpanel,
definition;
try {
data = Y.JSON.parse(content);
if (data.success){

View File

@ -24,7 +24,9 @@ Y.extend(AUTOLINKER, Y.Base, {
//display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" /></div>'),
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
@ -59,7 +61,8 @@ Y.extend(AUTOLINKER, Y.Base, {
display_callback : function(content) {
var data,
key,
alertpanel;
alertpanel,
definition;
try {
data = Y.JSON.parse(content);
if (data.success){

View File

@ -76,11 +76,11 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
window.MathJax.Hub.Configured();
this._configured = true;
}
}
@ -97,8 +97,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});
@ -116,8 +116,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});

View File

@ -1 +1 @@
YUI.add("moodle-filter_mathjaxloader-loader",function(e,t){M.filter_mathjaxloader=M.filter_mathjaxloader||{_lang:"",_configured:!1,configure:function(t){var n=document.createElement("script");n.type="text/x-mathjax-config",n[window.opera?"innerHTML":"text"]=t.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(n),this._lang=t.lang,e.on(M.core.event.FILTER_CONTENT_UPDATED,this.contentUpdated,this)},_setLocale:function(){if(!this._configured){var e=this._lang;typeof MathJax!="undefined"&&(MathJax.Hub.Queue(function(){MathJax.Localization.setLocale(e)}),MathJax.Hub.Configured(),this._configured=!0)}},typeset:function(){if(!this._configured){var t=this;e.use("mathjax",function(){t._setLocale(),e.all(".filter_mathjaxloader_equation").each(function(e){typeof MathJax!="undefined"&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,e.getDOMNode()])})})}},contentUpdated:function(t){var n=this;e.use("mathjax",function(){n._setLocale(),t.nodes.each(function(e){e.all(".filter_mathjaxloader_equation").each(function(e){typeof MathJax!="undefined"&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,e.getDOMNode()])})})})}}},"@VERSION@",{requires:["moodle-core-event"]});
YUI.add("moodle-filter_mathjaxloader-loader",function(e,t){M.filter_mathjaxloader=M.filter_mathjaxloader||{_lang:"",_configured:!1,configure:function(t){var n=document.createElement("script");n.type="text/x-mathjax-config",n[window.opera?"innerHTML":"text"]=t.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(n),this._lang=t.lang,e.on(M.core.event.FILTER_CONTENT_UPDATED,this.contentUpdated,this)},_setLocale:function(){if(!this._configured){var e=this._lang;typeof window.MathJax!="undefined"&&(window.MathJax.Hub.Queue(function(){window.MathJax.Localization.setLocale(e)}),window.MathJax.Hub.Configured(),this._configured=!0)}},typeset:function(){if(!this._configured){var t=this;e.use("mathjax",function(){t._setLocale(),e.all(".filter_mathjaxloader_equation").each(function(e){typeof window.MathJax!="undefined"&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})})}},contentUpdated:function(t){var n=this;e.use("mathjax",function(){n._setLocale(),t.nodes.each(function(e){e.all(".filter_mathjaxloader_equation").each(function(e){typeof window.MathJax!="undefined"&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.getDOMNode()])})})})}}},"@VERSION@",{requires:["moodle-core-event"]});

View File

@ -76,11 +76,11 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
window.MathJax.Hub.Configured();
this._configured = true;
}
}
@ -97,8 +97,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});
@ -116,8 +116,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});

View File

@ -74,11 +74,11 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
_setLocale: function() {
if (!this._configured) {
var lang = this._lang;
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(function () {
MathJax.Localization.setLocale(lang);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Localization.setLocale(lang);
});
MathJax.Hub.Configured();
window.MathJax.Hub.Configured();
this._configured = true;
}
}
@ -95,8 +95,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
Y.use('mathjax', function() {
self._setLocale();
Y.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});
@ -114,8 +114,8 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
self._setLocale();
event.nodes.each(function (node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
if (typeof MathJax !== "undefined") {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, node.getDOMNode()]);
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
}
});
});

View File

@ -660,7 +660,8 @@ FloatingHeaders.prototype = {
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
// Create the floating row and cell.
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" ' +
'class="floater sideonly heading"></div>'),
floatingUserHeaderCell = Y.Node.create('<div></div>'),
nodepos = this._getRelativeXY(this.headerCell)[0],
coordinates = this._getRelativeXY(this.headerRow),
@ -922,7 +923,7 @@ FloatingHeaders.prototype = {
}
// User column position.
if (right_to_left()) {
if (window.right_to_left()) {
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);

View File

@ -660,7 +660,8 @@ FloatingHeaders.prototype = {
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
// Create the floating row and cell.
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" ' +
'class="floater sideonly heading"></div>'),
floatingUserHeaderCell = Y.Node.create('<div></div>'),
nodepos = this._getRelativeXY(this.headerCell)[0],
coordinates = this._getRelativeXY(this.headerRow),
@ -921,7 +922,7 @@ FloatingHeaders.prototype = {
}
// User column position.
if (right_to_left()) {
if (window.right_to_left()) {
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);

View File

@ -517,7 +517,8 @@ FloatingHeaders.prototype = {
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
// Create the floating row and cell.
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" ' +
'class="floater sideonly heading"></div>'),
floatingUserHeaderCell = Y.Node.create('<div></div>'),
nodepos = this._getRelativeXY(this.headerCell)[0],
coordinates = this._getRelativeXY(this.headerRow),
@ -779,7 +780,7 @@ FloatingHeaders.prototype = {
}
// User column position.
if (right_to_left()) {
if (window.right_to_left()) {
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);

View File

@ -274,7 +274,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
data:build_querystring(params),
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
@ -376,7 +376,9 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Create the div containing the users when it is a fresh search.
if (!args.append) {
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="'+CSS.USERS+'"></div>');
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="' +
CSS.USERS +
'"></div>');
} else {
users = bb.one(SELECTORS.RESULTSUSERS);
}
@ -405,6 +407,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Append the users one by one.
count = this.get(USP.USERCOUNT);
selected = '';
var user;
for (i in result.response.users) {
count++;
user = result.response.users[i];

View File

@ -274,7 +274,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
data:build_querystring(params),
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
@ -376,7 +376,9 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Create the div containing the users when it is a fresh search.
if (!args.append) {
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="'+CSS.USERS+'"></div>');
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="' +
CSS.USERS +
'"></div>');
} else {
users = bb.one(SELECTORS.RESULTSUSERS);
}
@ -405,6 +407,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Append the users one by one.
count = this.get(USP.USERCOUNT);
selected = '';
var user;
for (i in result.response.users) {
count++;
user = result.response.users[i];

View File

@ -272,7 +272,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
data:build_querystring(params),
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
@ -374,7 +374,9 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Create the div containing the users when it is a fresh search.
if (!args.append) {
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="'+CSS.USERS+'"></div>');
users = Y.Node.create('<div role="listbox" aria-activedescendant="" aria-multiselectable="true" class="' +
CSS.USERS +
'"></div>');
} else {
users = bb.one(SELECTORS.RESULTSUSERS);
}
@ -403,6 +405,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
// Append the users one by one.
count = this.get(USP.USERCOUNT);
selected = '';
var user;
for (i in result.response.users) {
count++;
user = result.response.users[i];

View File

@ -110,7 +110,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Images with no alt text or dodgy alt text.
problemNodes = [];
this.editor.all('img').each(function (img) {
alt = img.getAttribute('alt');
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
problemNodes.push(img);
@ -178,7 +178,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no captions.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('caption');
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
}
@ -188,7 +188,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with merged cells.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('[colspan],[rowspan]');
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
}

View File

@ -1 +1 @@
YUI.add("moodle-atto_accessibilitychecker-button",function(e,t){var n="atto_accessibilitychecker";e.namespace("M.atto_accessibilitychecker").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/accessibility_checker",callback:this._displayDialogue})},_displayDialogue:function(){var e=this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"500px",focusAfterHide:!0});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Node.create('<div style="word-wrap: break-word;"></div>');return t.append(this._getWarnings()),t.delegate("click",function(e){e.preventDefault();var t=this.get("host"),n=e.currentTarget.getData("sourceNode"),r=this.getDialogue();n?(r.set("focusAfterHide",this.editor).hide(),t.setSelection(t.getSelectionFromNode(n))):r.hide()},"a",this),t},_getWarnings:function(){var t,r=e.Node.create("<div></div>");return t=[],this.editor.all("img").each(function(e){alt=e.getAttribute("alt"),(typeof alt=="undefined"||alt==="")&&e.getAttribute("role")!=="presentation"&&t.push(e)},this),this._addWarnings(r,M.util.get_string("imagesmissingalt",n),t,!0),t=[],this.editor.all("*").each(function(n){var r,i,s,o,u;if(e.Lang.trim(n.get("text"))!==""){r=n.getComputedStyle("color"),i=n.getComputedStyle("backgroundColor"),o=this._getLuminanceFromCssColor(r),u=this._getLuminanceFromCssColor(i),o>u?s=(o+.05)/(u+.05):s=(u+.05)/(o+.05);if(s<=4.5){var a=0,f=!1;for(a=0;a<t.length;a++){if(n.ancestors("*").indexOf(t[a])!==-1){f=!0;break}if(t[a].ancestors("*").indexOf(n)!==-1){t[a]=n,f=!0;break}}f||t.push(n)}}},this),this._addWarnings(r,M.util.get_string("needsmorecontrast",n),t,!1),this.editor.get("text").length>1e3&&!this.editor.one("h3, h4, h5")&&this._addWarnings(r,M.util.get_string("needsmoreheadings",n),[this.editor],!1),t=[],this.editor.all("table").each(function(e){caption=e.one("caption"),(caption===null||caption.get("text").trim()==="")&&t.push(e)},this),this._addWarnings(r,M.util.get_string("tablesmissingcaption",n),t,!1),t=[],this.editor.all("table").each(function(e){caption=e.one("[colspan],[rowspan]"),caption!==null&&t.push(e)},this),this._addWarnings(r,M.util.get_string("tableswithmergedcells",n),t,!1),t=[],this.editor.all("table").each(function(e){if(e.one("tr").one("td"))e.all("tr").some(function(n){var r=n.one("th");return!r||r.get("text").trim()===""?(t.push(e),!0):!1},this);else{var n=!1;e.one("tr").all("th").some(function(r){return n=!0,r.get("text").trim()===""?(t.push(e),!0):!1}),n||t.push(e)}},this),this._addWarnings(r,M.util.get_string("tablesmissingheaders",n),t,!1),r.hasChildNodes()||r.append("<p>"+M.util.get_string("nowarnings",n)+"</p>"),r},_addWarnings:function(t,r,i,s){var o,u,a,f,l,c,h,p;if(i.length>0){o=e.Node.create("<p>"+r+"</p>"),u=e.Node.create('<ol class="accessibilitywarnings"></ol>'),a=0;for(a=0;a<i.length;a++)c=e.Node.create("<li></li>"),s?(f=i[a].getAttribute("src"),h=e.Node.create('<a href="#"><img src="'+f+'" /> '+f+"</a>")):(l="innerText"in i[a]?"innerText":"textContent",p=i[a].get(l).trim(),p===""&&(p=M.util.get_string("emptytext",n)),i[a]===this.editor&&(p=M.util.get_string("entiredocument",n)),h=e.Node.create('<a href="#">'+p+"</a>")),h.setData("sourceNode",i[a]),c.append(h),u.append(c);o.append(u),t.append(o)}},_getLuminanceFromCssColor:function(t){var n;t==="transparent"&&(t="#ffffff"),n=e.Color.toArray(e.Color.toRGB(t));var r=function(e){return e=parseInt(e,10)/255,e<=.03928?e/=12.92:e=Math.pow((e+.055)/1.055,2.4),e},i=r(n[0]),s=r(n[1]),o=r(n[2]);return.2126*i+.7152*s+.0722*o}})},"@VERSION@",{requires:["color-base","moodle-editor_atto-plugin"]});
YUI.add("moodle-atto_accessibilitychecker-button",function(e,t){var n="atto_accessibilitychecker";e.namespace("M.atto_accessibilitychecker").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/accessibility_checker",callback:this._displayDialogue})},_displayDialogue:function(){var e=this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"500px",focusAfterHide:!0});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Node.create('<div style="word-wrap: break-word;"></div>');return t.append(this._getWarnings()),t.delegate("click",function(e){e.preventDefault();var t=this.get("host"),n=e.currentTarget.getData("sourceNode"),r=this.getDialogue();n?(r.set("focusAfterHide",this.editor).hide(),t.setSelection(t.getSelectionFromNode(n))):r.hide()},"a",this),t},_getWarnings:function(){var t,r=e.Node.create("<div></div>");return t=[],this.editor.all("img").each(function(e){var n=e.getAttribute("alt");(typeof n=="undefined"||n==="")&&e.getAttribute("role")!=="presentation"&&t.push(e)},this),this._addWarnings(r,M.util.get_string("imagesmissingalt",n),t,!0),t=[],this.editor.all("*").each(function(n){var r,i,s,o,u;if(e.Lang.trim(n.get("text"))!==""){r=n.getComputedStyle("color"),i=n.getComputedStyle("backgroundColor"),o=this._getLuminanceFromCssColor(r),u=this._getLuminanceFromCssColor(i),o>u?s=(o+.05)/(u+.05):s=(u+.05)/(o+.05);if(s<=4.5){var a=0,f=!1;for(a=0;a<t.length;a++){if(n.ancestors("*").indexOf(t[a])!==-1){f=!0;break}if(t[a].ancestors("*").indexOf(n)!==-1){t[a]=n,f=!0;break}}f||t.push(n)}}},this),this._addWarnings(r,M.util.get_string("needsmorecontrast",n),t,!1),this.editor.get("text").length>1e3&&!this.editor.one("h3, h4, h5")&&this._addWarnings(r,M.util.get_string("needsmoreheadings",n),[this.editor],!1),t=[],this.editor.all("table").each(function(e){var n=e.one("caption");(n===null||n.get("text").trim()==="")&&t.push(e)},this),this._addWarnings(r,M.util.get_string("tablesmissingcaption",n),t,!1),t=[],this.editor.all("table").each(function(e){var n=e.one("[colspan],[rowspan]");n!==null&&t.push(e)},this),this._addWarnings(r,M.util.get_string("tableswithmergedcells",n),t,!1),t=[],this.editor.all("table").each(function(e){if(e.one("tr").one("td"))e.all("tr").some(function(n){var r=n.one("th");return!r||r.get("text").trim()===""?(t.push(e),!0):!1},this);else{var n=!1;e.one("tr").all("th").some(function(r){return n=!0,r.get("text").trim()===""?(t.push(e),!0):!1}),n||t.push(e)}},this),this._addWarnings(r,M.util.get_string("tablesmissingheaders",n),t,!1),r.hasChildNodes()||r.append("<p>"+M.util.get_string("nowarnings",n)+"</p>"),r},_addWarnings:function(t,r,i,s){var o,u,a,f,l,c,h,p;if(i.length>0){o=e.Node.create("<p>"+r+"</p>"),u=e.Node.create('<ol class="accessibilitywarnings"></ol>'),a=0;for(a=0;a<i.length;a++)c=e.Node.create("<li></li>"),s?(f=i[a].getAttribute("src"),h=e.Node.create('<a href="#"><img src="'+f+'" /> '+f+"</a>")):(l="innerText"in i[a]?"innerText":"textContent",p=i[a].get(l).trim(),p===""&&(p=M.util.get_string("emptytext",n)),i[a]===this.editor&&(p=M.util.get_string("entiredocument",n)),h=e.Node.create('<a href="#">'+p+"</a>")),h.setData("sourceNode",i[a]),c.append(h),u.append(c);o.append(u),t.append(o)}},_getLuminanceFromCssColor:function(t){var n;t==="transparent"&&(t="#ffffff"),n=e.Color.toArray(e.Color.toRGB(t));var r=function(e){return e=parseInt(e,10)/255,e<=.03928?e/=12.92:e=Math.pow((e+.055)/1.055,2.4),e},i=r(n[0]),s=r(n[1]),o=r(n[2]);return.2126*i+.7152*s+.0722*o}})},"@VERSION@",{requires:["color-base","moodle-editor_atto-plugin"]});

View File

@ -110,7 +110,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Images with no alt text or dodgy alt text.
problemNodes = [];
this.editor.all('img').each(function (img) {
alt = img.getAttribute('alt');
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
problemNodes.push(img);
@ -173,7 +173,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no captions.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('caption');
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
}
@ -183,7 +183,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with merged cells.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('[colspan],[rowspan]');
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
}

View File

@ -108,7 +108,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Images with no alt text or dodgy alt text.
problemNodes = [];
this.editor.all('img').each(function (img) {
alt = img.getAttribute('alt');
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
problemNodes.push(img);
@ -176,7 +176,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no captions.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('caption');
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
}
@ -186,7 +186,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with merged cells.
problemNodes = [];
this.editor.all('table').each(function (table) {
caption = table.one('[colspan],[rowspan]');
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
}

View File

@ -60,9 +60,11 @@ var COMPONENTNAME = 'atto_equation',
'<form class="atto_form">' +
'{{{library}}}' +
'<label for="{{elementid}}_{{CSS.EQUATION_TEXT}}">{{{get_string "editequation" component texdocsurl}}}</label>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<label for="{{elementid}}_{{CSS.EQUATION_PREVIEW}}">{{get_string "preview" component}}</label>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div id="{{elementid}}_cursorinfo">{{get_string "cursorinfo" component}}</div>' +
'<div class="mdl-align">' +
'<br/>' +
@ -186,7 +188,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
var replacement = Y.Node.create('<span>' + DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END + '</span>');
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
texNode.replace(replacement);
});
}
@ -273,7 +277,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text = Y.one(selectedNode).get('text');
// For each of these patterns we have a RegExp which captures the inner component of the equation but also includes the delimiters.
// For each of these patterns we have a RegExp which captures the inner component of the equation but also
// includes the delimiters.
// We first run the RegExp adding the global flag ("g"). This ignores the capture, instead matching the entire
// equation including delimiters and returning one entry per match of the whole equation.
// We have to deal with multiple occurences of the same equation in a String so must be able to loop on the
@ -353,7 +358,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode,
text,
value,
host;
host,
newText;
host = this.get('host');
@ -446,7 +452,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
isChar = /[a-zA-Z\{\}]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) && currentPos < equation.length && isChar.test(equation.charAt(currentPos-1))) {
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
currentPos += 1;
}
}
@ -688,7 +696,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text: content
};
preview = Y.io(url, {
var preview = Y.io(url, {
sync: true,
data: params,
method: 'POST'

View File

@ -60,9 +60,11 @@ var COMPONENTNAME = 'atto_equation',
'<form class="atto_form">' +
'{{{library}}}' +
'<label for="{{elementid}}_{{CSS.EQUATION_TEXT}}">{{{get_string "editequation" component texdocsurl}}}</label>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<label for="{{elementid}}_{{CSS.EQUATION_PREVIEW}}">{{get_string "preview" component}}</label>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div id="{{elementid}}_cursorinfo">{{get_string "cursorinfo" component}}</div>' +
'<div class="mdl-align">' +
'<br/>' +
@ -186,7 +188,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
var replacement = Y.Node.create('<span>' + DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END + '</span>');
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
texNode.replace(replacement);
});
}
@ -273,7 +277,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text = Y.one(selectedNode).get('text');
// For each of these patterns we have a RegExp which captures the inner component of the equation but also includes the delimiters.
// For each of these patterns we have a RegExp which captures the inner component of the equation but also
// includes the delimiters.
// We first run the RegExp adding the global flag ("g"). This ignores the capture, instead matching the entire
// equation including delimiters and returning one entry per match of the whole equation.
// We have to deal with multiple occurences of the same equation in a String so must be able to loop on the
@ -353,7 +358,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode,
text,
value,
host;
host,
newText;
host = this.get('host');
@ -446,7 +452,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
isChar = /[a-zA-Z\{\}]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) && currentPos < equation.length && isChar.test(equation.charAt(currentPos-1))) {
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
currentPos += 1;
}
}
@ -686,7 +694,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text: content
};
preview = Y.io(url, {
var preview = Y.io(url, {
sync: true,
data: params,
method: 'POST'

View File

@ -58,9 +58,11 @@ var COMPONENTNAME = 'atto_equation',
'<form class="atto_form">' +
'{{{library}}}' +
'<label for="{{elementid}}_{{CSS.EQUATION_TEXT}}">{{{get_string "editequation" component texdocsurl}}}</label>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<textarea class="fullwidth {{CSS.EQUATION_TEXT}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_TEXT}}" rows="8"></textarea><br/>' +
'<label for="{{elementid}}_{{CSS.EQUATION_PREVIEW}}">{{get_string "preview" component}}</label>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div describedby="{{elementid}}_cursorinfo" class="well well-small fullwidth {{CSS.EQUATION_PREVIEW}}" ' +
'id="{{elementid}}_{{CSS.EQUATION_PREVIEW}}"></div>' +
'<div id="{{elementid}}_cursorinfo">{{get_string "cursorinfo" component}}</div>' +
'<div class="mdl-align">' +
'<br/>' +
@ -184,7 +186,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
var replacement = Y.Node.create('<span>' + DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END + '</span>');
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
texNode.replace(replacement);
});
}
@ -271,7 +275,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text = Y.one(selectedNode).get('text');
// For each of these patterns we have a RegExp which captures the inner component of the equation but also includes the delimiters.
// For each of these patterns we have a RegExp which captures the inner component of the equation but also
// includes the delimiters.
// We first run the RegExp adding the global flag ("g"). This ignores the capture, instead matching the entire
// equation including delimiters and returning one entry per match of the whole equation.
// We have to deal with multiple occurences of the same equation in a String so must be able to loop on the
@ -351,7 +356,8 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode,
text,
value,
host;
host,
newText;
host = this.get('host');
@ -444,7 +450,9 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
isChar = /[a-zA-Z\{\}]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) && currentPos < equation.length && isChar.test(equation.charAt(currentPos-1))) {
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
currentPos += 1;
}
}
@ -686,7 +694,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
text: content
};
preview = Y.io(url, {
var preview = Y.io(url, {
sync: true,
data: params,
method: 'POST'

View File

@ -118,7 +118,9 @@ var CSS = {
// Add the presentation select box.
'<input type="checkbox" class="{{CSS.IMAGEPRESENTATION}}" id="{{elementid}}_{{CSS.IMAGEPRESENTATION}}"/>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">{{get_string "presentation" component}}</label>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">' +
'{{get_string "presentation" component}}' +
'</label>' +
'<br/>' +
// Add the size entry boxes.
@ -236,7 +238,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e = e._event;
// Only handle the event if an image file was dropped in.
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length && /^image\//.test(e.dataTransfer.files[0].type)) {
var handlesDataTransfer = (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length);
if (handlesDataTransfer && /^image\//.test(e.dataTransfer.files[0].type)) {
var options = host.get('filepickeroptions').image,
savepath = (options.savepath === undefined) ? '/' : options.savepath,
@ -319,7 +322,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
self.markUpdated();
}
} else {
alert(M.util.get_string('servererror', 'moodle'));
Y.use('moodle-core-notification-alert', function() {
new M.core.alert({message: M.util.get_string('servererror', 'moodle')});
});
if (placeholder) {
placeholder.remove(true);
}
@ -634,7 +639,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_applyImageProperties: function(form) {
var properties = this._getSelectedImageProperties(),
img = form.one('.' + CSS.IMAGEPREVIEW),
i;
i,
css;
if (properties === false) {
img.setStyle('display', 'none');
@ -702,7 +708,13 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Get the current selection.
images = this.get('host').getSelectedNodes(),
i, width, height, style, css;
i,
width,
height,
style,
css,
image,
margin;
if (images) {
images = images.filter('img');
@ -790,6 +802,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
imagehtml,
customstyle = '',
i,
css,
classlist = [],
host = this.get('host');
@ -834,7 +847,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
template = Y.Handlebars.compile(IMAGETEMPLATE);
var template = Y.Handlebars.compile(IMAGETEMPLATE);
imagehtml = template({
url: url,
alt: alt,

File diff suppressed because one or more lines are too long

View File

@ -118,7 +118,9 @@ var CSS = {
// Add the presentation select box.
'<input type="checkbox" class="{{CSS.IMAGEPRESENTATION}}" id="{{elementid}}_{{CSS.IMAGEPRESENTATION}}"/>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">{{get_string "presentation" component}}</label>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">' +
'{{get_string "presentation" component}}' +
'</label>' +
'<br/>' +
// Add the size entry boxes.
@ -236,7 +238,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e = e._event;
// Only handle the event if an image file was dropped in.
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length && /^image\//.test(e.dataTransfer.files[0].type)) {
var handlesDataTransfer = (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length);
if (handlesDataTransfer && /^image\//.test(e.dataTransfer.files[0].type)) {
var options = host.get('filepickeroptions').image,
savepath = (options.savepath === undefined) ? '/' : options.savepath,
@ -319,7 +322,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
self.markUpdated();
}
} else {
alert(M.util.get_string('servererror', 'moodle'));
Y.use('moodle-core-notification-alert', function() {
new M.core.alert({message: M.util.get_string('servererror', 'moodle')});
});
if (placeholder) {
placeholder.remove(true);
}
@ -634,7 +639,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_applyImageProperties: function(form) {
var properties = this._getSelectedImageProperties(),
img = form.one('.' + CSS.IMAGEPREVIEW),
i;
i,
css;
if (properties === false) {
img.setStyle('display', 'none');
@ -702,7 +708,13 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Get the current selection.
images = this.get('host').getSelectedNodes(),
i, width, height, style, css;
i,
width,
height,
style,
css,
image,
margin;
if (images) {
images = images.filter('img');
@ -790,6 +802,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
imagehtml,
customstyle = '',
i,
css,
classlist = [],
host = this.get('host');
@ -834,7 +847,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
template = Y.Handlebars.compile(IMAGETEMPLATE);
var template = Y.Handlebars.compile(IMAGETEMPLATE);
imagehtml = template({
url: url,
alt: alt,

View File

@ -116,7 +116,9 @@ var CSS = {
// Add the presentation select box.
'<input type="checkbox" class="{{CSS.IMAGEPRESENTATION}}" id="{{elementid}}_{{CSS.IMAGEPRESENTATION}}"/>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">{{get_string "presentation" component}}</label>' +
'<label class="sameline" for="{{elementid}}_{{CSS.IMAGEPRESENTATION}}">' +
'{{get_string "presentation" component}}' +
'</label>' +
'<br/>' +
// Add the size entry boxes.
@ -234,7 +236,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e = e._event;
// Only handle the event if an image file was dropped in.
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length && /^image\//.test(e.dataTransfer.files[0].type)) {
var handlesDataTransfer = (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length);
if (handlesDataTransfer && /^image\//.test(e.dataTransfer.files[0].type)) {
var options = host.get('filepickeroptions').image,
savepath = (options.savepath === undefined) ? '/' : options.savepath,
@ -317,7 +320,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
self.markUpdated();
}
} else {
alert(M.util.get_string('servererror', 'moodle'));
Y.use('moodle-core-notification-alert', function() {
new M.core.alert({message: M.util.get_string('servererror', 'moodle')});
});
if (placeholder) {
placeholder.remove(true);
}
@ -632,7 +637,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_applyImageProperties: function(form) {
var properties = this._getSelectedImageProperties(),
img = form.one('.' + CSS.IMAGEPREVIEW),
i;
i,
css;
if (properties === false) {
img.setStyle('display', 'none');
@ -700,7 +706,13 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Get the current selection.
images = this.get('host').getSelectedNodes(),
i, width, height, style, css;
i,
width,
height,
style,
css,
image,
margin;
if (images) {
images = images.filter('img');
@ -788,6 +800,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
imagehtml,
customstyle = '',
i,
css,
classlist = [],
host = this.get('host');
@ -832,7 +845,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
template = Y.Handlebars.compile(IMAGETEMPLATE);
var template = Y.Handlebars.compile(IMAGETEMPLATE);
imagehtml = template({
url: url,
alt: alt,

View File

@ -58,7 +58,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
indent: function() {
// Save the current selection - we want to restore this.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -80,14 +80,14 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We don't want blockquotes, we're going to convert them to divs.
this.replaceBlockquote(this.editor);
// Finally restore the seelction. The content has changed - sometimes this works - but not always :(
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// There were no new blockquotes, this happens if the user is indenting/outdenting a list.
blockquotes.removeClass('pre-existing');
}
// Remove the selection markers - a clean up really.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -100,7 +100,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
outdent: function() {
// Save the selection we will want to restore it.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -111,9 +111,9 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
this.replaceEditorIndents(this.editor);
// Restore the users selection - otherwise the next outdent operation won't work!
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
// And save it once more.
selection = rangy.saveSelection();
selection = window.rangy.saveSelection();
// Outdent.
document.execCommand('outdent', false, null);
@ -125,7 +125,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// The number of blockquotes hasn't changed.
// This occurs when the user has outdented a list item.
this.replaceBlockquote(this.editor);
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// The number of blockquotes is the same and is more than 0 we just need to clean up the class
// we added to mark pre-existing blockquotes.
@ -133,7 +133,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
}
// Clean up any left over selection markers.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -153,7 +153,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
if (blockquote.hasClass('pre-existing')) {
blockquote.removeClass('pre-existing');
} else {
var clone = Y.Node.create('<div></div>').setAttrs(blockquote.getAttrs()).setStyle(margindir, '30px').addClass('editor-indent');
var clone = Y.Node.create('<div></div>')
.setAttrs(blockquote.getAttrs())
.setStyle(margindir, '30px')
.addClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = blockquote.getDOMNode().childNodes, child;
child = children[0];
@ -176,7 +179,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We use the editor-indent class because it is preserved between saves.
var indent = editor.one('.editor-indent');
while (indent) {
var clone = Y.Node.create('<blockquote></blockquote>').setAttrs(indent.getAttrs()).removeClass('editor-indent');
var clone = Y.Node.create('<blockquote></blockquote>')
.setAttrs(indent
.getAttrs())
.removeClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = indent.getDOMNode().childNodes, child;
child = children[0];

View File

@ -1 +1 @@
YUI.add("moodle-atto_indent-button",function(e,t){e.namespace("M.atto_indent").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/decrease_indent",title:"outdent",buttonName:"outdent",callback:this.outdent}),this.addButton({icon:"e/increase_indent",title:"indent",buttonName:"indent",callback:this.indent})},indent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();this.editor.all(".rangySelectionBoundary").setStyle("display",null),t.addClass("pre-existing"),document.execCommand("indent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},outdent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();t.addClass("pre-existing"),this.replaceEditorIndents(this.editor),rangy.restoreSelection(e),e=rangy.saveSelection(),document.execCommand("outdent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},replaceBlockquote:function(t){t.all("blockquote").setAttribute("data-iterate",!0);var n=t.one("blockquote"),r=e.one("body.dir-ltr")?"marginLeft":"marginRight";while(n){n.removeAttribute("data-iterate");if(n.hasClass("pre-existing"))n.removeClass("pre-existing");else{var i=e.Node.create("<div></div>").setAttrs(n.getAttrs()).setStyle(r,"30px").addClass("editor-indent"),s=n.getDOMNode().childNodes,o;o=s[0];while(typeof o!="undefined")i.append(o),o=s[0];n.replace(i)}n=t.one("blockquote[data-iterate]")}},replaceEditorIndents:function(t){var n=t.one(".editor-indent");while(n){var r=e.Node.create("<blockquote></blockquote>").setAttrs(n.getAttrs()).removeClass("editor-indent"),i=n.getDOMNode().childNodes,s;s=i[0];while(typeof s!="undefined")r.append(s),s=i[0];n.replace(r),n=t.one(".editor-indent")}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
YUI.add("moodle-atto_indent-button",function(e,t){e.namespace("M.atto_indent").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/decrease_indent",title:"outdent",buttonName:"outdent",callback:this.outdent}),this.addButton({icon:"e/increase_indent",title:"indent",buttonName:"indent",callback:this.indent})},indent:function(){var e=window.rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();this.editor.all(".rangySelectionBoundary").setStyle("display",null),t.addClass("pre-existing"),document.execCommand("indent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),window.rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),window.rangy.removeMarkers(e),this.markUpdated()},outdent:function(){var e=window.rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();t.addClass("pre-existing"),this.replaceEditorIndents(this.editor),window.rangy.restoreSelection(e),e=window.rangy.saveSelection(),document.execCommand("outdent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),window.rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),window.rangy.removeMarkers(e),this.markUpdated()},replaceBlockquote:function(t){t.all("blockquote").setAttribute("data-iterate",!0);var n=t.one("blockquote"),r=e.one("body.dir-ltr")?"marginLeft":"marginRight";while(n){n.removeAttribute("data-iterate");if(n.hasClass("pre-existing"))n.removeClass("pre-existing");else{var i=e.Node.create("<div></div>").setAttrs(n.getAttrs()).setStyle(r,"30px").addClass("editor-indent"),s=n.getDOMNode().childNodes,o;o=s[0];while(typeof o!="undefined")i.append(o),o=s[0];n.replace(i)}n=t.one("blockquote[data-iterate]")}},replaceEditorIndents:function(t){var n=t.one(".editor-indent");while(n){var r=e.Node.create("<blockquote></blockquote>").setAttrs(n.getAttrs()).removeClass("editor-indent"),i=n.getDOMNode().childNodes,s;s=i[0];while(typeof s!="undefined")r.append(s),s=i[0];n.replace(r),n=t.one(".editor-indent")}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});

View File

@ -58,7 +58,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
indent: function() {
// Save the current selection - we want to restore this.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -80,14 +80,14 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We don't want blockquotes, we're going to convert them to divs.
this.replaceBlockquote(this.editor);
// Finally restore the seelction. The content has changed - sometimes this works - but not always :(
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// There were no new blockquotes, this happens if the user is indenting/outdenting a list.
blockquotes.removeClass('pre-existing');
}
// Remove the selection markers - a clean up really.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -100,7 +100,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
outdent: function() {
// Save the selection we will want to restore it.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -111,9 +111,9 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
this.replaceEditorIndents(this.editor);
// Restore the users selection - otherwise the next outdent operation won't work!
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
// And save it once more.
selection = rangy.saveSelection();
selection = window.rangy.saveSelection();
// Outdent.
document.execCommand('outdent', false, null);
@ -125,7 +125,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// The number of blockquotes hasn't changed.
// This occurs when the user has outdented a list item.
this.replaceBlockquote(this.editor);
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// The number of blockquotes is the same and is more than 0 we just need to clean up the class
// we added to mark pre-existing blockquotes.
@ -133,7 +133,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
}
// Clean up any left over selection markers.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -153,7 +153,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
if (blockquote.hasClass('pre-existing')) {
blockquote.removeClass('pre-existing');
} else {
var clone = Y.Node.create('<div></div>').setAttrs(blockquote.getAttrs()).setStyle(margindir, '30px').addClass('editor-indent');
var clone = Y.Node.create('<div></div>')
.setAttrs(blockquote.getAttrs())
.setStyle(margindir, '30px')
.addClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = blockquote.getDOMNode().childNodes, child;
child = children[0];
@ -176,7 +179,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We use the editor-indent class because it is preserved between saves.
var indent = editor.one('.editor-indent');
while (indent) {
var clone = Y.Node.create('<blockquote></blockquote>').setAttrs(indent.getAttrs()).removeClass('editor-indent');
var clone = Y.Node.create('<blockquote></blockquote>')
.setAttrs(indent
.getAttrs())
.removeClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = indent.getDOMNode().childNodes, child;
child = children[0];

View File

@ -56,7 +56,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
indent: function() {
// Save the current selection - we want to restore this.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -78,14 +78,14 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We don't want blockquotes, we're going to convert them to divs.
this.replaceBlockquote(this.editor);
// Finally restore the seelction. The content has changed - sometimes this works - but not always :(
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// There were no new blockquotes, this happens if the user is indenting/outdenting a list.
blockquotes.removeClass('pre-existing');
}
// Remove the selection markers - a clean up really.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -98,7 +98,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
*/
outdent: function() {
// Save the selection we will want to restore it.
var selection = rangy.saveSelection(),
var selection = window.rangy.saveSelection(),
blockquotes = this.editor.all('blockquote'),
count = blockquotes.size();
@ -109,9 +109,9 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
this.replaceEditorIndents(this.editor);
// Restore the users selection - otherwise the next outdent operation won't work!
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
// And save it once more.
selection = rangy.saveSelection();
selection = window.rangy.saveSelection();
// Outdent.
document.execCommand('outdent', false, null);
@ -123,7 +123,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// The number of blockquotes hasn't changed.
// This occurs when the user has outdented a list item.
this.replaceBlockquote(this.editor);
rangy.restoreSelection(selection);
window.rangy.restoreSelection(selection);
} else if (blockquotes.size() > 0) {
// The number of blockquotes is the same and is more than 0 we just need to clean up the class
// we added to mark pre-existing blockquotes.
@ -131,7 +131,7 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
}
// Clean up any left over selection markers.
rangy.removeMarkers(selection);
window.rangy.removeMarkers(selection);
// Mark the text as having been updated.
this.markUpdated();
@ -151,7 +151,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
if (blockquote.hasClass('pre-existing')) {
blockquote.removeClass('pre-existing');
} else {
var clone = Y.Node.create('<div></div>').setAttrs(blockquote.getAttrs()).setStyle(margindir, '30px').addClass('editor-indent');
var clone = Y.Node.create('<div></div>')
.setAttrs(blockquote.getAttrs())
.setStyle(margindir, '30px')
.addClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = blockquote.getDOMNode().childNodes, child;
child = children[0];
@ -174,7 +177,10 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
// We use the editor-indent class because it is preserved between saves.
var indent = editor.one('.editor-indent');
while (indent) {
var clone = Y.Node.create('<blockquote></blockquote>').setAttrs(indent.getAttrs()).removeClass('editor-indent');
var clone = Y.Node.create('<blockquote></blockquote>')
.setAttrs(indent
.getAttrs())
.removeClass('editor-indent');
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = indent.getDOMNode().childNodes, child;
child = children[0];

View File

@ -98,6 +98,8 @@ M.atto_managefiles.usedfiles = M.atto_managefiles.usedfiles || {
var allFiles = config.files;
var form = Y.one(SELECTORS.FORM),
usedFiles,
unusedFiles,
missingFiles,
missingFilesTxt,
i;

View File

@ -1 +1 @@
YUI.add("moodle-atto_managefiles-usedfiles",function(e,t){var n={HASMISSINGFILES:"has-missing-files",HASUNUSEDFILES:"has-unused-files"},r={FILEANCESTOR:".fitem_fcheckbox",FORM:"#atto_managefiles_manageform",MISSINGFILES:".missing-files"};M.atto_managefiles=M.atto_managefiles||{},M.atto_managefiles.usedfiles=M.atto_managefiles.usedfiles||{_usercontext:null,_itemid:null,_elementid:null,init:function(t){this._usercontext=t.usercontext,this._itemid=t.itemid,this._elementid=t.elementid;var i=t.files,s=e.one(r.FORM),o,u,a;if(!s||!window.parent)return;o=this._getUsedFiles(),unusedFiles=this.findUnusedFiles(i,o),missingFiles=this.findMissingFiles(i,o),unusedFiles.length>0?(s.all('input[type=checkbox][name^="deletefile"]').each(function(t){e.Array.indexOf(unusedFiles,t.getData("filename"))===-1&&t.ancestor(r.FILEANCESTOR).remove()}),s.addClass(n.HASUNUSEDFILES)):s.removeClass(n.HASUNUSEDFILES);if(missingFiles.length>0){u="<ul>";for(a=0;a<missingFiles.length;a++)u+="<li>"+e.Escape.html(missingFiles[a])+"</li>";u+="</ul>",s.one(r.MISSINGFILES).setHTML("").append(u),s.addClass(n.HASMISSINGFILES)}else s.removeClass(n.HASMISSINGFILES)},_getUsedFiles:function(){var t=e.one(window.parent.document.getElementById(this._elementid+"editable")),n=M.cfg.wwwroot+"/draftfile.php/"+this._usercontext+"/user/draft/"+this._itemid+"/",r=new RegExp(n.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")+"(.+?)[\\?\"']","gm"),i="",s="",o={};while((s=r.exec(t.get("innerHTML")))!==null)i=decodeURI(s[1]),o[i]=!0;return o},findUnusedFiles:function(e,t){var n,r=[];for(n in e)t[n]||r.push(n);return r},findMissingFiles:function(e,t){var n,r=[];for(n in t)e[n]||r.push(n);return r}}},"@VERSION@",{requires:["node","escape"]});
YUI.add("moodle-atto_managefiles-usedfiles",function(e,t){var n={HASMISSINGFILES:"has-missing-files",HASUNUSEDFILES:"has-unused-files"},r={FILEANCESTOR:".fitem_fcheckbox",FORM:"#atto_managefiles_manageform",MISSINGFILES:".missing-files"};M.atto_managefiles=M.atto_managefiles||{},M.atto_managefiles.usedfiles=M.atto_managefiles.usedfiles||{_usercontext:null,_itemid:null,_elementid:null,init:function(t){this._usercontext=t.usercontext,this._itemid=t.itemid,this._elementid=t.elementid;var i=t.files,s=e.one(r.FORM),o,u,a,f,l;if(!s||!window.parent)return;o=this._getUsedFiles(),u=this.findUnusedFiles(i,o),a=this.findMissingFiles(i,o),u.length>0?(s.all('input[type=checkbox][name^="deletefile"]').each(function(t){e.Array.indexOf(u,t.getData("filename"))===-1&&t.ancestor(r.FILEANCESTOR).remove()}),s.addClass(n.HASUNUSEDFILES)):s.removeClass(n.HASUNUSEDFILES);if(a.length>0){f="<ul>";for(l=0;l<a.length;l++)f+="<li>"+e.Escape.html(a[l])+"</li>";f+="</ul>",s.one(r.MISSINGFILES).setHTML("").append(f),s.addClass(n.HASMISSINGFILES)}else s.removeClass(n.HASMISSINGFILES)},_getUsedFiles:function(){var t=e.one(window.parent.document.getElementById(this._elementid+"editable")),n=M.cfg.wwwroot+"/draftfile.php/"+this._usercontext+"/user/draft/"+this._itemid+"/",r=new RegExp(n.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")+"(.+?)[\\?\"']","gm"),i="",s="",o={};while((s=r.exec(t.get("innerHTML")))!==null)i=decodeURI(s[1]),o[i]=!0;return o},findUnusedFiles:function(e,t){var n,r=[];for(n in e)t[n]||r.push(n);return r},findMissingFiles:function(e,t){var n,r=[];for(n in t)e[n]||r.push(n);return r}}},"@VERSION@",{requires:["node","escape"]});

View File

@ -98,6 +98,8 @@ M.atto_managefiles.usedfiles = M.atto_managefiles.usedfiles || {
var allFiles = config.files;
var form = Y.one(SELECTORS.FORM),
usedFiles,
unusedFiles,
missingFiles,
missingFilesTxt,
i;

View File

@ -96,6 +96,8 @@ M.atto_managefiles.usedfiles = M.atto_managefiles.usedfiles || {
var allFiles = config.files;
var form = Y.one(SELECTORS.FORM),
usedFiles,
unusedFiles,
missingFiles,
missingFilesTxt,
i;

View File

@ -48,7 +48,8 @@ var COMPONENTNAME = 'atto_media',
'<input class="fullwidth {{CSS.URLINPUT}}" type="url" id="{{elementid}}_atto_media_urlentry" size="32"/><br/>' +
'<button class="openmediabrowser" type="button">{{get_string "browserepositories" component}}</button>' +
'<label for="{{elementid}}_atto_media_nameentry">{{get_string "entername" component}}</label>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry" size="32" required="true"/>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry"' +
'size="32" required="true"/>' +
'<div class="mdl-align">' +
'<br/>' +
'<button class="submit" type="submit">{{get_string "createmedia" component}}</button>' +

View File

@ -1 +1 @@
YUI.add("moodle-atto_media-button",function(e,t){var n="atto_media",r={URLINPUT:"atto_media_urlentry",NAMEINPUT:"atto_media_nameentry"},i={URLINPUT:"."+r.URLINPUT,NAMEINPUT:"."+r.NAMEINPUT},s='<form class="atto_form"><label for="{{elementid}}_atto_media_urlentry">{{get_string "enterurl" component}}</label><input class="fullwidth {{CSS.URLINPUT}}" type="url" id="{{elementid}}_atto_media_urlentry" size="32"/><br/><button class="openmediabrowser" type="button">{{get_string "browserepositories" component}}</button><label for="{{elementid}}_atto_media_nameentry">{{get_string "entername" component}}</label><input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry" size="32" required="true"/><div class="mdl-align"><br/><button class="submit" type="submit">{{get_string "createmedia" component}}</button></div></form>';e.namespace("M.atto_media").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_content:null,initializer:function(){this.get("host").canShowFilepicker("media")&&this.addButton({icon:"e/insert_edit_video",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection();if(this._currentSelection===!1)return;var e=this.getDialogue({headerContent:M.util.get_string("createmedia",n),focusAfterHide:!0,focusOnShowSelector:i.URLINPUT});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Handlebars.compile(s);return this._content=e.Node.create(t({component:n,elementid:this.get("host").get("elementid"),CSS:r})),this._content.one(".submit").on("click",this._setMedia,this),this._content.one(".openmediabrowser").on("click",function(e){e.preventDefault(),this.get("host").showFilepicker("media",this._filepickerCallback,this)},this),this._content},_filepickerCallback:function(e){e.url!==""&&(this._content.one(i.URLINPUT).set("value",e.url),this._content.one(i.NAMEINPUT).set("value",e.file))},_setMedia:function(t){t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide();var n=t.currentTarget.ancestor(".atto_form"),r=n.one(i.URLINPUT).get("value"),s=n.one(i.NAMEINPUT).get("value"),o=this.get("host");if(r!==""&&s!==""){o.setSelection(this._currentSelection);var u='<a href="'+e.Escape.html(r)+'">'+s+"</a>";o.insertContentAtFocusPoint(u),this.markUpdated()}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
YUI.add("moodle-atto_media-button",function(e,t){var n="atto_media",r={URLINPUT:"atto_media_urlentry",NAMEINPUT:"atto_media_nameentry"},i={URLINPUT:"."+r.URLINPUT,NAMEINPUT:"."+r.NAMEINPUT},s='<form class="atto_form"><label for="{{elementid}}_atto_media_urlentry">{{get_string "enterurl" component}}</label><input class="fullwidth {{CSS.URLINPUT}}" type="url" id="{{elementid}}_atto_media_urlentry" size="32"/><br/><button class="openmediabrowser" type="button">{{get_string "browserepositories" component}}</button><label for="{{elementid}}_atto_media_nameentry">{{get_string "entername" component}}</label><input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry"size="32" required="true"/><div class="mdl-align"><br/><button class="submit" type="submit">{{get_string "createmedia" component}}</button></div></form>';e.namespace("M.atto_media").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_content:null,initializer:function(){this.get("host").canShowFilepicker("media")&&this.addButton({icon:"e/insert_edit_video",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection();if(this._currentSelection===!1)return;var e=this.getDialogue({headerContent:M.util.get_string("createmedia",n),focusAfterHide:!0,focusOnShowSelector:i.URLINPUT});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Handlebars.compile(s);return this._content=e.Node.create(t({component:n,elementid:this.get("host").get("elementid"),CSS:r})),this._content.one(".submit").on("click",this._setMedia,this),this._content.one(".openmediabrowser").on("click",function(e){e.preventDefault(),this.get("host").showFilepicker("media",this._filepickerCallback,this)},this),this._content},_filepickerCallback:function(e){e.url!==""&&(this._content.one(i.URLINPUT).set("value",e.url),this._content.one(i.NAMEINPUT).set("value",e.file))},_setMedia:function(t){t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide();var n=t.currentTarget.ancestor(".atto_form"),r=n.one(i.URLINPUT).get("value"),s=n.one(i.NAMEINPUT).get("value"),o=this.get("host");if(r!==""&&s!==""){o.setSelection(this._currentSelection);var u='<a href="'+e.Escape.html(r)+'">'+s+"</a>";o.insertContentAtFocusPoint(u),this.markUpdated()}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});

View File

@ -48,7 +48,8 @@ var COMPONENTNAME = 'atto_media',
'<input class="fullwidth {{CSS.URLINPUT}}" type="url" id="{{elementid}}_atto_media_urlentry" size="32"/><br/>' +
'<button class="openmediabrowser" type="button">{{get_string "browserepositories" component}}</button>' +
'<label for="{{elementid}}_atto_media_nameentry">{{get_string "entername" component}}</label>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry" size="32" required="true"/>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry"' +
'size="32" required="true"/>' +
'<div class="mdl-align">' +
'<br/>' +
'<button class="submit" type="submit">{{get_string "createmedia" component}}</button>' +

View File

@ -46,7 +46,8 @@ var COMPONENTNAME = 'atto_media',
'<input class="fullwidth {{CSS.URLINPUT}}" type="url" id="{{elementid}}_atto_media_urlentry" size="32"/><br/>' +
'<button class="openmediabrowser" type="button">{{get_string "browserepositories" component}}</button>' +
'<label for="{{elementid}}_atto_media_nameentry">{{get_string "entername" component}}</label>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry" size="32" required="true"/>' +
'<input class="fullwidth {{CSS.NAMEINPUT}}" type="text" id="{{elementid}}_atto_media_nameentry"' +
'size="32" required="true"/>' +
'<div class="mdl-align">' +
'<br/>' +
'<button class="submit" type="submit">{{get_string "createmedia" component}}</button>' +

View File

@ -69,7 +69,8 @@ var COMPONENT = 'atto_table',
'<input class="{{CSS.ROWS}}" type="number" value="3" id="{{elementid}}_atto_table_rows" size="8" min="1" max="50"/>' +
'<br/>' +
'<label for="{{elementid}}_atto_table_columns" class="sameline">{{get_string "numberofcolumns" component}}</label>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" size="8" min="1" max="20"/>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" ' +
'size="8" min="1" max="20"/>' +
'<br/>' +
'<div class="mdl-align">' +
'<br/>' +
@ -966,7 +967,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Table has no rows. Boo.
return;
}
newrow = firstrow.cloneNode(true);
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,8 @@ var COMPONENT = 'atto_table',
'<input class="{{CSS.ROWS}}" type="number" value="3" id="{{elementid}}_atto_table_rows" size="8" min="1" max="50"/>' +
'<br/>' +
'<label for="{{elementid}}_atto_table_columns" class="sameline">{{get_string "numberofcolumns" component}}</label>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" size="8" min="1" max="20"/>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" ' +
'size="8" min="1" max="20"/>' +
'<br/>' +
'<div class="mdl-align">' +
'<br/>' +
@ -966,7 +967,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Table has no rows. Boo.
return;
}
newrow = firstrow.cloneNode(true);
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {

View File

@ -67,7 +67,8 @@ var COMPONENT = 'atto_table',
'<input class="{{CSS.ROWS}}" type="number" value="3" id="{{elementid}}_atto_table_rows" size="8" min="1" max="50"/>' +
'<br/>' +
'<label for="{{elementid}}_atto_table_columns" class="sameline">{{get_string "numberofcolumns" component}}</label>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" size="8" min="1" max="20"/>' +
'<input class="{{CSS.COLUMNS}}" type="number" value="3" id="{{elementid}}_atto_table_columns" ' +
'size="8" min="1" max="20"/>' +
'<br/>' +
'<div class="mdl-align">' +
'<br/>' +
@ -964,7 +965,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Table has no rows. Boo.
return;
}
newrow = firstrow.cloneNode(true);
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {

View File

@ -25,8 +25,6 @@ YUI.add('moodle-atto_undo-button', function (Y, NAME) {
* @module moodle-atto_undo-button
*/
var LOGNAME = 'moodle-atto_undo-button';
/**
* Atto text editor undo plugin.
*
@ -171,7 +169,7 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
return this._undoStack[0];
}
last = this._undoStack.pop();
var last = this._undoStack.pop();
if (last === current) {
// Oops, the latest undo step is the current content, we should unstack once more.
// There is no need to do that in a loop as the same stack should never contain duplicates.

View File

@ -1 +1 @@
YUI.add("moodle-atto_undo-button",function(e,t){var n="moodle-atto_undo-button";e.namespace("M.atto_undo").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this._undoStack=[],this._redoStack=[],this.addButton({icon:"e/undo",callback:this._undoHandler,buttonName:"undo",keys:90}),this.addButton({icon:"e/redo",callback:this._redoHandler,buttonName:"redo",keys:89}),this.get("host").on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.get("host").on("atto:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates()},_addToRedo:function(e){this._redoStack.push(e)},_addToUndo:function(e,t){var n=this._undoStack[this._undoStack.length-1];typeof t=="undefined"&&(t=!1),n!==e&&(this._undoStack.push(e),t&&(this._redoStack=[]));while(this._undoStack.length>this._maxUndos)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(e){return this._undoStack.length===1?this._undoStack[0]:(last=this._undoStack.pop(),last===e&&(last=this._undoStack.pop()),this._undoStack.length===0&&this._addToUndo(last),last)},_restoreValue:function(e){this.editor.setHTML(e),this._addToUndo(e)},_updateButtonsStates:function(){this._undoStack.length>1?this.enableButtons("undo"):this.disableButtons("undo"),this._redoStack.length>0?this.enableButtons("redo"):this.disableButtons("redo")},_undoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getUndo(t);if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._addToRedo(t),this._updateButtonsStates()},_redoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getRedo();if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._updateButtonsStates()},_changeListener:function(e){if(e.event&&e.event.type.indexOf("key")!==-1&&e.event.keyCode!==39&&e.event.keyCode!==37&&e.event.keyCode!==40&&e.event.keyCode!==38)return;this._addToUndo(this._getHTML(),!0),this._updateButtonsStates()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
YUI.add("moodle-atto_undo-button",function(e,t){e.namespace("M.atto_undo").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this._undoStack=[],this._redoStack=[],this.addButton({icon:"e/undo",callback:this._undoHandler,buttonName:"undo",keys:90}),this.addButton({icon:"e/redo",callback:this._redoHandler,buttonName:"redo",keys:89}),this.get("host").on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.get("host").on("atto:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates()},_addToRedo:function(e){this._redoStack.push(e)},_addToUndo:function(e,t){var n=this._undoStack[this._undoStack.length-1];typeof t=="undefined"&&(t=!1),n!==e&&(this._undoStack.push(e),t&&(this._redoStack=[]));while(this._undoStack.length>this._maxUndos)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(e){if(this._undoStack.length===1)return this._undoStack[0];var t=this._undoStack.pop();return t===e&&(t=this._undoStack.pop()),this._undoStack.length===0&&this._addToUndo(t),t},_restoreValue:function(e){this.editor.setHTML(e),this._addToUndo(e)},_updateButtonsStates:function(){this._undoStack.length>1?this.enableButtons("undo"):this.disableButtons("undo"),this._redoStack.length>0?this.enableButtons("redo"):this.disableButtons("redo")},_undoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getUndo(t);if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._addToRedo(t),this._updateButtonsStates()},_redoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getRedo();if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._updateButtonsStates()},_changeListener:function(e){if(e.event&&e.event.type.indexOf("key")!==-1&&e.event.keyCode!==39&&e.event.keyCode!==37&&e.event.keyCode!==40&&e.event.keyCode!==38)return;this._addToUndo(this._getHTML(),!0),this._updateButtonsStates()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});

View File

@ -25,8 +25,6 @@ YUI.add('moodle-atto_undo-button', function (Y, NAME) {
* @module moodle-atto_undo-button
*/
var LOGNAME = 'moodle-atto_undo-button';
/**
* Atto text editor undo plugin.
*
@ -171,7 +169,7 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
return this._undoStack[0];
}
last = this._undoStack.pop();
var last = this._undoStack.pop();
if (last === current) {
// Oops, the latest undo step is the current content, we should unstack once more.
// There is no need to do that in a loop as the same stack should never contain duplicates.

View File

@ -23,8 +23,6 @@
* @module moodle-atto_undo-button
*/
var LOGNAME = 'moodle-atto_undo-button';
/**
* Atto text editor undo plugin.
*
@ -169,7 +167,7 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
return this._undoStack[0];
}
last = this._undoStack.pop();
var last = this._undoStack.pop();
if (last === current) {
// Oops, the latest undo step is the current content, we should unstack once more.
// There is no need to do that in a loop as the same stack should never contain duplicates.

View File

@ -37,7 +37,8 @@ var CSS = {
TOOLBAR: 'editor_atto_toolbar',
WRAPPER: 'editor_atto',
HIGHLIGHT: 'highlight'
};
},
rangy = window.rangy;
/**
* The Atto editor for Moodle.
@ -813,7 +814,9 @@ EditorAutosave.prototype = {
setupAutosave: function() {
var draftid = -1,
optiontype = null,
options = this.get('filepickeroptions');
options = this.get('filepickeroptions'),
params,
url;
if (!this.get('autosaveEnabled')) {
// Autosave disabled for this instance.
@ -847,6 +850,7 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
var response_json;
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
@ -864,7 +868,8 @@ EditorAutosave.prototype = {
if (response_json.error || typeof response_json.result === 'undefined') {
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json.result !== this.textarea.get('value') &&
response_json.result !== '') {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
@ -874,7 +879,8 @@ EditorAutosave.prototype = {
}
},
failure: function() {
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
}
}
});
@ -897,8 +903,8 @@ EditorAutosave.prototype = {
*/
resetAutosave: function() {
// Make an ajax request to reset the autosaved text.
url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
params = {
var url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
var params = {
sesskey: M.cfg.sesskey,
contextid: this.get('contextid'),
action: 'reset',
@ -929,7 +935,8 @@ EditorAutosave.prototype = {
this.updateOriginal();
this.lastText = text;
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'), NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'),
NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
return this;
},
@ -941,6 +948,7 @@ EditorAutosave.prototype = {
* @chainable
*/
saveDraft: function() {
var url, params;
// Only copy the text from the div to the textarea if the textarea is not currently visible.
if (!this.editor.get('hidden')) {
this.updateOriginal();
@ -983,7 +991,8 @@ EditorAutosave.prototype = {
} else {
// All working.
this.lastText = newText;
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'), NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'),
NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
}
}
}
@ -1374,7 +1383,7 @@ EditorToolbarNav.prototype = {
if (this._tabFocus.hasAttribute('disabled') || this._tabFocus.hasAttribute('hidden')
|| this._tabFocus.ancestor('.atto_group').hasAttribute('hidden')) {
// Find first available button.
button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
var button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
if (button) {
if (this._tabFocus.compareTo(document.activeElement)) {
// We should also move the focus, because the inaccessible button also has the focus.

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,8 @@ var CSS = {
TOOLBAR: 'editor_atto_toolbar',
WRAPPER: 'editor_atto',
HIGHLIGHT: 'highlight'
};
},
rangy = window.rangy;
/**
* The Atto editor for Moodle.
@ -808,7 +809,9 @@ EditorAutosave.prototype = {
setupAutosave: function() {
var draftid = -1,
optiontype = null,
options = this.get('filepickeroptions');
options = this.get('filepickeroptions'),
params,
url;
if (!this.get('autosaveEnabled')) {
// Autosave disabled for this instance.
@ -842,6 +845,7 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
var response_json;
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
@ -858,7 +862,8 @@ EditorAutosave.prototype = {
}
if (response_json.error || typeof response_json.result === 'undefined') {
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json.result !== this.textarea.get('value') &&
response_json.result !== '') {
this.recoverText(response_json.result);
@ -867,7 +872,8 @@ EditorAutosave.prototype = {
}
},
failure: function() {
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
}
}
});
@ -890,8 +896,8 @@ EditorAutosave.prototype = {
*/
resetAutosave: function() {
// Make an ajax request to reset the autosaved text.
url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
params = {
var url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
var params = {
sesskey: M.cfg.sesskey,
contextid: this.get('contextid'),
action: 'reset',
@ -922,7 +928,8 @@ EditorAutosave.prototype = {
this.updateOriginal();
this.lastText = text;
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'), NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'),
NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
return this;
},
@ -934,6 +941,7 @@ EditorAutosave.prototype = {
* @chainable
*/
saveDraft: function() {
var url, params;
// Only copy the text from the div to the textarea if the textarea is not currently visible.
if (!this.editor.get('hidden')) {
this.updateOriginal();
@ -973,7 +981,8 @@ EditorAutosave.prototype = {
} else {
// All working.
this.lastText = newText;
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'), NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'),
NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
}
}
}
@ -1362,7 +1371,7 @@ EditorToolbarNav.prototype = {
if (this._tabFocus.hasAttribute('disabled') || this._tabFocus.hasAttribute('hidden')
|| this._tabFocus.ancestor('.atto_group').hasAttribute('hidden')) {
// Find first available button.
button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
var button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
if (button) {
if (this._tabFocus.compareTo(document.activeElement)) {
// We should also move the focus, because the inaccessible button also has the focus.

View File

@ -25,6 +25,7 @@ YUI.add('moodle-editor_atto-menu', function (Y, NAME) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var LOGNAME = 'moodle-editor_atto-menu';
var MENUDIALOGUE = '' +
'<div class="open {{config.buttonClass}} atto_menu" ' +
'style="min-width:{{config.innerOverlayWidth}};">' +
@ -51,7 +52,7 @@ var MENUDIALOGUE = '' +
* @constructor
* @extends M.core.dialogue
*/
Menu = function() {
var Menu = function() {
Menu.superclass.constructor.apply(this, arguments);
};
@ -173,7 +174,8 @@ Y.extend(Menu, M.core.dialogue, {
index = 0,
direction = 1,
checkCount = 0,
current = e.target.ancestor('a[role="menuitem"]', true);
current = e.target.ancestor('a[role="menuitem"]', true),
next;
// Determine which button is currently selected.
while (!found && index < buttons.size()) {

View File

@ -1 +1 @@
YUI.add("moodle-editor_atto-menu",function(e,t){var n='<div class="open {{config.buttonClass}} atto_menu" style="min-width:{{config.innerOverlayWidth}};"><ul class="dropdown-menu">{{#each config.items}}<li role="presentation" class="atto_menuentry"><a href="#" role="menuitem" data-index="{{@index}}" {{#each data}}data-{{@key}}="{{this}}"{{/each}}>{{{text}}}</a></li>{{/each}}</ul></div>';Menu=function(){Menu.superclass.constructor.apply(this,arguments)},e.extend(Menu,M.core.dialogue,{_menuHandlers:null,initializer:function(t){var r,i;this._menuHandlers=[];var s=e.Handlebars.compile(n),o=e.Node.create(s({config:t}));this.set("bodyContent",o),i=this.get("boundingBox"),i.addClass("editor_atto_controlmenu"),i.addClass("editor_atto_menu"),i.one(".moodle-dialogue-wrap").removeClass("moodle-dialogue-wrap").addClass("moodle-dialogue-content"),r=e.Node.create("<h3/>").addClass("accesshide").setHTML(this.get("headerText")),this.get("bodyContent").prepend(r),this.headerNode.hide(),this.footerNode.hide(),this._setupHandlers()},_setupHandlers:function(){var e=this.get("contentBox");this._menuHandlers.push(e.delegate("key",this._chooseMenuItem,"32, enter",".atto_menuentry",this),e.delegate("key",this._handleKeyboardEvent,"down:38,40",".dropdown-menu",this),e.on("focusoutside",this.hide,this),e.delegate("key",this.hide,"down:37,39,esc",".dropdown-menu",this))},_chooseMenuItem:function(e){e.target.simulate("click"),e.preventDefault()},hide:function(e){if(this.get("preventHideMenu")===!0)return;return e&&e.preventDefault(),Menu.superclass.hide.call(this,arguments)},_handleKeyboardEvent:function(e){e.preventDefault();var t=e.currentTarget.all('a[role="menuitem"]'),n=!1,r=0,i=1,s=0,o=e.target.ancestor('a[role="menuitem"]',!0);while(!n&&r<t.size())t.item(r)===o?n=!0:r++;if(!n)return;e.keyCode===38&&(i=-1);do r+=i,r<0?r=t.size()-1:r>=t.size()&&(r=0),next=t.item(r),s++;while(s<t.size()&&next!==o&&next.hasAttribute("hidden"));next&&next.focus(),e.preventDefault(),e.stopImmediatePropagation()}},{NAME:"menu",ATTRS:{headerText:{value:""}}}),e.Base.modifyAttrs(Menu,{width:{value:"auto"},hideOn:{value:[{eventName:"clickoutside"}]},extraClasses:{value:["editor_atto_menu"]},responsive:{value:!1},visible:{value:!1},center:{value:!1},closeButton:{value:!1}}),e.namespace("M.editor_atto").Menu=Menu},"@VERSION@",{requires:["moodle-core-notification-dialogue","node","event","event-custom"]});
YUI.add("moodle-editor_atto-menu",function(e,t){var n="moodle-editor_atto-menu",r='<div class="open {{config.buttonClass}} atto_menu" style="min-width:{{config.innerOverlayWidth}};"><ul class="dropdown-menu">{{#each config.items}}<li role="presentation" class="atto_menuentry"><a href="#" role="menuitem" data-index="{{@index}}" {{#each data}}data-{{@key}}="{{this}}"{{/each}}>{{{text}}}</a></li>{{/each}}</ul></div>',i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.dialogue,{_menuHandlers:null,initializer:function(t){var n,i;this._menuHandlers=[];var s=e.Handlebars.compile(r),o=e.Node.create(s({config:t}));this.set("bodyContent",o),i=this.get("boundingBox"),i.addClass("editor_atto_controlmenu"),i.addClass("editor_atto_menu"),i.one(".moodle-dialogue-wrap").removeClass("moodle-dialogue-wrap").addClass("moodle-dialogue-content"),n=e.Node.create("<h3/>").addClass("accesshide").setHTML(this.get("headerText")),this.get("bodyContent").prepend(n),this.headerNode.hide(),this.footerNode.hide(),this._setupHandlers()},_setupHandlers:function(){var e=this.get("contentBox");this._menuHandlers.push(e.delegate("key",this._chooseMenuItem,"32, enter",".atto_menuentry",this),e.delegate("key",this._handleKeyboardEvent,"down:38,40",".dropdown-menu",this),e.on("focusoutside",this.hide,this),e.delegate("key",this.hide,"down:37,39,esc",".dropdown-menu",this))},_chooseMenuItem:function(e){e.target.simulate("click"),e.preventDefault()},hide:function(e){if(this.get("preventHideMenu")===!0)return;return e&&e.preventDefault(),i.superclass.hide.call(this,arguments)},_handleKeyboardEvent:function(e){e.preventDefault();var t=e.currentTarget.all('a[role="menuitem"]'),n=!1,r=0,i=1,s=0,o=e.target.ancestor('a[role="menuitem"]',!0),u;while(!n&&r<t.size())t.item(r)===o?n=!0:r++;if(!n)return;e.keyCode===38&&(i=-1);do r+=i,r<0?r=t.size()-1:r>=t.size()&&(r=0),u=t.item(r),s++;while(s<t.size()&&u!==o&&u.hasAttribute("hidden"));u&&u.focus(),e.preventDefault(),e.stopImmediatePropagation()}},{NAME:"menu",ATTRS:{headerText:{value:""}}}),e.Base.modifyAttrs(i,{width:{value:"auto"},hideOn:{value:[{eventName:"clickoutside"}]},extraClasses:{value:["editor_atto_menu"]},responsive:{value:!1},visible:{value:!1},center:{value:!1},closeButton:{value:!1}}),e.namespace("M.editor_atto").Menu=i},"@VERSION@",{requires:["moodle-core-notification-dialogue","node","event","event-custom"]});

View File

@ -25,6 +25,7 @@ YUI.add('moodle-editor_atto-menu', function (Y, NAME) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var LOGNAME = 'moodle-editor_atto-menu';
var MENUDIALOGUE = '' +
'<div class="open {{config.buttonClass}} atto_menu" ' +
'style="min-width:{{config.innerOverlayWidth}};">' +
@ -51,7 +52,7 @@ var MENUDIALOGUE = '' +
* @constructor
* @extends M.core.dialogue
*/
Menu = function() {
var Menu = function() {
Menu.superclass.constructor.apply(this, arguments);
};
@ -173,7 +174,8 @@ Y.extend(Menu, M.core.dialogue, {
index = 0,
direction = 1,
checkCount = 0,
current = e.target.ancestor('a[role="menuitem"]', true);
current = e.target.ancestor('a[role="menuitem"]', true),
next;
// Determine which button is currently selected.
while (!found && index < buttons.size()) {

View File

@ -92,7 +92,8 @@ Y.extend(EditorPlugin, Y.Base, {
/**
* Mark the content ediable content as having been changed.
*
* This is a convenience function and passes through to {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
* This is a convenience function and passes through to
* {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
*
* @method markUpdated
*/
@ -183,7 +184,8 @@ var MENUTEMPLATE = '' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'style="background-color:{{config.menuColor}};" src="{{config.iconurl}}" />' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="{{image_url "t/expanded" "moodle"}}"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" ' +
'src="{{image_url "t/expanded" "moodle"}}"/>' +
'</button>';
var DISABLED = 'disabled',
@ -357,7 +359,8 @@ EditorPluginButtons.prototype = {
// Create the actual button.
button = Y.Node.create('<button type="button" class="' + buttonClass + '"' +
'tabindex="-1">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' + config.iconurl + '"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' +
config.iconurl + '"/>' +
'</button>');
button.setAttribute('title', title);
@ -430,7 +433,8 @@ EditorPluginButtons.prototype = {
/**
* Add a basic button which ties into the execCommand.
*
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}} for full details of the optional parameters.
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}}
* for full details of the optional parameters.
*
* @method addBasicButton
* @param {object} config The button configuration
@ -659,7 +663,6 @@ EditorPluginButtons.prototype = {
// Cancel the hide menu prevention.
menuDialogue.set('preventHideMenu', false);
console.log('Menu item chosen');
// Set the focus after hide so that focus is returned to the editor and changes are made correctly.
menuDialogue.set('focusAfterHide', this.get('host').editor);
menuDialogue.hide(e);

File diff suppressed because one or more lines are too long

View File

@ -92,7 +92,8 @@ Y.extend(EditorPlugin, Y.Base, {
/**
* Mark the content ediable content as having been changed.
*
* This is a convenience function and passes through to {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
* This is a convenience function and passes through to
* {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
*
* @method markUpdated
*/
@ -183,7 +184,8 @@ var MENUTEMPLATE = '' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'style="background-color:{{config.menuColor}};" src="{{config.iconurl}}" />' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="{{image_url "t/expanded" "moodle"}}"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" ' +
'src="{{image_url "t/expanded" "moodle"}}"/>' +
'</button>';
var DISABLED = 'disabled',
@ -357,7 +359,8 @@ EditorPluginButtons.prototype = {
// Create the actual button.
button = Y.Node.create('<button type="button" class="' + buttonClass + '"' +
'tabindex="-1">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' + config.iconurl + '"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' +
config.iconurl + '"/>' +
'</button>');
button.setAttribute('title', title);
@ -430,7 +433,8 @@ EditorPluginButtons.prototype = {
/**
* Add a basic button which ties into the execCommand.
*
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}} for full details of the optional parameters.
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}}
* for full details of the optional parameters.
*
* @method addBasicButton
* @param {object} config The button configuration
@ -657,7 +661,6 @@ EditorPluginButtons.prototype = {
// Cancel the hide menu prevention.
menuDialogue.set('preventHideMenu', false);
console.log('Menu item chosen');
// Set the focus after hide so that focus is returned to the editor and changes are made correctly.
menuDialogue.set('focusAfterHide', this.get('host').editor);
menuDialogue.hide(e);

View File

@ -108,7 +108,9 @@ EditorAutosave.prototype = {
setupAutosave: function() {
var draftid = -1,
optiontype = null,
options = this.get('filepickeroptions');
options = this.get('filepickeroptions'),
params,
url;
if (!this.get('autosaveEnabled')) {
// Autosave disabled for this instance.
@ -142,6 +144,7 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
var response_json;
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
@ -159,7 +162,8 @@ EditorAutosave.prototype = {
if (response_json.error || typeof response_json.result === 'undefined') {
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json.result !== this.textarea.get('value') &&
response_json.result !== '') {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
@ -169,7 +173,8 @@ EditorAutosave.prototype = {
}
},
failure: function() {
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'),
NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
}
}
});
@ -192,8 +197,8 @@ EditorAutosave.prototype = {
*/
resetAutosave: function() {
// Make an ajax request to reset the autosaved text.
url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
params = {
var url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
var params = {
sesskey: M.cfg.sesskey,
contextid: this.get('contextid'),
action: 'reset',
@ -224,7 +229,8 @@ EditorAutosave.prototype = {
this.updateOriginal();
this.lastText = text;
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'), NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('textrecovered', 'editor_atto'),
NOTIFY_INFO, RECOVER_MESSAGE_TIMEOUT);
return this;
},
@ -236,6 +242,7 @@ EditorAutosave.prototype = {
* @chainable
*/
saveDraft: function() {
var url, params;
// Only copy the text from the div to the textarea if the textarea is not currently visible.
if (!this.editor.get('hidden')) {
this.updateOriginal();
@ -278,7 +285,8 @@ EditorAutosave.prototype = {
} else {
// All working.
this.lastText = newText;
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'), NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
this.showMessage(M.util.get_string('autosavesucceeded', 'editor_atto'),
NOTIFY_INFO, SUCCESS_MESSAGE_TIMEOUT);
}
}
}

View File

@ -34,7 +34,8 @@ var MENUTEMPLATE = '' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'style="background-color:{{config.menuColor}};" src="{{config.iconurl}}" />' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="{{image_url "t/expanded" "moodle"}}"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" ' +
'src="{{image_url "t/expanded" "moodle"}}"/>' +
'</button>';
var DISABLED = 'disabled',
@ -208,7 +209,8 @@ EditorPluginButtons.prototype = {
// Create the actual button.
button = Y.Node.create('<button type="button" class="' + buttonClass + '"' +
'tabindex="-1">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' + config.iconurl + '"/>' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" src="' +
config.iconurl + '"/>' +
'</button>');
button.setAttribute('title', title);
@ -281,7 +283,8 @@ EditorPluginButtons.prototype = {
/**
* Add a basic button which ties into the execCommand.
*
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}} for full details of the optional parameters.
* See {{#crossLink "M.editor_atto.EditorPluginButtons/addButton:method"}}addButton{{/crossLink}}
* for full details of the optional parameters.
*
* @method addBasicButton
* @param {object} config The button configuration
@ -510,7 +513,6 @@ EditorPluginButtons.prototype = {
// Cancel the hide menu prevention.
menuDialogue.set('preventHideMenu', false);
console.log('Menu item chosen');
// Set the focus after hide so that focus is returned to the editor and changes are made correctly.
menuDialogue.set('focusAfterHide', this.get('host').editor);
menuDialogue.hide(e);

View File

@ -90,7 +90,8 @@ Y.extend(EditorPlugin, Y.Base, {
/**
* Mark the content ediable content as having been changed.
*
* This is a convenience function and passes through to {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
* This is a convenience function and passes through to
* {{#crossLink "M.editor_atto.EditorTextArea/updateOriginal"}}updateOriginal{{/crossLink}}.
*
* @method markUpdated
*/

View File

@ -35,7 +35,8 @@ var CSS = {
TOOLBAR: 'editor_atto_toolbar',
WRAPPER: 'editor_atto',
HIGHLIGHT: 'highlight'
};
},
rangy = window.rangy;
/**
* The Atto editor for Moodle.

View File

@ -0,0 +1 @@
/* globals rangy */

View File

@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var LOGNAME = 'moodle-editor_atto-menu';
var MENUDIALOGUE = '' +
'<div class="open {{config.buttonClass}} atto_menu" ' +
'style="min-width:{{config.innerOverlayWidth}};">' +
@ -49,7 +50,7 @@ var MENUDIALOGUE = '' +
* @constructor
* @extends M.core.dialogue
*/
Menu = function() {
var Menu = function() {
Menu.superclass.constructor.apply(this, arguments);
};
@ -171,7 +172,8 @@ Y.extend(Menu, M.core.dialogue, {
index = 0,
direction = 1,
checkCount = 0,
current = e.target.ancestor('a[role="menuitem"]', true);
current = e.target.ancestor('a[role="menuitem"]', true),
next;
// Determine which button is currently selected.
while (!found && index < buttons.size()) {

View File

@ -167,7 +167,7 @@ EditorToolbarNav.prototype = {
if (this._tabFocus.hasAttribute('disabled') || this._tabFocus.hasAttribute('hidden')
|| this._tabFocus.ancestor('.atto_group').hasAttribute('hidden')) {
// Find first available button.
button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
var button = this._findFirstFocusable(this.toolbar.all('button'), this._tabFocus, -1);
if (button) {
if (this._tabFocus.compareTo(document.activeElement)) {
// We should also move the focus, because the inaccessible button also has the focus.

View File

@ -120,7 +120,7 @@ M.form.dateselector = {
];
// Change the alignment if this is an RTL language.
if (right_to_left()) {
if (window.right_to_left()) {
alignpoints = [
Y.WidgetPositionAlign.BR,
Y.WidgetPositionAlign.TR

File diff suppressed because one or more lines are too long

View File

@ -120,7 +120,7 @@ M.form.dateselector = {
];
// Change the alignment if this is an RTL language.
if (right_to_left()) {
if (window.right_to_left()) {
alignpoints = [
Y.WidgetPositionAlign.BR,
Y.WidgetPositionAlign.TR

View File

@ -24,7 +24,7 @@ Y.extend(PASSWORDUNMASK, Y.Base, {
checkboxname+'unmask">');
unmaskdiv.appendChild(unmaskchb);
// Attach event using static javascript function for unmasking password.
unmaskchb.on('click', function() {unmaskPassword(elementid);});
unmaskchb.on('click', function() {window.unmaskPassword(elementid);});
// Add label for checkbox to unmaskdiv.
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');

View File

@ -1 +1 @@
YUI.add("moodle-form-passwordunmask",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(e){e&&e.formid&&this.add_checkbox(e.formid,e.checkboxlabel,e.checkboxname)},add_checkbox:function(t,n,r){var i=e.one("#"+t),s=e.Node.create('<div id="'+t+'unmaskdiv" class="unmask"></div>'),o=e.Node.create('<input id="'+t+'unmask" type="checkbox" name="'+r+'unmask">');s.appendChild(o),o.on("click",function(){unmaskPassword(t)});var u=e.Node.create('<label for="'+t+'unmask">'+n+"</label>");s.appendChild(u),i.get("parentNode").insert(s,i.get("lastNode"))}}),M.form=M.form||{},M.form.passwordunmask=function(e){return new n(e)}},"@VERSION@",{requires:["node","base"]});
YUI.add("moodle-form-passwordunmask",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(e){e&&e.formid&&this.add_checkbox(e.formid,e.checkboxlabel,e.checkboxname)},add_checkbox:function(t,n,r){var i=e.one("#"+t),s=e.Node.create('<div id="'+t+'unmaskdiv" class="unmask"></div>'),o=e.Node.create('<input id="'+t+'unmask" type="checkbox" name="'+r+'unmask">');s.appendChild(o),o.on("click",function(){window.unmaskPassword(t)});var u=e.Node.create('<label for="'+t+'unmask">'+n+"</label>");s.appendChild(u),i.get("parentNode").insert(s,i.get("lastNode"))}}),M.form=M.form||{},M.form.passwordunmask=function(e){return new n(e)}},"@VERSION@",{requires:["node","base"]});

View File

@ -24,7 +24,7 @@ Y.extend(PASSWORDUNMASK, Y.Base, {
checkboxname+'unmask">');
unmaskdiv.appendChild(unmaskchb);
// Attach event using static javascript function for unmasking password.
unmaskchb.on('click', function() {unmaskPassword(elementid);});
unmaskchb.on('click', function() {window.unmaskPassword(elementid);});
// Add label for checkbox to unmaskdiv.
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');

View File

@ -141,7 +141,7 @@ Y.extend(SHORTFORMS, Y.Base, {
* @chainable
*/
set_state: function(fieldset, collapsed) {
headerlink = fieldset.one(SELECTORS.FHEADER);
var headerlink = fieldset.one(SELECTORS.FHEADER);
if (collapsed) {
fieldset.addClass(CSS.COLLAPSED);
if (headerlink) {

Some files were not shown because too many files have changed in this diff Show More