Merge branch 'MDL-55244-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2016-07-27 00:19:40 +02:00
246 changed files with 6833 additions and 6566 deletions
@@ -24,7 +24,7 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
form : null,
form: null,
/**
* The capability select node.
* @property select
@@ -38,7 +38,7 @@ SEARCH.prototype = {
* @type Object
* @protected
*/
selectoptions : {},
selectoptions: {},
/**
* The search input field.
* @property input
@@ -60,12 +60,12 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
lastsearch : null,
lastsearch: null,
/**
* Constructs the search manager.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.form = Y.one('#capability-overview-form');
this.select = this.form.one('select[data-search=capability]');
this.select.setStyle('minWidth', this.select.get('offsetWidth'));
@@ -77,7 +77,7 @@ SEARCH.prototype = {
this.lastsearch = this.form.one('input[name=search]');
var div = Y.Node.create('<div id="capabilitysearchui"></div>'),
label = Y.Node.create('<label for="capabilitysearch">'+this.get('strsearch')+'</label>');
label = Y.Node.create('<label for="capabilitysearch">' + this.get('strsearch') + '</label>');
this.input = Y.Node.create('<input type="text" id="capabilitysearch" />');
div.append(label).append(this.input);
@@ -101,7 +101,7 @@ SEARCH.prototype = {
* Disables the submit button if there are no capabilities selected.
* @method validate
*/
validate : function() {
validate: function() {
this.button.set('disabled', (this.select.get('value') === ''));
},
/**
@@ -109,7 +109,7 @@ SEARCH.prototype = {
* This method hides any capabilities that don't match the search term.
* @method typed
*/
typed : function() {
typed: function() {
var search = this.input.get('value'),
matching = 0,
last = null,
@@ -137,9 +137,9 @@ SEARCH.prototype = {
}
};
Y.extend(SEARCH, Y.Base, SEARCH.prototype, {
NAME : 'tool_capability-search',
ATTRS : {
strsearch : {}
NAME: 'tool_capability-search',
ATTRS: {
strsearch: {}
}
});
@@ -24,7 +24,7 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
form : null,
form: null,
/**
* The capability select node.
* @property select
@@ -38,7 +38,7 @@ SEARCH.prototype = {
* @type Object
* @protected
*/
selectoptions : {},
selectoptions: {},
/**
* The search input field.
* @property input
@@ -60,12 +60,12 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
lastsearch : null,
lastsearch: null,
/**
* Constructs the search manager.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.form = Y.one('#capability-overview-form');
this.select = this.form.one('select[data-search=capability]');
this.select.setStyle('minWidth', this.select.get('offsetWidth'));
@@ -77,7 +77,7 @@ SEARCH.prototype = {
this.lastsearch = this.form.one('input[name=search]');
var div = Y.Node.create('<div id="capabilitysearchui"></div>'),
label = Y.Node.create('<label for="capabilitysearch">'+this.get('strsearch')+'</label>');
label = Y.Node.create('<label for="capabilitysearch">' + this.get('strsearch') + '</label>');
this.input = Y.Node.create('<input type="text" id="capabilitysearch" />');
div.append(label).append(this.input);
@@ -101,7 +101,7 @@ SEARCH.prototype = {
* Disables the submit button if there are no capabilities selected.
* @method validate
*/
validate : function() {
validate: function() {
this.button.set('disabled', (this.select.get('value') === ''));
},
/**
@@ -109,7 +109,7 @@ SEARCH.prototype = {
* This method hides any capabilities that don't match the search term.
* @method typed
*/
typed : function() {
typed: function() {
var search = this.input.get('value'),
matching = 0,
last = null,
@@ -137,9 +137,9 @@ SEARCH.prototype = {
}
};
Y.extend(SEARCH, Y.Base, SEARCH.prototype, {
NAME : 'tool_capability-search',
ATTRS : {
strsearch : {}
NAME: 'tool_capability-search',
ATTRS: {
strsearch: {}
}
});
+10 -10
View File
@@ -22,7 +22,7 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
form : null,
form: null,
/**
* The capability select node.
* @property select
@@ -36,7 +36,7 @@ SEARCH.prototype = {
* @type Object
* @protected
*/
selectoptions : {},
selectoptions: {},
/**
* The search input field.
* @property input
@@ -58,12 +58,12 @@ SEARCH.prototype = {
* @type Node
* @protected
*/
lastsearch : null,
lastsearch: null,
/**
* Constructs the search manager.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.form = Y.one('#capability-overview-form');
this.select = this.form.one('select[data-search=capability]');
this.select.setStyle('minWidth', this.select.get('offsetWidth'));
@@ -75,7 +75,7 @@ SEARCH.prototype = {
this.lastsearch = this.form.one('input[name=search]');
var div = Y.Node.create('<div id="capabilitysearchui"></div>'),
label = Y.Node.create('<label for="capabilitysearch">'+this.get('strsearch')+'</label>');
label = Y.Node.create('<label for="capabilitysearch">' + this.get('strsearch') + '</label>');
this.input = Y.Node.create('<input type="text" id="capabilitysearch" />');
div.append(label).append(this.input);
@@ -99,7 +99,7 @@ SEARCH.prototype = {
* Disables the submit button if there are no capabilities selected.
* @method validate
*/
validate : function() {
validate: function() {
this.button.set('disabled', (this.select.get('value') === ''));
},
/**
@@ -107,7 +107,7 @@ SEARCH.prototype = {
* This method hides any capabilities that don't match the search term.
* @method typed
*/
typed : function() {
typed: function() {
var search = this.input.get('value'),
matching = 0,
last = null,
@@ -135,9 +135,9 @@ SEARCH.prototype = {
}
};
Y.extend(SEARCH, Y.Base, SEARCH.prototype, {
NAME : 'tool_capability-search',
ATTRS : {
strsearch : {}
NAME: 'tool_capability-search',
ATTRS: {
strsearch: {}
}
});
@@ -48,9 +48,9 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
Y.one('.' + args.parentNodeClass)
.all('.' + args.dragHandleInsertClass)
.each(
function (node) {
function(node) {
node.insert(this.draghandle.cloneNode(true));
} , this);
}, this);
},
drop_hit: function(e) {
@@ -48,9 +48,9 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
Y.one('.' + args.parentNodeClass)
.all('.' + args.dragHandleInsertClass)
.each(
function (node) {
function(node) {
node.insert(this.draghandle.cloneNode(true));
} , this);
}, this);
},
drop_hit: function(e) {
@@ -46,9 +46,9 @@ Y.extend(DRAGREORDER, M.core.dragdrop, {
Y.one('.' + args.parentNodeClass)
.all('.' + args.dragHandleInsertClass)
.each(
function (node) {
function(node) {
node.insert(this.draghandle.cloneNode(true));
} , this);
}, this);
},
drop_hit: function(e) {
@@ -47,8 +47,8 @@ M.availability_date.form.getNode = function(json) {
var url = M.cfg.wwwroot + '/availability/condition/date/ajax.php?action=fromtime' +
'&time=' + json.t;
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
var fields = Y.JSON.parse(response.responseText);
for (var field in fields) {
var select = node.one('select[name=x\\[' + field + '\\]]');
@@ -56,7 +56,7 @@ M.availability_date.form.getNode = function(json) {
select.set('disabled', false);
}
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
@@ -125,12 +125,12 @@ M.availability_date.form.updateTime = function(node) {
'&day=' + node.one('select[name=x\\[day\\]]').get('value') +
'&hour=' + node.one('select[name=x\\[hour\\]]').get('value') +
'&minute=' + node.one('select[name=x\\[minute\\]]').get('value');
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
node.setData('time', response.responseText);
M.core_availability.form.update();
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
@@ -47,8 +47,8 @@ M.availability_date.form.getNode = function(json) {
var url = M.cfg.wwwroot + '/availability/condition/date/ajax.php?action=fromtime' +
'&time=' + json.t;
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
var fields = Y.JSON.parse(response.responseText);
for (var field in fields) {
var select = node.one('select[name=x\\[' + field + '\\]]');
@@ -56,7 +56,7 @@ M.availability_date.form.getNode = function(json) {
select.set('disabled', false);
}
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
@@ -125,12 +125,12 @@ M.availability_date.form.updateTime = function(node) {
'&day=' + node.one('select[name=x\\[day\\]]').get('value') +
'&hour=' + node.one('select[name=x\\[hour\\]]').get('value') +
'&minute=' + node.one('select[name=x\\[minute\\]]').get('value');
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
node.setData('time', response.responseText);
M.core_availability.form.update();
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
+6 -6
View File
@@ -45,8 +45,8 @@ M.availability_date.form.getNode = function(json) {
var url = M.cfg.wwwroot + '/availability/condition/date/ajax.php?action=fromtime' +
'&time=' + json.t;
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
var fields = Y.JSON.parse(response.responseText);
for (var field in fields) {
var select = node.one('select[name=x\\[' + field + '\\]]');
@@ -54,7 +54,7 @@ M.availability_date.form.getNode = function(json) {
select.set('disabled', false);
}
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
@@ -123,12 +123,12 @@ M.availability_date.form.updateTime = function(node) {
'&day=' + node.one('select[name=x\\[day\\]]').get('value') +
'&hour=' + node.one('select[name=x\\[hour\\]]').get('value') +
'&minute=' + node.one('select[name=x\\[minute\\]]').get('value');
Y.io(url, { on : {
success : function(id, response) {
Y.io(url, {on: {
success: function(id, response) {
node.setData('time', response.responseText);
M.core_availability.form.update();
},
failure : function() {
failure: function() {
window.alert(M.util.get_string('ajaxerror', 'availability_date'));
}
}});
@@ -151,8 +151,8 @@ M.availability_grade.form.fillErrors = function(errors, node) {
}
// Check numeric values.
if ((value.min !== undefined && typeof(value.min) === 'string') ||
(value.max !== undefined && typeof(value.max) === 'string')) {
if ((value.min !== undefined && typeof (value.min) === 'string') ||
(value.max !== undefined && typeof (value.max) === 'string')) {
errors.push('availability_grade:error_invalidnumber');
} else if (value.min !== undefined && value.max !== undefined &&
value.min >= value.max) {
@@ -151,8 +151,8 @@ M.availability_grade.form.fillErrors = function(errors, node) {
}
// Check numeric values.
if ((value.min !== undefined && typeof(value.min) === 'string') ||
(value.max !== undefined && typeof(value.max) === 'string')) {
if ((value.min !== undefined && typeof (value.min) === 'string') ||
(value.max !== undefined && typeof (value.max) === 'string')) {
errors.push('availability_grade:error_invalidnumber');
} else if (value.min !== undefined && value.max !== undefined &&
value.min >= value.max) {
+2 -2
View File
@@ -149,8 +149,8 @@ M.availability_grade.form.fillErrors = function(errors, node) {
}
// Check numeric values.
if ((value.min !== undefined && typeof(value.min) === 'string') ||
(value.max !== undefined && typeof(value.max) === 'string')) {
if ((value.min !== undefined && typeof (value.min) === 'string') ||
(value.max !== undefined && typeof (value.max) === 'string')) {
errors.push('availability_grade:error_invalidnumber');
} else if (value.min !== undefined && value.max !== undefined &&
value.min >= value.max) {
@@ -32,7 +32,7 @@ M.core_availability.form = {
* @property plugins
* @type Object
*/
plugins : {},
plugins: {},
/**
* Availability field (textarea).
@@ -40,7 +40,7 @@ M.core_availability.form = {
* @property field
* @type Y.Node
*/
field : null,
field: null,
/**
* Main div that replaces the availability field.
@@ -48,7 +48,7 @@ M.core_availability.form = {
* @property mainDiv
* @type Y.Node
*/
mainDiv : null,
mainDiv: null,
/**
* Object that represents the root of the tree.
@@ -56,7 +56,7 @@ M.core_availability.form = {
* @property rootList
* @type M.core_availability.List
*/
rootList : null,
rootList: null,
/**
* Counter used when creating anything that needs an id.
@@ -64,7 +64,7 @@ M.core_availability.form = {
* @property idCounter
* @type Number
*/
idCounter : 0,
idCounter: 0,
/**
* The 'Restrict by group' button if present.
@@ -72,7 +72,7 @@ M.core_availability.form = {
* @property restrictByGroup
* @type Y.Node
*/
restrictByGroup : null,
restrictByGroup: null,
/**
* Called to initialise the system when the page loads. This method will
@@ -80,9 +80,9 @@ M.core_availability.form = {
*
* @method init
*/
init : function(pluginParams) {
init: function(pluginParams) {
// Init all plugins.
for(var plugin in pluginParams) {
for (var plugin in pluginParams) {
var params = pluginParams[plugin];
var pluginClass = M[params[0]].form;
pluginClass.init.apply(pluginClass, params);
@@ -108,7 +108,7 @@ M.core_availability.form = {
if (value !== '') {
try {
data = Y.JSON.parse(value);
} catch(x) {
} catch (x) {
// If the JSON data is not valid, treat it as empty.
this.field.set('value', '');
}
@@ -154,7 +154,7 @@ M.core_availability.form = {
*
* @method update
*/
update : function() {
update: function() {
// Convert tree to value.
var jsValue = this.rootList.getValue();
@@ -176,7 +176,7 @@ M.core_availability.form = {
* Updates the status of the 'restrict by group' button (enables or disables
* it) based on current availability restrictions and group/grouping settings.
*/
updateRestrictByGroup : function() {
updateRestrictByGroup: function() {
if (!this.restrictByGroup) {
return;
}
@@ -215,7 +215,7 @@ M.core_availability.form = {
*
* @param e Button click event
*/
addRestrictByGroup : function(e) {
addRestrictByGroup: function(e) {
// If you don't prevent default, it submits the form for some reason.
e.preventDefault();
@@ -225,10 +225,10 @@ M.core_availability.form = {
if (groupingid && Number(groupingid.get('value')) !== 0) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type : 'grouping', id : Number(groupingid.get('value'))}, true);
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type : 'group'}, true);
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
@@ -253,7 +253,7 @@ M.core_availability.plugin = {
* @property allowAdd
* @type Boolean
*/
allowAdd : false,
allowAdd: false,
/**
* Called (from PHP) to initialise the plugin. Should usually not be
@@ -262,7 +262,7 @@ M.core_availability.plugin = {
* @method init
* @param {String} component Component name e.g. 'availability_date'
*/
init : function(component, allowAdd, params) {
init: function(component, allowAdd, params) {
var name = component.replace(/^availability_/, '');
this.allowAdd = allowAdd;
M.core_availability.form.plugins[name] = this;
@@ -278,7 +278,8 @@ M.core_availability.plugin = {
* @method initInner
* @protected
*/
initInner : function() {
initInner: function() {
// Can be overriden.
},
/**
@@ -289,7 +290,7 @@ M.core_availability.plugin = {
* @method getNode
* @return {Y.Node} YUI node
*/
getNode : function() {
getNode: function() {
throw 'getNode not implemented';
},
@@ -303,7 +304,7 @@ M.core_availability.plugin = {
* @param {Object} value Value object (to be written to)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillValue : function() {
fillValue: function() {
throw 'fillValue not implemented';
},
@@ -320,7 +321,8 @@ M.core_availability.plugin = {
* @param {Array} errors Array of errors (push new errors here)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillErrors : function() {
fillErrors: function() {
// Can be overriden.
},
/**
@@ -329,7 +331,7 @@ M.core_availability.plugin = {
* The default implementation uses a simple algorithm to identify the
* first focusable input/select and then focuses it.
*/
focusAfterAdd : function(node) {
focusAfterAdd: function(node) {
var target = node.one('input:not([disabled]),select:not([disabled])');
target.focus();
}
@@ -411,7 +413,9 @@ M.core_availability.List = function(json, root, parentRoot) {
// Create the button and add it.
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
M.util.get_string('addrestriction', 'availability') + '</button>');
button.on("click", function() { this.clickAdd(); }, this);
button.on("click", function() {
this.clickAdd();
}, this);
this.node.one('div.availability-button').appendChild(button);
if (json) {
@@ -532,7 +536,7 @@ M.core_availability.List.prototype.isIndividualShowIcons = function() {
*/
M.core_availability.List.prototype.renumber = function(parentNumber) {
// Update heading for list.
var headingParams = { count: this.children.length };
var headingParams = {count: this.children.length};
var prefix;
if (parentNumber === undefined) {
headingParams.number = '';
@@ -670,7 +674,7 @@ M.core_availability.List.prototype.clickAdd = function() {
var cancel = content.one('button');
// Make a list of all the dialog options.
var dialogRef = { dialog: null };
var dialogRef = {dialog: null};
var ul = content.one('ul');
var li, id, button, label;
for (var type in M.core_availability.form.plugins) {
@@ -703,13 +707,13 @@ M.core_availability.List.prototype.clickAdd = function() {
ul.appendChild(li);
var config = {
headerContent : M.util.get_string('addrestriction', 'availability'),
bodyContent : content,
additionalBaseClass : 'availability-dialogue',
draggable : true,
modal : true,
closeButton : false,
width : '450px'
headerContent: M.util.get_string('addrestriction', 'availability'),
bodyContent: content,
additionalBaseClass: 'availability-dialogue',
draggable: true,
modal: true,
closeButton: false,
width: '450px'
};
dialogRef.dialog = new M.core.dialogue(config);
dialogRef.dialog.show();
@@ -734,10 +738,10 @@ M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
newItem = new M.core_availability.Item({type: type, creating: true}, this.root);
} else {
// Create a new List object to represent the child.
newItem = new M.core_availability.List({ c: [], showc: true }, false, this.root);
newItem = new M.core_availability.List({c: [], showc: true}, false, this.root);
}
// Add to list.
this.addChild(newItem);
@@ -899,7 +903,7 @@ M.core_availability.Item = function(json, root) {
// hidden depending on the selected list operator.
if (root) {
var shown = true;
if(json.showc !== undefined) {
if (json.showc !== undefined) {
shown = json.showc;
}
this.eyeIcon = new M.core_availability.EyeIcon(true, shown);
@@ -927,7 +931,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
var value = { 'type' : this.pluginType };
var value = {'type': this.pluginType};
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}
@@ -968,7 +972,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
*/
M.core_availability.Item.prototype.renumber = function(number) {
// Update heading for item.
var headingParams = { number: number };
var headingParams = {number: number};
if (this.plugin) {
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
} else {
@@ -1064,7 +1068,7 @@ M.core_availability.EyeIcon = function(individual, shown) {
this.span.set('title', shownStr + ' \u2022 ' +
M.util.get_string('hide_verb', 'availability'));
};
if(shown) {
if (shown) {
setShown.call(this);
} else {
setHidden.call(this);
@@ -1082,7 +1086,9 @@ M.core_availability.EyeIcon = function(individual, shown) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
@@ -1134,7 +1140,9 @@ M.core_availability.DeleteIcon = function(toDelete) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
@@ -32,7 +32,7 @@ M.core_availability.form = {
* @property plugins
* @type Object
*/
plugins : {},
plugins: {},
/**
* Availability field (textarea).
@@ -40,7 +40,7 @@ M.core_availability.form = {
* @property field
* @type Y.Node
*/
field : null,
field: null,
/**
* Main div that replaces the availability field.
@@ -48,7 +48,7 @@ M.core_availability.form = {
* @property mainDiv
* @type Y.Node
*/
mainDiv : null,
mainDiv: null,
/**
* Object that represents the root of the tree.
@@ -56,7 +56,7 @@ M.core_availability.form = {
* @property rootList
* @type M.core_availability.List
*/
rootList : null,
rootList: null,
/**
* Counter used when creating anything that needs an id.
@@ -64,7 +64,7 @@ M.core_availability.form = {
* @property idCounter
* @type Number
*/
idCounter : 0,
idCounter: 0,
/**
* The 'Restrict by group' button if present.
@@ -72,7 +72,7 @@ M.core_availability.form = {
* @property restrictByGroup
* @type Y.Node
*/
restrictByGroup : null,
restrictByGroup: null,
/**
* Called to initialise the system when the page loads. This method will
@@ -80,9 +80,9 @@ M.core_availability.form = {
*
* @method init
*/
init : function(pluginParams) {
init: function(pluginParams) {
// Init all plugins.
for(var plugin in pluginParams) {
for (var plugin in pluginParams) {
var params = pluginParams[plugin];
var pluginClass = M[params[0]].form;
pluginClass.init.apply(pluginClass, params);
@@ -108,7 +108,7 @@ M.core_availability.form = {
if (value !== '') {
try {
data = Y.JSON.parse(value);
} catch(x) {
} catch (x) {
// If the JSON data is not valid, treat it as empty.
this.field.set('value', '');
}
@@ -154,7 +154,7 @@ M.core_availability.form = {
*
* @method update
*/
update : function() {
update: function() {
// Convert tree to value.
var jsValue = this.rootList.getValue();
@@ -176,7 +176,7 @@ M.core_availability.form = {
* Updates the status of the 'restrict by group' button (enables or disables
* it) based on current availability restrictions and group/grouping settings.
*/
updateRestrictByGroup : function() {
updateRestrictByGroup: function() {
if (!this.restrictByGroup) {
return;
}
@@ -215,7 +215,7 @@ M.core_availability.form = {
*
* @param e Button click event
*/
addRestrictByGroup : function(e) {
addRestrictByGroup: function(e) {
// If you don't prevent default, it submits the form for some reason.
e.preventDefault();
@@ -225,10 +225,10 @@ M.core_availability.form = {
if (groupingid && Number(groupingid.get('value')) !== 0) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type : 'grouping', id : Number(groupingid.get('value'))}, true);
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type : 'group'}, true);
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
@@ -253,7 +253,7 @@ M.core_availability.plugin = {
* @property allowAdd
* @type Boolean
*/
allowAdd : false,
allowAdd: false,
/**
* Called (from PHP) to initialise the plugin. Should usually not be
@@ -262,7 +262,7 @@ M.core_availability.plugin = {
* @method init
* @param {String} component Component name e.g. 'availability_date'
*/
init : function(component, allowAdd, params) {
init: function(component, allowAdd, params) {
var name = component.replace(/^availability_/, '');
this.allowAdd = allowAdd;
M.core_availability.form.plugins[name] = this;
@@ -278,7 +278,8 @@ M.core_availability.plugin = {
* @method initInner
* @protected
*/
initInner : function() {
initInner: function() {
// Can be overriden.
},
/**
@@ -289,7 +290,7 @@ M.core_availability.plugin = {
* @method getNode
* @return {Y.Node} YUI node
*/
getNode : function() {
getNode: function() {
throw 'getNode not implemented';
},
@@ -303,7 +304,7 @@ M.core_availability.plugin = {
* @param {Object} value Value object (to be written to)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillValue : function() {
fillValue: function() {
throw 'fillValue not implemented';
},
@@ -320,7 +321,8 @@ M.core_availability.plugin = {
* @param {Array} errors Array of errors (push new errors here)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillErrors : function() {
fillErrors: function() {
// Can be overriden.
},
/**
@@ -329,7 +331,7 @@ M.core_availability.plugin = {
* The default implementation uses a simple algorithm to identify the
* first focusable input/select and then focuses it.
*/
focusAfterAdd : function(node) {
focusAfterAdd: function(node) {
var target = node.one('input:not([disabled]),select:not([disabled])');
target.focus();
}
@@ -411,7 +413,9 @@ M.core_availability.List = function(json, root, parentRoot) {
// Create the button and add it.
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
M.util.get_string('addrestriction', 'availability') + '</button>');
button.on("click", function() { this.clickAdd(); }, this);
button.on("click", function() {
this.clickAdd();
}, this);
this.node.one('div.availability-button').appendChild(button);
if (json) {
@@ -532,7 +536,7 @@ M.core_availability.List.prototype.isIndividualShowIcons = function() {
*/
M.core_availability.List.prototype.renumber = function(parentNumber) {
// Update heading for list.
var headingParams = { count: this.children.length };
var headingParams = {count: this.children.length};
var prefix;
if (parentNumber === undefined) {
headingParams.number = '';
@@ -670,7 +674,7 @@ M.core_availability.List.prototype.clickAdd = function() {
var cancel = content.one('button');
// Make a list of all the dialog options.
var dialogRef = { dialog: null };
var dialogRef = {dialog: null};
var ul = content.one('ul');
var li, id, button, label;
for (var type in M.core_availability.form.plugins) {
@@ -703,13 +707,13 @@ M.core_availability.List.prototype.clickAdd = function() {
ul.appendChild(li);
var config = {
headerContent : M.util.get_string('addrestriction', 'availability'),
bodyContent : content,
additionalBaseClass : 'availability-dialogue',
draggable : true,
modal : true,
closeButton : false,
width : '450px'
headerContent: M.util.get_string('addrestriction', 'availability'),
bodyContent: content,
additionalBaseClass: 'availability-dialogue',
draggable: true,
modal: true,
closeButton: false,
width: '450px'
};
dialogRef.dialog = new M.core.dialogue(config);
dialogRef.dialog.show();
@@ -734,10 +738,10 @@ M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
newItem = new M.core_availability.Item({type: type, creating: true}, this.root);
} else {
// Create a new List object to represent the child.
newItem = new M.core_availability.List({ c: [], showc: true }, false, this.root);
newItem = new M.core_availability.List({c: [], showc: true}, false, this.root);
}
// Add to list.
this.addChild(newItem);
@@ -899,7 +903,7 @@ M.core_availability.Item = function(json, root) {
// hidden depending on the selected list operator.
if (root) {
var shown = true;
if(json.showc !== undefined) {
if (json.showc !== undefined) {
shown = json.showc;
}
this.eyeIcon = new M.core_availability.EyeIcon(true, shown);
@@ -927,7 +931,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
var value = { 'type' : this.pluginType };
var value = {'type': this.pluginType};
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}
@@ -968,7 +972,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
*/
M.core_availability.Item.prototype.renumber = function(number) {
// Update heading for item.
var headingParams = { number: number };
var headingParams = {number: number};
if (this.plugin) {
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
} else {
@@ -1064,7 +1068,7 @@ M.core_availability.EyeIcon = function(individual, shown) {
this.span.set('title', shownStr + ' \u2022 ' +
M.util.get_string('hide_verb', 'availability'));
};
if(shown) {
if (shown) {
setShown.call(this);
} else {
setHidden.call(this);
@@ -1082,7 +1086,9 @@ M.core_availability.EyeIcon = function(individual, shown) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
@@ -1134,7 +1140,9 @@ M.core_availability.DeleteIcon = function(toDelete) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
+47 -39
View File
@@ -30,7 +30,7 @@ M.core_availability.form = {
* @property plugins
* @type Object
*/
plugins : {},
plugins: {},
/**
* Availability field (textarea).
@@ -38,7 +38,7 @@ M.core_availability.form = {
* @property field
* @type Y.Node
*/
field : null,
field: null,
/**
* Main div that replaces the availability field.
@@ -46,7 +46,7 @@ M.core_availability.form = {
* @property mainDiv
* @type Y.Node
*/
mainDiv : null,
mainDiv: null,
/**
* Object that represents the root of the tree.
@@ -54,7 +54,7 @@ M.core_availability.form = {
* @property rootList
* @type M.core_availability.List
*/
rootList : null,
rootList: null,
/**
* Counter used when creating anything that needs an id.
@@ -62,7 +62,7 @@ M.core_availability.form = {
* @property idCounter
* @type Number
*/
idCounter : 0,
idCounter: 0,
/**
* The 'Restrict by group' button if present.
@@ -70,7 +70,7 @@ M.core_availability.form = {
* @property restrictByGroup
* @type Y.Node
*/
restrictByGroup : null,
restrictByGroup: null,
/**
* Called to initialise the system when the page loads. This method will
@@ -78,9 +78,9 @@ M.core_availability.form = {
*
* @method init
*/
init : function(pluginParams) {
init: function(pluginParams) {
// Init all plugins.
for(var plugin in pluginParams) {
for (var plugin in pluginParams) {
var params = pluginParams[plugin];
var pluginClass = M[params[0]].form;
pluginClass.init.apply(pluginClass, params);
@@ -106,7 +106,7 @@ M.core_availability.form = {
if (value !== '') {
try {
data = Y.JSON.parse(value);
} catch(x) {
} catch (x) {
// If the JSON data is not valid, treat it as empty.
this.field.set('value', '');
}
@@ -152,7 +152,7 @@ M.core_availability.form = {
*
* @method update
*/
update : function() {
update: function() {
// Convert tree to value.
var jsValue = this.rootList.getValue();
@@ -174,7 +174,7 @@ M.core_availability.form = {
* Updates the status of the 'restrict by group' button (enables or disables
* it) based on current availability restrictions and group/grouping settings.
*/
updateRestrictByGroup : function() {
updateRestrictByGroup: function() {
if (!this.restrictByGroup) {
return;
}
@@ -213,7 +213,7 @@ M.core_availability.form = {
*
* @param e Button click event
*/
addRestrictByGroup : function(e) {
addRestrictByGroup: function(e) {
// If you don't prevent default, it submits the form for some reason.
e.preventDefault();
@@ -223,10 +223,10 @@ M.core_availability.form = {
if (groupingid && Number(groupingid.get('value')) !== 0) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type : 'grouping', id : Number(groupingid.get('value'))}, true);
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type : 'group'}, true);
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
@@ -251,7 +251,7 @@ M.core_availability.plugin = {
* @property allowAdd
* @type Boolean
*/
allowAdd : false,
allowAdd: false,
/**
* Called (from PHP) to initialise the plugin. Should usually not be
@@ -260,7 +260,7 @@ M.core_availability.plugin = {
* @method init
* @param {String} component Component name e.g. 'availability_date'
*/
init : function(component, allowAdd, params) {
init: function(component, allowAdd, params) {
var name = component.replace(/^availability_/, '');
this.allowAdd = allowAdd;
M.core_availability.form.plugins[name] = this;
@@ -276,7 +276,8 @@ M.core_availability.plugin = {
* @method initInner
* @protected
*/
initInner : function() {
initInner: function() {
// Can be overriden.
},
/**
@@ -287,7 +288,7 @@ M.core_availability.plugin = {
* @method getNode
* @return {Y.Node} YUI node
*/
getNode : function() {
getNode: function() {
throw 'getNode not implemented';
},
@@ -301,7 +302,7 @@ M.core_availability.plugin = {
* @param {Object} value Value object (to be written to)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillValue : function() {
fillValue: function() {
throw 'fillValue not implemented';
},
@@ -318,7 +319,8 @@ M.core_availability.plugin = {
* @param {Array} errors Array of errors (push new errors here)
* @param {Y.Node} node YUI node (same one returned from getNode)
*/
fillErrors : function() {
fillErrors: function() {
// Can be overriden.
},
/**
@@ -327,7 +329,7 @@ M.core_availability.plugin = {
* The default implementation uses a simple algorithm to identify the
* first focusable input/select and then focuses it.
*/
focusAfterAdd : function(node) {
focusAfterAdd: function(node) {
var target = node.one('input:not([disabled]),select:not([disabled])');
target.focus();
}
@@ -409,7 +411,9 @@ M.core_availability.List = function(json, root, parentRoot) {
// Create the button and add it.
var button = Y.Node.create('<button type="button" class="btn btn-default">' +
M.util.get_string('addrestriction', 'availability') + '</button>');
button.on("click", function() { this.clickAdd(); }, this);
button.on("click", function() {
this.clickAdd();
}, this);
this.node.one('div.availability-button').appendChild(button);
if (json) {
@@ -530,7 +534,7 @@ M.core_availability.List.prototype.isIndividualShowIcons = function() {
*/
M.core_availability.List.prototype.renumber = function(parentNumber) {
// Update heading for list.
var headingParams = { count: this.children.length };
var headingParams = {count: this.children.length};
var prefix;
if (parentNumber === undefined) {
headingParams.number = '';
@@ -668,7 +672,7 @@ M.core_availability.List.prototype.clickAdd = function() {
var cancel = content.one('button');
// Make a list of all the dialog options.
var dialogRef = { dialog: null };
var dialogRef = {dialog: null};
var ul = content.one('ul');
var li, id, button, label;
for (var type in M.core_availability.form.plugins) {
@@ -701,13 +705,13 @@ M.core_availability.List.prototype.clickAdd = function() {
ul.appendChild(li);
var config = {
headerContent : M.util.get_string('addrestriction', 'availability'),
bodyContent : content,
additionalBaseClass : 'availability-dialogue',
draggable : true,
modal : true,
closeButton : false,
width : '450px'
headerContent: M.util.get_string('addrestriction', 'availability'),
bodyContent: content,
additionalBaseClass: 'availability-dialogue',
draggable: true,
modal: true,
closeButton: false,
width: '450px'
};
dialogRef.dialog = new M.core.dialogue(config);
dialogRef.dialog.show();
@@ -732,10 +736,10 @@ M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
var newItem;
if (type) {
// Create an Item object to represent the child.
newItem = new M.core_availability.Item({ type: type, creating: true }, this.root);
newItem = new M.core_availability.Item({type: type, creating: true}, this.root);
} else {
// Create a new List object to represent the child.
newItem = new M.core_availability.List({ c: [], showc: true }, false, this.root);
newItem = new M.core_availability.List({c: [], showc: true}, false, this.root);
}
// Add to list.
this.addChild(newItem);
@@ -897,7 +901,7 @@ M.core_availability.Item = function(json, root) {
// hidden depending on the selected list operator.
if (root) {
var shown = true;
if(json.showc !== undefined) {
if (json.showc !== undefined) {
shown = json.showc;
}
this.eyeIcon = new M.core_availability.EyeIcon(true, shown);
@@ -925,7 +929,7 @@ M.core_availability.Item = function(json, root) {
* @return {Object} JavaScript object containing value of this item
*/
M.core_availability.Item.prototype.getValue = function() {
var value = { 'type' : this.pluginType };
var value = {'type': this.pluginType};
if (this.plugin) {
this.plugin.fillValue(value, this.pluginNode);
}
@@ -966,7 +970,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
*/
M.core_availability.Item.prototype.renumber = function(number) {
// Update heading for item.
var headingParams = { number: number };
var headingParams = {number: number};
if (this.plugin) {
headingParams.type = M.util.get_string('title', 'availability_' + this.pluginType);
} else {
@@ -1062,7 +1066,7 @@ M.core_availability.EyeIcon = function(individual, shown) {
this.span.set('title', shownStr + ' \u2022 ' +
M.util.get_string('hide_verb', 'availability'));
};
if(shown) {
if (shown) {
setShown.call(this);
} else {
setHidden.call(this);
@@ -1080,7 +1084,9 @@ M.core_availability.EyeIcon = function(individual, shown) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
@@ -1132,7 +1138,9 @@ M.core_availability.DeleteIcon = function(toDelete) {
};
this.span.on('click', click, this);
this.span.on('key', click, 'up:32', this);
this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this);
this.span.on('key', function(e) {
e.preventDefault();
}, 'down:32', this);
};
/**
@@ -93,11 +93,19 @@ M.core_backup.backupselectall = function(modnames) {
// Add select all/none for each module type.
var initlinks = function(links, mod) {
Y.one('#backup-all-mod_' + mod).on('click', function(e) { helper(e, true, '_included', mod); });
Y.one('#backup-none-mod_' + mod).on('click', function(e) { helper(e, false, '_included', mod); });
Y.one('#backup-all-mod_' + mod).on('click', function(e) {
helper(e, true, '_included', mod);
});
Y.one('#backup-none-mod_' + mod).on('click', function(e) {
helper(e, false, '_included', mod);
});
if (withuserdata) {
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) { helper(e, true, withuserdata, mod); });
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) { helper(e, false, withuserdata, mod); });
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) {
helper(e, true, withuserdata, mod);
});
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) {
helper(e, false, withuserdata, mod);
});
}
};
@@ -135,33 +143,48 @@ M.core_backup.backupselectall = function(modnames) {
modlist.currentlyshown = !modlist.currentlyshown;
// Either hide or show the links.
var animcfg = { node: modlist, duration: 0.2 },
var animcfg = {node: modlist, duration: 0.2},
anim;
if (modlist.currentlyshown) {
// Animate reveal of the module links.
modlist.show();
animcfg.to = { maxHeight: modlist.get('clientHeight') + 'px' };
animcfg.to = {maxHeight: modlist.get('clientHeight') + 'px'};
modlist.setStyle('maxHeight', '0px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.setStyle('maxHeight', 'none');
});
anim.run();
} else {
// Animate hide of the module links.
animcfg.to = { maxHeight: '0px' };
animcfg.to = {maxHeight: '0px'};
modlist.setStyle('maxHeight', modlist.get('clientHeight') + 'px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.hide(); modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.hide();
modlist.setStyle('maxHeight', 'none');
});
anim.run();
}
};
Y.one('#backup-bytype').on('click', function() { toggletypes(); });
Y.one('#backup-bytype').on('click', function() {
toggletypes();
});
Y.one('#backup-all-included').on('click', function(e) { helper(e, true, '_included'); });
Y.one('#backup-none-included').on('click', function(e) { helper(e, false, '_included'); });
Y.one('#backup-all-included').on('click', function(e) {
helper(e, true, '_included');
});
Y.one('#backup-none-included').on('click', function(e) {
helper(e, false, '_included');
});
if (withuserdata) {
Y.one('#backup-all-userdata').on('click', function(e) { helper(e, true, withuserdata); });
Y.one('#backup-none-userdata').on('click', function(e) { helper(e, false, withuserdata); });
Y.one('#backup-all-userdata').on('click', function(e) {
helper(e, true, withuserdata);
});
Y.one('#backup-none-userdata').on('click', function(e) {
helper(e, false, withuserdata);
});
}
};
@@ -93,11 +93,19 @@ M.core_backup.backupselectall = function(modnames) {
// Add select all/none for each module type.
var initlinks = function(links, mod) {
Y.one('#backup-all-mod_' + mod).on('click', function(e) { helper(e, true, '_included', mod); });
Y.one('#backup-none-mod_' + mod).on('click', function(e) { helper(e, false, '_included', mod); });
Y.one('#backup-all-mod_' + mod).on('click', function(e) {
helper(e, true, '_included', mod);
});
Y.one('#backup-none-mod_' + mod).on('click', function(e) {
helper(e, false, '_included', mod);
});
if (withuserdata) {
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) { helper(e, true, withuserdata, mod); });
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) { helper(e, false, withuserdata, mod); });
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) {
helper(e, true, withuserdata, mod);
});
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) {
helper(e, false, withuserdata, mod);
});
}
};
@@ -135,33 +143,48 @@ M.core_backup.backupselectall = function(modnames) {
modlist.currentlyshown = !modlist.currentlyshown;
// Either hide or show the links.
var animcfg = { node: modlist, duration: 0.2 },
var animcfg = {node: modlist, duration: 0.2},
anim;
if (modlist.currentlyshown) {
// Animate reveal of the module links.
modlist.show();
animcfg.to = { maxHeight: modlist.get('clientHeight') + 'px' };
animcfg.to = {maxHeight: modlist.get('clientHeight') + 'px'};
modlist.setStyle('maxHeight', '0px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.setStyle('maxHeight', 'none');
});
anim.run();
} else {
// Animate hide of the module links.
animcfg.to = { maxHeight: '0px' };
animcfg.to = {maxHeight: '0px'};
modlist.setStyle('maxHeight', modlist.get('clientHeight') + 'px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.hide(); modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.hide();
modlist.setStyle('maxHeight', 'none');
});
anim.run();
}
};
Y.one('#backup-bytype').on('click', function() { toggletypes(); });
Y.one('#backup-bytype').on('click', function() {
toggletypes();
});
Y.one('#backup-all-included').on('click', function(e) { helper(e, true, '_included'); });
Y.one('#backup-none-included').on('click', function(e) { helper(e, false, '_included'); });
Y.one('#backup-all-included').on('click', function(e) {
helper(e, true, '_included');
});
Y.one('#backup-none-included').on('click', function(e) {
helper(e, false, '_included');
});
if (withuserdata) {
Y.one('#backup-all-userdata').on('click', function(e) { helper(e, true, withuserdata); });
Y.one('#backup-none-userdata').on('click', function(e) { helper(e, false, withuserdata); });
Y.one('#backup-all-userdata').on('click', function(e) {
helper(e, true, withuserdata);
});
Y.one('#backup-none-userdata').on('click', function(e) {
helper(e, false, withuserdata);
});
}
};
@@ -64,7 +64,7 @@ M.core_backup.confirmcancel = {
var confirm = new M.core.confirm(this.config);
// If the user clicks yes.
confirm.on('complete-yes', function(){
confirm.on('complete-yes', function() {
// Detach the listeners for the confirm box so they don't fire again.
new Y.EventHandle(M.core_backup.confirmcancel.listeners).detach();
@@ -64,7 +64,7 @@ M.core_backup.confirmcancel = {
var confirm = new M.core.confirm(this.config);
// If the user clicks yes.
confirm.on('complete-yes', function(){
confirm.on('complete-yes', function() {
// Detach the listeners for the confirm box so they don't fire again.
new Y.EventHandle(M.core_backup.confirmcancel.listeners).detach();
+37 -14
View File
@@ -91,11 +91,19 @@ M.core_backup.backupselectall = function(modnames) {
// Add select all/none for each module type.
var initlinks = function(links, mod) {
Y.one('#backup-all-mod_' + mod).on('click', function(e) { helper(e, true, '_included', mod); });
Y.one('#backup-none-mod_' + mod).on('click', function(e) { helper(e, false, '_included', mod); });
Y.one('#backup-all-mod_' + mod).on('click', function(e) {
helper(e, true, '_included', mod);
});
Y.one('#backup-none-mod_' + mod).on('click', function(e) {
helper(e, false, '_included', mod);
});
if (withuserdata) {
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) { helper(e, true, withuserdata, mod); });
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) { helper(e, false, withuserdata, mod); });
Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) {
helper(e, true, withuserdata, mod);
});
Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) {
helper(e, false, withuserdata, mod);
});
}
};
@@ -133,32 +141,47 @@ M.core_backup.backupselectall = function(modnames) {
modlist.currentlyshown = !modlist.currentlyshown;
// Either hide or show the links.
var animcfg = { node: modlist, duration: 0.2 },
var animcfg = {node: modlist, duration: 0.2},
anim;
if (modlist.currentlyshown) {
// Animate reveal of the module links.
modlist.show();
animcfg.to = { maxHeight: modlist.get('clientHeight') + 'px' };
animcfg.to = {maxHeight: modlist.get('clientHeight') + 'px'};
modlist.setStyle('maxHeight', '0px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.setStyle('maxHeight', 'none');
});
anim.run();
} else {
// Animate hide of the module links.
animcfg.to = { maxHeight: '0px' };
animcfg.to = {maxHeight: '0px'};
modlist.setStyle('maxHeight', modlist.get('clientHeight') + 'px');
anim = new Y.Anim(animcfg);
anim.on('end', function() { modlist.hide(); modlist.setStyle('maxHeight', 'none'); });
anim.on('end', function() {
modlist.hide();
modlist.setStyle('maxHeight', 'none');
});
anim.run();
}
};
Y.one('#backup-bytype').on('click', function() { toggletypes(); });
Y.one('#backup-bytype').on('click', function() {
toggletypes();
});
Y.one('#backup-all-included').on('click', function(e) { helper(e, true, '_included'); });
Y.one('#backup-none-included').on('click', function(e) { helper(e, false, '_included'); });
Y.one('#backup-all-included').on('click', function(e) {
helper(e, true, '_included');
});
Y.one('#backup-none-included').on('click', function(e) {
helper(e, false, '_included');
});
if (withuserdata) {
Y.one('#backup-all-userdata').on('click', function(e) { helper(e, true, withuserdata); });
Y.one('#backup-none-userdata').on('click', function(e) { helper(e, false, withuserdata); });
Y.one('#backup-all-userdata').on('click', function(e) {
helper(e, true, withuserdata);
});
Y.one('#backup-none-userdata').on('click', function(e) {
helper(e, false, withuserdata);
});
}
};
+1 -1
View File
@@ -62,7 +62,7 @@ M.core_backup.confirmcancel = {
var confirm = new M.core.confirm(this.config);
// If the user clicks yes.
confirm.on('complete-yes', function(){
confirm.on('complete-yes', function() {
// Detach the listeners for the confirm box so they don't fire again.
new Y.EventHandle(M.core_backup.confirmcancel.listeners).detach();
@@ -21,7 +21,7 @@ var COURSEBASE = function() {
*/
Y.extend(COURSEBASE, Y.Base, {
// Registered Modules
registermodules : [],
registermodules: [],
/**
* Register a new Javascript Module
@@ -30,7 +30,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {Object} The instantiated module to call functions on
* @chainable
*/
register_module : function(object) {
register_module: function(object) {
this.registermodules.push(object);
return this;
@@ -44,7 +44,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {mixed} args The argument supplied to the function
* @chainable
*/
invoke_function : function(functionname, args) {
invoke_function: function(functionname, args) {
var module;
for (module in this.registermodules) {
if (functionname in this.registermodules[module]) {
@@ -55,8 +55,8 @@ Y.extend(COURSEBASE, Y.Base, {
return this;
}
}, {
NAME : COURSEBASENAME,
ATTRS : {}
NAME: COURSEBASENAME,
ATTRS: {}
});
// Ensure that M.course exists and that coursebase is initialised correctly
@@ -104,12 +104,12 @@ M.course.format.process_sections = M.course.format.process_sections || function(
*/
M.course.format.get_config = M.course.format.get_config || function() {
return {
container_node : null, // compulsory
container_class : null, // compulsory
section_wrapper_node : null, // optional
section_wrapper_class : null, // optional
section_node : null, // compulsory
section_class : null // compulsory
container_node: null, // compulsory
container_class: null, // compulsory
section_wrapper_node: null, // optional
section_wrapper_class: null, // optional
section_node: null, // compulsory
section_class: null // compulsory
};
};
@@ -21,7 +21,7 @@ var COURSEBASE = function() {
*/
Y.extend(COURSEBASE, Y.Base, {
// Registered Modules
registermodules : [],
registermodules: [],
/**
* Register a new Javascript Module
@@ -30,7 +30,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {Object} The instantiated module to call functions on
* @chainable
*/
register_module : function(object) {
register_module: function(object) {
this.registermodules.push(object);
return this;
@@ -44,7 +44,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {mixed} args The argument supplied to the function
* @chainable
*/
invoke_function : function(functionname, args) {
invoke_function: function(functionname, args) {
var module;
for (module in this.registermodules) {
if (functionname in this.registermodules[module]) {
@@ -55,8 +55,8 @@ Y.extend(COURSEBASE, Y.Base, {
return this;
}
}, {
NAME : COURSEBASENAME,
ATTRS : {}
NAME: COURSEBASENAME,
ATTRS: {}
});
// Ensure that M.course exists and that coursebase is initialised correctly
@@ -104,12 +104,12 @@ M.course.format.process_sections = M.course.format.process_sections || function(
*/
M.course.format.get_config = M.course.format.get_config || function() {
return {
container_node : null, // compulsory
container_class : null, // compulsory
section_wrapper_node : null, // optional
section_wrapper_class : null, // optional
section_node : null, // compulsory
section_class : null // compulsory
container_node: null, // compulsory
container_class: null, // compulsory
section_wrapper_node: null, // optional
section_wrapper_class: null, // optional
section_node: null, // compulsory
section_class: null // compulsory
};
};
@@ -45,7 +45,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
initializer: function() {
// Set group for parent class
this.groups = [ CSS.SECTIONDRAGGABLE ];
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
@@ -152,7 +152,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.addClass(M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
containernode.appendChild(sectionnode);
@@ -246,7 +246,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
new M.core.ajaxException(responsetext);
}
M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend);
} catch (e) {}
} catch (e) {
// Ignore.
}
// Update all of the section IDs - first unset them, then set them
// to avoid duplicates in the DOM.
@@ -287,7 +289,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
lightbox.hide();
}
},
context:this
context: this
});
}
@@ -497,7 +499,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
// TODO: revert nodes location
}
},
context:this
context: this
});
}
}, {
@@ -45,7 +45,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
initializer: function() {
// Set group for parent class
this.groups = [ CSS.SECTIONDRAGGABLE ];
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
@@ -152,7 +152,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.addClass(M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
containernode.appendChild(sectionnode);
@@ -244,7 +244,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
new M.core.ajaxException(responsetext);
}
M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend);
} catch (e) {}
} catch (e) {
// Ignore.
}
// Update all of the section IDs - first unset them, then set them
// to avoid duplicates in the DOM.
@@ -283,7 +285,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
lightbox.hide();
}
},
context:this
context: this
});
}
@@ -493,7 +495,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
// TODO: revert nodes location
}
},
context:this
context: this
});
}
}, {
@@ -5,10 +5,10 @@ var FORMATCHOOSER = function() {
};
Y.extend(FORMATCHOOSER, Y.Base, {
initializer : function(params) {
initializer: function(params) {
if (params && params.formid) {
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
var formatselect = Y.one('#'+params.formid+' #id_format');
var updatebut = Y.one('#' + params.formid + ' #id_updatecourseformat');
var formatselect = Y.one('#' + params.formid + ' #id_format');
var ancestor = updatebut.ancestor('fieldset');
var action = Y.one('form.mform').get('action');
if (updatebut && formatselect) {
@@ -5,10 +5,10 @@ var FORMATCHOOSER = function() {
};
Y.extend(FORMATCHOOSER, Y.Base, {
initializer : function(params) {
initializer: function(params) {
if (params && params.formid) {
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
var formatselect = Y.one('#'+params.formid+' #id_format');
var updatebut = Y.one('#' + params.formid + ' #id_updatecourseformat');
var formatselect = Y.one('#' + params.formid + ' #id_format');
var ancestor = updatebut.ancestor('fieldset');
var action = Y.one('form.mform').get('action');
if (updatebut && formatselect) {
File diff suppressed because it is too large Load Diff
@@ -29,10 +29,10 @@ Console.ATTRS = {
* @attribute element
* @type Node
*/
element : {
setter : function(node) {
element: {
setter: function(node) {
if (typeof node === 'string') {
node = Y.one('#'+node);
node = Y.one('#' + node);
}
return node;
}
@@ -44,8 +44,8 @@ Console.ATTRS = {
* @type Node
* @default null
*/
categorylisting : {
value : null
categorylisting: {
value: null
},
/**
@@ -54,8 +54,8 @@ Console.ATTRS = {
* @type Node
* @default null
*/
courselisting : {
value : null
courselisting: {
value: null
},
/**
@@ -64,8 +64,8 @@ Console.ATTRS = {
* @type Node|null
* @default null
*/
coursedetails : {
value : null
coursedetails: {
value: null
},
/**
@@ -74,8 +74,8 @@ Console.ATTRS = {
* @type Number
* @default null
*/
activecategoryid : {
value : null
activecategoryid: {
value: null
},
/**
@@ -84,8 +84,8 @@ Console.ATTRS = {
* @type Number
* @default Null
*/
activecourseid : {
value : null
activecourseid: {
value: null
},
/**
@@ -94,8 +94,8 @@ Console.ATTRS = {
* @type Array
* @default []
*/
categories : {
setter : function(item, name) {
categories: {
setter: function(item, name) {
if (Y.Lang.isArray(item)) {
return item;
}
@@ -103,7 +103,7 @@ Console.ATTRS = {
items.push(item);
return items;
},
value : []
value: []
},
/**
@@ -112,11 +112,11 @@ Console.ATTRS = {
* @type Course[]
* @default Array
*/
courses : {
validator : function(val) {
courses: {
validator: function(val) {
return Y.Lang.isArray(val);
},
value : []
value: []
},
/**
@@ -125,15 +125,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
page : {
getter : function(value, name) {
page: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -142,15 +142,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
totalpages : {
getter : function(value, name) {
totalpages: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -159,15 +159,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
totalcourses : {
getter : function(value, name) {
totalcourses: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -176,14 +176,14 @@ Console.ATTRS = {
* @type String
* @default /course/ajax/management.php
*/
ajaxurl : {
getter : function(value) {
ajaxurl: {
getter: function(value) {
if (value === null) {
value = M.cfg.wwwroot + '/course/ajax/management.php';
}
return value;
},
value : null
value: null
},
/**
@@ -192,8 +192,8 @@ Console.ATTRS = {
* @type DragDrop
* @default null
*/
dragdrop : {
value : null
dragdrop: {
value: null
}
};
Console.prototype = {
@@ -204,13 +204,13 @@ Console.prototype = {
* @private
* @type {boolean}
*/
categoriesinit : false,
categoriesinit: false,
/**
* Initialises a new instance of the Console.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.set('element', 'coursecat-management');
var element = this.get('element'),
categorylisting = element.one('#category-listing'),
@@ -238,7 +238,7 @@ Console.prototype = {
if (courselisting) {
// No need for dragdrop if we don't have a course listing.
this.set('dragdrop', new DragDrop({console:this}));
this.set('dragdrop', new DragDrop({console: this}));
}
},
@@ -248,7 +248,7 @@ Console.prototype = {
* @private
* @return {boolean}
*/
initialiseCategories : function(listing) {
initialiseCategories: function(listing) {
var count = 0;
if (!listing) {
return false;
@@ -268,10 +268,10 @@ Console.prototype = {
menuresortcoursesby.setAttribute('disabled', true);
}
listing.all('.listitem[data-id]').each(function(node){
listing.all('.listitem[data-id]').each(function(node) {
this.set('categories', new Category({
node : node,
console : this
node: node,
console: this
}));
count++;
}, this);
@@ -290,7 +290,7 @@ Console.prototype = {
* @private
* @return {boolean}
*/
initialiseCourses : function() {
initialiseCourses: function() {
var category = this.getCategoryById(this.get('activecategoryid')),
listing = this.get('courselisting'),
count = 0;
@@ -304,11 +304,11 @@ Console.prototype = {
menumovecoursesto.setAttribute('disabled', true);
}
listing.all('.listitem[data-id]').each(function(node){
listing.all('.listitem[data-id]').each(function(node) {
this.registerCourse(new Course({
node : node,
console : this,
category : category
node: node,
console: this,
category: category
}));
count++;
}, this);
@@ -321,7 +321,7 @@ Console.prototype = {
* @method registerCourse
* @param {Course} course
*/
registerCourse : function(course) {
registerCourse: function(course) {
var courses = this.get('courses');
courses.push(course);
this.set('courses', courses);
@@ -334,7 +334,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleCourseDelegation : function(e) {
handleCourseDelegation: function(e) {
var target = e.currentTarget,
action = target.getData('action'),
courseid = target.ancestor('.listitem').getData('id'),
@@ -352,7 +352,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleCategoryDelegation : function(e) {
handleCategoryDelegation: function(e) {
var target = e.currentTarget,
action = target.getData('action'),
categoryid = target.ancestor('.listitem').getData('id'),
@@ -370,7 +370,7 @@ Console.prototype = {
* @param {Node} checkboxnode Checkbox node on which action happened.
* @return bool
*/
isCourseSelected : function(checkboxnode) {
isCourseSelected: function(checkboxnode) {
var selected = false;
// If any course selected then show move to category select box.
@@ -401,7 +401,7 @@ Console.prototype = {
* @param {Node} checkboxnode Checkbox node on which action happened.
* @return bool
*/
isCategorySelected : function(checkboxnode) {
isCategorySelected: function(checkboxnode) {
var selected = false;
// If any category selected then show move to category select box.
@@ -432,7 +432,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleBulkSortByaction : function(e) {
handleBulkSortByaction: function(e) {
var sortcategoryby = this.get('categorylisting').one('#menuresortcategoriesby'),
sortcourseby = this.get('categorylisting').one('#menuresortcoursesby'),
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]'),
@@ -481,7 +481,7 @@ Console.prototype = {
* @param {Number} id
* @return {Category|Boolean} The category or false if it can't be found.
*/
getCategoryById : function(id) {
getCategoryById: function(id) {
var i,
category,
categories = this.get('categories'),
@@ -503,7 +503,7 @@ Console.prototype = {
* @param {Number} id
* @return {Course|Boolean} The course or false if not found/
*/
getCourseById : function(id) {
getCourseById: function(id) {
var i,
course,
courses = this.get('courses'),
@@ -524,7 +524,7 @@ Console.prototype = {
* @method removeCourseById
* @param {Number} id
*/
removeCourseById : function(id) {
removeCourseById: function(id) {
var courses = this.get('courses'),
length = courses.length,
course,
@@ -547,7 +547,7 @@ Console.prototype = {
* @param {Function} callback The function to call when all is done.
* @param {Object} context The object to use as the context for the callback.
*/
performAjaxAction : function(action, args, callback, context) {
performAjaxAction: function(action, args, callback, context) {
var io = new Y.IO();
args.action = action;
args.ajax = '1';
@@ -557,13 +557,13 @@ Console.prototype = {
};
}
io.send(this.get('ajaxurl'), {
method : 'POST',
on : {
complete : callback
method: 'POST',
on: {
complete: callback
},
context : context,
data : args,
'arguments' : args
context: context,
data: args,
'arguments': args
});
}
};
@@ -605,8 +605,8 @@ DragDrop.ATTRS = {
* @type Console
* @writeOnce
*/
console : {
writeOnce : 'initOnly'
console: {
writeOnce: 'initOnly'
}
};
DragDrop.prototype = {
@@ -616,7 +616,7 @@ DragDrop.prototype = {
* @protected
* @default false
*/
goingup : false,
goingup: false,
/**
* The last Y position of the course being dragged
@@ -624,7 +624,7 @@ DragDrop.prototype = {
* @protected
* @default null
*/
lasty : null,
lasty: null,
/**
* The sibling above the course being dragged currently (tracking its original position).
@@ -633,13 +633,13 @@ DragDrop.prototype = {
* @protected
* @default false
*/
previoussibling : null,
previoussibling: null,
/**
* Initialises the DragDrop instance.
* @method initializer
*/
initializer : function() {
initializer: function() {
var managementconsole = this.get('console'),
container = managementconsole.get('element'),
categorylisting = container.one('#category-listing'),
@@ -654,7 +654,7 @@ DragDrop.prototype = {
return false;
}
courseul.all('> li').each(function(li){
courseul.all('> li').each(function(li) {
this.initCourseListing(li, contstraint);
}, this);
courseul.setData('dd', new Y.DD.Drop({
@@ -662,7 +662,7 @@ DragDrop.prototype = {
}));
if (canmoveoutof && categoryul) {
// Category UL may not be there if viewmode is just courses.
categoryul.all('li > div').each(function(div){
categoryul.all('li > div').each(function(div) {
this.initCategoryListitem(div);
}, this);
}
@@ -681,10 +681,10 @@ DragDrop.prototype = {
* @method initCourseListing
* @param Node
*/
initCourseListing : function(node, contstraint) {
initCourseListing: function(node, contstraint) {
node.setData('dd', new Y.DD.Drag({
node : node,
target : {
node: node,
target: {
padding: '0 0 0 20'
}
}).addHandle(
@@ -702,7 +702,7 @@ DragDrop.prototype = {
* @method initCategoryListitem
* @param Node
*/
initCategoryListitem : function(node) {
initCategoryListitem: function(node) {
node.setData('dd', new Y.DD.Drop({
node: node
}));
@@ -714,7 +714,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragStart : function(e) {
dragStart: function(e) {
var drag = e.target,
node = drag.get('node'),
dragnode = drag.get('dragNode');
@@ -729,7 +729,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragEnd : function(e) {
dragEnd: function(e) {
var drag = e.target,
node = drag.get('node');
node.removeClass('course-being-dragged');
@@ -742,7 +742,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragDrag : function(e) {
dragDrag: function(e) {
var y = e.target.lastXY[1];
if (y < this.lasty) {
this.goingup = true;
@@ -758,8 +758,8 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropOver : function(e) {
//Get a reference to our drag and drop nodes
dropOver: function(e) {
// Get a reference to our drag and drop nodes
var drag = e.drag.get('node'),
drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
@@ -783,7 +783,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropEnter : function(e) {
dropEnter: function(e) {
var drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
if (tag === 'div') {
@@ -797,7 +797,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropExit : function(e) {
dropExit: function(e) {
var drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
if (tag === 'div') {
@@ -811,7 +811,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropHit : function(e) {
dropHit: function(e) {
var drag = e.drag.get('node'),
drop = e.drop.get('node'),
iscategory = (drop.ancestor('.listitem-category') !== null),
@@ -842,7 +842,7 @@ DragDrop.prototype = {
course = managementconsole.getCourseById(courseid);
previoussibling = drag.get('previousSibling');
aftercourseid = (previoussibling) ? previoussibling.getData('id') || 0 : 0;
previousid = (this.previoussibling) ? this.previoussibling.getData('id') : 0;
previousid = (this.previoussibling) ? this.previoussibling.getData('id') : 0;
if (aftercourseid !== previousid) {
course.moveAfter(aftercourseid, previousid);
}
@@ -870,14 +870,14 @@ Item.ATTRS = {
* @attribute node
* @type Node
*/
node : {},
node: {},
/**
* The management console.
* @attribute console
* @type Console
*/
console : {},
console: {},
/**
* Describes the type of this item. Should be set by the extending class.
@@ -885,8 +885,8 @@ Item.ATTRS = {
* @type {String}
* @default item
*/
itemname : {
value : 'item'
itemname: {
value: 'item'
}
};
Item.prototype = {
@@ -897,7 +897,7 @@ Item.prototype = {
* @type Timeout
* @default null
*/
highlighttimeout : null,
highlighttimeout: null,
/**
* Checks and parses an AJAX response for an item.
@@ -909,7 +909,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Object|Boolean}
*/
checkAjaxResponse : function(transactionid, response, args) {
checkAjaxResponse: function(transactionid, response, args) {
if (response.status !== 200) {
return false;
}
@@ -935,7 +935,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
moveup : function(transactionid, response, args) {
moveup: function(transactionid, response, args) {
var node,
nodeup,
nodedown,
@@ -1000,7 +1000,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
movedown : function(transactionid, response, args) {
movedown: function(transactionid, response, args) {
var node,
next,
nodeup,
@@ -1065,7 +1065,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
show : function(transactionid, response, args) {
show: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
hidebtn;
if (outcome === false) {
@@ -1084,7 +1084,7 @@ Item.prototype = {
* Marks the item as visible
* @method markVisible
*/
markVisible : function() {
markVisible: function() {
this.get('node').setAttribute('data-visible', '1');
return true;
},
@@ -1098,7 +1098,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
hide : function(transactionid, response, args) {
hide: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
showbtn;
if (outcome === false) {
@@ -1116,7 +1116,7 @@ Item.prototype = {
* Marks the item as hidden.
* @method makeHidden
*/
markHidden : function() {
markHidden: function() {
this.get('node').setAttribute('data-visible', '0');
return true;
},
@@ -1127,7 +1127,7 @@ Item.prototype = {
* @method updated
* @param {Boolean} moved True if this item was moved.
*/
updated : function(moved) {
updated: function(moved) {
if (moved) {
this.highlight();
}
@@ -1138,14 +1138,14 @@ Item.prototype = {
*
* @method highlight
*/
highlight : function() {
highlight: function() {
var node = this.get('node');
node.siblings('.highlight').removeClass('highlight');
node.addClass('highlight');
if (this.highlighttimeout) {
window.clearTimeout(this.highlighttimeout);
}
this.highlighttimeout = window.setTimeout(function(){
this.highlighttimeout = window.setTimeout(function() {
node.removeClass('highlight');
}, 2500);
}
@@ -1174,16 +1174,16 @@ Category.ATTRS = {
* @writeOnce
* @default null
*/
categoryid : {
getter : function (value, name) {
categoryid: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData('id');
this.set(name, value);
}
return value;
},
value : null,
writeOnce : true
value: null,
writeOnce: true
},
/**
@@ -1192,8 +1192,8 @@ Category.ATTRS = {
* @type Boolean
* @default null
*/
selected : {
getter : function(value, name) {
selected: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData(name);
if (value === null) {
@@ -1203,7 +1203,7 @@ Category.ATTRS = {
}
return value;
},
value : null
value: null
},
/**
@@ -1212,11 +1212,11 @@ Category.ATTRS = {
* @type Course[]
* @default Array
*/
courses : {
validator : function(val) {
courses: {
validator: function(val) {
return Y.Lang.isArray(val);
},
value : []
value: []
}
};
Category.prototype = {
@@ -1224,7 +1224,7 @@ Category.prototype = {
* Initialises an instance of a Category.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.set('itemname', 'category');
},
@@ -1233,7 +1233,7 @@ Category.prototype = {
* @method getName
* @return {String}
*/
getName : function() {
getName: function() {
return this.get('node').one('a.categoryname').get('innerHTML');
},
@@ -1242,7 +1242,7 @@ Category.prototype = {
* @method registerCourse
* @param {Course} course
*/
registerCourse : function(course) {
registerCourse: function(course) {
var courses = this.get('courses');
courses.push(course);
this.set('courses', courses);
@@ -1256,8 +1256,8 @@ Category.prototype = {
* @param {EventFacade} e
* @return {Boolean}
*/
handle : function(action, e) {
var catarg = {categoryid : this.get('categoryid')},
handle: function(action, e) {
var catarg = {categoryid: this.get('categoryid')},
selected = this.get('console').get('activecategoryid');
if (selected && selected !== catarg.categoryid) {
catarg.selectedcategory = selected;
@@ -1314,42 +1314,42 @@ Category.prototype = {
* Expands the category making its sub categories visible.
* @method expand
*/
expand : function() {
expand: function() {
var node = this.get('node'),
action = node.one('a[data-action=expand]'),
ul = node.one('ul[role=group]');
node.removeClass('collapsed').setAttribute('aria-expanded', 'true');
action.setAttribute('data-action', 'collapse').setAttrs({
title : M.util.get_string('collapsecategory', 'moodle', this.getName())
title: M.util.get_string('collapsecategory', 'moodle', this.getName())
}).one('img').setAttrs({
src : M.util.image_url('t/switch_minus', 'moodle'),
alt : M.util.get_string('collapse', 'moodle')
src: M.util.image_url('t/switch_minus', 'moodle'),
alt: M.util.get_string('collapse', 'moodle')
});
if (ul) {
ul.setAttribute('aria-hidden', 'false');
}
this.get('console').performAjaxAction('expandcategory', {categoryid : this.get('categoryid')}, null, this);
this.get('console').performAjaxAction('expandcategory', {categoryid: this.get('categoryid')}, null, this);
},
/**
* Collapses the category making its sub categories hidden.
* @method collapse
*/
collapse : function() {
collapse: function() {
var node = this.get('node'),
action = node.one('a[data-action=collapse]'),
ul = node.one('ul[role=group]');
node.addClass('collapsed').setAttribute('aria-expanded', 'false');
action.setAttribute('data-action', 'expand').setAttrs({
title : M.util.get_string('expandcategory', 'moodle', this.getName())
title: M.util.get_string('expandcategory', 'moodle', this.getName())
}).one('img').setAttrs({
src : M.util.image_url('t/switch_plus', 'moodle'),
alt : M.util.get_string('expand', 'moodle')
src: M.util.image_url('t/switch_plus', 'moodle'),
alt: M.util.get_string('expand', 'moodle')
});
if (ul) {
ul.setAttribute('aria-hidden', 'true');
}
this.get('console').performAjaxAction('collapsecategory', {categoryid : this.get('categoryid')}, null, this);
this.get('console').performAjaxAction('collapsecategory', {categoryid: this.get('categoryid')}, null, this);
},
/**
@@ -1362,7 +1362,7 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean} Returns true on success - false otherwise.
*/
loadSubcategories : function(transactionid, response, args) {
loadSubcategories: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
node = this.get('node'),
managementconsole = this.get('console'),
@@ -1390,24 +1390,24 @@ Category.prototype = {
* @method moveCourseTo
* @param {Course} course
*/
moveCourseTo : function(course) {
moveCourseTo: function(course) {
var self = this;
Y.use('moodle-core-notification-confirm', function() {
var confirm = new M.core.confirm({
title : M.util.get_string('confirm', 'moodle'),
question : M.util.get_string('confirmcoursemove', 'moodle', {
course : course.getName(),
category : self.getName()
title: M.util.get_string('confirm', 'moodle'),
question: M.util.get_string('confirmcoursemove', 'moodle', {
course: course.getName(),
category: self.getName()
}),
yesLabel : M.util.get_string('move', 'moodle'),
noLabel : M.util.get_string('cancel', 'moodle')
yesLabel: M.util.get_string('move', 'moodle'),
noLabel: M.util.get_string('cancel', 'moodle')
});
confirm.on('complete-yes', function() {
confirm.hide();
confirm.destroy();
this.get('console').performAjaxAction('movecourseintocategory', {
categoryid : this.get('categoryid'),
courseid : course.get('courseid')
categoryid: this.get('categoryid'),
courseid: course.get('courseid')
}, this.completeMoveCourse, this);
}, self);
confirm.show();
@@ -1423,7 +1423,7 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
completeMoveCourse : function(transactionid, response, args) {
completeMoveCourse: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
managementconsole = this.get('console'),
category,
@@ -1474,7 +1474,7 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
show : function(transactionid, response, args) {
show: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
hidebtn;
if (outcome === false) {
@@ -1504,7 +1504,7 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
hide : function(transactionid, response, args) {
hide: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
showbtn;
if (outcome === false) {
@@ -1530,7 +1530,7 @@ Category.prototype = {
* @chainable
* @param courses
*/
updateCourseVisiblity : function(courses) {
updateCourseVisiblity: function(courses) {
var managementconsole = this.get('console'),
key,
course;
@@ -1558,7 +1558,7 @@ Category.prototype = {
* @chainable
* @param categories
*/
updateChildVisibility : function(categories) {
updateChildVisibility: function(categories) {
var managementconsole = this.get('console'),
key,
category;
@@ -1603,7 +1603,7 @@ Course.ATTRS = {
* @attribute courseid
* @type Number
*/
courseid : {},
courseid: {},
/**
* True if this is the selected course.
@@ -1611,17 +1611,17 @@ Course.ATTRS = {
* @type Boolean
* @default null
*/
selected : {
getter : function(value, name) {
selected: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
node : {
node: {
},
/**
@@ -1630,8 +1630,8 @@ Course.ATTRS = {
* @type Console
* @writeOnce
*/
console : {
writeOnce : 'initOnly'
console: {
writeOnce: 'initOnly'
},
/**
@@ -1640,8 +1640,8 @@ Course.ATTRS = {
* @type Category
* @writeOnce
*/
category : {
writeOnce : 'initOnly'
category: {
writeOnce: 'initOnly'
}
};
Course.prototype = {
@@ -1649,7 +1649,7 @@ Course.prototype = {
* Initialises the new course instance.
* @method initializer
*/
initializer : function() {
initializer: function() {
var node = this.get('node'),
category = this.get('category');
this.set('courseid', node.getData('id'));
@@ -1664,7 +1664,7 @@ Course.prototype = {
* @method getName
* @return {String}
*/
getName : function() {
getName: function() {
return this.get('node').one('a.coursename').get('innerHTML');
},
@@ -1675,9 +1675,9 @@ Course.prototype = {
* @param {EventFacade} e
* @return {Boolean}
*/
handle : function(action, e) {
handle: function(action, e) {
var managementconsole = this.get('console'),
args = {courseid : this.get('courseid')};
args = {courseid: this.get('courseid')};
switch (action) {
case 'moveup':
e.halt();
@@ -1715,7 +1715,7 @@ Course.prototype = {
* Removes this course.
* @method remove
*/
remove : function() {
remove: function() {
this.get('console').removeCourseById(this.get('courseid'));
this.get('node').remove();
},
@@ -1727,12 +1727,12 @@ Course.prototype = {
* @param {Number} moveaftercourse The course to move after or 0 to put it at the top.
* @param {Number} previousid the course it was previously after in case we need to revert.
*/
moveAfter : function(moveaftercourse, previousid) {
moveAfter: function(moveaftercourse, previousid) {
var managementconsole = this.get('console'),
args = {
courseid : this.get('courseid'),
moveafter : moveaftercourse,
previous : previousid
courseid: this.get('courseid'),
moveafter: moveaftercourse,
previous: previousid
};
managementconsole.performAjaxAction('movecourseafter', args, this.moveAfterResponse, this);
},
@@ -1747,12 +1747,12 @@ Course.prototype = {
* @param {Objects} args The arguments that were given with the request.
* @return {Boolean}
*/
moveAfterResponse : function(transactionid, response, args) {
moveAfterResponse: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
node = this.get('node'),
previous;
if (outcome === false) {
previous = node.ancestor('ul').one('li[data-id='+args.previous+']');
previous = node.ancestor('ul').one('li[data-id=' + args.previous + ']');
if (previous) {
// After the last previous.
previous.insertAfter(node, 'after');
@@ -7,11 +7,11 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) {
*/
var CSS = {
PAGECONTENT : 'body',
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER : 'span.section-modchooser-link',
SITEMENU : 'div.block_site_main_menu',
SITETOPIC : 'div.sitetopic'
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
var MODCHOOSERNAME = 'course-modchooser';
@@ -36,14 +36,14 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default null
*/
sectionid : null,
sectionid: null,
/**
* Set up the activity chooser.
*
* @method initializer
*/
initializer : function() {
initializer: function() {
var sectionclass = M.course.format.get_sectionwrapperclass();
if (sectionclass) {
CSS.SECTION = '.' + sectionclass;
@@ -65,7 +65,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method setup_for_section
* @param baseselector The selector to limit scope to
*/
setup_for_section : function(baseselector) {
setup_for_section: function(baseselector) {
if (!baseselector) {
baseselector = CSS.PAGECONTENT;
}
@@ -96,7 +96,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @private
* @param baseselector The selector to limit scope to
*/
_setup_for_section : function(section) {
_setup_for_section: function(section) {
var chooserspan = section.one(CSS.SECTIONMODCHOOSER);
if (!chooserspan) {
return;
@@ -114,7 +114,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method display_mod_chooser
* @param {EventFacade} e Triggering Event
*/
display_mod_chooser : function (e) {
display_mod_chooser: function(e) {
// Set the section for this version of the dialogue
if (e.target.ancestor(CSS.SITETOPIC)) {
// The site topic has a sectionid of 1
@@ -137,7 +137,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @param {String} thisoption The selected option value
* @private
*/
option_selected : function(thisoption) {
option_selected: function(thisoption) {
// Add the sectionid to the URL.
this.hiddenRadioValue.setAttrs({
name: 'jump',
@@ -146,8 +146,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
}
},
{
NAME : MODCHOOSERNAME,
ATTRS : {
NAME: MODCHOOSERNAME,
ATTRS: {
/**
* The maximum height (in pixels) of the activity chooser.
*
@@ -155,8 +155,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default 800
*/
maxheight : {
value : 800
maxheight: {
value: 800
}
}
});
@@ -7,11 +7,11 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) {
*/
var CSS = {
PAGECONTENT : 'body',
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER : 'span.section-modchooser-link',
SITEMENU : 'div.block_site_main_menu',
SITETOPIC : 'div.sitetopic'
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
var MODCHOOSERNAME = 'course-modchooser';
@@ -36,14 +36,14 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default null
*/
sectionid : null,
sectionid: null,
/**
* Set up the activity chooser.
*
* @method initializer
*/
initializer : function() {
initializer: function() {
var sectionclass = M.course.format.get_sectionwrapperclass();
if (sectionclass) {
CSS.SECTION = '.' + sectionclass;
@@ -65,7 +65,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method setup_for_section
* @param baseselector The selector to limit scope to
*/
setup_for_section : function(baseselector) {
setup_for_section: function(baseselector) {
if (!baseselector) {
baseselector = CSS.PAGECONTENT;
}
@@ -96,7 +96,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @private
* @param baseselector The selector to limit scope to
*/
_setup_for_section : function(section) {
_setup_for_section: function(section) {
var chooserspan = section.one(CSS.SECTIONMODCHOOSER);
if (!chooserspan) {
return;
@@ -114,7 +114,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method display_mod_chooser
* @param {EventFacade} e Triggering Event
*/
display_mod_chooser : function (e) {
display_mod_chooser: function(e) {
// Set the section for this version of the dialogue
if (e.target.ancestor(CSS.SITETOPIC)) {
// The site topic has a sectionid of 1
@@ -137,7 +137,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @param {String} thisoption The selected option value
* @private
*/
option_selected : function(thisoption) {
option_selected: function(thisoption) {
// Add the sectionid to the URL.
this.hiddenRadioValue.setAttrs({
name: 'jump',
@@ -146,8 +146,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
}
},
{
NAME : MODCHOOSERNAME,
ATTRS : {
NAME: MODCHOOSERNAME,
ATTRS: {
/**
* The maximum height (in pixels) of the activity chooser.
*
@@ -155,8 +155,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default 800
*/
maxheight : {
value : 800
maxheight: {
value: 800
}
}
});
@@ -13,44 +13,44 @@ YUI.add('moodle-course-toolboxes', function (Y, NAME) {
// The CSS classes we use.
var CSS = {
ACTIVITYINSTANCE : 'activityinstance',
AVAILABILITYINFODIV : 'div.availabilityinfo',
CONTENTWITHOUTLINK : 'contentwithoutlink',
CONDITIONALHIDDEN : 'conditionalhidden',
DIMCLASS : 'dimmed',
DIMMEDTEXT : 'dimmed_text',
EDITINSTRUCTIONS : 'editinstructions',
HIDE : 'hide',
MODINDENTCOUNT : 'mod-indent-',
MODINDENTHUGE : 'mod-indent-huge',
MODULEIDPREFIX : 'module-',
SECTIONHIDDENCLASS : 'hidden',
SECTIONIDPREFIX : 'section-',
SHOW : 'editing_show'
ACTIVITYINSTANCE: 'activityinstance',
AVAILABILITYINFODIV: 'div.availabilityinfo',
CONTENTWITHOUTLINK: 'contentwithoutlink',
CONDITIONALHIDDEN: 'conditionalhidden',
DIMCLASS: 'dimmed',
DIMMEDTEXT: 'dimmed_text',
EDITINSTRUCTIONS: 'editinstructions',
HIDE: 'hide',
MODINDENTCOUNT: 'mod-indent-',
MODINDENTHUGE: 'mod-indent-huge',
MODULEIDPREFIX: 'module-',
SECTIONHIDDENCLASS: 'hidden',
SECTIONIDPREFIX: 'section-',
SHOW: 'editing_show'
},
// The CSS selectors we use.
SELECTOR = {
ACTIONAREA: '.actions',
ACTIONLINKTEXT : '.actionlinktext',
ACTIVITYACTION : 'a.cm-edit-action[data-action]',
ACTIVITYICON : 'img.activityicon',
ACTIVITYINSTANCE : '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .'+ CSS.ACTIVITYINSTANCE +
ACTIONLINKTEXT: '.actionlinktext',
ACTIVITYACTION: 'a.cm-edit-action[data-action]',
ACTIVITYICON: 'img.activityicon',
ACTIVITYINSTANCE: '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .' + CSS.ACTIVITYINSTANCE +
' > span[data-inplaceeditable] > a:not([data-inplaceeditablelink])',
ACTIVITYLI : 'li.activity',
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
ACTIVITYLI: 'li.activity',
COMMANDSPAN: '.commands',
CONTENTAFTERLINK: 'div.contentafterlink',
CONTENTWITHOUTLINK: 'div.contentwithoutlink',
GROUPINGLABEL: '.' + CSS.ACTIVITYINSTANCE + ' .groupinglabel',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
INSTANCENAME : 'span.instancename',
MODINDENTDIV : '.mod-indent',
MODINDENTOUTER : '.mod-indent-outer',
PAGECONTENT : 'body',
SECTIONLI : 'li.section',
SHOW : 'a.'+CSS.SHOW,
SHOWHIDE : 'a.editing_showhide'
HIDE: 'a.editing_hide',
HIGHLIGHT: 'a.editing_highlight',
INSTANCENAME: 'span.instancename',
MODINDENTDIV: '.mod-indent',
MODINDENTOUTER: '.mod-indent-outer',
PAGECONTENT: 'body',
SECTIONLI: 'li.section',
SHOW: 'a.' + CSS.SHOW,
SHOWHIDE: 'a.editing_showhide'
},
INDENTLIMITS = {
MIN: 0,
@@ -114,7 +114,9 @@ Y.extend(TOOLBOX, Y.Base, {
if (responsetext.error) {
new M.core.ajaxException(responsetext);
}
} catch (e) {}
} catch (e) {
// Ignore.
}
// Run the callback if we have one.
if (success_callback) {
@@ -370,7 +372,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Prevent the default button action
ev.preventDefault();
var direction = (action === 'moveleft') ? -1: 1;
var direction = (action === 'moveleft') ? -1 : 1;
// And we need to determine the current and new indent level
var indentdiv = activity.one(SELECTOR.MODINDENTDIV),
@@ -447,7 +449,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
ev.preventDefault();
// Get the element we're working on
var element = activity,
var element = activity,
// Create confirm string (different if element has or does not have name)
confirmstring = '',
plugindata = {
@@ -580,7 +582,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
SELECTOR.CONTENTWITHOUTLINK
].join(', ')),
availabilityinfo = activity.one(CSS.AVAILABILITYINFODIV),
nextaction = (action === 'hide') ? 'show': 'hide',
nextaction = (action === 'hide') ? 'show' : 'hide',
buttontext = button.one('span'),
newstring = M.util.get_string(nextaction, 'moodle'),
buttonimg = button.one('img');
@@ -598,7 +600,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
buttonimg.setAttribute('alt', newstring);
}
button.replaceClass('editing_'+action, 'editing_'+nextaction);
button.replaceClass('editing_' + action, 'editing_' + nextaction);
button.setData('action', nextaction);
if (buttontext) {
buttontext.set('text', newstring);
@@ -629,7 +631,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
if (availabilityinfo) {
availabilityinfo.toggleClass(CSS.HIDE);
}
return (action === 'hide') ? 0: 1;
return (action === 'hide') ? 0 : 1;
},
/**
@@ -786,7 +788,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method initializer
* @protected
*/
initializer : function() {
initializer: function() {
M.course.coursebase.register_module(this);
// Section Highlighting.
@@ -796,7 +798,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
Y.delegate('click', this.toggle_hide_section, SELECTOR.PAGECONTENT, SELECTOR.SECTIONLI + ' ' + SELECTOR.SHOWHIDE, this);
},
toggle_hide_section : function(e) {
toggle_hide_section: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -827,8 +829,8 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
var newstring = M.util.get_string(nextaction + 'fromothers', 'format_' + this.get('format'));
hideicon.setAttrs({
'alt' : newstring,
'src' : M.util.image_url('i/' + nextaction)
'alt': newstring,
'src': M.util.image_url('i/' + nextaction)
});
button.set('title', newstring);
if (buttontext) {
@@ -837,10 +839,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the show/hide status
var data = {
'class' : 'section',
'field' : 'visible',
'id' : Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value' : value
'class': 'section',
'field': 'visible',
'id': Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
@@ -872,7 +874,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method toggle_highlight
* @param {EventFacade} e
*/
toggle_highlight : function(e) {
toggle_highlight: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -923,17 +925,17 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the highlight status.
var data = {
'class' : 'course',
'field' : 'marker',
'value' : value
'class': 'course',
'field': 'marker',
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
lightbox.show();
this.send_request(data, lightbox);
}
}, {
NAME : 'course-section-toolbox',
ATTRS : {
NAME: 'course-section-toolbox',
ATTRS: {
}
});
@@ -13,44 +13,44 @@ YUI.add('moodle-course-toolboxes', function (Y, NAME) {
// The CSS classes we use.
var CSS = {
ACTIVITYINSTANCE : 'activityinstance',
AVAILABILITYINFODIV : 'div.availabilityinfo',
CONTENTWITHOUTLINK : 'contentwithoutlink',
CONDITIONALHIDDEN : 'conditionalhidden',
DIMCLASS : 'dimmed',
DIMMEDTEXT : 'dimmed_text',
EDITINSTRUCTIONS : 'editinstructions',
HIDE : 'hide',
MODINDENTCOUNT : 'mod-indent-',
MODINDENTHUGE : 'mod-indent-huge',
MODULEIDPREFIX : 'module-',
SECTIONHIDDENCLASS : 'hidden',
SECTIONIDPREFIX : 'section-',
SHOW : 'editing_show'
ACTIVITYINSTANCE: 'activityinstance',
AVAILABILITYINFODIV: 'div.availabilityinfo',
CONTENTWITHOUTLINK: 'contentwithoutlink',
CONDITIONALHIDDEN: 'conditionalhidden',
DIMCLASS: 'dimmed',
DIMMEDTEXT: 'dimmed_text',
EDITINSTRUCTIONS: 'editinstructions',
HIDE: 'hide',
MODINDENTCOUNT: 'mod-indent-',
MODINDENTHUGE: 'mod-indent-huge',
MODULEIDPREFIX: 'module-',
SECTIONHIDDENCLASS: 'hidden',
SECTIONIDPREFIX: 'section-',
SHOW: 'editing_show'
},
// The CSS selectors we use.
SELECTOR = {
ACTIONAREA: '.actions',
ACTIONLINKTEXT : '.actionlinktext',
ACTIVITYACTION : 'a.cm-edit-action[data-action]',
ACTIVITYICON : 'img.activityicon',
ACTIVITYINSTANCE : '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .'+ CSS.ACTIVITYINSTANCE +
ACTIONLINKTEXT: '.actionlinktext',
ACTIVITYACTION: 'a.cm-edit-action[data-action]',
ACTIVITYICON: 'img.activityicon',
ACTIVITYINSTANCE: '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .' + CSS.ACTIVITYINSTANCE +
' > span[data-inplaceeditable] > a:not([data-inplaceeditablelink])',
ACTIVITYLI : 'li.activity',
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
ACTIVITYLI: 'li.activity',
COMMANDSPAN: '.commands',
CONTENTAFTERLINK: 'div.contentafterlink',
CONTENTWITHOUTLINK: 'div.contentwithoutlink',
GROUPINGLABEL: '.' + CSS.ACTIVITYINSTANCE + ' .groupinglabel',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
INSTANCENAME : 'span.instancename',
MODINDENTDIV : '.mod-indent',
MODINDENTOUTER : '.mod-indent-outer',
PAGECONTENT : 'body',
SECTIONLI : 'li.section',
SHOW : 'a.'+CSS.SHOW,
SHOWHIDE : 'a.editing_showhide'
HIDE: 'a.editing_hide',
HIGHLIGHT: 'a.editing_highlight',
INSTANCENAME: 'span.instancename',
MODINDENTDIV: '.mod-indent',
MODINDENTOUTER: '.mod-indent-outer',
PAGECONTENT: 'body',
SECTIONLI: 'li.section',
SHOW: 'a.' + CSS.SHOW,
SHOWHIDE: 'a.editing_showhide'
},
INDENTLIMITS = {
MIN: 0,
@@ -114,7 +114,9 @@ Y.extend(TOOLBOX, Y.Base, {
if (responsetext.error) {
new M.core.ajaxException(responsetext);
}
} catch (e) {}
} catch (e) {
// Ignore.
}
// Run the callback if we have one.
if (success_callback) {
@@ -370,7 +372,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Prevent the default button action
ev.preventDefault();
var direction = (action === 'moveleft') ? -1: 1;
var direction = (action === 'moveleft') ? -1 : 1;
// And we need to determine the current and new indent level
var indentdiv = activity.one(SELECTOR.MODINDENTDIV),
@@ -447,7 +449,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
ev.preventDefault();
// Get the element we're working on
var element = activity,
var element = activity,
// Create confirm string (different if element has or does not have name)
confirmstring = '',
plugindata = {
@@ -580,7 +582,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
SELECTOR.CONTENTWITHOUTLINK
].join(', ')),
availabilityinfo = activity.one(CSS.AVAILABILITYINFODIV),
nextaction = (action === 'hide') ? 'show': 'hide',
nextaction = (action === 'hide') ? 'show' : 'hide',
buttontext = button.one('span'),
newstring = M.util.get_string(nextaction, 'moodle'),
buttonimg = button.one('img');
@@ -598,7 +600,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
buttonimg.setAttribute('alt', newstring);
}
button.replaceClass('editing_'+action, 'editing_'+nextaction);
button.replaceClass('editing_' + action, 'editing_' + nextaction);
button.setData('action', nextaction);
if (buttontext) {
buttontext.set('text', newstring);
@@ -629,7 +631,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
if (availabilityinfo) {
availabilityinfo.toggleClass(CSS.HIDE);
}
return (action === 'hide') ? 0: 1;
return (action === 'hide') ? 0 : 1;
},
/**
@@ -786,7 +788,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method initializer
* @protected
*/
initializer : function() {
initializer: function() {
M.course.coursebase.register_module(this);
// Section Highlighting.
@@ -796,7 +798,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
Y.delegate('click', this.toggle_hide_section, SELECTOR.PAGECONTENT, SELECTOR.SECTIONLI + ' ' + SELECTOR.SHOWHIDE, this);
},
toggle_hide_section : function(e) {
toggle_hide_section: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -827,8 +829,8 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
var newstring = M.util.get_string(nextaction + 'fromothers', 'format_' + this.get('format'));
hideicon.setAttrs({
'alt' : newstring,
'src' : M.util.image_url('i/' + nextaction)
'alt': newstring,
'src': M.util.image_url('i/' + nextaction)
});
button.set('title', newstring);
if (buttontext) {
@@ -837,10 +839,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the show/hide status
var data = {
'class' : 'section',
'field' : 'visible',
'id' : Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value' : value
'class': 'section',
'field': 'visible',
'id': Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
@@ -872,7 +874,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method toggle_highlight
* @param {EventFacade} e
*/
toggle_highlight : function(e) {
toggle_highlight: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -923,17 +925,17 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the highlight status.
var data = {
'class' : 'course',
'field' : 'marker',
'value' : value
'class': 'course',
'field': 'marker',
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
lightbox.show();
this.send_request(data, lightbox);
}
}, {
NAME : 'course-section-toolbox',
ATTRS : {
NAME: 'course-section-toolbox',
ATTRS: {
}
});
@@ -17,7 +17,7 @@ Y.namespace('Moodle.core_course.util.cm');
*/
Y.Moodle.core_course.util.cm = {
CONSTANTS: {
MODULEIDPREFIX : 'module-'
MODULEIDPREFIX: 'module-'
},
SELECTORS: {
COURSEMODULE: '.activity',
@@ -17,7 +17,7 @@ Y.namespace('Moodle.core_course.util.cm');
*/
Y.Moodle.core_course.util.cm = {
CONSTANTS: {
MODULEIDPREFIX : 'module-'
MODULEIDPREFIX: 'module-'
},
SELECTORS: {
COURSEMODULE: '.activity',
@@ -17,7 +17,7 @@ Y.namespace('Moodle.core_course.util.section');
*/
Y.Moodle.core_course.util.section = {
CONSTANTS: {
SECTIONIDPREFIX : 'section-'
SECTIONIDPREFIX: 'section-'
},
/**
@@ -17,7 +17,7 @@ Y.namespace('Moodle.core_course.util.section');
*/
Y.Moodle.core_course.util.section = {
CONSTANTS: {
SECTIONIDPREFIX : 'section-'
SECTIONIDPREFIX: 'section-'
},
/**
+11 -11
View File
@@ -19,7 +19,7 @@ var COURSEBASE = function() {
*/
Y.extend(COURSEBASE, Y.Base, {
// Registered Modules
registermodules : [],
registermodules: [],
/**
* Register a new Javascript Module
@@ -28,7 +28,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {Object} The instantiated module to call functions on
* @chainable
*/
register_module : function(object) {
register_module: function(object) {
this.registermodules.push(object);
return this;
@@ -42,7 +42,7 @@ Y.extend(COURSEBASE, Y.Base, {
* @param {mixed} args The argument supplied to the function
* @chainable
*/
invoke_function : function(functionname, args) {
invoke_function: function(functionname, args) {
var module;
for (module in this.registermodules) {
if (functionname in this.registermodules[module]) {
@@ -53,8 +53,8 @@ Y.extend(COURSEBASE, Y.Base, {
return this;
}
}, {
NAME : COURSEBASENAME,
ATTRS : {}
NAME: COURSEBASENAME,
ATTRS: {}
});
// Ensure that M.course exists and that coursebase is initialised correctly
@@ -102,12 +102,12 @@ M.course.format.process_sections = M.course.format.process_sections || function(
*/
M.course.format.get_config = M.course.format.get_config || function() {
return {
container_node : null, // compulsory
container_class : null, // compulsory
section_wrapper_node : null, // optional
section_wrapper_class : null, // optional
section_node : null, // compulsory
section_class : null // compulsory
container_node: null, // compulsory
container_class: null, // compulsory
section_wrapper_node: null, // optional
section_wrapper_class: null, // optional
section_node: null, // compulsory
section_class: null // compulsory
};
};
+1 -1
View File
@@ -185,7 +185,7 @@ Y.extend(DRAGRESOURCE, M.core.dragdrop, {
// TODO: revert nodes location
}
},
context:this
context: this
});
}
}, {
+6 -4
View File
@@ -13,7 +13,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
initializer: function() {
// Set group for parent class
this.groups = [ CSS.SECTIONDRAGGABLE ];
this.groups = [CSS.SECTIONDRAGGABLE];
this.samenodeclass = M.course.format.get_sectionwrapperclass();
this.parentnodeclass = M.course.format.get_containerclass();
@@ -120,7 +120,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
containernode.addClass(M.course.format.get_containerclass());
var sectionnode = Y.Node.create('<' + M.course.format.get_sectionwrappernode() +
'></' + M.course.format.get_sectionwrappernode() + '>');
sectionnode.addClass( M.course.format.get_sectionwrapperclass());
sectionnode.addClass(M.course.format.get_sectionwrapperclass());
sectionnode.setStyle('margin', 0);
sectionnode.setContent(drag.get('node').get('innerHTML'));
containernode.appendChild(sectionnode);
@@ -214,7 +214,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
new M.core.ajaxException(responsetext);
}
M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend);
} catch (e) {}
} catch (e) {
// Ignore.
}
// Update all of the section IDs - first unset them, then set them
// to avoid duplicates in the DOM.
@@ -255,7 +257,7 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
lightbox.hide();
}
},
context:this
context: this
});
}
+3 -3
View File
@@ -3,10 +3,10 @@ var FORMATCHOOSER = function() {
};
Y.extend(FORMATCHOOSER, Y.Base, {
initializer : function(params) {
initializer: function(params) {
if (params && params.formid) {
var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat');
var formatselect = Y.one('#'+params.formid+' #id_format');
var updatebut = Y.one('#' + params.formid + ' #id_updatecourseformat');
var formatselect = Y.one('#' + params.formid + ' #id_format');
var ancestor = updatebut.ancestor('fieldset');
var action = Y.one('form.mform').get('action');
if (updatebut && formatselect) {
+46 -46
View File
@@ -21,16 +21,16 @@ Category.ATTRS = {
* @writeOnce
* @default null
*/
categoryid : {
getter : function (value, name) {
categoryid: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData('id');
this.set(name, value);
}
return value;
},
value : null,
writeOnce : true
value: null,
writeOnce: true
},
/**
@@ -39,8 +39,8 @@ Category.ATTRS = {
* @type Boolean
* @default null
*/
selected : {
getter : function(value, name) {
selected: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData(name);
if (value === null) {
@@ -50,7 +50,7 @@ Category.ATTRS = {
}
return value;
},
value : null
value: null
},
/**
@@ -59,11 +59,11 @@ Category.ATTRS = {
* @type Course[]
* @default Array
*/
courses : {
validator : function(val) {
courses: {
validator: function(val) {
return Y.Lang.isArray(val);
},
value : []
value: []
}
};
Category.prototype = {
@@ -71,7 +71,7 @@ Category.prototype = {
* Initialises an instance of a Category.
* @method initializer
*/
initializer : function() {
initializer: function() {
this.set('itemname', 'category');
},
@@ -80,7 +80,7 @@ Category.prototype = {
* @method getName
* @return {String}
*/
getName : function() {
getName: function() {
return this.get('node').one('a.categoryname').get('innerHTML');
},
@@ -89,7 +89,7 @@ Category.prototype = {
* @method registerCourse
* @param {Course} course
*/
registerCourse : function(course) {
registerCourse: function(course) {
var courses = this.get('courses');
courses.push(course);
this.set('courses', courses);
@@ -103,8 +103,8 @@ Category.prototype = {
* @param {EventFacade} e
* @return {Boolean}
*/
handle : function(action, e) {
var catarg = {categoryid : this.get('categoryid')},
handle: function(action, e) {
var catarg = {categoryid: this.get('categoryid')},
selected = this.get('console').get('activecategoryid');
if (selected && selected !== catarg.categoryid) {
catarg.selectedcategory = selected;
@@ -162,42 +162,42 @@ Category.prototype = {
* Expands the category making its sub categories visible.
* @method expand
*/
expand : function() {
expand: function() {
var node = this.get('node'),
action = node.one('a[data-action=expand]'),
ul = node.one('ul[role=group]');
node.removeClass('collapsed').setAttribute('aria-expanded', 'true');
action.setAttribute('data-action', 'collapse').setAttrs({
title : M.util.get_string('collapsecategory', 'moodle', this.getName())
title: M.util.get_string('collapsecategory', 'moodle', this.getName())
}).one('img').setAttrs({
src : M.util.image_url('t/switch_minus', 'moodle'),
alt : M.util.get_string('collapse', 'moodle')
src: M.util.image_url('t/switch_minus', 'moodle'),
alt: M.util.get_string('collapse', 'moodle')
});
if (ul) {
ul.setAttribute('aria-hidden', 'false');
}
this.get('console').performAjaxAction('expandcategory', {categoryid : this.get('categoryid')}, null, this);
this.get('console').performAjaxAction('expandcategory', {categoryid: this.get('categoryid')}, null, this);
},
/**
* Collapses the category making its sub categories hidden.
* @method collapse
*/
collapse : function() {
collapse: function() {
var node = this.get('node'),
action = node.one('a[data-action=collapse]'),
ul = node.one('ul[role=group]');
node.addClass('collapsed').setAttribute('aria-expanded', 'false');
action.setAttribute('data-action', 'expand').setAttrs({
title : M.util.get_string('expandcategory', 'moodle', this.getName())
title: M.util.get_string('expandcategory', 'moodle', this.getName())
}).one('img').setAttrs({
src : M.util.image_url('t/switch_plus', 'moodle'),
alt : M.util.get_string('expand', 'moodle')
src: M.util.image_url('t/switch_plus', 'moodle'),
alt: M.util.get_string('expand', 'moodle')
});
if (ul) {
ul.setAttribute('aria-hidden', 'true');
}
this.get('console').performAjaxAction('collapsecategory', {categoryid : this.get('categoryid')}, null, this);
this.get('console').performAjaxAction('collapsecategory', {categoryid: this.get('categoryid')}, null, this);
},
/**
@@ -210,17 +210,17 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean} Returns true on success - false otherwise.
*/
loadSubcategories : function(transactionid, response, args) {
loadSubcategories: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
node = this.get('node'),
managementconsole = this.get('console'),
ul,
actionnode;
if (outcome === false) {
Y.log('AJAX failed to load sub categories for '+this.get('itemname'), 'warn', 'moodle-course-management');
Y.log('AJAX failed to load sub categories for ' + this.get('itemname'), 'warn', 'moodle-course-management');
return false;
}
Y.log('AJAX loaded subcategories for '+this.get('itemname'), 'info', 'moodle-course-management');
Y.log('AJAX loaded subcategories for ' + this.get('itemname'), 'info', 'moodle-course-management');
node.append(outcome.html);
managementconsole.initialiseCategories(node);
if (M.core && M.core.actionmenu && M.core.actionmenu.newDOMNode) {
@@ -240,24 +240,24 @@ Category.prototype = {
* @method moveCourseTo
* @param {Course} course
*/
moveCourseTo : function(course) {
moveCourseTo: function(course) {
var self = this;
Y.use('moodle-core-notification-confirm', function() {
var confirm = new M.core.confirm({
title : M.util.get_string('confirm', 'moodle'),
question : M.util.get_string('confirmcoursemove', 'moodle', {
course : course.getName(),
category : self.getName()
title: M.util.get_string('confirm', 'moodle'),
question: M.util.get_string('confirmcoursemove', 'moodle', {
course: course.getName(),
category: self.getName()
}),
yesLabel : M.util.get_string('move', 'moodle'),
noLabel : M.util.get_string('cancel', 'moodle')
yesLabel: M.util.get_string('move', 'moodle'),
noLabel: M.util.get_string('cancel', 'moodle')
});
confirm.on('complete-yes', function() {
confirm.hide();
confirm.destroy();
this.get('console').performAjaxAction('movecourseintocategory', {
categoryid : this.get('categoryid'),
courseid : course.get('courseid')
categoryid: this.get('categoryid'),
courseid: course.get('courseid')
}, this.completeMoveCourse, this);
}, self);
confirm.show();
@@ -273,14 +273,14 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
completeMoveCourse : function(transactionid, response, args) {
completeMoveCourse: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
managementconsole = this.get('console'),
category,
course,
totals;
if (outcome === false) {
Y.log('AJAX failed to move courses into this category: '+this.get('itemname'), 'warn', 'moodle-course-management');
Y.log('AJAX failed to move courses into this category: ' + this.get('itemname'), 'warn', 'moodle-course-management');
return false;
}
course = managementconsole.getCourseById(args.courseid);
@@ -328,11 +328,11 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
show : function(transactionid, response, args) {
show: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
hidebtn;
if (outcome === false) {
Y.log('AJAX request to show '+this.get('itemname')+' by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to show ' + this.get('itemname') + ' by outcome.', 'warn', 'moodle-course-management');
return false;
}
@@ -360,11 +360,11 @@ Category.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
hide : function(transactionid, response, args) {
hide: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
showbtn;
if (outcome === false) {
Y.log('AJAX request to hide '+this.get('itemname')+' by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to hide ' + this.get('itemname') + ' by outcome.', 'warn', 'moodle-course-management');
return false;
}
this.markHidden();
@@ -379,7 +379,7 @@ Category.prototype = {
this.updateCourseVisiblity(outcome.coursevisibility);
}
this.updated();
Y.log('Success: '+this.get('itemname')+' made hidden by AJAX.', 'info', 'moodle-course-management');
Y.log('Success: ' + this.get('itemname') + ' made hidden by AJAX.', 'info', 'moodle-course-management');
},
/**
@@ -388,7 +388,7 @@ Category.prototype = {
* @chainable
* @param courses
*/
updateCourseVisiblity : function(courses) {
updateCourseVisiblity: function(courses) {
var managementconsole = this.get('console'),
key,
course;
@@ -418,7 +418,7 @@ Category.prototype = {
* @chainable
* @param categories
*/
updateChildVisibility : function(categories) {
updateChildVisibility: function(categories) {
var managementconsole = this.get('console'),
key,
category;
+66 -66
View File
@@ -27,10 +27,10 @@ Console.ATTRS = {
* @attribute element
* @type Node
*/
element : {
setter : function(node) {
element: {
setter: function(node) {
if (typeof node === 'string') {
node = Y.one('#'+node);
node = Y.one('#' + node);
}
return node;
}
@@ -42,8 +42,8 @@ Console.ATTRS = {
* @type Node
* @default null
*/
categorylisting : {
value : null
categorylisting: {
value: null
},
/**
@@ -52,8 +52,8 @@ Console.ATTRS = {
* @type Node
* @default null
*/
courselisting : {
value : null
courselisting: {
value: null
},
/**
@@ -62,8 +62,8 @@ Console.ATTRS = {
* @type Node|null
* @default null
*/
coursedetails : {
value : null
coursedetails: {
value: null
},
/**
@@ -72,8 +72,8 @@ Console.ATTRS = {
* @type Number
* @default null
*/
activecategoryid : {
value : null
activecategoryid: {
value: null
},
/**
@@ -82,8 +82,8 @@ Console.ATTRS = {
* @type Number
* @default Null
*/
activecourseid : {
value : null
activecourseid: {
value: null
},
/**
@@ -92,8 +92,8 @@ Console.ATTRS = {
* @type Array
* @default []
*/
categories : {
setter : function(item, name) {
categories: {
setter: function(item, name) {
if (Y.Lang.isArray(item)) {
return item;
}
@@ -101,7 +101,7 @@ Console.ATTRS = {
items.push(item);
return items;
},
value : []
value: []
},
/**
@@ -110,11 +110,11 @@ Console.ATTRS = {
* @type Course[]
* @default Array
*/
courses : {
validator : function(val) {
courses: {
validator: function(val) {
return Y.Lang.isArray(val);
},
value : []
value: []
},
/**
@@ -123,15 +123,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
page : {
getter : function(value, name) {
page: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -140,15 +140,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
totalpages : {
getter : function(value, name) {
totalpages: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -157,15 +157,15 @@ Console.ATTRS = {
* @type Number
* @default null
*/
totalcourses : {
getter : function(value, name) {
totalcourses: {
getter: function(value, name) {
if (value === null) {
value = this.get('element').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
/**
@@ -174,14 +174,14 @@ Console.ATTRS = {
* @type String
* @default /course/ajax/management.php
*/
ajaxurl : {
getter : function(value) {
ajaxurl: {
getter: function(value) {
if (value === null) {
value = M.cfg.wwwroot + '/course/ajax/management.php';
}
return value;
},
value : null
value: null
},
/**
@@ -190,8 +190,8 @@ Console.ATTRS = {
* @type DragDrop
* @default null
*/
dragdrop : {
value : null
dragdrop: {
value: null
}
};
Console.prototype = {
@@ -202,13 +202,13 @@ Console.prototype = {
* @private
* @type {boolean}
*/
categoriesinit : false,
categoriesinit: false,
/**
* Initialises a new instance of the Console.
* @method initializer
*/
initializer : function() {
initializer: function() {
Y.log('Initialising course category management console', 'info', 'moodle-course-management');
this.set('element', 'coursecat-management');
var element = this.get('element'),
@@ -237,7 +237,7 @@ Console.prototype = {
if (courselisting) {
// No need for dragdrop if we don't have a course listing.
this.set('dragdrop', new DragDrop({console:this}));
this.set('dragdrop', new DragDrop({console: this}));
}
},
@@ -247,7 +247,7 @@ Console.prototype = {
* @private
* @return {boolean}
*/
initialiseCategories : function(listing) {
initialiseCategories: function(listing) {
var count = 0;
if (!listing) {
return false;
@@ -267,10 +267,10 @@ Console.prototype = {
menuresortcoursesby.setAttribute('disabled', true);
}
listing.all('.listitem[data-id]').each(function(node){
listing.all('.listitem[data-id]').each(function(node) {
this.set('categories', new Category({
node : node,
console : this
node: node,
console: this
}));
count++;
}, this);
@@ -279,9 +279,9 @@ Console.prototype = {
this.get('categorylisting').delegate('click', this.handleCategoryDelegation, 'input[name="bcat[]"]', this);
this.get('categorylisting').delegate('click', this.handleBulkSortByaction, '#menuselectsortby', this);
this.categoriesinit = true;
Y.log(count+' categories being managed', 'info', 'moodle-course-management');
Y.log(count + ' categories being managed', 'info', 'moodle-course-management');
} else {
Y.log(count+' new categories being managed', 'info', 'moodle-course-management');
Y.log(count + ' new categories being managed', 'info', 'moodle-course-management');
}
},
@@ -291,7 +291,7 @@ Console.prototype = {
* @private
* @return {boolean}
*/
initialiseCourses : function() {
initialiseCourses: function() {
var category = this.getCategoryById(this.get('activecategoryid')),
listing = this.get('courselisting'),
count = 0;
@@ -305,17 +305,17 @@ Console.prototype = {
menumovecoursesto.setAttribute('disabled', true);
}
listing.all('.listitem[data-id]').each(function(node){
listing.all('.listitem[data-id]').each(function(node) {
this.registerCourse(new Course({
node : node,
console : this,
category : category
node: node,
console: this,
category: category
}));
count++;
}, this);
listing.delegate('click', this.handleCourseDelegation, 'a[data-action]', this);
listing.delegate('click', this.handleCourseDelegation, 'input[name="bc[]"]', this);
Y.log(count+' courses being managed', 'info', 'moodle-course-management');
Y.log(count + ' courses being managed', 'info', 'moodle-course-management');
},
/**
@@ -323,7 +323,7 @@ Console.prototype = {
* @method registerCourse
* @param {Course} course
*/
registerCourse : function(course) {
registerCourse: function(course) {
var courses = this.get('courses');
courses.push(course);
this.set('courses', courses);
@@ -336,7 +336,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleCourseDelegation : function(e) {
handleCourseDelegation: function(e) {
var target = e.currentTarget,
action = target.getData('action'),
courseid = target.ancestor('.listitem').getData('id'),
@@ -344,7 +344,7 @@ Console.prototype = {
if (course) {
course.handle(action, e);
} else {
Y.log('Course with ID '+courseid+' could not be found for delegation', 'error', 'moodle-course-management');
Y.log('Course with ID ' + courseid + ' could not be found for delegation', 'error', 'moodle-course-management');
}
},
@@ -355,7 +355,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleCategoryDelegation : function(e) {
handleCategoryDelegation: function(e) {
var target = e.currentTarget,
action = target.getData('action'),
categoryid = target.ancestor('.listitem').getData('id'),
@@ -374,7 +374,7 @@ Console.prototype = {
* @param {Node} checkboxnode Checkbox node on which action happened.
* @return bool
*/
isCourseSelected : function(checkboxnode) {
isCourseSelected: function(checkboxnode) {
var selected = false;
// If any course selected then show move to category select box.
@@ -405,7 +405,7 @@ Console.prototype = {
* @param {Node} checkboxnode Checkbox node on which action happened.
* @return bool
*/
isCategorySelected : function(checkboxnode) {
isCategorySelected: function(checkboxnode) {
var selected = false;
// If any category selected then show move to category select box.
@@ -436,7 +436,7 @@ Console.prototype = {
* @protected
* @param {EventFacade} e
*/
handleBulkSortByaction : function(e) {
handleBulkSortByaction: function(e) {
var sortcategoryby = this.get('categorylisting').one('#menuresortcategoriesby'),
sortcourseby = this.get('categorylisting').one('#menuresortcoursesby'),
sortbybutton = this.get('categorylisting').one('input[name="bulksort"]'),
@@ -485,7 +485,7 @@ Console.prototype = {
* @param {Number} id
* @return {Category|Boolean} The category or false if it can't be found.
*/
getCategoryById : function(id) {
getCategoryById: function(id) {
var i,
category,
categories = this.get('categories'),
@@ -507,7 +507,7 @@ Console.prototype = {
* @param {Number} id
* @return {Course|Boolean} The course or false if not found/
*/
getCourseById : function(id) {
getCourseById: function(id) {
var i,
course,
courses = this.get('courses'),
@@ -528,7 +528,7 @@ Console.prototype = {
* @method removeCourseById
* @param {Number} id
*/
removeCourseById : function(id) {
removeCourseById: function(id) {
var courses = this.get('courses'),
length = courses.length,
course,
@@ -551,24 +551,24 @@ Console.prototype = {
* @param {Function} callback The function to call when all is done.
* @param {Object} context The object to use as the context for the callback.
*/
performAjaxAction : function(action, args, callback, context) {
performAjaxAction: function(action, args, callback, context) {
var io = new Y.IO();
args.action = action;
args.ajax = '1';
args.sesskey = M.cfg.sesskey;
if (callback === null) {
callback = function() {
Y.log("'Action '"+action+"' completed", 'debug', 'moodle-course-management');
Y.log("'Action '" + action + "' completed", 'debug', 'moodle-course-management');
};
}
io.send(this.get('ajaxurl'), {
method : 'POST',
on : {
complete : callback
method: 'POST',
on: {
complete: callback
},
context : context,
data : args,
'arguments' : args
context: context,
data: args,
'arguments': args
});
}
};
+21 -21
View File
@@ -20,7 +20,7 @@ Course.ATTRS = {
* @attribute courseid
* @type Number
*/
courseid : {},
courseid: {},
/**
* True if this is the selected course.
@@ -28,17 +28,17 @@ Course.ATTRS = {
* @type Boolean
* @default null
*/
selected : {
getter : function(value, name) {
selected: {
getter: function(value, name) {
if (value === null) {
value = this.get('node').getData(name);
this.set(name, value);
}
return value;
},
value : null
value: null
},
node : {
node: {
},
/**
@@ -47,8 +47,8 @@ Course.ATTRS = {
* @type Console
* @writeOnce
*/
console : {
writeOnce : 'initOnly'
console: {
writeOnce: 'initOnly'
},
/**
@@ -57,8 +57,8 @@ Course.ATTRS = {
* @type Category
* @writeOnce
*/
category : {
writeOnce : 'initOnly'
category: {
writeOnce: 'initOnly'
}
};
Course.prototype = {
@@ -66,7 +66,7 @@ Course.prototype = {
* Initialises the new course instance.
* @method initializer
*/
initializer : function() {
initializer: function() {
var node = this.get('node'),
category = this.get('category');
this.set('courseid', node.getData('id'));
@@ -81,7 +81,7 @@ Course.prototype = {
* @method getName
* @return {String}
*/
getName : function() {
getName: function() {
return this.get('node').one('a.coursename').get('innerHTML');
},
@@ -92,9 +92,9 @@ Course.prototype = {
* @param {EventFacade} e
* @return {Boolean}
*/
handle : function(action, e) {
handle: function(action, e) {
var managementconsole = this.get('console'),
args = {courseid : this.get('courseid')};
args = {courseid: this.get('courseid')};
switch (action) {
case 'moveup':
e.halt();
@@ -133,7 +133,7 @@ Course.prototype = {
* Removes this course.
* @method remove
*/
remove : function() {
remove: function() {
this.get('console').removeCourseById(this.get('courseid'));
this.get('node').remove();
},
@@ -145,12 +145,12 @@ Course.prototype = {
* @param {Number} moveaftercourse The course to move after or 0 to put it at the top.
* @param {Number} previousid the course it was previously after in case we need to revert.
*/
moveAfter : function(moveaftercourse, previousid) {
moveAfter: function(moveaftercourse, previousid) {
var managementconsole = this.get('console'),
args = {
courseid : this.get('courseid'),
moveafter : moveaftercourse,
previous : previousid
courseid: this.get('courseid'),
moveafter: moveaftercourse,
previous: previousid
};
managementconsole.performAjaxAction('movecourseafter', args, this.moveAfterResponse, this);
},
@@ -165,12 +165,12 @@ Course.prototype = {
* @param {Objects} args The arguments that were given with the request.
* @return {Boolean}
*/
moveAfterResponse : function(transactionid, response, args) {
moveAfterResponse: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
node = this.get('node'),
previous;
if (outcome === false) {
previous = node.ancestor('ul').one('li[data-id='+args.previous+']');
previous = node.ancestor('ul').one('li[data-id=' + args.previous + ']');
Y.log('AJAX failed to move this course after the requested course', 'warn', 'moodle-course-management');
if (previous) {
// After the last previous.
@@ -181,7 +181,7 @@ Course.prototype = {
}
return false;
}
Y.log('AJAX successfully moved course ('+this.getName()+')', 'info', 'moodle-course-management');
Y.log('AJAX successfully moved course (' + this.getName() + ')', 'info', 'moodle-course-management');
this.highlight();
}
};
+21 -21
View File
@@ -20,8 +20,8 @@ DragDrop.ATTRS = {
* @type Console
* @writeOnce
*/
console : {
writeOnce : 'initOnly'
console: {
writeOnce: 'initOnly'
}
};
DragDrop.prototype = {
@@ -31,7 +31,7 @@ DragDrop.prototype = {
* @protected
* @default false
*/
goingup : false,
goingup: false,
/**
* The last Y position of the course being dragged
@@ -39,7 +39,7 @@ DragDrop.prototype = {
* @protected
* @default null
*/
lasty : null,
lasty: null,
/**
* The sibling above the course being dragged currently (tracking its original position).
@@ -48,13 +48,13 @@ DragDrop.prototype = {
* @protected
* @default false
*/
previoussibling : null,
previoussibling: null,
/**
* Initialises the DragDrop instance.
* @method initializer
*/
initializer : function() {
initializer: function() {
var managementconsole = this.get('console'),
container = managementconsole.get('element'),
categorylisting = container.one('#category-listing'),
@@ -69,7 +69,7 @@ DragDrop.prototype = {
return false;
}
courseul.all('> li').each(function(li){
courseul.all('> li').each(function(li) {
this.initCourseListing(li, contstraint);
}, this);
courseul.setData('dd', new Y.DD.Drop({
@@ -77,7 +77,7 @@ DragDrop.prototype = {
}));
if (canmoveoutof && categoryul) {
// Category UL may not be there if viewmode is just courses.
categoryul.all('li > div').each(function(div){
categoryul.all('li > div').each(function(div) {
this.initCategoryListitem(div);
}, this);
}
@@ -96,10 +96,10 @@ DragDrop.prototype = {
* @method initCourseListing
* @param Node
*/
initCourseListing : function(node, contstraint) {
initCourseListing: function(node, contstraint) {
node.setData('dd', new Y.DD.Drag({
node : node,
target : {
node: node,
target: {
padding: '0 0 0 20'
}
}).addHandle(
@@ -117,7 +117,7 @@ DragDrop.prototype = {
* @method initCategoryListitem
* @param Node
*/
initCategoryListitem : function(node) {
initCategoryListitem: function(node) {
node.setData('dd', new Y.DD.Drop({
node: node
}));
@@ -129,7 +129,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragStart : function(e) {
dragStart: function(e) {
var drag = e.target,
node = drag.get('node'),
dragnode = drag.get('dragNode');
@@ -144,7 +144,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragEnd : function(e) {
dragEnd: function(e) {
var drag = e.target,
node = drag.get('node');
node.removeClass('course-being-dragged');
@@ -157,7 +157,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dragDrag : function(e) {
dragDrag: function(e) {
var y = e.target.lastXY[1];
if (y < this.lasty) {
this.goingup = true;
@@ -173,8 +173,8 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropOver : function(e) {
//Get a reference to our drag and drop nodes
dropOver: function(e) {
// Get a reference to our drag and drop nodes
var drag = e.drag.get('node'),
drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
@@ -198,7 +198,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropEnter : function(e) {
dropEnter: function(e) {
var drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
if (tag === 'div') {
@@ -212,7 +212,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropExit : function(e) {
dropExit: function(e) {
var drop = e.drop.get('node'),
tag = drop.get('tagName').toLowerCase();
if (tag === 'div') {
@@ -226,7 +226,7 @@ DragDrop.prototype = {
* @private
* @param {EventFacade} e
*/
dropHit : function(e) {
dropHit: function(e) {
var drag = e.drag.get('node'),
drop = e.drop.get('node'),
iscategory = (drop.ancestor('.listitem-category') !== null),
@@ -259,7 +259,7 @@ DragDrop.prototype = {
course = managementconsole.getCourseById(courseid);
previoussibling = drag.get('previousSibling');
aftercourseid = (previoussibling) ? previoussibling.getData('id') || 0 : 0;
previousid = (this.previoussibling) ? this.previoussibling.getData('id') : 0;
previousid = (this.previoussibling) ? this.previoussibling.getData('id') : 0;
if (aftercourseid !== previousid) {
course.moveAfter(aftercourseid, previousid);
}
+25 -25
View File
@@ -17,14 +17,14 @@ Item.ATTRS = {
* @attribute node
* @type Node
*/
node : {},
node: {},
/**
* The management console.
* @attribute console
* @type Console
*/
console : {},
console: {},
/**
* Describes the type of this item. Should be set by the extending class.
@@ -32,8 +32,8 @@ Item.ATTRS = {
* @type {String}
* @default item
*/
itemname : {
value : 'item'
itemname: {
value: 'item'
}
};
Item.prototype = {
@@ -44,7 +44,7 @@ Item.prototype = {
* @type Timeout
* @default null
*/
highlighttimeout : null,
highlighttimeout: null,
/**
* Checks and parses an AJAX response for an item.
@@ -56,7 +56,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Object|Boolean}
*/
checkAjaxResponse : function(transactionid, response, args) {
checkAjaxResponse: function(transactionid, response, args) {
if (response.status !== 200) {
Y.log('Error: AJAX response resulted in non 200 status.', 'error', 'Item.checkAjaxResponse');
return false;
@@ -84,7 +84,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
moveup : function(transactionid, response, args) {
moveup: function(transactionid, response, args) {
var node,
nodeup,
nodedown,
@@ -94,7 +94,7 @@ Item.prototype = {
tmpnode,
outcome = this.checkAjaxResponse(transactionid, response, args);
if (outcome === false) {
Y.log('AJAX request to move '+this.get('itemname')+' up failed by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to move ' + this.get('itemname') + ' up failed by outcome.', 'warn', 'moodle-course-management');
return false;
}
node = this.get('node');
@@ -134,7 +134,7 @@ Item.prototype = {
}
}
this.updated(true);
Y.log('Success: '+this.get('itemname')+' moved up by AJAX.', 'info', 'moodle-course-management');
Y.log('Success: ' + this.get('itemname') + ' moved up by AJAX.', 'info', 'moodle-course-management');
} else {
// Aha it succeeded but this is the top item in the list. Pagination is in play!
// Refresh to update the state of things.
@@ -153,7 +153,7 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
movedown : function(transactionid, response, args) {
movedown: function(transactionid, response, args) {
var node,
next,
nodeup,
@@ -163,7 +163,7 @@ Item.prototype = {
tmpnode,
outcome = this.checkAjaxResponse(transactionid, response, args);
if (outcome === false) {
Y.log('AJAX request to move '+this.get('itemname')+' down failed by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to move ' + this.get('itemname') + ' down failed by outcome.', 'warn', 'moodle-course-management');
return false;
}
node = this.get('node');
@@ -203,7 +203,7 @@ Item.prototype = {
}
}
this.updated(true);
Y.log('Success: '+this.get('itemname')+' moved down by AJAX.', 'info', 'moodle-course-management');
Y.log('Success: ' + this.get('itemname') + ' moved down by AJAX.', 'info', 'moodle-course-management');
} else {
// Aha it succeeded but this is the bottom item in the list. Pagination is in play!
// Refresh to update the state of things.
@@ -222,11 +222,11 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
show : function(transactionid, response, args) {
show: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
hidebtn;
if (outcome === false) {
Y.log('AJAX request to show '+this.get('itemname')+' by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to show ' + this.get('itemname') + ' by outcome.', 'warn', 'moodle-course-management');
return false;
}
@@ -236,16 +236,16 @@ Item.prototype = {
hidebtn.focus();
}
this.updated();
Y.log('Success: '+this.get('itemname')+' made visible by AJAX.', 'info', 'moodle-course-management');
Y.log('Success: ' + this.get('itemname') + ' made visible by AJAX.', 'info', 'moodle-course-management');
},
/**
* Marks the item as visible
* @method markVisible
*/
markVisible : function() {
markVisible: function() {
this.get('node').setAttribute('data-visible', '1');
Y.log('Marked '+this.get('itemname')+' as visible', 'info', 'moodle-course-management');
Y.log('Marked ' + this.get('itemname') + ' as visible', 'info', 'moodle-course-management');
return true;
},
@@ -258,11 +258,11 @@ Item.prototype = {
* @param {Object} args The arguments given to the request.
* @return {Boolean}
*/
hide : function(transactionid, response, args) {
hide: function(transactionid, response, args) {
var outcome = this.checkAjaxResponse(transactionid, response, args),
showbtn;
if (outcome === false) {
Y.log('AJAX request to hide '+this.get('itemname')+' by outcome.', 'warn', 'moodle-course-management');
Y.log('AJAX request to hide ' + this.get('itemname') + ' by outcome.', 'warn', 'moodle-course-management');
return false;
}
this.markHidden();
@@ -271,16 +271,16 @@ Item.prototype = {
showbtn.focus();
}
this.updated();
Y.log('Success: '+this.get('itemname')+' made hidden by AJAX.', 'info', 'moodle-course-management');
Y.log('Success: ' + this.get('itemname') + ' made hidden by AJAX.', 'info', 'moodle-course-management');
},
/**
* Marks the item as hidden.
* @method makeHidden
*/
markHidden : function() {
markHidden: function() {
this.get('node').setAttribute('data-visible', '0');
Y.log('Marked '+this.get('itemname')+' as hidden', 'info', 'moodle-course-management');
Y.log('Marked ' + this.get('itemname') + ' as hidden', 'info', 'moodle-course-management');
return true;
},
@@ -290,7 +290,7 @@ Item.prototype = {
* @method updated
* @param {Boolean} moved True if this item was moved.
*/
updated : function(moved) {
updated: function(moved) {
if (moved) {
this.highlight();
}
@@ -301,14 +301,14 @@ Item.prototype = {
*
* @method highlight
*/
highlight : function() {
highlight: function() {
var node = this.get('node');
node.siblings('.highlight').removeClass('highlight');
node.addClass('highlight');
if (this.highlighttimeout) {
window.clearTimeout(this.highlighttimeout);
}
this.highlighttimeout = window.setTimeout(function(){
this.highlighttimeout = window.setTimeout(function() {
node.removeClass('highlight');
}, 2500);
}
+14 -14
View File
@@ -5,11 +5,11 @@
*/
var CSS = {
PAGECONTENT : 'body',
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER : 'span.section-modchooser-link',
SITEMENU : 'div.block_site_main_menu',
SITETOPIC : 'div.sitetopic'
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
var MODCHOOSERNAME = 'course-modchooser';
@@ -34,14 +34,14 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default null
*/
sectionid : null,
sectionid: null,
/**
* Set up the activity chooser.
*
* @method initializer
*/
initializer : function() {
initializer: function() {
var sectionclass = M.course.format.get_sectionwrapperclass();
if (sectionclass) {
CSS.SECTION = '.' + sectionclass;
@@ -63,7 +63,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method setup_for_section
* @param baseselector The selector to limit scope to
*/
setup_for_section : function(baseselector) {
setup_for_section: function(baseselector) {
if (!baseselector) {
baseselector = CSS.PAGECONTENT;
}
@@ -94,7 +94,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @private
* @param baseselector The selector to limit scope to
*/
_setup_for_section : function(section) {
_setup_for_section: function(section) {
var chooserspan = section.one(CSS.SECTIONMODCHOOSER);
if (!chooserspan) {
return;
@@ -112,7 +112,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @method display_mod_chooser
* @param {EventFacade} e Triggering Event
*/
display_mod_chooser : function (e) {
display_mod_chooser: function(e) {
// Set the section for this version of the dialogue
if (e.target.ancestor(CSS.SITETOPIC)) {
// The site topic has a sectionid of 1
@@ -135,7 +135,7 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @param {String} thisoption The selected option value
* @private
*/
option_selected : function(thisoption) {
option_selected: function(thisoption) {
// Add the sectionid to the URL.
this.hiddenRadioValue.setAttrs({
name: 'jump',
@@ -144,8 +144,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
}
},
{
NAME : MODCHOOSERNAME,
ATTRS : {
NAME: MODCHOOSERNAME,
ATTRS: {
/**
* The maximum height (in pixels) of the activity chooser.
*
@@ -153,8 +153,8 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
* @type Number
* @default 800
*/
maxheight : {
value : 800
maxheight: {
value: 800
}
}
});
+5 -5
View File
@@ -169,7 +169,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
// Prevent the default button action
ev.preventDefault();
var direction = (action === 'moveleft') ? -1: 1;
var direction = (action === 'moveleft') ? -1 : 1;
// And we need to determine the current and new indent level
var indentdiv = activity.one(SELECTOR.MODINDENTDIV),
@@ -246,7 +246,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
ev.preventDefault();
// Get the element we're working on
var element = activity,
var element = activity,
// Create confirm string (different if element has or does not have name)
confirmstring = '',
plugindata = {
@@ -379,7 +379,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
SELECTOR.CONTENTWITHOUTLINK
].join(', ')),
availabilityinfo = activity.one(CSS.AVAILABILITYINFODIV),
nextaction = (action === 'hide') ? 'show': 'hide',
nextaction = (action === 'hide') ? 'show' : 'hide',
buttontext = button.one('span'),
newstring = M.util.get_string(nextaction, 'moodle'),
buttonimg = button.one('img');
@@ -397,7 +397,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
buttonimg.setAttribute('alt', newstring);
}
button.replaceClass('editing_'+action, 'editing_'+nextaction);
button.replaceClass('editing_' + action, 'editing_' + nextaction);
button.setData('action', nextaction);
if (buttontext) {
buttontext.set('text', newstring);
@@ -428,7 +428,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
if (availabilityinfo) {
availabilityinfo.toggleClass(CSS.HIDE);
}
return (action === 'hide') ? 0: 1;
return (action === 'hide') ? 0 : 1;
},
/**
+14 -14
View File
@@ -33,7 +33,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method initializer
* @protected
*/
initializer : function() {
initializer: function() {
M.course.coursebase.register_module(this);
// Section Highlighting.
@@ -43,7 +43,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
Y.delegate('click', this.toggle_hide_section, SELECTOR.PAGECONTENT, SELECTOR.SECTIONLI + ' ' + SELECTOR.SHOWHIDE, this);
},
toggle_hide_section : function(e) {
toggle_hide_section: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -74,8 +74,8 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
var newstring = M.util.get_string(nextaction + 'fromothers', 'format_' + this.get('format'));
hideicon.setAttrs({
'alt' : newstring,
'src' : M.util.image_url('i/' + nextaction)
'alt': newstring,
'src': M.util.image_url('i/' + nextaction)
});
button.set('title', newstring);
if (buttontext) {
@@ -84,10 +84,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the show/hide status
var data = {
'class' : 'section',
'field' : 'visible',
'id' : Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value' : value
'class': 'section',
'field': 'visible',
'id': Y.Moodle.core_course.util.section.getId(section.ancestor(M.course.format.get_section_wrapper(Y), true)),
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
@@ -119,7 +119,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
* @method toggle_highlight
* @param {EventFacade} e
*/
toggle_highlight : function(e) {
toggle_highlight: function(e) {
// Prevent the default button action.
e.preventDefault();
@@ -170,17 +170,17 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Change the highlight status.
var data = {
'class' : 'course',
'field' : 'marker',
'value' : value
'class': 'course',
'field': 'marker',
'value': value
};
var lightbox = M.util.add_lightbox(Y, section);
lightbox.show();
this.send_request(data, lightbox);
}
}, {
NAME : 'course-section-toolbox',
ATTRS : {
NAME: 'course-section-toolbox',
ATTRS: {
}
});
+35 -33
View File
@@ -11,44 +11,44 @@
// The CSS classes we use.
var CSS = {
ACTIVITYINSTANCE : 'activityinstance',
AVAILABILITYINFODIV : 'div.availabilityinfo',
CONTENTWITHOUTLINK : 'contentwithoutlink',
CONDITIONALHIDDEN : 'conditionalhidden',
DIMCLASS : 'dimmed',
DIMMEDTEXT : 'dimmed_text',
EDITINSTRUCTIONS : 'editinstructions',
HIDE : 'hide',
MODINDENTCOUNT : 'mod-indent-',
MODINDENTHUGE : 'mod-indent-huge',
MODULEIDPREFIX : 'module-',
SECTIONHIDDENCLASS : 'hidden',
SECTIONIDPREFIX : 'section-',
SHOW : 'editing_show'
ACTIVITYINSTANCE: 'activityinstance',
AVAILABILITYINFODIV: 'div.availabilityinfo',
CONTENTWITHOUTLINK: 'contentwithoutlink',
CONDITIONALHIDDEN: 'conditionalhidden',
DIMCLASS: 'dimmed',
DIMMEDTEXT: 'dimmed_text',
EDITINSTRUCTIONS: 'editinstructions',
HIDE: 'hide',
MODINDENTCOUNT: 'mod-indent-',
MODINDENTHUGE: 'mod-indent-huge',
MODULEIDPREFIX: 'module-',
SECTIONHIDDENCLASS: 'hidden',
SECTIONIDPREFIX: 'section-',
SHOW: 'editing_show'
},
// The CSS selectors we use.
SELECTOR = {
ACTIONAREA: '.actions',
ACTIONLINKTEXT : '.actionlinktext',
ACTIVITYACTION : 'a.cm-edit-action[data-action]',
ACTIVITYICON : 'img.activityicon',
ACTIVITYINSTANCE : '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .'+ CSS.ACTIVITYINSTANCE +
ACTIONLINKTEXT: '.actionlinktext',
ACTIVITYACTION: 'a.cm-edit-action[data-action]',
ACTIVITYICON: 'img.activityicon',
ACTIVITYINSTANCE: '.' + CSS.ACTIVITYINSTANCE,
ACTIVITYLINK: '.' + CSS.ACTIVITYINSTANCE + ' > a, .' + CSS.ACTIVITYINSTANCE +
' > span[data-inplaceeditable] > a:not([data-inplaceeditablelink])',
ACTIVITYLI : 'li.activity',
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
ACTIVITYLI: 'li.activity',
COMMANDSPAN: '.commands',
CONTENTAFTERLINK: 'div.contentafterlink',
CONTENTWITHOUTLINK: 'div.contentwithoutlink',
GROUPINGLABEL: '.' + CSS.ACTIVITYINSTANCE + ' .groupinglabel',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
INSTANCENAME : 'span.instancename',
MODINDENTDIV : '.mod-indent',
MODINDENTOUTER : '.mod-indent-outer',
PAGECONTENT : 'body',
SECTIONLI : 'li.section',
SHOW : 'a.'+CSS.SHOW,
SHOWHIDE : 'a.editing_showhide'
HIDE: 'a.editing_hide',
HIGHLIGHT: 'a.editing_highlight',
INSTANCENAME: 'span.instancename',
MODINDENTDIV: '.mod-indent',
MODINDENTOUTER: '.mod-indent-outer',
PAGECONTENT: 'body',
SECTIONLI: 'li.section',
SHOW: 'a.' + CSS.SHOW,
SHOWHIDE: 'a.editing_showhide'
},
INDENTLIMITS = {
MIN: 0,
@@ -112,7 +112,9 @@ Y.extend(TOOLBOX, Y.Base, {
if (responsetext.error) {
new M.core.ajaxException(responsetext);
}
} catch (e) {}
} catch (e) {
// Ignore.
}
// Run the callback if we have one.
if (success_callback) {
+1 -1
View File
@@ -15,7 +15,7 @@ Y.namespace('Moodle.core_course.util.cm');
*/
Y.Moodle.core_course.util.cm = {
CONSTANTS: {
MODULEIDPREFIX : 'module-'
MODULEIDPREFIX: 'module-'
},
SELECTORS: {
COURSEMODULE: '.activity',
+1 -1
View File
@@ -15,7 +15,7 @@ Y.namespace('Moodle.core_course.util.section');
*/
Y.Moodle.core_course.util.section = {
CONSTANTS: {
SECTIONIDPREFIX : 'section-'
SECTIONIDPREFIX: 'section-'
},
/**
@@ -18,33 +18,33 @@ AUTOLINKER = function() {
AUTOLINKER.superclass.constructor.apply(this, arguments);
};
Y.extend(AUTOLINKER, Y.Base, {
overlay : null,
overlay: null,
alertpanels: {},
initializer : function() {
initializer: function() {
var self = this;
require(['core/event'], function(event) {
Y.delegate('click', function(e){
Y.delegate('click', function(e) {
e.preventDefault();
//display a progress indicator
// display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
headerContent: title,
bodyContent: content
}),
fullurl,
cfg;
self.overlay = o;
o.render(Y.one(document.body));
//Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php','showentry_ajax.php');
// Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php', 'showentry_ajax.php');
cfg = {
method: 'get',
context : self,
context: self,
on: {
success: function(id, o) {
this.display_callback(o.responseText, event);
@@ -54,7 +54,7 @@ Y.extend(AUTOLINKER, Y.Base, {
if (M.cfg.developerdebug) {
o.statusText += ' (' + fullurl + ')';
}
new M.core.exception({ message: debuginfo });
new M.core.exception({message: debuginfo});
}
}
};
@@ -68,7 +68,7 @@ Y.extend(AUTOLINKER, Y.Base, {
* @param {String} content - Content to display
* @param {Object} event The amd event module used to fire events for jquery and yui.
*/
display_callback : function(content, event) {
display_callback: function(content, event) {
var data,
key,
alertpanel,
@@ -77,13 +77,13 @@ Y.extend(AUTOLINKER, Y.Base, {
position;
try {
data = Y.JSON.parse(content);
if (data.success){
this.overlay.hide(); //hide progress indicator
if (data.success) {
this.overlay.hide(); // hide progress indicator
for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, draggable: true,
message:definition, modal:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel = new M.core.alert({title: data.entries[key].concept, draggable: true,
message: definition, modal: false, yesLabel: M.util.get_string('ok', 'moodle')});
// Notify the filters about the modified nodes.
event.notifyFilterContentUpdated(alertpanel.get('boundingBox').getDOMNode());
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
@@ -93,7 +93,7 @@ Y.extend(AUTOLINKER, Y.Base, {
alertpanel.on('complete', this._deletealertpanel, this, alertpanelid);
// We already have some windows opened, so set the right position...
if (!Y.Object.isEmpty(this.alertpanels)){
if (!Y.Object.isEmpty(this.alertpanels)) {
position = this._getLatestWindowPosition();
Y.Node.one(alertpanelid).setXY([position[0] + 10, position[1] + 10]);
}
@@ -105,63 +105,63 @@ Y.extend(AUTOLINKER, Y.Base, {
} else if (data.error) {
new M.core.ajaxException(data);
}
} catch(e) {
} catch (e) {
new M.core.exception(e);
}
return false;
},
_getLatestWindowPosition : function() {
_getLatestWindowPosition: function() {
var lastPosition = [0, 0];
Y.Object.each(this.alertpanels, function(position) {
if (position[0] > lastPosition[0]){
if (position[0] > lastPosition[0]) {
lastPosition = position;
}
});
return lastPosition;
},
_deletealertpanel : function(ev, alertpanelid) {
_deletealertpanel: function(ev, alertpanelid) {
delete this.alertpanels[alertpanelid];
}
}, {
NAME : AUTOLINKERNAME,
ATTRS : {
url : {
validator : Y.Lang.isString,
value : M.cfg.wwwroot+'/mod/glossary/showentry.php'
NAME: AUTOLINKERNAME,
ATTRS: {
url: {
validator: Y.Lang.isString,
value: M.cfg.wwwroot + '/mod/glossary/showentry.php'
},
name : {
validator : Y.Lang.isString,
value : 'glossaryconcept'
name: {
validator: Y.Lang.isString,
value: 'glossaryconcept'
},
options : {
getter : function() {
options: {
getter: function() {
return {
width : this.get(WIDTH),
height : this.get(HEIGHT),
menubar : this.get(MENUBAR),
location : this.get(LOCATION),
scrollbars : this.get(SCROLLBARS),
resizable : this.get(RESIZEABLE),
toolbar : this.get(TOOLBAR),
status : this.get(STATUS),
directories : this.get(DIRECTORIES),
fullscreen : this.get(FULLSCREEN),
dependent : this.get(DEPENDENT)
width: this.get(WIDTH),
height: this.get(HEIGHT),
menubar: this.get(MENUBAR),
location: this.get(LOCATION),
scrollbars: this.get(SCROLLBARS),
resizable: this.get(RESIZEABLE),
toolbar: this.get(TOOLBAR),
status: this.get(STATUS),
directories: this.get(DIRECTORIES),
fullscreen: this.get(FULLSCREEN),
dependent: this.get(DEPENDENT)
};
},
readOnly : true
readOnly: true
},
width : {value : 600},
height : {value : 450},
menubar : {value : false},
location : {value : false},
scrollbars : {value : true},
resizable : {value : true},
toolbar : {value : true},
status : {value : true},
directories : {value : false},
fullscreen : {value : false},
dependent : {value : true}
width: {value: 600},
height: {value: 450},
menubar: {value: false},
location: {value: false},
scrollbars: {value: true},
resizable: {value: true},
toolbar: {value: true},
status: {value: true},
directories: {value: false},
fullscreen: {value: false},
dependent: {value: true}
}
});
@@ -18,33 +18,33 @@ AUTOLINKER = function() {
AUTOLINKER.superclass.constructor.apply(this, arguments);
};
Y.extend(AUTOLINKER, Y.Base, {
overlay : null,
overlay: null,
alertpanels: {},
initializer : function() {
initializer: function() {
var self = this;
require(['core/event'], function(event) {
Y.delegate('click', function(e){
Y.delegate('click', function(e) {
e.preventDefault();
//display a progress indicator
// display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
headerContent: title,
bodyContent: content
}),
fullurl,
cfg;
self.overlay = o;
o.render(Y.one(document.body));
//Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php','showentry_ajax.php');
// Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php', 'showentry_ajax.php');
cfg = {
method: 'get',
context : self,
context: self,
on: {
success: function(id, o) {
this.display_callback(o.responseText, event);
@@ -54,7 +54,7 @@ Y.extend(AUTOLINKER, Y.Base, {
if (M.cfg.developerdebug) {
o.statusText += ' (' + fullurl + ')';
}
new M.core.exception({ message: debuginfo });
new M.core.exception({message: debuginfo});
}
}
};
@@ -68,7 +68,7 @@ Y.extend(AUTOLINKER, Y.Base, {
* @param {String} content - Content to display
* @param {Object} event The amd event module used to fire events for jquery and yui.
*/
display_callback : function(content, event) {
display_callback: function(content, event) {
var data,
key,
alertpanel,
@@ -77,13 +77,13 @@ Y.extend(AUTOLINKER, Y.Base, {
position;
try {
data = Y.JSON.parse(content);
if (data.success){
this.overlay.hide(); //hide progress indicator
if (data.success) {
this.overlay.hide(); // hide progress indicator
for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, draggable: true,
message:definition, modal:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel = new M.core.alert({title: data.entries[key].concept, draggable: true,
message: definition, modal: false, yesLabel: M.util.get_string('ok', 'moodle')});
// Notify the filters about the modified nodes.
event.notifyFilterContentUpdated(alertpanel.get('boundingBox').getDOMNode());
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
@@ -93,7 +93,7 @@ Y.extend(AUTOLINKER, Y.Base, {
alertpanel.on('complete', this._deletealertpanel, this, alertpanelid);
// We already have some windows opened, so set the right position...
if (!Y.Object.isEmpty(this.alertpanels)){
if (!Y.Object.isEmpty(this.alertpanels)) {
position = this._getLatestWindowPosition();
Y.Node.one(alertpanelid).setXY([position[0] + 10, position[1] + 10]);
}
@@ -105,63 +105,63 @@ Y.extend(AUTOLINKER, Y.Base, {
} else if (data.error) {
new M.core.ajaxException(data);
}
} catch(e) {
} catch (e) {
new M.core.exception(e);
}
return false;
},
_getLatestWindowPosition : function() {
_getLatestWindowPosition: function() {
var lastPosition = [0, 0];
Y.Object.each(this.alertpanels, function(position) {
if (position[0] > lastPosition[0]){
if (position[0] > lastPosition[0]) {
lastPosition = position;
}
});
return lastPosition;
},
_deletealertpanel : function(ev, alertpanelid) {
_deletealertpanel: function(ev, alertpanelid) {
delete this.alertpanels[alertpanelid];
}
}, {
NAME : AUTOLINKERNAME,
ATTRS : {
url : {
validator : Y.Lang.isString,
value : M.cfg.wwwroot+'/mod/glossary/showentry.php'
NAME: AUTOLINKERNAME,
ATTRS: {
url: {
validator: Y.Lang.isString,
value: M.cfg.wwwroot + '/mod/glossary/showentry.php'
},
name : {
validator : Y.Lang.isString,
value : 'glossaryconcept'
name: {
validator: Y.Lang.isString,
value: 'glossaryconcept'
},
options : {
getter : function() {
options: {
getter: function() {
return {
width : this.get(WIDTH),
height : this.get(HEIGHT),
menubar : this.get(MENUBAR),
location : this.get(LOCATION),
scrollbars : this.get(SCROLLBARS),
resizable : this.get(RESIZEABLE),
toolbar : this.get(TOOLBAR),
status : this.get(STATUS),
directories : this.get(DIRECTORIES),
fullscreen : this.get(FULLSCREEN),
dependent : this.get(DEPENDENT)
width: this.get(WIDTH),
height: this.get(HEIGHT),
menubar: this.get(MENUBAR),
location: this.get(LOCATION),
scrollbars: this.get(SCROLLBARS),
resizable: this.get(RESIZEABLE),
toolbar: this.get(TOOLBAR),
status: this.get(STATUS),
directories: this.get(DIRECTORIES),
fullscreen: this.get(FULLSCREEN),
dependent: this.get(DEPENDENT)
};
},
readOnly : true
readOnly: true
},
width : {value : 600},
height : {value : 450},
menubar : {value : false},
location : {value : false},
scrollbars : {value : true},
resizable : {value : true},
toolbar : {value : true},
status : {value : true},
directories : {value : false},
fullscreen : {value : false},
dependent : {value : true}
width: {value: 600},
height: {value: 450},
menubar: {value: false},
location: {value: false},
scrollbars: {value: true},
resizable: {value: true},
toolbar: {value: true},
status: {value: true},
directories: {value: false},
fullscreen: {value: false},
dependent: {value: true}
}
});
+53 -53
View File
@@ -16,33 +16,33 @@ AUTOLINKER = function() {
AUTOLINKER.superclass.constructor.apply(this, arguments);
};
Y.extend(AUTOLINKER, Y.Base, {
overlay : null,
overlay: null,
alertpanels: {},
initializer : function() {
initializer: function() {
var self = this;
require(['core/event'], function(event) {
Y.delegate('click', function(e){
Y.delegate('click', function(e) {
e.preventDefault();
//display a progress indicator
// display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent : title,
bodyContent : content
headerContent: title,
bodyContent: content
}),
fullurl,
cfg;
self.overlay = o;
o.render(Y.one(document.body));
//Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php','showentry_ajax.php');
// Switch over to the ajax url and fetch the glossary item
fullurl = this.getAttribute('href').replace('showentry.php', 'showentry_ajax.php');
cfg = {
method: 'get',
context : self,
context: self,
on: {
success: function(id, o) {
this.display_callback(o.responseText, event);
@@ -52,7 +52,7 @@ Y.extend(AUTOLINKER, Y.Base, {
if (M.cfg.developerdebug) {
o.statusText += ' (' + fullurl + ')';
}
new M.core.exception({ message: debuginfo });
new M.core.exception({message: debuginfo});
}
}
};
@@ -66,7 +66,7 @@ Y.extend(AUTOLINKER, Y.Base, {
* @param {String} content - Content to display
* @param {Object} event The amd event module used to fire events for jquery and yui.
*/
display_callback : function(content, event) {
display_callback: function(content, event) {
var data,
key,
alertpanel,
@@ -75,13 +75,13 @@ Y.extend(AUTOLINKER, Y.Base, {
position;
try {
data = Y.JSON.parse(content);
if (data.success){
this.overlay.hide(); //hide progress indicator
if (data.success) {
this.overlay.hide(); // hide progress indicator
for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, draggable: true,
message:definition, modal:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel = new M.core.alert({title: data.entries[key].concept, draggable: true,
message: definition, modal: false, yesLabel: M.util.get_string('ok', 'moodle')});
// Notify the filters about the modified nodes.
event.notifyFilterContentUpdated(alertpanel.get('boundingBox').getDOMNode());
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
@@ -91,7 +91,7 @@ Y.extend(AUTOLINKER, Y.Base, {
alertpanel.on('complete', this._deletealertpanel, this, alertpanelid);
// We already have some windows opened, so set the right position...
if (!Y.Object.isEmpty(this.alertpanels)){
if (!Y.Object.isEmpty(this.alertpanels)) {
position = this._getLatestWindowPosition();
Y.Node.one(alertpanelid).setXY([position[0] + 10, position[1] + 10]);
}
@@ -103,63 +103,63 @@ Y.extend(AUTOLINKER, Y.Base, {
} else if (data.error) {
new M.core.ajaxException(data);
}
} catch(e) {
} catch (e) {
new M.core.exception(e);
}
return false;
},
_getLatestWindowPosition : function() {
_getLatestWindowPosition: function() {
var lastPosition = [0, 0];
Y.Object.each(this.alertpanels, function(position) {
if (position[0] > lastPosition[0]){
if (position[0] > lastPosition[0]) {
lastPosition = position;
}
});
return lastPosition;
},
_deletealertpanel : function(ev, alertpanelid) {
_deletealertpanel: function(ev, alertpanelid) {
delete this.alertpanels[alertpanelid];
}
}, {
NAME : AUTOLINKERNAME,
ATTRS : {
url : {
validator : Y.Lang.isString,
value : M.cfg.wwwroot+'/mod/glossary/showentry.php'
NAME: AUTOLINKERNAME,
ATTRS: {
url: {
validator: Y.Lang.isString,
value: M.cfg.wwwroot + '/mod/glossary/showentry.php'
},
name : {
validator : Y.Lang.isString,
value : 'glossaryconcept'
name: {
validator: Y.Lang.isString,
value: 'glossaryconcept'
},
options : {
getter : function() {
options: {
getter: function() {
return {
width : this.get(WIDTH),
height : this.get(HEIGHT),
menubar : this.get(MENUBAR),
location : this.get(LOCATION),
scrollbars : this.get(SCROLLBARS),
resizable : this.get(RESIZEABLE),
toolbar : this.get(TOOLBAR),
status : this.get(STATUS),
directories : this.get(DIRECTORIES),
fullscreen : this.get(FULLSCREEN),
dependent : this.get(DEPENDENT)
width: this.get(WIDTH),
height: this.get(HEIGHT),
menubar: this.get(MENUBAR),
location: this.get(LOCATION),
scrollbars: this.get(SCROLLBARS),
resizable: this.get(RESIZEABLE),
toolbar: this.get(TOOLBAR),
status: this.get(STATUS),
directories: this.get(DIRECTORIES),
fullscreen: this.get(FULLSCREEN),
dependent: this.get(DEPENDENT)
};
},
readOnly : true
readOnly: true
},
width : {value : 600},
height : {value : 450},
menubar : {value : false},
location : {value : false},
scrollbars : {value : true},
resizable : {value : true},
toolbar : {value : true},
status : {value : true},
directories : {value : false},
fullscreen : {value : false},
dependent : {value : true}
width: {value: 600},
height: {value: 450},
menubar: {value: false},
location: {value: false},
scrollbars: {value: true},
resizable: {value: true},
toolbar: {value: true},
status: {value: true},
directories: {value: false},
fullscreen: {value: false},
dependent: {value: true}
}
});
@@ -77,7 +77,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
if (!this._configured) {
var lang = this._lang;
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Hub.Queue(function() {
window.MathJax.Localization.setLocale(lang);
});
window.MathJax.Hub.Configured();
@@ -120,7 +120,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
// Set the process section delay to 0 when updating the formula.
window.MathJax.Hub.processSectionDelay = 0;
self._setLocale();
event.nodes.each(function (node) {
event.nodes.each(function(node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
});
@@ -77,7 +77,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
if (!this._configured) {
var lang = this._lang;
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Hub.Queue(function() {
window.MathJax.Localization.setLocale(lang);
});
window.MathJax.Hub.Configured();
@@ -120,7 +120,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
// Set the process section delay to 0 when updating the formula.
window.MathJax.Hub.processSectionDelay = 0;
self._setLocale();
event.nodes.each(function (node) {
event.nodes.each(function(node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
});
+2 -2
View File
@@ -75,7 +75,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
if (!this._configured) {
var lang = this._lang;
if (typeof window.MathJax !== "undefined") {
window.MathJax.Hub.Queue(function () {
window.MathJax.Hub.Queue(function() {
window.MathJax.Localization.setLocale(lang);
});
window.MathJax.Hub.Configured();
@@ -118,7 +118,7 @@ M.filter_mathjaxloader = M.filter_mathjaxloader || {
// Set the process section delay to 0 when updating the formula.
window.MathJax.Hub.processSectionDelay = 0;
self._setLocale();
event.nodes.each(function (node) {
event.nodes.each(function(node) {
node.all('.filter_mathjaxloader_equation').each(function(node) {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node.getDOMNode()]);
});
@@ -182,7 +182,7 @@ CSS.FLOATING = 'floating';
function FloatingHeaders() {}
FloatingHeaders.ATTRS= {
FloatingHeaders.ATTRS = {
};
FloatingHeaders.prototype = {
@@ -629,14 +629,14 @@ FloatingHeaders.prototype = {
userColumn.each(function(node) {
var height = node.getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var allHeight = node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
// Create and configure the new container.
@@ -1084,17 +1084,17 @@ FloatingHeaders.prototype = {
this.userColumn.all('.cell').each(function(cell, idx) {
var height = userCells.item(idx).getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var node = userCells.item(idx);
var allHeight = node.getDOMNode ?
node.getDOMNode().getBoundingClientRect().height :
node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
cell.setStyles({
@@ -182,7 +182,7 @@ CSS.FLOATING = 'floating';
function FloatingHeaders() {}
FloatingHeaders.ATTRS= {
FloatingHeaders.ATTRS = {
};
FloatingHeaders.prototype = {
@@ -629,14 +629,14 @@ FloatingHeaders.prototype = {
userColumn.each(function(node) {
var height = node.getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var allHeight = node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
// Create and configure the new container.
@@ -1083,17 +1083,17 @@ FloatingHeaders.prototype = {
this.userColumn.all('.cell').each(function(cell, idx) {
var height = userCells.item(idx).getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var node = userCells.item(idx);
var allHeight = node.getDOMNode ?
node.getDOMNode().getBoundingClientRect().height :
node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
cell.setStyles({
@@ -38,7 +38,7 @@ CSS.FLOATING = 'floating';
function FloatingHeaders() {}
FloatingHeaders.ATTRS= {
FloatingHeaders.ATTRS = {
};
FloatingHeaders.prototype = {
@@ -485,14 +485,14 @@ FloatingHeaders.prototype = {
userColumn.each(function(node) {
var height = node.getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var allHeight = node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
// Create and configure the new container.
@@ -940,17 +940,17 @@ FloatingHeaders.prototype = {
this.userColumn.all('.cell').each(function(cell, idx) {
var height = userCells.item(idx).getComputedStyle(HEIGHT);
// Nasty hack to account for Internet Explorer
if(Y.UA.ie !== 0) {
if (Y.UA.ie !== 0) {
var node = userCells.item(idx);
var allHeight = node.getDOMNode ?
node.getDOMNode().getBoundingClientRect().height :
node.get('offsetHeight');
var marginHeight = parseInt(node.getComputedStyle('marginTop'),10) +
parseInt(node.getComputedStyle('marginBottom'),10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'),10) +
parseInt(node.getComputedStyle('paddingBottom'),10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'),10) +
parseInt(node.getComputedStyle('borderBottomWidth'),10);
var marginHeight = parseInt(node.getComputedStyle('marginTop'), 10) +
parseInt(node.getComputedStyle('marginBottom'), 10);
var paddingHeight = parseInt(node.getComputedStyle('paddingTop'), 10) +
parseInt(node.getComputedStyle('paddingBottom'), 10);
var borderHeight = parseInt(node.getComputedStyle('borderTopWidth'), 10) +
parseInt(node.getComputedStyle('borderBottomWidth'), 10);
height = allHeight - marginHeight - paddingHeight - borderHeight;
}
cell.setStyles({
@@ -260,7 +260,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
var params;
if (append) {
this.set(USP.PAGE, this.get(USP.PAGE)+1);
this.set(USP.PAGE, this.get(USP.PAGE) + 1);
} else {
this.set(USP.USERCOUNT, 0);
this.set(USP.PAGE, 0);
@@ -273,14 +273,14 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
params.perpage = this.get(USP.PERPAGE);
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
method: 'POST',
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
end: this.postSearch
},
context:this,
context: this,
"arguments": { // Quoted because this is a reserved keyword.
append: append
}
@@ -457,11 +457,11 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
bb.one(SELECTORS.RESULTSCOUNT).setHTML(M.util.get_string('foundnusers', COMPONENT, totalUsers));
}
content = Y.Node.create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
content = Y.Node.create('<div class="' + CSS.SEARCHRESULTS + '"></div>')
.append(users);
if (result.response.totalusers > (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'">' +
'<a href="#" role="button">'+M.util.get_string('loadmoreusers', COMPONENT)+'</a></div>');
if (result.response.totalusers > (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="' + CSS.MORERESULTS + '">' +
'<a href="#" role="button">' + M.util.get_string('loadmoreusers', COMPONENT) + '</a></div>');
fetchmore.one('a').on('click', this.search, this, true);
fetchmore.one('a').on('key', this.search, 'space', this, true);
content.append(fetchmore);
@@ -469,7 +469,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
this.setContent(content);
} else {
if (totalUsers <= (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
if (totalUsers <= (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
bb.one(SELECTORS.MORERESULTS).remove();
}
}
@@ -260,7 +260,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
var params;
if (append) {
this.set(USP.PAGE, this.get(USP.PAGE)+1);
this.set(USP.PAGE, this.get(USP.PAGE) + 1);
} else {
this.set(USP.USERCOUNT, 0);
this.set(USP.PAGE, 0);
@@ -273,14 +273,14 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
params.perpage = this.get(USP.PERPAGE);
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
method: 'POST',
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
end: this.postSearch
},
context:this,
context: this,
"arguments": { // Quoted because this is a reserved keyword.
append: append
}
@@ -457,11 +457,11 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
bb.one(SELECTORS.RESULTSCOUNT).setHTML(M.util.get_string('foundnusers', COMPONENT, totalUsers));
}
content = Y.Node.create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
content = Y.Node.create('<div class="' + CSS.SEARCHRESULTS + '"></div>')
.append(users);
if (result.response.totalusers > (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'">' +
'<a href="#" role="button">'+M.util.get_string('loadmoreusers', COMPONENT)+'</a></div>');
if (result.response.totalusers > (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="' + CSS.MORERESULTS + '">' +
'<a href="#" role="button">' + M.util.get_string('loadmoreusers', COMPONENT) + '</a></div>');
fetchmore.one('a').on('click', this.search, this, true);
fetchmore.one('a').on('key', this.search, 'space', this, true);
content.append(fetchmore);
@@ -469,7 +469,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
this.setContent(content);
} else {
if (totalUsers <= (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
if (totalUsers <= (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
bb.one(SELECTORS.MORERESULTS).remove();
}
}
@@ -258,7 +258,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
var params;
if (append) {
this.set(USP.PAGE, this.get(USP.PAGE)+1);
this.set(USP.PAGE, this.get(USP.PAGE) + 1);
} else {
this.set(USP.USERCOUNT, 0);
this.set(USP.PAGE, 0);
@@ -271,14 +271,14 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
params.perpage = this.get(USP.PERPAGE);
Y.io(M.cfg.wwwroot + this.get(USP.AJAXURL), {
method:'POST',
method: 'POST',
data: window.build_querystring(params),
on: {
start: this.preSearch,
complete: this.processSearchResults,
end: this.postSearch
},
context:this,
context: this,
"arguments": { // Quoted because this is a reserved keyword.
append: append
}
@@ -455,11 +455,11 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
bb.one(SELECTORS.RESULTSCOUNT).setHTML(M.util.get_string('foundnusers', COMPONENT, totalUsers));
}
content = Y.Node.create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
content = Y.Node.create('<div class="' + CSS.SEARCHRESULTS + '"></div>')
.append(users);
if (result.response.totalusers > (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'">' +
'<a href="#" role="button">'+M.util.get_string('loadmoreusers', COMPONENT)+'</a></div>');
if (result.response.totalusers > (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
fetchmore = Y.Node.create('<div class="' + CSS.MORERESULTS + '">' +
'<a href="#" role="button">' + M.util.get_string('loadmoreusers', COMPONENT) + '</a></div>');
fetchmore.one('a').on('click', this.search, this, true);
fetchmore.one('a').on('key', this.search, 'space', this, true);
content.append(fetchmore);
@@ -467,7 +467,7 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
}
this.setContent(content);
} else {
if (totalUsers <= (this.get(USP.PAGE)+1)*this.get(USP.PERPAGE)) {
if (totalUsers <= (this.get(USP.PAGE) + 1) * this.get(USP.PERPAGE)) {
bb.one(SELECTORS.MORERESULTS).remove();
}
}
@@ -109,7 +109,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) {
this.editor.all('img').each(function(img) {
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
@@ -120,7 +120,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
this._addWarnings(list, M.util.get_string('imagesmissingalt', COMPONENT), problemNodes, true);
problemNodes = [];
this.editor.all('*').each(function (node) {
this.editor.all('*').each(function(node) {
var foreground,
background,
ratio,
@@ -149,7 +149,8 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
' Luminance 2: ' + lum2);
// We only want the highest node with dodgy contrast reported.
var i = 0, found = false;
var i = 0;
var found = false;
for (i = 0; i < problemNodes.length; i++) {
if (node.ancestors('*').indexOf(problemNodes[i]) !== -1) {
// Do not add node - it already has a parent in the list.
@@ -177,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
@@ -187,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
@@ -197,10 +198,10 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no row/col headers
problemNodes = [];
this.editor.all('table').each(function (table) {
this.editor.all('table').each(function(table) {
if (table.one('tr').one('td')) {
// First row has a non-header cell, so all rows must have at least one header.
table.all('tr').some(function (row) {
table.all('tr').some(function(row) {
var header = row.one('th');
if (!header || (header.get('text').trim() === '')) {
problemNodes.push(table);
@@ -211,7 +212,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
} else {
// First row must have at least one header then.
var hasHeader = false;
table.one('tr').all('th').some(function (header) {
table.one('tr').all('th').some(function(header) {
hasHeader = true;
if (header.get('text').trim() === '') {
problemNodes.push(table);
@@ -296,9 +297,9 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
var part1 = function(a) {
a = parseInt(a, 10) / 255.0;
if (a <= 0.03928) {
a = a/12.92;
a = a / 12.92;
} else {
a = Math.pow(((a + 0.055)/1.055), 2.4);
a = Math.pow(((a + 0.055) / 1.055), 2.4);
}
return a;
};
@@ -109,7 +109,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) {
this.editor.all('img').each(function(img) {
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
@@ -120,7 +120,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
this._addWarnings(list, M.util.get_string('imagesmissingalt', COMPONENT), problemNodes, true);
problemNodes = [];
this.editor.all('*').each(function (node) {
this.editor.all('*').each(function(node) {
var foreground,
background,
ratio,
@@ -144,7 +144,8 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
if (ratio <= 4.5) {
// We only want the highest node with dodgy contrast reported.
var i = 0, found = false;
var i = 0;
var found = false;
for (i = 0; i < problemNodes.length; i++) {
if (node.ancestors('*').indexOf(problemNodes[i]) !== -1) {
// Do not add node - it already has a parent in the list.
@@ -172,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
@@ -182,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
@@ -192,10 +193,10 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no row/col headers
problemNodes = [];
this.editor.all('table').each(function (table) {
this.editor.all('table').each(function(table) {
if (table.one('tr').one('td')) {
// First row has a non-header cell, so all rows must have at least one header.
table.all('tr').some(function (row) {
table.all('tr').some(function(row) {
var header = row.one('th');
if (!header || (header.get('text').trim() === '')) {
problemNodes.push(table);
@@ -206,7 +207,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
} else {
// First row must have at least one header then.
var hasHeader = false;
table.one('tr').all('th').some(function (header) {
table.one('tr').all('th').some(function(header) {
hasHeader = true;
if (header.get('text').trim() === '') {
problemNodes.push(table);
@@ -291,9 +292,9 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
var part1 = function(a) {
a = parseInt(a, 10) / 255.0;
if (a <= 0.03928) {
a = a/12.92;
a = a / 12.92;
} else {
a = Math.pow(((a + 0.055)/1.055), 2.4);
a = Math.pow(((a + 0.055) / 1.055), 2.4);
}
return a;
};
@@ -107,7 +107,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) {
this.editor.all('img').each(function(img) {
var alt = img.getAttribute('alt');
if (typeof alt === 'undefined' || alt === '') {
if (img.getAttribute('role') !== 'presentation') {
@@ -118,7 +118,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
this._addWarnings(list, M.util.get_string('imagesmissingalt', COMPONENT), problemNodes, true);
problemNodes = [];
this.editor.all('*').each(function (node) {
this.editor.all('*').each(function(node) {
var foreground,
background,
ratio,
@@ -147,7 +147,8 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
' Luminance 2: ' + lum2);
// We only want the highest node with dodgy contrast reported.
var i = 0, found = false;
var i = 0;
var found = false;
for (i = 0; i < problemNodes.length; i++) {
if (node.ancestors('*').indexOf(problemNodes[i]) !== -1) {
// Do not add node - it already has a parent in the list.
@@ -175,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('caption');
if (caption === null || caption.get('text').trim() === '') {
problemNodes.push(table);
@@ -185,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) {
this.editor.all('table').each(function(table) {
var caption = table.one('[colspan],[rowspan]');
if (caption !== null) {
problemNodes.push(table);
@@ -195,10 +196,10 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
// Check for tables with no row/col headers
problemNodes = [];
this.editor.all('table').each(function (table) {
this.editor.all('table').each(function(table) {
if (table.one('tr').one('td')) {
// First row has a non-header cell, so all rows must have at least one header.
table.all('tr').some(function (row) {
table.all('tr').some(function(row) {
var header = row.one('th');
if (!header || (header.get('text').trim() === '')) {
problemNodes.push(table);
@@ -209,7 +210,7 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
} else {
// First row must have at least one header then.
var hasHeader = false;
table.one('tr').all('th').some(function (header) {
table.one('tr').all('th').some(function(header) {
hasHeader = true;
if (header.get('text').trim() === '') {
problemNodes.push(table);
@@ -294,9 +295,9 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M.
var part1 = function(a) {
a = parseInt(a, 10) / 255.0;
if (a <= 0.03928) {
a = a/12.92;
a = a / 12.92;
} else {
a = Math.pow(((a + 0.055)/1.055), 2.4);
a = Math.pow(((a + 0.055) / 1.055), 2.4);
}
return a;
};
@@ -45,277 +45,277 @@ var COMPONENTNAME = 'atto_charmap',
* @type {Array}
*/
CHARMAP = [
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
// Finance.
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
// Signs.
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
// Quotations.
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
// Math / logical.
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false,'similarto'],
['&cong;', '&#8773;', false,'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false,'elementof'],
['&notin;', '&#8713;', false,'notanelementof'],
['&ni;', '&#8715;', false,'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false,'logicaland'],
['&or;', '&#8744;', false,'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false,'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false,'forall'],
['&exist;', '&#8707;', false,'thereexists'],
['&empty;', '&#8709;', false,'diameter'],
['&nabla;', '&#8711;', false,'backwarddifference'],
['&lowast;', '&#8727;', false,'asteriskoperator'],
['&prop;', '&#8733;', false,'proportionalto'],
['&ang;', '&#8736;', false,'angle'],
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false, 'similarto'],
['&cong;', '&#8773;', false, 'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false, 'elementof'],
['&notin;', '&#8713;', false, 'notanelementof'],
['&ni;', '&#8715;', false, 'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false, 'logicaland'],
['&or;', '&#8744;', false, 'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false, 'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false, 'forall'],
['&exist;', '&#8707;', false, 'thereexists'],
['&empty;', '&#8709;', false, 'diameter'],
['&nabla;', '&#8711;', false, 'backwarddifference'],
['&lowast;', '&#8727;', false, 'asteriskoperator'],
['&prop;', '&#8733;', false, 'proportionalto'],
['&ang;', '&#8736;', false, 'angle'],
// Undefined.
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
// Alphabetical special chars.
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
// Symbols.
['&alefsym;', '&#8501;', false,'alefsymbol'],
['&piv;', '&#982;', false,'pisymbol'],
['&real;', '&#8476;', false,'realpartsymbol'],
['&thetasym;','&#977;', false,'thetasymbol'],
['&upsih;', '&#978;', false,'upsilonhooksymbol'],
['&weierp;', '&#8472;', false,'weierstrassp'],
['&image;', '&#8465;', false,'imaginarypart'],
['&alefsym;', '&#8501;', false, 'alefsymbol'],
['&piv;', '&#982;', false, 'pisymbol'],
['&real;', '&#8476;', false, 'realpartsymbol'],
['&thetasym;', '&#977;', false, 'thetasymbol'],
['&upsih;', '&#978;', false, 'upsilonhooksymbol'],
['&weierp;', '&#8472;', false, 'weierstrassp'],
['&image;', '&#8465;', false, 'imaginarypart'],
// Arrows.
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false,'carriagereturn'],
['&lArr;', '&#8656;', false,'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false,'upwardsdoublearrow'],
['&rArr;', '&#8658;', false,'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false,'downwardsdoublearrow'],
['&hArr;', '&#8660;', false,'leftrightdoublearrow'],
['&there4;', '&#8756;', false,'therefore'],
['&sub;', '&#8834;', false,'subsetof'],
['&sup;', '&#8835;', false,'supersetof'],
['&nsub;', '&#8836;', false,'notasubsetof'],
['&sube;', '&#8838;', false,'subsetoforequalto'],
['&supe;', '&#8839;', false,'supersetoforequalto'],
['&oplus;', '&#8853;', false,'circledplus'],
['&otimes;', '&#8855;', false,'circledtimes'],
['&perp;', '&#8869;', false,'perpendicular'],
['&sdot;', '&#8901;', false,'dotoperator'],
['&lceil;', '&#8968;', false,'leftceiling'],
['&rceil;', '&#8969;', false,'rightceiling'],
['&lfloor;', '&#8970;', false,'leftfloor'],
['&rfloor;', '&#8971;', false,'rightfloor'],
['&lang;', '&#9001;', false,'leftpointinganglebracket'],
['&rang;', '&#9002;', false,'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false,'enspace'],
['&emsp;', '&#8195;', false,'emspace'],
['&thinsp;', '&#8201;', false,'thinspace'],
['&zwnj;', '&#8204;', false,'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false,'zerowidthjoiner'],
['&lrm;', '&#8206;', false,'lefttorightmark'],
['&rlm;', '&#8207;', false,'righttoleftmark'],
['&shy;', '&#173;', false,'softhyphen']
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false, 'carriagereturn'],
['&lArr;', '&#8656;', false, 'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false, 'upwardsdoublearrow'],
['&rArr;', '&#8658;', false, 'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false, 'downwardsdoublearrow'],
['&hArr;', '&#8660;', false, 'leftrightdoublearrow'],
['&there4;', '&#8756;', false, 'therefore'],
['&sub;', '&#8834;', false, 'subsetof'],
['&sup;', '&#8835;', false, 'supersetof'],
['&nsub;', '&#8836;', false, 'notasubsetof'],
['&sube;', '&#8838;', false, 'subsetoforequalto'],
['&supe;', '&#8839;', false, 'supersetoforequalto'],
['&oplus;', '&#8853;', false, 'circledplus'],
['&otimes;', '&#8855;', false, 'circledtimes'],
['&perp;', '&#8869;', false, 'perpendicular'],
['&sdot;', '&#8901;', false, 'dotoperator'],
['&lceil;', '&#8968;', false, 'leftceiling'],
['&rceil;', '&#8969;', false, 'rightceiling'],
['&lfloor;', '&#8970;', false, 'leftfloor'],
['&rfloor;', '&#8971;', false, 'rightfloor'],
['&lang;', '&#9001;', false, 'leftpointinganglebracket'],
['&rang;', '&#9002;', false, 'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false, 'enspace'],
['&emsp;', '&#8195;', false, 'emspace'],
['&thinsp;', '&#8201;', false, 'thinspace'],
['&zwnj;', '&#8204;', false, 'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false, 'zerowidthjoiner'],
['&lrm;', '&#8206;', false, 'lefttorightmark'],
['&rlm;', '&#8207;', false, 'righttoleftmark'],
['&shy;', '&#173;', false, 'softhyphen']
];
/**
@@ -45,277 +45,277 @@ var COMPONENTNAME = 'atto_charmap',
* @type {Array}
*/
CHARMAP = [
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
// Finance.
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
// Signs.
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
// Quotations.
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
// Math / logical.
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false,'similarto'],
['&cong;', '&#8773;', false,'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false,'elementof'],
['&notin;', '&#8713;', false,'notanelementof'],
['&ni;', '&#8715;', false,'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false,'logicaland'],
['&or;', '&#8744;', false,'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false,'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false,'forall'],
['&exist;', '&#8707;', false,'thereexists'],
['&empty;', '&#8709;', false,'diameter'],
['&nabla;', '&#8711;', false,'backwarddifference'],
['&lowast;', '&#8727;', false,'asteriskoperator'],
['&prop;', '&#8733;', false,'proportionalto'],
['&ang;', '&#8736;', false,'angle'],
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false, 'similarto'],
['&cong;', '&#8773;', false, 'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false, 'elementof'],
['&notin;', '&#8713;', false, 'notanelementof'],
['&ni;', '&#8715;', false, 'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false, 'logicaland'],
['&or;', '&#8744;', false, 'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false, 'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false, 'forall'],
['&exist;', '&#8707;', false, 'thereexists'],
['&empty;', '&#8709;', false, 'diameter'],
['&nabla;', '&#8711;', false, 'backwarddifference'],
['&lowast;', '&#8727;', false, 'asteriskoperator'],
['&prop;', '&#8733;', false, 'proportionalto'],
['&ang;', '&#8736;', false, 'angle'],
// Undefined.
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
// Alphabetical special chars.
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
// Symbols.
['&alefsym;', '&#8501;', false,'alefsymbol'],
['&piv;', '&#982;', false,'pisymbol'],
['&real;', '&#8476;', false,'realpartsymbol'],
['&thetasym;','&#977;', false,'thetasymbol'],
['&upsih;', '&#978;', false,'upsilonhooksymbol'],
['&weierp;', '&#8472;', false,'weierstrassp'],
['&image;', '&#8465;', false,'imaginarypart'],
['&alefsym;', '&#8501;', false, 'alefsymbol'],
['&piv;', '&#982;', false, 'pisymbol'],
['&real;', '&#8476;', false, 'realpartsymbol'],
['&thetasym;', '&#977;', false, 'thetasymbol'],
['&upsih;', '&#978;', false, 'upsilonhooksymbol'],
['&weierp;', '&#8472;', false, 'weierstrassp'],
['&image;', '&#8465;', false, 'imaginarypart'],
// Arrows.
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false,'carriagereturn'],
['&lArr;', '&#8656;', false,'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false,'upwardsdoublearrow'],
['&rArr;', '&#8658;', false,'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false,'downwardsdoublearrow'],
['&hArr;', '&#8660;', false,'leftrightdoublearrow'],
['&there4;', '&#8756;', false,'therefore'],
['&sub;', '&#8834;', false,'subsetof'],
['&sup;', '&#8835;', false,'supersetof'],
['&nsub;', '&#8836;', false,'notasubsetof'],
['&sube;', '&#8838;', false,'subsetoforequalto'],
['&supe;', '&#8839;', false,'supersetoforequalto'],
['&oplus;', '&#8853;', false,'circledplus'],
['&otimes;', '&#8855;', false,'circledtimes'],
['&perp;', '&#8869;', false,'perpendicular'],
['&sdot;', '&#8901;', false,'dotoperator'],
['&lceil;', '&#8968;', false,'leftceiling'],
['&rceil;', '&#8969;', false,'rightceiling'],
['&lfloor;', '&#8970;', false,'leftfloor'],
['&rfloor;', '&#8971;', false,'rightfloor'],
['&lang;', '&#9001;', false,'leftpointinganglebracket'],
['&rang;', '&#9002;', false,'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false,'enspace'],
['&emsp;', '&#8195;', false,'emspace'],
['&thinsp;', '&#8201;', false,'thinspace'],
['&zwnj;', '&#8204;', false,'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false,'zerowidthjoiner'],
['&lrm;', '&#8206;', false,'lefttorightmark'],
['&rlm;', '&#8207;', false,'righttoleftmark'],
['&shy;', '&#173;', false,'softhyphen']
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false, 'carriagereturn'],
['&lArr;', '&#8656;', false, 'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false, 'upwardsdoublearrow'],
['&rArr;', '&#8658;', false, 'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false, 'downwardsdoublearrow'],
['&hArr;', '&#8660;', false, 'leftrightdoublearrow'],
['&there4;', '&#8756;', false, 'therefore'],
['&sub;', '&#8834;', false, 'subsetof'],
['&sup;', '&#8835;', false, 'supersetof'],
['&nsub;', '&#8836;', false, 'notasubsetof'],
['&sube;', '&#8838;', false, 'subsetoforequalto'],
['&supe;', '&#8839;', false, 'supersetoforequalto'],
['&oplus;', '&#8853;', false, 'circledplus'],
['&otimes;', '&#8855;', false, 'circledtimes'],
['&perp;', '&#8869;', false, 'perpendicular'],
['&sdot;', '&#8901;', false, 'dotoperator'],
['&lceil;', '&#8968;', false, 'leftceiling'],
['&rceil;', '&#8969;', false, 'rightceiling'],
['&lfloor;', '&#8970;', false, 'leftfloor'],
['&rfloor;', '&#8971;', false, 'rightfloor'],
['&lang;', '&#9001;', false, 'leftpointinganglebracket'],
['&rang;', '&#9002;', false, 'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false, 'enspace'],
['&emsp;', '&#8195;', false, 'emspace'],
['&thinsp;', '&#8201;', false, 'thinspace'],
['&zwnj;', '&#8204;', false, 'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false, 'zerowidthjoiner'],
['&lrm;', '&#8206;', false, 'lefttorightmark'],
['&rlm;', '&#8207;', false, 'righttoleftmark'],
['&shy;', '&#173;', false, 'softhyphen']
];
/**
+263 -263
View File
@@ -43,277 +43,277 @@ var COMPONENTNAME = 'atto_charmap',
* @type {Array}
*/
CHARMAP = [
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
['&nbsp;', '&#160;', true, 'nobreakspace'],
['&amp;', '&#38;', true, 'ampersand'],
['&quot;', '&#34;', true, 'quotationmark'],
['&#8253;', '&#8253;', true, 'interrobang'],
// Finance.
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
['&cent;', '&#162;', true, 'centsign'],
['&euro;', '&#8364;', true, 'eurosign'],
['&pound;', '&#163;', true, 'poundsign'],
['&yen;', '&#165;', true, 'yensign'],
// Signs.
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
['&copy;', '&#169;', true, 'copyrightsign'],
['&reg;', '&#174;', true, 'registeredsign'],
['&trade;', '&#8482;', true, 'trademarksign'],
['&permil;', '&#8240;', true, 'permillesign'],
['&micro;', '&#181;', true, 'microsign'],
['&middot;', '&#183;', true, 'middledot'],
['&bull;', '&#8226;', true, 'bullet'],
['&hellip;', '&#8230;', true, 'threedotleader'],
['&prime;', '&#8242;', true, 'minutesfeet'],
['&Prime;', '&#8243;', true, 'secondsinches'],
['&sect;', '&#167;', true, 'sectionsign'],
['&para;', '&#182;', true, 'paragraphsign'],
['&szlig;', '&#223;', true, 'sharpsesszed'],
// Quotations.
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
['&lsaquo;', '&#8249;', true, 'singleleftpointinganglequotationmark'],
['&rsaquo;', '&#8250;', true, 'singlerightpointinganglequotationmark'],
['&laquo;', '&#171;', true, 'leftpointingguillemet'],
['&raquo;', '&#187;', true, 'rightpointingguillemet'],
['&lsquo;', '&#8216;', true, 'leftsinglequotationmark'],
['&rsquo;', '&#8217;', true, 'rightsinglequotationmark'],
['&ldquo;', '&#8220;', true, 'leftdoublequotationmark'],
['&rdquo;', '&#8221;', true, 'rightdoublequotationmark'],
['&sbquo;', '&#8218;', true, 'singlelow9quotationmark'],
['&bdquo;', '&#8222;', true, 'doublelow9quotationmark'],
['&lt;', '&#60;', true, 'lessthansign'],
['&gt;', '&#62;', true, 'greaterthansign'],
['&le;', '&#8804;', true, 'lessthanorequalto'],
['&ge;', '&#8805;', true, 'greaterthanorequalto'],
['&ndash;', '&#8211;', true, 'endash'],
['&mdash;', '&#8212;', true, 'emdash'],
['&macr;', '&#175;', true, 'macron'],
['&oline;', '&#8254;', true, 'overline'],
['&curren;', '&#164;', true, 'currencysign'],
['&brvbar;', '&#166;', true, 'brokenbar'],
['&uml;', '&#168;', true, 'diaeresis'],
['&iexcl;', '&#161;', true, 'invertedexclamationmark'],
['&iquest;', '&#191;', true, 'turnedquestionmark'],
['&circ;', '&#710;', true, 'circumflexaccent'],
['&tilde;', '&#732;', true, 'smalltilde'],
['&deg;', '&#176;', true, 'degreesign'],
['&minus;', '&#8722;', true, 'minussign'],
['&plusmn;', '&#177;', true, 'plusminussign'],
['&divide;', '&#247;', true, 'divisionsign'],
['&frasl;', '&#8260;', true, 'fractionslash'],
['&times;', '&#215;', true, 'multiplicationsign'],
['&sup1;', '&#185;', true, 'superscriptone'],
['&sup2;', '&#178;', true, 'superscripttwo'],
['&sup3;', '&#179;', true, 'superscriptthree'],
['&frac14;', '&#188;', true, 'fractiononequarter'],
['&frac12;', '&#189;', true, 'fractiononehalf'],
['&frac34;', '&#190;', true, 'fractionthreequarters'],
// Math / logical.
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false,'similarto'],
['&cong;', '&#8773;', false,'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false,'elementof'],
['&notin;', '&#8713;', false,'notanelementof'],
['&ni;', '&#8715;', false,'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false,'logicaland'],
['&or;', '&#8744;', false,'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false,'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false,'forall'],
['&exist;', '&#8707;', false,'thereexists'],
['&empty;', '&#8709;', false,'diameter'],
['&nabla;', '&#8711;', false,'backwarddifference'],
['&lowast;', '&#8727;', false,'asteriskoperator'],
['&prop;', '&#8733;', false,'proportionalto'],
['&ang;', '&#8736;', false,'angle'],
['&fnof;', '&#402;', true, 'functionflorin'],
['&int;', '&#8747;', true, 'integral'],
['&sum;', '&#8721;', true, 'narysumation'],
['&infin;', '&#8734;', true, 'infinity'],
['&radic;', '&#8730;', true, 'squareroot'],
['&sim;', '&#8764;', false, 'similarto'],
['&cong;', '&#8773;', false, 'approximatelyequalto'],
['&asymp;', '&#8776;', true, 'almostequalto'],
['&ne;', '&#8800;', true, 'notequalto'],
['&equiv;', '&#8801;', true, 'identicalto'],
['&isin;', '&#8712;', false, 'elementof'],
['&notin;', '&#8713;', false, 'notanelementof'],
['&ni;', '&#8715;', false, 'containsasmember'],
['&prod;', '&#8719;', true, 'naryproduct'],
['&and;', '&#8743;', false, 'logicaland'],
['&or;', '&#8744;', false, 'logicalor'],
['&not;', '&#172;', true, 'notsign'],
['&cap;', '&#8745;', true, 'intersection'],
['&cup;', '&#8746;', false, 'union'],
['&part;', '&#8706;', true, 'partialdifferential'],
['&forall;', '&#8704;', false, 'forall'],
['&exist;', '&#8707;', false, 'thereexists'],
['&empty;', '&#8709;', false, 'diameter'],
['&nabla;', '&#8711;', false, 'backwarddifference'],
['&lowast;', '&#8727;', false, 'asteriskoperator'],
['&prop;', '&#8733;', false, 'proportionalto'],
['&ang;', '&#8736;', false, 'angle'],
// Undefined.
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
['&acute;', '&#180;', true, 'acuteaccent'],
['&cedil;', '&#184;', true, 'cedilla'],
['&ordf;', '&#170;', true, 'feminineordinalindicator'],
['&ordm;', '&#186;', true, 'masculineordinalindicator'],
['&dagger;', '&#8224;', true, 'dagger'],
['&Dagger;', '&#8225;', true, 'doubledagger'],
// Alphabetical special chars.
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
['&Agrave;', '&#192;', true, 'agrave_caps'],
['&Aacute;', '&#193;', true, 'aacute_caps'],
['&Acirc;', '&#194;', true, 'acircumflex_caps'],
['&Atilde;', '&#195;', true, 'atilde_caps'],
['&Auml;', '&#196;', true, 'adiaeresis_caps'],
['&Aring;', '&#197;', true, 'aringabove_caps'],
['&#256;', '&#256;', true, 'amacron_caps'],
['&AElig;', '&#198;', true, 'ligatureae_caps'],
['&Ccedil;', '&#199;', true, 'ccedilla_caps'],
['&Egrave;', '&#200;', true, 'egrave_caps'],
['&Eacute;', '&#201;', true, 'eacute_caps'],
['&Ecirc;', '&#202;', true, 'ecircumflex_caps'],
['&Euml;', '&#203;', true, 'ediaeresis_caps'],
['&#274;', '&#274;', true, 'emacron_caps'],
['&Igrave;', '&#204;', true, 'igrave_caps'],
['&Iacute;', '&#205;', true, 'iacute_caps'],
['&Icirc;', '&#206;', true, 'icircumflex_caps'],
['&Iuml;', '&#207;', true, 'idiaeresis_caps'],
['&#298;', '&#298;', true, 'imacron_caps'],
['&ETH;', '&#208;', true, 'eth_caps'],
['&Ntilde;', '&#209;', true, 'ntilde_caps'],
['&Ograve;', '&#210;', true, 'ograve_caps'],
['&Oacute;', '&#211;', true, 'oacute_caps'],
['&Ocirc;', '&#212;', true, 'ocircumflex_caps'],
['&Otilde;', '&#213;', true, 'otilde_caps'],
['&Ouml;', '&#214;', true, 'odiaeresis_caps'],
['&Oslash;', '&#216;', true, 'oslash_caps'],
['&#332;', '&#332;', true, 'omacron_caps'],
['&OElig;', '&#338;', true, 'ligatureoe_caps'],
['&Scaron;', '&#352;', true, 'scaron_caps'],
['&Ugrave;', '&#217;', true, 'ugrave_caps'],
['&Uacute;', '&#218;', true, 'uacute_caps'],
['&Ucirc;', '&#219;', true, 'ucircumflex_caps'],
['&Uuml;', '&#220;', true, 'udiaeresis_caps'],
['&#362;', '&#362;', true, 'umacron_caps'],
['&Yacute;', '&#221;', true, 'yacute_caps'],
['&Yuml;', '&#376;', true, 'ydiaeresis_caps'],
['&THORN;', '&#222;', true, 'thorn_caps'],
['&agrave;', '&#224;', true, 'agrave'],
['&aacute;', '&#225;', true, 'aacute'],
['&acirc;', '&#226;', true, 'acircumflex'],
['&atilde;', '&#227;', true, 'atilde'],
['&auml;', '&#228;', true, 'adiaeresis'],
['&aring;', '&#229;', true, 'aringabove'],
['&#257;', '&#257;', true, 'amacron'],
['&aelig;', '&#230;', true, 'ligatureae'],
['&ccedil;', '&#231;', true, 'ccedilla'],
['&egrave;', '&#232;', true, 'egrave'],
['&eacute;', '&#233;', true, 'eacute'],
['&ecirc;', '&#234;', true, 'ecircumflex'],
['&euml;', '&#235;', true, 'ediaeresis'],
['&#275;', '&#275;', true, 'emacron'],
['&igrave;', '&#236;', true, 'igrave'],
['&iacute;', '&#237;', true, 'iacute'],
['&icirc;', '&#238;', true, 'icircumflex'],
['&iuml;', '&#239;', true, 'idiaeresis'],
['&#299;', '&#299;', true, 'imacron'],
['&eth;', '&#240;', true, 'eth'],
['&ntilde;', '&#241;', true, 'ntilde'],
['&ograve;', '&#242;', true, 'ograve'],
['&oacute;', '&#243;', true, 'oacute'],
['&ocirc;', '&#244;', true, 'ocircumflex'],
['&otilde;', '&#245;', true, 'otilde'],
['&ouml;', '&#246;', true, 'odiaeresis'],
['&oslash;', '&#248;', true, 'oslash'],
['&#333;', '&#333;', true, 'omacron'],
['&oelig;', '&#339;', true, 'ligatureoe'],
['&scaron;', '&#353;', true, 'scaron'],
['&ugrave;', '&#249;', true, 'ugrave'],
['&uacute;', '&#250;', true, 'uacute'],
['&ucirc;', '&#251;', true, 'ucircumflex'],
['&uuml;', '&#252;', true, 'udiaeresis'],
['&#363;', '&#363;', true, 'umacron'],
['&yacute;', '&#253;', true, 'yacute'],
['&thorn;', '&#254;', true, 'thorn'],
['&yuml;', '&#255;', true, 'ydiaeresis'],
['&Alpha;', '&#913;', true, 'alpha_caps'],
['&Beta;', '&#914;', true, 'beta_caps'],
['&Gamma;', '&#915;', true, 'gamma_caps'],
['&Delta;', '&#916;', true, 'delta_caps'],
['&Epsilon;', '&#917;', true, 'epsilon_caps'],
['&Zeta;', '&#918;', true, 'zeta_caps'],
['&Eta;', '&#919;', true, 'eta_caps'],
['&Theta;', '&#920;', true, 'theta_caps'],
['&Iota;', '&#921;', true, 'iota_caps'],
['&Kappa;', '&#922;', true, 'kappa_caps'],
['&Lambda;', '&#923;', true, 'lambda_caps'],
['&Mu;', '&#924;', true, 'mu_caps'],
['&Nu;', '&#925;', true, 'nu_caps'],
['&Xi;', '&#926;', true, 'xi_caps'],
['&Omicron;', '&#927;', true, 'omicron_caps'],
['&Pi;', '&#928;', true, 'pi_caps'],
['&Rho;', '&#929;', true, 'rho_caps'],
['&Sigma;', '&#931;', true, 'sigma_caps'],
['&Tau;', '&#932;', true, 'tau_caps'],
['&Upsilon;', '&#933;', true, 'upsilon_caps'],
['&Phi;', '&#934;', true, 'phi_caps'],
['&Chi;', '&#935;', true, 'chi_caps'],
['&Psi;', '&#936;', true, 'psi_caps'],
['&Omega;', '&#937;', true, 'omega_caps'],
['&alpha;', '&#945;', true, 'alpha'],
['&beta;', '&#946;', true, 'beta'],
['&gamma;', '&#947;', true, 'gamma'],
['&delta;', '&#948;', true, 'delta'],
['&epsilon;', '&#949;', true, 'epsilon'],
['&zeta;', '&#950;', true, 'zeta'],
['&eta;', '&#951;', true, 'eta'],
['&theta;', '&#952;', true, 'theta'],
['&iota;', '&#953;', true, 'iota'],
['&kappa;', '&#954;', true, 'kappa'],
['&lambda;', '&#955;', true, 'lambda'],
['&mu;', '&#956;', true, 'mu'],
['&nu;', '&#957;', true, 'nu'],
['&xi;', '&#958;', true, 'xi'],
['&omicron;', '&#959;', true, 'omicron'],
['&pi;', '&#960;', true, 'pi'],
['&rho;', '&#961;', true, 'rho'],
['&sigmaf;', '&#962;', true, 'finalsigma'],
['&sigma;', '&#963;', true, 'sigma'],
['&tau;', '&#964;', true, 'tau'],
['&upsilon;', '&#965;', true, 'upsilon'],
['&phi;', '&#966;', true, 'phi'],
['&chi;', '&#967;', true, 'chi'],
['&psi;', '&#968;', true, 'psi'],
['&omega;', '&#969;', true, 'omega'],
// Symbols.
['&alefsym;', '&#8501;', false,'alefsymbol'],
['&piv;', '&#982;', false,'pisymbol'],
['&real;', '&#8476;', false,'realpartsymbol'],
['&thetasym;','&#977;', false,'thetasymbol'],
['&upsih;', '&#978;', false,'upsilonhooksymbol'],
['&weierp;', '&#8472;', false,'weierstrassp'],
['&image;', '&#8465;', false,'imaginarypart'],
['&alefsym;', '&#8501;', false, 'alefsymbol'],
['&piv;', '&#982;', false, 'pisymbol'],
['&real;', '&#8476;', false, 'realpartsymbol'],
['&thetasym;', '&#977;', false, 'thetasymbol'],
['&upsih;', '&#978;', false, 'upsilonhooksymbol'],
['&weierp;', '&#8472;', false, 'weierstrassp'],
['&image;', '&#8465;', false, 'imaginarypart'],
// Arrows.
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false,'carriagereturn'],
['&lArr;', '&#8656;', false,'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false,'upwardsdoublearrow'],
['&rArr;', '&#8658;', false,'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false,'downwardsdoublearrow'],
['&hArr;', '&#8660;', false,'leftrightdoublearrow'],
['&there4;', '&#8756;', false,'therefore'],
['&sub;', '&#8834;', false,'subsetof'],
['&sup;', '&#8835;', false,'supersetof'],
['&nsub;', '&#8836;', false,'notasubsetof'],
['&sube;', '&#8838;', false,'subsetoforequalto'],
['&supe;', '&#8839;', false,'supersetoforequalto'],
['&oplus;', '&#8853;', false,'circledplus'],
['&otimes;', '&#8855;', false,'circledtimes'],
['&perp;', '&#8869;', false,'perpendicular'],
['&sdot;', '&#8901;', false,'dotoperator'],
['&lceil;', '&#8968;', false,'leftceiling'],
['&rceil;', '&#8969;', false,'rightceiling'],
['&lfloor;', '&#8970;', false,'leftfloor'],
['&rfloor;', '&#8971;', false,'rightfloor'],
['&lang;', '&#9001;', false,'leftpointinganglebracket'],
['&rang;', '&#9002;', false,'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false,'enspace'],
['&emsp;', '&#8195;', false,'emspace'],
['&thinsp;', '&#8201;', false,'thinspace'],
['&zwnj;', '&#8204;', false,'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false,'zerowidthjoiner'],
['&lrm;', '&#8206;', false,'lefttorightmark'],
['&rlm;', '&#8207;', false,'righttoleftmark'],
['&shy;', '&#173;', false,'softhyphen']
['&larr;', '&#8592;', true, 'leftwardsarrow'],
['&uarr;', '&#8593;', true, 'upwardsarrow'],
['&rarr;', '&#8594;', true, 'rightwardsarrow'],
['&darr;', '&#8595;', true, 'downwardsarrow'],
['&harr;', '&#8596;', true, 'leftrightarrow'],
['&crarr;', '&#8629;', false, 'carriagereturn'],
['&lArr;', '&#8656;', false, 'leftwardsdoublearrow'],
['&uArr;', '&#8657;', false, 'upwardsdoublearrow'],
['&rArr;', '&#8658;', false, 'rightwardsdoublearrow'],
['&dArr;', '&#8659;', false, 'downwardsdoublearrow'],
['&hArr;', '&#8660;', false, 'leftrightdoublearrow'],
['&there4;', '&#8756;', false, 'therefore'],
['&sub;', '&#8834;', false, 'subsetof'],
['&sup;', '&#8835;', false, 'supersetof'],
['&nsub;', '&#8836;', false, 'notasubsetof'],
['&sube;', '&#8838;', false, 'subsetoforequalto'],
['&supe;', '&#8839;', false, 'supersetoforequalto'],
['&oplus;', '&#8853;', false, 'circledplus'],
['&otimes;', '&#8855;', false, 'circledtimes'],
['&perp;', '&#8869;', false, 'perpendicular'],
['&sdot;', '&#8901;', false, 'dotoperator'],
['&lceil;', '&#8968;', false, 'leftceiling'],
['&rceil;', '&#8969;', false, 'rightceiling'],
['&lfloor;', '&#8970;', false, 'leftfloor'],
['&rfloor;', '&#8971;', false, 'rightfloor'],
['&lang;', '&#9001;', false, 'leftpointinganglebracket'],
['&rang;', '&#9002;', false, 'rightpointinganglebracket'],
['&loz;', '&#9674;', true, 'lozenge'],
['&spades;', '&#9824;', true, 'blackspadesuit'],
['&clubs;', '&#9827;', true, 'blackclubsuit'],
['&hearts;', '&#9829;', true, 'blackheartsuit'],
['&diams;', '&#9830;', true, 'blackdiamondsuit'],
['&ensp;', '&#8194;', false, 'enspace'],
['&emsp;', '&#8195;', false, 'emspace'],
['&thinsp;', '&#8201;', false, 'thinspace'],
['&zwnj;', '&#8204;', false, 'zerowidthnonjoiner'],
['&zwj;', '&#8205;', false, 'zerowidthjoiner'],
['&lrm;', '&#8206;', false, 'lefttorightmark'],
['&rlm;', '&#8207;', false, 'righttoleftmark'],
['&shy;', '&#173;', false, 'softhyphen']
];
/**
@@ -44,13 +44,13 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.
var toolbarGroupCount = Y.Object.size(this.get('host').get('plugins'));
if (toolbarGroupCount <= 1 + parseInt(this.get(ATTRSHOWGROUPS), 10)) {
Y.log("There are not enough groups to require toggling - not adding the button",
'debug','moodle-atto_collapse');
'debug', 'moodle-atto_collapse');
return;
}
if (this.toolbar.all(GROUPS).size() > this.get(ATTRSHOWGROUPS)) {
Y.log("The collapse plugin is shown after it's cut-off - not adding the button",
'debug','moodle-atto_collapse');
'debug', 'moodle-atto_collapse');
return;
}
@@ -42,13 +42,13 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.
var toolbarGroupCount = Y.Object.size(this.get('host').get('plugins'));
if (toolbarGroupCount <= 1 + parseInt(this.get(ATTRSHOWGROUPS), 10)) {
Y.log("There are not enough groups to require toggling - not adding the button",
'debug','moodle-atto_collapse');
'debug', 'moodle-atto_collapse');
return;
}
if (this.toolbar.all(GROUPS).size() > this.get(ATTRSHOWGROUPS)) {
Y.log("The collapse plugin is shown after it's cut-off - not adding the button",
'debug','moodle-atto_collapse');
'debug', 'moodle-atto_collapse');
return;
}
@@ -186,7 +186,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
}, this);
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
this.editor.all('tex').each(function(texNode) {
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
@@ -295,7 +295,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
return Y.Array.find(patternMatches, function(match) {
// Check each occurrence of this match.
var startIndex = 0;
while(text.indexOf(match, startIndex) !== -1) {
while (text.indexOf(match, startIndex) !== -1) {
// Determine whether the cursor is in the current occurrence of this string.
// Note: We do not support a selection exceeding the bounds of an equation.
var startOuter = text.indexOf(match, startIndex),
@@ -380,7 +380,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode = Y.one(host.getSelectionParentNode());
text = selectedNode.get('text');
value = ' ' + value + ' ';
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
value +
text.slice(this.sourceEquation.endInnerPosition);
@@ -410,10 +410,10 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
*/
_throttle: function(fn, delay) {
var timer = null;
return function () {
return function() {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
timer = setTimeout(function() {
fn.apply(context, args);
}, delay);
};
@@ -455,7 +455,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
@@ -186,7 +186,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
}, this);
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
this.editor.all('tex').each(function(texNode) {
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
@@ -295,7 +295,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
return Y.Array.find(patternMatches, function(match) {
// Check each occurrence of this match.
var startIndex = 0;
while(text.indexOf(match, startIndex) !== -1) {
while (text.indexOf(match, startIndex) !== -1) {
// Determine whether the cursor is in the current occurrence of this string.
// Note: We do not support a selection exceeding the bounds of an equation.
var startOuter = text.indexOf(match, startIndex),
@@ -380,7 +380,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode = Y.one(host.getSelectionParentNode());
text = selectedNode.get('text');
value = ' ' + value + ' ';
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
value +
text.slice(this.sourceEquation.endInnerPosition);
@@ -410,10 +410,10 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
*/
_throttle: function(fn, delay) {
var timer = null;
return function () {
return function() {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
timer = setTimeout(function() {
fn.apply(context, args);
}, delay);
};
@@ -455,7 +455,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
@@ -184,7 +184,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
}, this);
// We need to convert these to a non dom node based format.
this.editor.all('tex').each(function (texNode) {
this.editor.all('tex').each(function(texNode) {
var replacement = Y.Node.create('<span>' +
DELIMITERS.START + ' ' + texNode.get('text') + ' ' + DELIMITERS.END +
'</span>');
@@ -293,7 +293,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
return Y.Array.find(patternMatches, function(match) {
// Check each occurrence of this match.
var startIndex = 0;
while(text.indexOf(match, startIndex) !== -1) {
while (text.indexOf(match, startIndex) !== -1) {
// Determine whether the cursor is in the current occurrence of this string.
// Note: We do not support a selection exceeding the bounds of an equation.
var startOuter = text.indexOf(match, startIndex),
@@ -378,7 +378,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
selectedNode = Y.one(host.getSelectionParentNode());
text = selectedNode.get('text');
value = ' ' + value + ' ';
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
newText = text.slice(0, this.sourceEquation.startInnerPosition) +
value +
text.slice(this.sourceEquation.endInnerPosition);
@@ -408,10 +408,10 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
*/
_throttle: function(fn, delay) {
var timer = null;
return function () {
return function() {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
timer = setTimeout(function() {
fn.apply(context, args);
}, delay);
};
@@ -453,7 +453,7 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos-1))) {
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
@@ -221,8 +221,12 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.editor.on('drop', this._handleDragDrop, this);
// e.preventDefault needed to stop the default event from clobbering the desired behaviour in some browsers.
this.editor.on('dragover', function(e){e.preventDefault();}, this);
this.editor.on('dragenter', function(e){e.preventDefault();}, this);
this.editor.on('dragover', function(e) {
e.preventDefault();
}, this);
this.editor.on('dragenter', function(e) {
e.preventDefault();
}, this);
},
/**
@@ -395,7 +399,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_loadPreviewImage: function(url) {
var image = new Image(), self = this;
var image = new Image();
var self = this;
image.onerror = function() {
var preview = self._form.one('.' + CSS.IMAGEPREVIEW);
@@ -444,8 +449,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.height = 1;
}
// This is the same as comparing to 3 decimal places.
widthRatio = Math.round(1000*parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000*parseInt(currentheight, 10) / this.height);
widthRatio = Math.round(1000 * parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000 * parseInt(currentheight, 10) / this.height);
input.set('checked', widthRatio === heightRatio);
}
@@ -703,7 +708,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_getSelectedImageProperties: function() {
var properties = {
src: null,
alt :null,
alt: null,
width: null,
height: null,
align: '',
@@ -221,8 +221,12 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.editor.on('drop', this._handleDragDrop, this);
// e.preventDefault needed to stop the default event from clobbering the desired behaviour in some browsers.
this.editor.on('dragover', function(e){e.preventDefault();}, this);
this.editor.on('dragenter', function(e){e.preventDefault();}, this);
this.editor.on('dragover', function(e) {
e.preventDefault();
}, this);
this.editor.on('dragenter', function(e) {
e.preventDefault();
}, this);
},
/**
@@ -395,7 +399,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_loadPreviewImage: function(url) {
var image = new Image(), self = this;
var image = new Image();
var self = this;
image.onerror = function() {
var preview = self._form.one('.' + CSS.IMAGEPREVIEW);
@@ -444,8 +449,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.height = 1;
}
// This is the same as comparing to 3 decimal places.
widthRatio = Math.round(1000*parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000*parseInt(currentheight, 10) / this.height);
widthRatio = Math.round(1000 * parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000 * parseInt(currentheight, 10) / this.height);
input.set('checked', widthRatio === heightRatio);
}
@@ -703,7 +708,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_getSelectedImageProperties: function() {
var properties = {
src: null,
alt :null,
alt: null,
width: null,
height: null,
align: '',
+11 -6
View File
@@ -219,8 +219,12 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.editor.on('drop', this._handleDragDrop, this);
// e.preventDefault needed to stop the default event from clobbering the desired behaviour in some browsers.
this.editor.on('dragover', function(e){e.preventDefault();}, this);
this.editor.on('dragenter', function(e){e.preventDefault();}, this);
this.editor.on('dragover', function(e) {
e.preventDefault();
}, this);
this.editor.on('dragenter', function(e) {
e.preventDefault();
}, this);
},
/**
@@ -393,7 +397,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_loadPreviewImage: function(url) {
var image = new Image(), self = this;
var image = new Image();
var self = this;
image.onerror = function() {
var preview = self._form.one('.' + CSS.IMAGEPREVIEW);
@@ -442,8 +447,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
this.height = 1;
}
// This is the same as comparing to 3 decimal places.
widthRatio = Math.round(1000*parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000*parseInt(currentheight, 10) / this.height);
widthRatio = Math.round(1000 * parseInt(currentwidth, 10) / this.width);
heightRatio = Math.round(1000 * parseInt(currentheight, 10) / this.height);
input.set('checked', widthRatio === heightRatio);
}
@@ -701,7 +706,7 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_getSelectedImageProperties: function() {
var properties = {
src: null,
alt :null,
alt: null,
width: null,
height: null,
align: '',
@@ -158,7 +158,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = blockquote.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -184,7 +185,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = indent.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -158,7 +158,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = blockquote.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -184,7 +185,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = indent.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
+4 -2
View File
@@ -156,7 +156,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = blockquote.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -182,7 +183,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed
.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;
var children = indent.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -106,7 +106,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_bordercolour_-1"' +
'type="radio" name="borderColour" value="none" checked="checked"'+
'type="radio" name="borderColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -133,7 +133,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_-1"' +
'type="radio" name="backgroundColour" value="none" checked="checked"'+
'type="radio" name="backgroundColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -141,7 +141,7 @@ var COMPONENT = 'atto_table',
'{{#each availableColours}}' +
'<label for="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'style="background-color:{{this}};color:{{this}}">'+
'style="background-color:{{this}};color:{{this}}">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'type="radio" name="backgroundColour" value="' + '{{this}}' + '" title="{{this}}">' +
@@ -372,10 +372,10 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_updateAvailableSettings: function() {
var tableForm = this._content,
enableBorders = tableForm.one('[name="borders"]'),
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
if (!enableBorders) {
return;
@@ -412,7 +412,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var targetcell = null,
host = this.get('host');
host.getSelectedNodes().some(function (node) {
host.getSelectedNodes().some(function(node) {
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
targetcell = node;
@@ -516,7 +516,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Add the row headers.
if (headers.get('value') === 'rows' || headers.get('value') === 'both') {
table.all('tr').each(function (row) {
table.all('tr').each(function(row) {
var cells = row.all('th, td'),
firstCell = cells.shift(),
newCell;
@@ -530,7 +530,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
// Now make sure all other cells in the row are td.
cells.each(function (cell) {
cells.each(function(cell) {
if (cell.get('tagName') === 'TH') {
newCell = this._changeNodeType(cell, 'td');
newCell.removeAttribute('scope');
@@ -545,7 +545,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
firstRow = rows.shift(),
newCell;
firstRow.all('td, th').each(function (cell) {
firstRow.all('td, th').each(function(cell) {
if (cell.get('tagName') === 'TD') {
// Cell is a td but should be a th - change it.
newCell = this._changeNodeType(cell, 'th');
@@ -687,8 +687,8 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
rows.each(function(row) {
var cells = row.all('td, th'),
cell = cells.item(columnindex),
cellprev = cells.item(columnindex-1),
cellnext = cells.item(columnindex+1);
cellprev = cells.item(columnindex - 1),
cellnext = cells.item(columnindex + 1);
currentcells.push(cell);
if (cellprev) {
prevcells.push(cellprev);
@@ -1050,7 +1050,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var cells = this._findColumnCells();
// Check we have some tds in this column, and one exists to the right.
if ( (cells.next.size() > 0) &&
if ((cells.next.size() > 0) &&
(cells.current.size() === cells.next.size()) &&
(cells.current.filter('td').size() > 0)) {
var i = 0;
@@ -1331,7 +1331,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
newrow.all('th, td').each(function(tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {
var newcell = Y.Node.create('<td></td>');
@@ -106,7 +106,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_bordercolour_-1"' +
'type="radio" name="borderColour" value="none" checked="checked"'+
'type="radio" name="borderColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -133,7 +133,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_-1"' +
'type="radio" name="backgroundColour" value="none" checked="checked"'+
'type="radio" name="backgroundColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -141,7 +141,7 @@ var COMPONENT = 'atto_table',
'{{#each availableColours}}' +
'<label for="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'style="background-color:{{this}};color:{{this}}">'+
'style="background-color:{{this}};color:{{this}}">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'type="radio" name="backgroundColour" value="' + '{{this}}' + '" title="{{this}}">' +
@@ -372,10 +372,10 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_updateAvailableSettings: function() {
var tableForm = this._content,
enableBorders = tableForm.one('[name="borders"]'),
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
if (!enableBorders) {
return;
@@ -412,7 +412,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var targetcell = null,
host = this.get('host');
host.getSelectedNodes().some(function (node) {
host.getSelectedNodes().some(function(node) {
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
targetcell = node;
@@ -516,7 +516,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Add the row headers.
if (headers.get('value') === 'rows' || headers.get('value') === 'both') {
table.all('tr').each(function (row) {
table.all('tr').each(function(row) {
var cells = row.all('th, td'),
firstCell = cells.shift(),
newCell;
@@ -530,7 +530,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
// Now make sure all other cells in the row are td.
cells.each(function (cell) {
cells.each(function(cell) {
if (cell.get('tagName') === 'TH') {
newCell = this._changeNodeType(cell, 'td');
newCell.removeAttribute('scope');
@@ -545,7 +545,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
firstRow = rows.shift(),
newCell;
firstRow.all('td, th').each(function (cell) {
firstRow.all('td, th').each(function(cell) {
if (cell.get('tagName') === 'TD') {
// Cell is a td but should be a th - change it.
newCell = this._changeNodeType(cell, 'th');
@@ -687,8 +687,8 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
rows.each(function(row) {
var cells = row.all('td, th'),
cell = cells.item(columnindex),
cellprev = cells.item(columnindex-1),
cellnext = cells.item(columnindex+1);
cellprev = cells.item(columnindex - 1),
cellnext = cells.item(columnindex + 1);
currentcells.push(cell);
if (cellprev) {
prevcells.push(cellprev);
@@ -1050,7 +1050,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var cells = this._findColumnCells();
// Check we have some tds in this column, and one exists to the right.
if ( (cells.next.size() > 0) &&
if ((cells.next.size() > 0) &&
(cells.current.size() === cells.next.size()) &&
(cells.current.filter('td').size() > 0)) {
var i = 0;
@@ -1331,7 +1331,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
newrow.all('th, td').each(function(tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {
var newcell = Y.Node.create('<td></td>');
+15 -15
View File
@@ -104,7 +104,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_bordercolour_-1"' +
'type="radio" name="borderColour" value="none" checked="checked"'+
'type="radio" name="borderColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -131,7 +131,7 @@ var COMPONENT = 'atto_table',
'style="background-color:transparent;color:transparent">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_-1"' +
'type="radio" name="backgroundColour" value="none" checked="checked"'+
'type="radio" name="backgroundColour" value="none" checked="checked"' +
'title="{{get_string "themedefault" component}}"></input>' +
'{{get_string "themedefault" component}}' +
@@ -139,7 +139,7 @@ var COMPONENT = 'atto_table',
'{{#each availableColours}}' +
'<label for="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'style="background-color:{{this}};color:{{this}}">'+
'style="background-color:{{this}};color:{{this}}">' +
'<input id="{{../elementid}}_atto_table_backgroundcolour_{{@index}}"' +
'type="radio" name="backgroundColour" value="' + '{{this}}' + '" title="{{this}}">' +
@@ -370,10 +370,10 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
_updateAvailableSettings: function() {
var tableForm = this._content,
enableBorders = tableForm.one('[name="borders"]'),
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
borderStyle = tableForm.one('[name="borderstyles"]'),
borderSize = tableForm.one('[name="bordersize"]'),
borderColour = tableForm.all('[name="borderColour"]'),
disabledValue = 'removeAttribute';
if (!enableBorders) {
return;
@@ -410,7 +410,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var targetcell = null,
host = this.get('host');
host.getSelectedNodes().some(function (node) {
host.getSelectedNodes().some(function(node) {
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
targetcell = node;
@@ -514,7 +514,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
// Add the row headers.
if (headers.get('value') === 'rows' || headers.get('value') === 'both') {
table.all('tr').each(function (row) {
table.all('tr').each(function(row) {
var cells = row.all('th, td'),
firstCell = cells.shift(),
newCell;
@@ -528,7 +528,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
// Now make sure all other cells in the row are td.
cells.each(function (cell) {
cells.each(function(cell) {
if (cell.get('tagName') === 'TH') {
newCell = this._changeNodeType(cell, 'td');
newCell.removeAttribute('scope');
@@ -543,7 +543,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
firstRow = rows.shift(),
newCell;
firstRow.all('td, th').each(function (cell) {
firstRow.all('td, th').each(function(cell) {
if (cell.get('tagName') === 'TD') {
// Cell is a td but should be a th - change it.
newCell = this._changeNodeType(cell, 'th');
@@ -685,8 +685,8 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
rows.each(function(row) {
var cells = row.all('td, th'),
cell = cells.item(columnindex),
cellprev = cells.item(columnindex-1),
cellnext = cells.item(columnindex+1);
cellprev = cells.item(columnindex - 1),
cellnext = cells.item(columnindex + 1);
currentcells.push(cell);
if (cellprev) {
prevcells.push(cellprev);
@@ -1048,7 +1048,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
var cells = this._findColumnCells();
// Check we have some tds in this column, and one exists to the right.
if ( (cells.next.size() > 0) &&
if ((cells.next.size() > 0) &&
(cells.current.size() === cells.next.size()) &&
(cells.current.filter('td').size() > 0)) {
var i = 0;
@@ -1329,7 +1329,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
return;
}
var newrow = firstrow.cloneNode(true);
newrow.all('th, td').each(function (tablecell) {
newrow.all('th, td').each(function(tablecell) {
if (tablecell.get('tagName') === 'TH') {
if (tablecell.getAttribute('scope') !== 'row') {
var newcell = Y.Node.create('<td></td>');
@@ -69,7 +69,7 @@ Y.extend(Editor, Y.Base, {
* @property BLOCK_TAGS
* @type {Array}
*/
BLOCK_TAGS : [
BLOCK_TAGS: [
'address',
'article',
'aside',
@@ -503,7 +503,7 @@ var LOGNAME_NOTIFY = 'moodle-editor_atto-editor-notify',
function EditorNotify() {}
EditorNotify.ATTRS= {
EditorNotify.ATTRS = {
};
EditorNotify.prototype = {
@@ -643,7 +643,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorNotify]);
function EditorTextArea() {}
EditorTextArea.ATTRS= {
EditorTextArea.ATTRS = {
};
EditorTextArea.prototype = {
@@ -695,7 +695,7 @@ EditorTextArea.prototype = {
* @method updateOriginal
* @chainable
*/
updateOriginal : function() {
updateOriginal: function() {
// Get the previous and current value to compare them.
var oldValue = this.textarea.get('value'),
newValue = this.getCleanHTML();
@@ -755,7 +755,7 @@ var SUCCESS_MESSAGE_TIMEOUT = 5000,
function EditorAutosave() {}
EditorAutosave.ATTRS= {
EditorAutosave.ATTRS = {
/**
* Enable/Disable auto save for this instance.
*
@@ -1276,7 +1276,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorAutosaveIo]);
function EditorClean() {}
EditorClean.ATTRS= {
EditorClean.ATTRS = {
};
EditorClean.prototype = {
@@ -1536,9 +1536,9 @@ EditorClean.prototype = {
// Get all class attributes so we can work on them.
{regex: /(<[^>]*?class\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO classes.
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi, "");
// Remove Apple- classes.
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi, "");
return group1 + group2 + group3;
}},
// Remove OLE_LINK# anchors that may litter the code.
@@ -1673,7 +1673,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorClean]);
function EditorCommand() {}
EditorCommand.ATTRS= {
EditorCommand.ATTRS = {
};
EditorCommand.prototype = {
@@ -1755,7 +1755,8 @@ EditorCommand.prototype = {
clone.setAttribute('class', node.getAttribute('class'));
}
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = node.getDOMNode().childNodes, child;
var children = node.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -1849,7 +1850,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorCommand]);
function EditorToolbar() {}
EditorToolbar.ATTRS= {
EditorToolbar.ATTRS = {
};
EditorToolbar.prototype = {
@@ -1924,7 +1925,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbar]);
function EditorToolbarNav() {}
EditorToolbarNav.ATTRS= {
EditorToolbarNav.ATTRS = {
};
EditorToolbarNav.prototype = {
@@ -2133,7 +2134,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbarNav]);
function EditorSelection() {}
EditorSelection.ATTRS= {
EditorSelection.ATTRS = {
};
EditorSelection.prototype = {
@@ -2356,7 +2357,7 @@ EditorSelection.prototype = {
return false;
}
selectednodes.each(function(node){
selectednodes.each(function(node) {
// Check each node, if it doesn't match the tags AND is not within the specified tags then fail this thing.
if (requireall) {
// Check for at least one failure.
@@ -2554,7 +2555,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorSelection]);
function EditorStyling() {}
EditorStyling.ATTRS= {
EditorStyling.ATTRS = {
};
EditorStyling.prototype = {
@@ -2631,7 +2632,7 @@ EditorStyling.prototype = {
cssApplier.applyToSelection();
this.editor.all('.' + classname).each(function (node) {
this.editor.all('.' + classname).each(function(node) {
node.removeClass(classname).setStyles(styles);
}, this);
@@ -2670,7 +2671,7 @@ EditorStyling.prototype = {
// move the boundary to the table cell.
// This is because we might have a table in a div, and we select some text in a cell,
// want to limit the change in style to the table cell, not the entire table (via the outer div).
cell = selectionparentnode.ancestor(function (node) {
cell = selectionparentnode.ancestor(function(node) {
var tagname = node.get('tagName');
if (tagname) {
tagname = tagname.toLowerCase();
@@ -2688,7 +2689,7 @@ EditorStyling.prototype = {
nearestblock = selectionparentnode.ancestor(this.BLOCK_TAGS.join(', '), true);
if (nearestblock) {
// Check that the block is contained by the boundary.
match = nearestblock.ancestor(function (node) {
match = nearestblock.ancestor(function(node) {
return node === boundary;
}, false);
@@ -2701,7 +2702,7 @@ EditorStyling.prototype = {
if (!nearestblock) {
// There is no block node in the content, wrap the content in a p and use that.
newcontent = Y.Node.create('<p></p>');
boundary.get('childNodes').each(function (child) {
boundary.get('childNodes').each(function(child) {
newcontent.append(child.remove());
});
boundary.append(newcontent);
@@ -2716,7 +2717,7 @@ EditorStyling.prototype = {
// Copy all attributes.
replacement.setAttrs(nearestblock.getAttrs());
// Copy all children.
nearestblock.get('childNodes').each(function (child) {
nearestblock.get('childNodes').each(function(child) {
child.remove();
replacement.append(child);
});
@@ -2772,7 +2773,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorStyling]);
function EditorFilepicker() {}
EditorFilepicker.ATTRS= {
EditorFilepicker.ATTRS = {
/**
* The options for the filepicker.
*
@@ -2809,7 +2810,7 @@ EditorFilepicker.prototype = {
*/
showFilepicker: function(type, callback, context) {
var self = this;
Y.use('core_filepicker', function (Y) {
Y.use('core_filepicker', function(Y) {
var options = Y.clone(self.get('filepickeroptions')[type], true);
options.formcallback = callback;
if (context) {
@@ -69,7 +69,7 @@ Y.extend(Editor, Y.Base, {
* @property BLOCK_TAGS
* @type {Array}
*/
BLOCK_TAGS : [
BLOCK_TAGS: [
'address',
'article',
'aside',
@@ -500,7 +500,7 @@ var LOGNAME_NOTIFY = 'moodle-editor_atto-editor-notify',
function EditorNotify() {}
EditorNotify.ATTRS= {
EditorNotify.ATTRS = {
};
EditorNotify.prototype = {
@@ -638,7 +638,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorNotify]);
function EditorTextArea() {}
EditorTextArea.ATTRS= {
EditorTextArea.ATTRS = {
};
EditorTextArea.prototype = {
@@ -690,7 +690,7 @@ EditorTextArea.prototype = {
* @method updateOriginal
* @chainable
*/
updateOriginal : function() {
updateOriginal: function() {
// Get the previous and current value to compare them.
var oldValue = this.textarea.get('value'),
newValue = this.getCleanHTML();
@@ -750,7 +750,7 @@ var SUCCESS_MESSAGE_TIMEOUT = 5000,
function EditorAutosave() {}
EditorAutosave.ATTRS= {
EditorAutosave.ATTRS = {
/**
* Enable/Disable auto save for this instance.
*
@@ -1265,7 +1265,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorAutosaveIo]);
function EditorClean() {}
EditorClean.ATTRS= {
EditorClean.ATTRS = {
};
EditorClean.prototype = {
@@ -1524,9 +1524,9 @@ EditorClean.prototype = {
// Get all class attributes so we can work on them.
{regex: /(<[^>]*?class\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO classes.
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi, "");
// Remove Apple- classes.
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi, "");
return group1 + group2 + group3;
}},
// Remove OLE_LINK# anchors that may litter the code.
@@ -1661,7 +1661,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorClean]);
function EditorCommand() {}
EditorCommand.ATTRS= {
EditorCommand.ATTRS = {
};
EditorCommand.prototype = {
@@ -1743,7 +1743,8 @@ EditorCommand.prototype = {
clone.setAttribute('class', node.getAttribute('class'));
}
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = node.getDOMNode().childNodes, child;
var children = node.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
@@ -1837,7 +1838,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorCommand]);
function EditorToolbar() {}
EditorToolbar.ATTRS= {
EditorToolbar.ATTRS = {
};
EditorToolbar.prototype = {
@@ -1912,7 +1913,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbar]);
function EditorToolbarNav() {}
EditorToolbarNav.ATTRS= {
EditorToolbarNav.ATTRS = {
};
EditorToolbarNav.prototype = {
@@ -2119,7 +2120,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbarNav]);
function EditorSelection() {}
EditorSelection.ATTRS= {
EditorSelection.ATTRS = {
};
EditorSelection.prototype = {
@@ -2342,7 +2343,7 @@ EditorSelection.prototype = {
return false;
}
selectednodes.each(function(node){
selectednodes.each(function(node) {
// Check each node, if it doesn't match the tags AND is not within the specified tags then fail this thing.
if (requireall) {
// Check for at least one failure.
@@ -2540,7 +2541,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorSelection]);
function EditorStyling() {}
EditorStyling.ATTRS= {
EditorStyling.ATTRS = {
};
EditorStyling.prototype = {
@@ -2617,7 +2618,7 @@ EditorStyling.prototype = {
cssApplier.applyToSelection();
this.editor.all('.' + classname).each(function (node) {
this.editor.all('.' + classname).each(function(node) {
node.removeClass(classname).setStyles(styles);
}, this);
@@ -2656,7 +2657,7 @@ EditorStyling.prototype = {
// move the boundary to the table cell.
// This is because we might have a table in a div, and we select some text in a cell,
// want to limit the change in style to the table cell, not the entire table (via the outer div).
cell = selectionparentnode.ancestor(function (node) {
cell = selectionparentnode.ancestor(function(node) {
var tagname = node.get('tagName');
if (tagname) {
tagname = tagname.toLowerCase();
@@ -2674,7 +2675,7 @@ EditorStyling.prototype = {
nearestblock = selectionparentnode.ancestor(this.BLOCK_TAGS.join(', '), true);
if (nearestblock) {
// Check that the block is contained by the boundary.
match = nearestblock.ancestor(function (node) {
match = nearestblock.ancestor(function(node) {
return node === boundary;
}, false);
@@ -2687,7 +2688,7 @@ EditorStyling.prototype = {
if (!nearestblock) {
// There is no block node in the content, wrap the content in a p and use that.
newcontent = Y.Node.create('<p></p>');
boundary.get('childNodes').each(function (child) {
boundary.get('childNodes').each(function(child) {
newcontent.append(child.remove());
});
boundary.append(newcontent);
@@ -2702,7 +2703,7 @@ EditorStyling.prototype = {
// Copy all attributes.
replacement.setAttrs(nearestblock.getAttrs());
// Copy all children.
nearestblock.get('childNodes').each(function (child) {
nearestblock.get('childNodes').each(function(child) {
child.remove();
replacement.append(child);
});
@@ -2758,7 +2759,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorStyling]);
function EditorFilepicker() {}
EditorFilepicker.ATTRS= {
EditorFilepicker.ATTRS = {
/**
* The options for the filepicker.
*
@@ -2795,7 +2796,7 @@ EditorFilepicker.prototype = {
*/
showFilepicker: function(type, callback, context) {
var self = this;
Y.use('core_filepicker', function (Y) {
Y.use('core_filepicker', function(Y) {
var options = Y.clone(self.get('filepickeroptions')[type], true);
options.formcallback = callback;
if (context) {
@@ -183,7 +183,7 @@ var MENUTEMPLATE = '' +
'tabindex="-1" ' +
'type="button" ' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'<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"}}"/>' +
@@ -198,7 +198,7 @@ var DISABLED = 'disabled',
function EditorPluginButtons() {}
EditorPluginButtons.ATTRS= {
EditorPluginButtons.ATTRS = {
};
EditorPluginButtons.prototype = {
@@ -1103,7 +1103,7 @@ Y.Base.mix(Y.M.editor_atto.EditorPlugin, [EditorPluginButtons]);
function EditorPluginDialogue() {}
EditorPluginDialogue.ATTRS= {
EditorPluginDialogue.ATTRS = {
};
EditorPluginDialogue.prototype = {
@@ -183,7 +183,7 @@ var MENUTEMPLATE = '' +
'tabindex="-1" ' +
'type="button" ' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'<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"}}"/>' +
@@ -198,7 +198,7 @@ var DISABLED = 'disabled',
function EditorPluginButtons() {}
EditorPluginButtons.ATTRS= {
EditorPluginButtons.ATTRS = {
};
EditorPluginButtons.prototype = {
@@ -1099,7 +1099,7 @@ Y.Base.mix(Y.M.editor_atto.EditorPlugin, [EditorPluginButtons]);
function EditorPluginDialogue() {}
EditorPluginDialogue.ATTRS= {
EditorPluginDialogue.ATTRS = {
};
EditorPluginDialogue.prototype = {
+1 -1
View File
@@ -31,7 +31,7 @@ var SUCCESS_MESSAGE_TIMEOUT = 5000,
function EditorAutosave() {}
EditorAutosave.ATTRS= {
EditorAutosave.ATTRS = {
/**
* Enable/Disable auto save for this instance.
*
+3 -3
View File
@@ -30,7 +30,7 @@
function EditorClean() {}
EditorClean.ATTRS= {
EditorClean.ATTRS = {
};
EditorClean.prototype = {
@@ -290,9 +290,9 @@ EditorClean.prototype = {
// Get all class attributes so we can work on them.
{regex: /(<[^>]*?class\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO classes.
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi, "");
// Remove Apple- classes.
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi,"");
group2 = group2.replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi, "");
return group1 + group2 + group3;
}},
// Remove OLE_LINK# anchors that may litter the code.
+3 -2
View File
@@ -29,7 +29,7 @@
function EditorCommand() {}
EditorCommand.ATTRS= {
EditorCommand.ATTRS = {
};
EditorCommand.prototype = {
@@ -111,7 +111,8 @@ EditorCommand.prototype = {
clone.setAttribute('class', node.getAttribute('class'));
}
// We use childNodes here because we are interested in both type 1 and 3 child nodes.
var children = node.getDOMNode().childNodes, child;
var children = node.getDOMNode().childNodes;
var child;
child = children[0];
while (typeof child !== "undefined") {
clone.append(child);
+2 -2
View File
@@ -33,7 +33,7 @@ var MENUTEMPLATE = '' +
'tabindex="-1" ' +
'type="button" ' +
'title="{{title}}">' +
'<img class="icon" aria-hidden="true" role="presentation" width="16" height="16" '+
'<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"}}"/>' +
@@ -48,7 +48,7 @@ var DISABLED = 'disabled',
function EditorPluginButtons() {}
EditorPluginButtons.ATTRS= {
EditorPluginButtons.ATTRS = {
};
EditorPluginButtons.prototype = {
@@ -29,7 +29,7 @@
function EditorPluginDialogue() {}
EditorPluginDialogue.ATTRS= {
EditorPluginDialogue.ATTRS = {
};
EditorPluginDialogue.prototype = {
+1 -1
View File
@@ -67,7 +67,7 @@ Y.extend(Editor, Y.Base, {
* @property BLOCK_TAGS
* @type {Array}
*/
BLOCK_TAGS : [
BLOCK_TAGS: [
'address',
'article',
'aside',
+2 -2
View File
@@ -29,7 +29,7 @@
function EditorFilepicker() {}
EditorFilepicker.ATTRS= {
EditorFilepicker.ATTRS = {
/**
* The options for the filepicker.
*
@@ -66,7 +66,7 @@ EditorFilepicker.prototype = {
*/
showFilepicker: function(type, callback, context) {
var self = this;
Y.use('core_filepicker', function (Y) {
Y.use('core_filepicker', function(Y) {
var options = Y.clone(self.get('filepickeroptions')[type], true);
options.formcallback = callback;
if (context) {
+1 -1
View File
@@ -29,7 +29,7 @@ var LOGNAME_NOTIFY = 'moodle-editor_atto-editor-notify',
function EditorNotify() {}
EditorNotify.ATTRS= {
EditorNotify.ATTRS = {
};
EditorNotify.prototype = {
+2 -2
View File
@@ -30,7 +30,7 @@
function EditorSelection() {}
EditorSelection.ATTRS= {
EditorSelection.ATTRS = {
};
EditorSelection.prototype = {
@@ -253,7 +253,7 @@ EditorSelection.prototype = {
return false;
}
selectednodes.each(function(node){
selectednodes.each(function(node) {
// Check each node, if it doesn't match the tags AND is not within the specified tags then fail this thing.
if (requireall) {
// Check for at least one failure.
+6 -6
View File
@@ -30,7 +30,7 @@
function EditorStyling() {}
EditorStyling.ATTRS= {
EditorStyling.ATTRS = {
};
EditorStyling.prototype = {
@@ -107,7 +107,7 @@ EditorStyling.prototype = {
cssApplier.applyToSelection();
this.editor.all('.' + classname).each(function (node) {
this.editor.all('.' + classname).each(function(node) {
node.removeClass(classname).setStyles(styles);
}, this);
@@ -146,7 +146,7 @@ EditorStyling.prototype = {
// move the boundary to the table cell.
// This is because we might have a table in a div, and we select some text in a cell,
// want to limit the change in style to the table cell, not the entire table (via the outer div).
cell = selectionparentnode.ancestor(function (node) {
cell = selectionparentnode.ancestor(function(node) {
var tagname = node.get('tagName');
if (tagname) {
tagname = tagname.toLowerCase();
@@ -164,7 +164,7 @@ EditorStyling.prototype = {
nearestblock = selectionparentnode.ancestor(this.BLOCK_TAGS.join(', '), true);
if (nearestblock) {
// Check that the block is contained by the boundary.
match = nearestblock.ancestor(function (node) {
match = nearestblock.ancestor(function(node) {
return node === boundary;
}, false);
@@ -177,7 +177,7 @@ EditorStyling.prototype = {
if (!nearestblock) {
// There is no block node in the content, wrap the content in a p and use that.
newcontent = Y.Node.create('<p></p>');
boundary.get('childNodes').each(function (child) {
boundary.get('childNodes').each(function(child) {
newcontent.append(child.remove());
});
boundary.append(newcontent);
@@ -192,7 +192,7 @@ EditorStyling.prototype = {
// Copy all attributes.
replacement.setAttrs(nearestblock.getAttrs());
// Copy all children.
nearestblock.get('childNodes').each(function (child) {
nearestblock.get('childNodes').each(function(child) {
child.remove();
replacement.append(child);
});
+2 -2
View File
@@ -29,7 +29,7 @@
function EditorTextArea() {}
EditorTextArea.ATTRS= {
EditorTextArea.ATTRS = {
};
EditorTextArea.prototype = {
@@ -81,7 +81,7 @@ EditorTextArea.prototype = {
* @method updateOriginal
* @chainable
*/
updateOriginal : function() {
updateOriginal: function() {
// Get the previous and current value to compare them.
var oldValue = this.textarea.get('value'),
newValue = this.getCleanHTML();
+1 -1
View File
@@ -30,7 +30,7 @@
function EditorToolbarNav() {}
EditorToolbarNav.ATTRS= {
EditorToolbarNav.ATTRS = {
};
EditorToolbarNav.prototype = {

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