Loading js/private_message_form.js +3 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Adds JS functionality to the Private Message form. */ (function ($, Drupal, drupalSettings) { (function ($, Drupal, drupalSettings, once) { 'use strict'; Loading Loading @@ -32,7 +32,7 @@ * @param {Object} context The context. */ function submitButtonListener(context) { $(context).parent().find('.private-message-add-form textarea').once('private-message-form-submit-button-listener').each(function () { $(once('private-message-form-submit-button-listener', '.private-message-add-form textarea', context)).each(function () { $(this).keyup(submitKeyPress); }); } Loading @@ -47,4 +47,4 @@ } }; }(jQuery, Drupal, drupalSettings)); }(jQuery, Drupal, drupalSettings, once)); js/private_message_inbox_block.js +4 −4 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Drupal.PrivateMessageInbox = {}; Drupal.PrivateMessageInbox.updateInbox = {}; (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; Loading Loading @@ -143,7 +143,7 @@ Drupal.PrivateMessageInbox.updateInbox = {}; * @param {Object} context The context. */ function loadOlderThreadWatcher(context) { $(context).find('#load-previous-threads-button').once('load-loder-threads-watcher').each(function () { $(once('load-loder-threads-watcher', '#load-previous-threads-button', context)).each(function () { $(this).on('click', loadOldThreadWatcherHandler); }); } Loading @@ -167,7 +167,7 @@ Drupal.PrivateMessageInbox.updateInbox = {}; * @param {Object} context The context. */ function inboxThreadLinkListener(context) { $(context).find('.private-message-inbox-thread-link').once('inbox-thread-link-listener').each(function () { $(once('inbox-thread-link-listener', '.private-message-inbox-thread-link', context)).each(function () { $(this).click(inboxThreadLinkListenerHandler); }); } Loading Loading @@ -230,4 +230,4 @@ Drupal.PrivateMessageInbox.updateInbox = {}; } }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once)); js/private_message_members_widget.js +5 −6 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Handles JavaScript for the members widget of a private message thread. */ (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; // Initialize script variables. Loading Loading @@ -227,7 +227,7 @@ * Watch the members field, inserting usernames as necessary. */ function membersFieldListener() { usernameInput.once('members-field-listener').each(function () { $(once('members-field-listener', usernameInput)).each(function () { var timeout; // Act on keydown. Loading Loading @@ -393,8 +393,7 @@ // Only do something if there is a container to work with. if (autocompleteResultsContainer) { // The JS is only applied a single time, by using $.once(). autocompleteResultsContainer.children('ul:first').children('li').children('a').once('pm-autocomplete-listener').each(function () { $(once('pm-autocomplete-listener', autocompleteResultsContainer.children('ul:first').children('li').children('a'))).each(function () { // If a search result is clicked, the username is added to the list of // members. $(this).click(addUserToMembersClickHandler) Loading Loading @@ -449,7 +448,7 @@ * @param {Object} context The context. */ function membersWatcher(context) { $(context).find('.private-message-member-display-item .pm-username-remove-link').once('private-message-members-watcher').each(function () { $(once('private-message-members-watcher', '.private-message-member-display-item .pm-username-remove-link', context)).each(function () { $(this).click(function () { removeMember($(this)); }); Loading Loading @@ -548,4 +547,4 @@ return $('<div />', { 'class': 'private-message-member-display-item', 'data-username': userName }).append($('<span/>', { 'class': 'pm-username', 'data-pm-username': userName }).text(extractUsernameFromAutocompleteValue(userName))).append($('<span/>', {class: 'pm-username-remove-link'}).text('X')); }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once)); js/private_message_thread.js +3 −3 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Drupal.PrivateMessages = {}; Drupal.PrivateMessages.threadChange = {}; (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; Loading Loading @@ -95,7 +95,7 @@ Drupal.PrivateMessages.threadChange = {}; * @param {Object} context The context. */ function loadPreviousListener(context) { $(context).find('#load-previous-messages').once('load-previous-private-messages-listener').each(function () { $(once('load-previous-private-messages-listener', '#load-previous-messages', context)).each(function () { $(this).click(loadPreviousListenerHandler); }); } Loading Loading @@ -389,4 +389,4 @@ Drupal.PrivateMessages.threadChange = {}; } }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once)); js/private_message_uninstall_prep_confirm.js +3 −3 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ * Adds JavaScript functionality to the uninstall preparation confirm page. */ (function ($, Drupal, window) { (function ($, Drupal, window, once) { 'use strict'; function uninstallButtonWatcher(context) { $(context).find('#private-message-admin-uninstall-form #edit-submit').once('uninstall-button-watcher').each(function () { $(once('uninstall-button-watcher', '#private-message-admin-uninstall-form #edit-submit', context)).each(function () { $(this).click(function () { return window.confirm(Drupal.t('This will delete all private message content from the database. Are you absolutely sure you wish to proceed?')); }); Loading @@ -21,4 +21,4 @@ } }; }(jQuery, Drupal, window)); }(jQuery, Drupal, window, once)); Loading
js/private_message_form.js +3 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Adds JS functionality to the Private Message form. */ (function ($, Drupal, drupalSettings) { (function ($, Drupal, drupalSettings, once) { 'use strict'; Loading Loading @@ -32,7 +32,7 @@ * @param {Object} context The context. */ function submitButtonListener(context) { $(context).parent().find('.private-message-add-form textarea').once('private-message-form-submit-button-listener').each(function () { $(once('private-message-form-submit-button-listener', '.private-message-add-form textarea', context)).each(function () { $(this).keyup(submitKeyPress); }); } Loading @@ -47,4 +47,4 @@ } }; }(jQuery, Drupal, drupalSettings)); }(jQuery, Drupal, drupalSettings, once));
js/private_message_inbox_block.js +4 −4 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Drupal.PrivateMessageInbox = {}; Drupal.PrivateMessageInbox.updateInbox = {}; (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; Loading Loading @@ -143,7 +143,7 @@ Drupal.PrivateMessageInbox.updateInbox = {}; * @param {Object} context The context. */ function loadOlderThreadWatcher(context) { $(context).find('#load-previous-threads-button').once('load-loder-threads-watcher').each(function () { $(once('load-loder-threads-watcher', '#load-previous-threads-button', context)).each(function () { $(this).on('click', loadOldThreadWatcherHandler); }); } Loading @@ -167,7 +167,7 @@ Drupal.PrivateMessageInbox.updateInbox = {}; * @param {Object} context The context. */ function inboxThreadLinkListener(context) { $(context).find('.private-message-inbox-thread-link').once('inbox-thread-link-listener').each(function () { $(once('inbox-thread-link-listener', '.private-message-inbox-thread-link', context)).each(function () { $(this).click(inboxThreadLinkListenerHandler); }); } Loading Loading @@ -230,4 +230,4 @@ Drupal.PrivateMessageInbox.updateInbox = {}; } }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once));
js/private_message_members_widget.js +5 −6 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Handles JavaScript for the members widget of a private message thread. */ (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; // Initialize script variables. Loading Loading @@ -227,7 +227,7 @@ * Watch the members field, inserting usernames as necessary. */ function membersFieldListener() { usernameInput.once('members-field-listener').each(function () { $(once('members-field-listener', usernameInput)).each(function () { var timeout; // Act on keydown. Loading Loading @@ -393,8 +393,7 @@ // Only do something if there is a container to work with. if (autocompleteResultsContainer) { // The JS is only applied a single time, by using $.once(). autocompleteResultsContainer.children('ul:first').children('li').children('a').once('pm-autocomplete-listener').each(function () { $(once('pm-autocomplete-listener', autocompleteResultsContainer.children('ul:first').children('li').children('a'))).each(function () { // If a search result is clicked, the username is added to the list of // members. $(this).click(addUserToMembersClickHandler) Loading Loading @@ -449,7 +448,7 @@ * @param {Object} context The context. */ function membersWatcher(context) { $(context).find('.private-message-member-display-item .pm-username-remove-link').once('private-message-members-watcher').each(function () { $(once('private-message-members-watcher', '.private-message-member-display-item .pm-username-remove-link', context)).each(function () { $(this).click(function () { removeMember($(this)); }); Loading Loading @@ -548,4 +547,4 @@ return $('<div />', { 'class': 'private-message-member-display-item', 'data-username': userName }).append($('<span/>', { 'class': 'pm-username', 'data-pm-username': userName }).text(extractUsernameFromAutocompleteValue(userName))).append($('<span/>', {class: 'pm-username-remove-link'}).text('X')); }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once));
js/private_message_thread.js +3 −3 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Drupal.PrivateMessages = {}; Drupal.PrivateMessages.threadChange = {}; (function ($, Drupal, drupalSettings, window) { (function ($, Drupal, drupalSettings, window, once) { 'use strict'; Loading Loading @@ -95,7 +95,7 @@ Drupal.PrivateMessages.threadChange = {}; * @param {Object} context The context. */ function loadPreviousListener(context) { $(context).find('#load-previous-messages').once('load-previous-private-messages-listener').each(function () { $(once('load-previous-private-messages-listener', '#load-previous-messages', context)).each(function () { $(this).click(loadPreviousListenerHandler); }); } Loading Loading @@ -389,4 +389,4 @@ Drupal.PrivateMessages.threadChange = {}; } }; }(jQuery, Drupal, drupalSettings, window)); }(jQuery, Drupal, drupalSettings, window, once));
js/private_message_uninstall_prep_confirm.js +3 −3 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ * Adds JavaScript functionality to the uninstall preparation confirm page. */ (function ($, Drupal, window) { (function ($, Drupal, window, once) { 'use strict'; function uninstallButtonWatcher(context) { $(context).find('#private-message-admin-uninstall-form #edit-submit').once('uninstall-button-watcher').each(function () { $(once('uninstall-button-watcher', '#private-message-admin-uninstall-form #edit-submit', context)).each(function () { $(this).click(function () { return window.confirm(Drupal.t('This will delete all private message content from the database. Are you absolutely sure you wish to proceed?')); }); Loading @@ -21,4 +21,4 @@ } }; }(jQuery, Drupal, window)); }(jQuery, Drupal, window, once));