Issue #2383865 by mgifford, pguillard, rpayanm, alexpott, jhodgdon: Spellchecking Drupal - Javascript
parent
0c50be4f81
commit
4f2257113e
|
|
@ -46,7 +46,7 @@
|
||||||
* parsing works identically, but instead of failing on invalid styles, we
|
* parsing works identically, but instead of failing on invalid styles, we
|
||||||
* just ignore those.
|
* just ignore those.
|
||||||
*
|
*
|
||||||
* @param String sstyles
|
* @param String styles
|
||||||
* The "styles" setting.
|
* The "styles" setting.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
var uncachedIDs = _.filter(ids, function initIfCached(contextualID) {
|
var uncachedIDs = _.filter(ids, function initIfCached(contextualID) {
|
||||||
var html = storage.getItem('Drupal.contextual.' + contextualID);
|
var html = storage.getItem('Drupal.contextual.' + contextualID);
|
||||||
if (html !== null) {
|
if (html !== null) {
|
||||||
// Initialize after the current executation cycle, to make the AJAX
|
// Initialize after the current execution cycle, to make the AJAX
|
||||||
// request for retrieving the uncached contextual links as soon as
|
// request for retrieving the uncached contextual links as soon as
|
||||||
// possible, but also to ensure that other Drupal behaviors have had the
|
// possible, but also to ensure that other Drupal behaviors have had the
|
||||||
// chance to set up an event listener on the Backbone collection
|
// chance to set up an event listener on the Backbone collection
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
initialize: function (attrs, options) {
|
initialize: function (attrs, options) {
|
||||||
// Respond to new/removed contextual links.
|
// Respond to new/removed contextual links.
|
||||||
this.listenTo(options.contextualCollection, {
|
this.listenTo(options.contextualCollection, {
|
||||||
'reset remove add': this.countCountextualLinks,
|
'reset remove add': this.countContextualLinks,
|
||||||
'add': this.lockNewContextualLinks
|
'add': this.lockNewContextualLinks
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
* @param Backbone.Collection contextualCollection
|
* @param Backbone.Collection contextualCollection
|
||||||
* The collection of contextual link models.
|
* The collection of contextual link models.
|
||||||
*/
|
*/
|
||||||
countCountextualLinks: function (contextualModel, contextualCollection) {
|
countContextualLinks: function (contextualModel, contextualCollection) {
|
||||||
this.set('contextualCount', contextualCollection.length);
|
this.set('contextualCount', contextualCollection.length);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -379,8 +379,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the current status of a filter allows a specific feature
|
* Checks whether the current status of a filter allows a specific feature
|
||||||
* by building the universe of potential values from the feature's require-
|
* by building the universe of potential values from the feature's
|
||||||
* ments and then checking whether anything in the filter prevents that.
|
* requirements and then checking whether anything in the filter prevents
|
||||||
|
* that.
|
||||||
*
|
*
|
||||||
* @see generateUniverseFromFeatureRequirements()
|
* @see generateUniverseFromFeatureRequirements()
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@
|
||||||
// do not get enabled when we re-enable these fields at the end of behavior
|
// do not get enabled when we re-enable these fields at the end of behavior
|
||||||
// processing. Re-enable in a setTimeout set to a relatively short amount
|
// processing. Re-enable in a setTimeout set to a relatively short amount
|
||||||
// of time (1 second). All the other mousedown handlers (like Drupal's Ajax
|
// of time (1 second). All the other mousedown handlers (like Drupal's Ajax
|
||||||
// behaviors) are excuted before any timeout functions are called, so we
|
// behaviors) are executed before any timeout functions are called, so we
|
||||||
// don't have to worry about the fields being re-enabled too soon.
|
// don't have to worry about the fields being re-enabled too soon.
|
||||||
// @todo If the previous sentence is true, why not set the timeout to 0?
|
// @todo If the previous sentence is true, why not set the timeout to 0?
|
||||||
var $fieldsToTemporarilyDisable = $('div.form-managed-file input.form-file').not($enabledFields).not(':disabled');
|
var $fieldsToTemporarilyDisable = $('div.form-managed-file input.form-file').not($enabledFields).not(':disabled');
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
Drupal.behaviors.filterFilterHtmlUpdating = {
|
Drupal.behaviors.filterFilterHtmlUpdating = {
|
||||||
|
|
||||||
// The form item containg the "Allowed HTML tags" setting.
|
// The form item contains the "Allowed HTML tags" setting.
|
||||||
$allowedHTMLFormItem: null,
|
$allowedHTMLFormItem: null,
|
||||||
|
|
||||||
// The description for the "Allowed HTML tags" field.
|
// The description for the "Allowed HTML tags" field.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
var $select = $('#edit-menu-parent');
|
var $select = $('#edit-menu-parent');
|
||||||
// Save key of last selected element.
|
// Save key of last selected element.
|
||||||
var selected = $select.val();
|
var selected = $select.val();
|
||||||
// Remove all exisiting options from dropdown.
|
// Remove all existing options from dropdown.
|
||||||
$select.children().remove();
|
$select.children().remove();
|
||||||
// Add new options to dropdown. Keep a count of options for testing later.
|
// Add new options to dropdown. Keep a count of options for testing later.
|
||||||
var totalOptions = 0;
|
var totalOptions = 0;
|
||||||
|
|
|
||||||
|
|
@ -36,29 +36,29 @@
|
||||||
// If there is a link title already, mark it as overridden. The user expects
|
// If there is a link title already, mark it as overridden. The user expects
|
||||||
// that toggling the checkbox twice will take over the node's title.
|
// that toggling the checkbox twice will take over the node's title.
|
||||||
if ($checkbox.is(':checked') && $link_title.val().length) {
|
if ($checkbox.is(':checked') && $link_title.val().length) {
|
||||||
$link_title.data('menuLinkAutomaticTitleOveridden', true);
|
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||||
}
|
}
|
||||||
// Whenever the value is changed manually, disable this behavior.
|
// Whenever the value is changed manually, disable this behavior.
|
||||||
$link_title.on('keyup', function () {
|
$link_title.on('keyup', function () {
|
||||||
$link_title.data('menuLinkAutomaticTitleOveridden', true);
|
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||||
});
|
});
|
||||||
// Global trigger on checkbox (do not fill-in a value when disabled).
|
// Global trigger on checkbox (do not fill-in a value when disabled).
|
||||||
$checkbox.on('change', function () {
|
$checkbox.on('change', function () {
|
||||||
if ($checkbox.is(':checked')) {
|
if ($checkbox.is(':checked')) {
|
||||||
if (!$link_title.data('menuLinkAutomaticTitleOveridden')) {
|
if (!$link_title.data('menuLinkAutomaticTitleOverridden')) {
|
||||||
$link_title.val($title.val());
|
$link_title.val($title.val());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$link_title.val('');
|
$link_title.val('');
|
||||||
$link_title.removeData('menuLinkAutomaticTitleOveridden');
|
$link_title.removeData('menuLinkAutomaticTitleOverridden');
|
||||||
}
|
}
|
||||||
$checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated');
|
$checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated');
|
||||||
$checkbox.trigger('formUpdated');
|
$checkbox.trigger('formUpdated');
|
||||||
});
|
});
|
||||||
// Take over any title change.
|
// Take over any title change.
|
||||||
$title.on('keyup', function () {
|
$title.on('keyup', function () {
|
||||||
if (!$link_title.data('menuLinkAutomaticTitleOveridden') && $checkbox.is(':checked')) {
|
if (!$link_title.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {
|
||||||
$link_title.val($title.val());
|
$link_title.val($title.val());
|
||||||
$link_title.val($title.val()).trigger('formUpdated');
|
$link_title.val($title.val()).trigger('formUpdated');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
el: null,
|
el: null,
|
||||||
// An entity ID, of the form "<entity type>/<entity ID>", e.g. "node/1".
|
// An entity ID, of the form "<entity type>/<entity ID>", e.g. "node/1".
|
||||||
entityID: null,
|
entityID: null,
|
||||||
// An entity instance ID. The first intance of a specific entity (i.e. with
|
// An entity instance ID. The first instance of a specific entity (i.e. with
|
||||||
// a given entity ID) is assigned 0, the second 1, and so on.
|
// a given entity ID) is assigned 0, the second 1, and so on.
|
||||||
entityInstanceID: null,
|
entityInstanceID: null,
|
||||||
// The unique ID of this entity instance on the page, of the form "<entity
|
// The unique ID of this entity instance on the page, of the form "<entity
|
||||||
|
|
@ -450,7 +450,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (currentIsCommitting === true && nextIsCommitting === true) {
|
else if (currentIsCommitting === true && nextIsCommitting === true) {
|
||||||
return "isCommiting is a mutex, hence only changes are allowed";
|
return "isCommitting is a mutex, hence only changes are allowed";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
// Allow the state change. If the state of the active field is:
|
// Allow the state change. If the state of the active field is:
|
||||||
// - 'activating' or 'active': change it to 'candidate'
|
// - 'activating' or 'active': change it to 'candidate'
|
||||||
// - 'changed' or 'invalid': change it to 'saving'
|
// - 'changed' or 'invalid': change it to 'saving'
|
||||||
// - 'saving'or 'saved': don't do anything.
|
// - 'saving' or 'saved': don't do anything.
|
||||||
if (this.activeFieldStates.indexOf(activeFieldState) !== -1) {
|
if (this.activeFieldStates.indexOf(activeFieldState) !== -1) {
|
||||||
activeField.set('state', 'candidate');
|
activeField.set('state', 'candidate');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
/**
|
/**
|
||||||
* Repositions the entity toolbar on window scroll and resize.
|
* Repositions the entity toolbar on window scroll and resize.
|
||||||
*
|
*
|
||||||
* @param jQuery.Eevent event
|
* @param jQuery.Event event
|
||||||
*/
|
*/
|
||||||
windowChangeHandler: function (event) {
|
windowChangeHandler: function (event) {
|
||||||
this.position();
|
this.position();
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@
|
||||||
var $displayButtons = $menu.nextAll('input.add-display').detach();
|
var $displayButtons = $menu.nextAll('input.add-display').detach();
|
||||||
$displayButtons.appendTo($addDisplayDropdown.find('.action-list')).wrap('<li>')
|
$displayButtons.appendTo($addDisplayDropdown.find('.action-list')).wrap('<li>')
|
||||||
.parent().eq(0).addClass('first').end().eq(-1).addClass('last');
|
.parent().eq(0).addClass('first').end().eq(-1).addClass('last');
|
||||||
// Remove the 'Add ' prefix from the button labels since they're being palced
|
// Remove the 'Add ' prefix from the button labels since they're being placed
|
||||||
// in an 'Add' dropdown.
|
// in an 'Add' dropdown.
|
||||||
// @todo This assumes English, but so does $addDisplayDropdown above. Add
|
// @todo This assumes English, but so does $addDisplayDropdown above. Add
|
||||||
// support for translation.
|
// support for translation.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue