Replaces all click events with WCF_CLICK_EVENT
authorFabii547 <fabiangossner@gmail.com>
Fri, 20 May 2016 08:53:40 +0000 (10:53 +0200)
committerFabii547 <fabiangossner@gmail.com>
Fri, 20 May 2016 08:53:40 +0000 (10:53 +0200)
34 files changed:
wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js
wcfsetup/install/files/js/WoltLab/WCF/Attachment/Upload.js
wcfsetup/install/files/js/WoltLab/WCF/Bbcode/Collapsible.js
wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js
wcfsetup/install/files/js/WoltLab/WCF/Controller/Notice/Dismiss.js
wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js
wcfsetup/install/files/js/WoltLab/WCF/Controller/Style/Changer.js
wcfsetup/install/files/js/WoltLab/WCF/Controller/User/Notification/Settings.js
wcfsetup/install/files/js/WoltLab/WCF/Date/Picker.js
wcfsetup/install/files/js/WoltLab/WCF/Language/Chooser.js
wcfsetup/install/files/js/WoltLab/WCF/Language/Input.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Editor.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Base.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Search.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Select.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Search.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Upload.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/CloseOverlay.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Confirmation.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Dialog.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/FlexibleMenu.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/ItemList.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Like/Handler.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Mobile.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Notification.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/JumpTo.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/JumpToTop.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Pagination.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Redactor/Mention.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Suggestion.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/TabMenu/Simple.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Tooltip.js

index 1422d2d6ea15bfb9cb3c896fc94ee2377c6aef72..7ae492419295a46248af56f3606758fa18e19ad1 100644 (file)
@@ -89,7 +89,7 @@ define(['Ajax', 'Dictionary', 'Dom/Util', 'EventHandler'], function(Ajax, Dictio
                                button.disabled = !checkbox.checked;
                        });
                        
-                       button.addEventListener('click', function() {
+                       button.addEventListener(WCF_CLICK_EVENT, function() {
                                Ajax.apiOnce({
                                        data: {
                                                actionName: 'markAsTainted',
index ffba3f7011d4d7c84884123ee845c7eb28e3bcda..c278a50b920ced3bb9446119bbd30ae6cd0d8614 100644 (file)
@@ -21,10 +21,10 @@ define(['Core', 'Dom/ChangeListener', 'Dom/Traverse', 'Language', 'List', 'Uploa
                });
                
                // add event listeners
-               DomTraverse.childByClass(this._button, '.button').addEventListener('click', this._validateLimit.bind(this));
-               elByClass(this._target, 'jsButtonInsertAttachment').addEventListener('click', this._insert.bind(this));
-               elByClass(this._target, 'jsButtonAttachmentInsertThumbnail').addEventListener('click', this._insert.bind(this));
-               elByClass(this._target, 'jsButtonAttachmentInsertFull').addEventListener('click', this._insert.bind(this));
+               DomTraverse.childByClass(this._button, '.button').addEventListener(WCF_CLICK_EVENT, this._validateLimit.bind(this));
+               elByClass(this._target, 'jsButtonInsertAttachment').addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
+               elByClass(this._target, 'jsButtonAttachmentInsertThumbnail').addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
+               elByClass(this._target, 'jsButtonAttachmentInsertFull').addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
                
                // TODO: WCF.System.Event.addListener('com.woltlab.wcf.action.delete', 'attachment_' + this._wysiwygContainerId, $.proxy(this._removeLimitError, this));
                
@@ -36,7 +36,7 @@ define(['Core', 'Dom/ChangeListener', 'Dom/Traverse', 'Language', 'List', 'Uploa
                if (DomTraverse.childBySel(this._target, 'li:not(.uploadFailed)')) {
                        elHide(this._insertAllButton);
                }
-               this._insertAllButton.addEventListener('click', this._insertAll.bind(this));
+               this._insertAllButton.addEventListener(WCF_CLICK_EVENT, this._insertAll.bind(this));
                this._button.appendChild(this._insertAllButton);
                
                if (this._wysiwygContainerId) {
@@ -197,7 +197,7 @@ define(['Core', 'Dom/ChangeListener', 'Dom/Traverse', 'Language', 'List', 'Uploa
                                                        span.className = 'button small jsButtonAttachmentInsertThumbnail';
                                                        span.textContent = Language.get('wcf.global.button.insertThumbnail');
                                                        elData(span, 'object-id', attachment.attachmentID);
-                                                       span.addEventListener('click', this._insert.bind(this));
+                                                       span.addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
                                                        insertThumbnailButton.appendChild(span);
                                                        
                                                        var insertOriginalButton = elCreate('li');
@@ -207,7 +207,7 @@ define(['Core', 'Dom/ChangeListener', 'Dom/Traverse', 'Language', 'List', 'Uploa
                                                        span.className = 'button small jsButtonAttachmentInsertFull';
                                                        span.textContent = Language.get('wcf.global.button.insertFull');
                                                        elData(span, 'object-id', attachment.attachmentID);
-                                                       span.addEventListener('click', this._insert.bind(this));
+                                                       span.addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
                                                        insertOriginalButton.appendChild(span);
                                                }
                                                else {
@@ -218,7 +218,7 @@ define(['Core', 'Dom/ChangeListener', 'Dom/Traverse', 'Language', 'List', 'Uploa
                                                        span.className = 'button small jsButtonAttachmentInsertPlain';
                                                        span.textContent = Language.get('wcf.global.button.insert');
                                                        elData(span, 'object-id', attachment.attachmentID);
-                                                       span.addEventListener('click', this._insert.bind(this));
+                                                       span.addEventListener(WCF_CLICK_EVENT, this._insert.bind(this));
                                                        insertPlainButton.appendChild(span);
                                                }
                                        }
index ccfed639fee7fc7431118ba2df74adb161a4e88f..c120611bedb1372844944b55205b375c070baaed 100644 (file)
@@ -33,7 +33,7 @@ define([], function() {
                                                toggleButton.textContent = elData(toggleButton, 'title-' + (expand ? 'collapse' : 'expand'));
                                        };
                                        
-                                       toggleButton.addEventListener('click', toggle);
+                                       toggleButton.addEventListener(WCF_CLICK_EVENT, toggle);
                                        
                                        // searching in a page causes Google Chrome to scroll
                                        // the box if something inside it matches
index c75ca83018491a8a28722a081d094dd7bb37ec06..290ae7a13ef4b94628715cf39a2e5909f2f83984 100644 (file)
@@ -90,7 +90,7 @@ define(
                                        var markAll = elBySel('.jsClipboardMarkAll', container);
                                        if (markAll !== null) {
                                                elData(markAll, 'container-id', containerId);
-                                               markAll.addEventListener('click', this._markAll.bind(this));
+                                               markAll.addEventListener(WCF_CLICK_EVENT, this._markAll.bind(this));
                                        }
                                        
                                        containerData = {
@@ -107,7 +107,7 @@ define(
                                        
                                        if (!_knownCheckboxes.has(checkbox)) {
                                                elData(checkbox, 'container-id', containerId);
-                                               checkbox.addEventListener('click', _callbackCheckbox);
+                                               checkbox.addEventListener(WCF_CLICK_EVENT, _callbackCheckbox);
                                                
                                                _knownCheckboxes.add(checkbox);
                                        }
@@ -485,7 +485,7 @@ define(
                                        dropdown.appendChild(item);
                                        
                                        elData(item, 'type', typeName);
-                                       item.addEventListener('click', _callbackItem);
+                                       item.addEventListener(WCF_CLICK_EVENT, _callbackItem);
                                        
                                        _itemData.set(item, itemData);
                                }
@@ -500,7 +500,7 @@ define(
                                label = elCreate('span');
                                label.textContent = Language.get('wcf.clipboard.item.unmarkAll');
                                unmarkAll.appendChild(label);
-                               unmarkAll.addEventListener('click', _callbackUnmarkAll);
+                               unmarkAll.addEventListener(WCF_CLICK_EVENT, _callbackUnmarkAll);
                                dropdown.appendChild(unmarkAll);
                                
                                if (keepEditors.indexOf(typeName) !== -1) {
index f238e72908f73c79411a0a98f54b67b81099b0da..493417693a310eec15d88d9568862c725f4534f7 100644 (file)
@@ -22,7 +22,7 @@ define(['Ajax'], function(Ajax) {
                        if (buttons.length) {
                                var clickCallback = this._click.bind(this);
                                for (var i = 0, length = buttons.length; i < length; i++) {
-                                       buttons[i].addEventListener('click', clickCallback);
+                                       buttons[i].addEventListener(WCF_CLICK_EVENT, clickCallback);
                                }
                        }
                },
index 33a5d15c677abd0ae07e406d7006486e157a1d8a..a9b48a9ab19c19a0e7acfdb28c9020eae4fffe84 100644 (file)
@@ -165,7 +165,7 @@ define(['Ajax', 'Dictionary', 'Environment', 'Dom/ChangeListener', 'Dom/Util', '
                                element.addEventListener('mouseleave', _callbackMouseLeave);
                                
                                if (element.nodeName === 'A' && elAttr(element, 'href')) {
-                                       element.addEventListener('click', _callbackClick);
+                                       element.addEventListener(WCF_CLICK_EVENT, _callbackClick);
                                }
                                
                                var cacheId = identifier + "-" + objectId;
index ff82cd4e0c72f8fadffcc47d88e434ee0c4ac9f0..9baa25203c39d8dec7f2f521f62802abba374cab 100644 (file)
@@ -24,7 +24,7 @@ define(['Ajax', 'Language', 'Ui/Dialog'], function(Ajax, Language, UiDialog) {
                        
                        var listItem = elCreate('li');
                        listItem.classList.add('styleChanger');
-                       listItem.addEventListener('click', this.showDialog.bind(this));
+                       listItem.addEventListener(WCF_CLICK_EVENT, this.showDialog.bind(this));
                        
                        var link = elCreate('a');
                        elAttr(link, 'href', '#');
@@ -63,7 +63,7 @@ define(['Ajax', 'Language', 'Ui/Dialog'], function(Ajax, Language, UiDialog) {
                                                        var style = styles[i];
                                                        
                                                        style.classList.add('pointer');
-                                                       style.addEventListener('click', this._click.bind(this));
+                                                       style.addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
                                                }
                                        }).bind(this)
                                }
index f45fff7eebbec1b43c82e72513f8a7da7e484b97..939af2398c881e054270caa290997b41e097edb9 100644 (file)
@@ -48,15 +48,15 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Ui/SimpleDropdown'], function
                        var groupId = ~~elData(group, 'object-id');
                        
                        var disabledNotification = elById('settings_' + groupId + '_disabled');
-                       disabledNotification.addEventListener('click', function() { mailSetting.classList.remove('active'); });
+                       disabledNotification.addEventListener(WCF_CLICK_EVENT, function() { mailSetting.classList.remove('active'); });
                        var enabledNotification = elById('settings_' + groupId + '_enabled');
-                       enabledNotification.addEventListener('click', function() { mailSetting.classList.add('active'); });
+                       enabledNotification.addEventListener(WCF_CLICK_EVENT, function() { mailSetting.classList.add('active'); });
                        
                        var mailValue = DomTraverse.childByTag(mailSetting, 'INPUT');
                        
                        var button = DomTraverse.childByTag(mailSetting, 'A');
                        elData(button, 'object-id', groupId);
-                       button.addEventListener('click', _callbackClick);
+                       button.addEventListener(WCF_CLICK_EVENT, _callbackClick);
                        
                        _data.set(groupId, {
                                button: button,
@@ -118,7 +118,7 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Ui/SimpleDropdown'], function
                                        link.textContent = Language.get('wcf.user.notification.mailNotificationType.' + value);
                                        listItem.appendChild(link);
                                        elData(listItem, 'value', value);
-                                       listItem.addEventListener('click', _callbackSelectType);
+                                       listItem.addEventListener(WCF_CLICK_EVENT, _callbackSelectType);
                                        
                                        if (initialValue === value) {
                                                listItem.className = 'active';
index 1ea7f363b5576ee841a33d73547bd5652c1bc11a..3417432a22ff046ebfbd54e7a66df03f0ee0dda1 100644 (file)
@@ -96,7 +96,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                                element.parentNode.insertBefore(shadowElement, element);
                                element.removeAttribute('name');
                                
-                               element.addEventListener('click', _callbackOpen);
+                               element.addEventListener(WCF_CLICK_EVENT, _callbackOpen);
                                
                                // create input addon
                                var container = elCreate('div');
@@ -104,7 +104,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                                
                                var button = elCreate('a');
                                button.className = 'inputSuffix button';
-                               button.addEventListener('click', _callbackOpen);
+                               button.addEventListener(WCF_CLICK_EVENT, _callbackOpen);
                                container.appendChild(button);
                                
                                var icon = elCreate('span');
@@ -448,7 +448,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                        
                        _datePicker = elCreate('div');
                        _datePicker.className = 'datePicker';
-                       _datePicker.addEventListener('click', function(event) { event.stopPropagation(); });
+                       _datePicker.addEventListener(WCF_CLICK_EVENT, function(event) { event.stopPropagation(); });
                        
                        var pointer = elCreate('span');
                        pointer.className = 'elementPointer';
@@ -460,7 +460,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                        
                        _dateMonthPrevious = elCreate('a');
                        _dateMonthPrevious.className = 'icon icon16 fa-arrow-left previous';
-                       _dateMonthPrevious.addEventListener('click', this.previousMonth.bind(this));
+                       _dateMonthPrevious.addEventListener(WCF_CLICK_EVENT, this.previousMonth.bind(this));
                        header.appendChild(_dateMonthPrevious);
                        
                        var monthYearContainer = elCreate('span');
@@ -492,7 +492,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                        
                        _dateMonthNext = elCreate('a');
                        _dateMonthNext.className = 'icon icon16 fa-arrow-right next';
-                       _dateMonthNext.addEventListener('click', this.nextMonth.bind(this));
+                       _dateMonthNext.addEventListener(WCF_CLICK_EVENT, this.nextMonth.bind(this));
                        header.appendChild(_dateMonthNext);
                        
                        _dateGrid = elCreate('ul');
@@ -520,7 +520,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                                
                                for (var j = 0; j < 7; j++) {
                                        cell = elCreate('a');
-                                       cell.addEventListener('click', callbackClick);
+                                       cell.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                        _dateCells.push(cell);
                                        
                                        row.appendChild(cell);
@@ -692,7 +692,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment
                        element.value = data.shadow.value;
                        
                        element.removeAttribute('data-value');
-                       element.removeEventListener('click', _callbackOpen);
+                       element.removeEventListener(WCF_CLICK_EVENT, _callbackOpen);
                        elRemove(data.shadow);
                        
                        element.classList.remove('inputDatePicker');
index 698089b66d7e66ae1cfedb9ef6d4c347db1d0312..89b58422a50b74cab69c900ae694d9d0e01c14e0 100644 (file)
@@ -115,7 +115,7 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/S
                                        
                                        listItem = elCreate('li');
                                        listItem.className = 'boxFlag';
-                                       listItem.addEventListener('click', callbackClick);
+                                       listItem.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                        elData(listItem, 'language-id', availableLanguageId);
                                        dropdownMenu.appendChild(listItem);
                                        
@@ -154,7 +154,7 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/S
                                
                                listItem = elCreate('li');
                                elData(listItem, 'language-id', availableLanguageId);
-                               listItem.addEventListener('click', callbackClick);
+                               listItem.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                dropdownMenu.appendChild(listItem);
                                
                                a = elCreate('a');
@@ -165,7 +165,7 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/S
                                        dropdownToggle.innerHTML = listItem.firstChild.innerHTML;
                                }
                                
-                               listItem.addEventListener('click', callbackClick)
+                               listItem.addEventListener(WCF_CLICK_EVENT, callbackClick)
                        }
                        else if (languageId === 0) {
                                dropdownToggle.innerHTML = null;
index 7cae3a5c254f8e82ef3c27fa0834e10b9d8e17fa..1055fcad4f98ab454dd76c81a4037cb30fcb9ee3 100644 (file)
@@ -120,7 +120,7 @@ define(['Core', 'Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'Dom/Traver
                                        span.textContent = availableLanguages[languageId];
                                        
                                        listItem.appendChild(span);
-                                       listItem.addEventListener('click', callbackClick);
+                                       listItem.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                        dropdownMenu.appendChild(listItem);
                                }
                        }
@@ -135,7 +135,7 @@ define(['Core', 'Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'Dom/Traver
                                span = elCreate('span');
                                span.textContent = Language.get('wcf.global.button.disabledI18n');
                                listItem.appendChild(span);
-                               listItem.addEventListener('click', callbackClick);
+                               listItem.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                dropdownMenu.appendChild(listItem);
                        }
                        
index f62eeb0282aca3a17dc20a6bac5104cc2ce0e8b7..7bae2439e7427e8b3cb149d307053d3018b3b414 100644 (file)
@@ -117,7 +117,7 @@ define(
                                                
                                                setTimeout(this._setData.bind(this), 100);
                                                
-                                               elBySel('button[data-type="submit"]', editor).addEventListener('click', this._saveData.bind(this));
+                                               elBySel('button[data-type="submit"]', editor).addEventListener(WCF_CLICK_EVENT, this._saveData.bind(this));
                                        }).bind(this),
                                        data: {
                                                actionName: 'getEditorDialog',
index b4988e69fb1124f94033b50f9784fc84cbbcc81f..c1c122ba224fb6f4f7ce0c40de33ae262713f7a6 100644 (file)
@@ -58,7 +58,7 @@ define(
                                        var editIcon = elByClass('jsMediaEditIcon', listItem)[0];
                                        if (editIcon) {
                                                editIcon.classList.remove('jsMediaEditIcon');
-                                               editIcon.addEventListener('click', this._editMedia.bind(this));
+                                               editIcon.addEventListener(WCF_CLICK_EVENT, this._editMedia.bind(this));
                                        }
                                }
                        }
index 52452f8b3cb7f86fc5d0b35d4a35ac0ccd678a1c..16de1dac628b8d56c01427db2d44f938fee610fd 100644 (file)
@@ -18,7 +18,7 @@ define(['Core', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/WCF/Media/Mana
                this._activeButton = null;
                this._buttons = elByClass(this._options.buttonClass || 'jsMediaEditorButton');
                for (var i = 0, length = this._buttons.length; i < length; i++) {
-                       this._buttons[i].addEventListener('click', this._click.bind(this));
+                       this._buttons[i].addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
                }
                
                this._activeButton = null;
@@ -39,7 +39,7 @@ define(['Core', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/WCF/Media/Mana
                                var insertIcon = elByClass('jsMediaInsertIcon', listItem)[0];
                                if (insertIcon) {
                                        insertIcon.classList.remove('jsMediaInsertIcon');
-                                       insertIcon.addEventListener('click', this._openInsertDialog.bind(this));
+                                       insertIcon.addEventListener(WCF_CLICK_EVENT, this._openInsertDialog.bind(this));
                                }
                        }
                },
@@ -119,7 +119,7 @@ define(['Core', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/WCF/Media/Mana
                                        submitButton.className = 'buttonPrimary';
                                        submitButton.textContent = Language.get('wcf.global.button.insert');
                                        elData(submitButton, 'object-id', media.mediaID);
-                                       submitButton.addEventListener('click', this._insertMedia.bind(this));
+                                       submitButton.addEventListener(WCF_CLICK_EVENT, this._insertMedia.bind(this));
                                        formSubmit.appendChild(submitButton);
                                        
                                        UiDialog.open({
index fa1c08c6c51c763fda103a5a58d879f31d56bc07..b3b4fd485a49c12b831eda0612514c6c3a329d79 100644 (file)
@@ -22,7 +22,7 @@ define(['Ajax', 'Core', 'Dom/Traverse', 'Dom/Util', 'Language', 'WoltLab/WCF/Med
                this._input.addEventListener('keypress', this._keyPress.bind(this));
                
                this._cancelButton = elById(this._getIdPrefix() + 'SearchCancelButton');
-               this._cancelButton.addEventListener('click', this._cancelSearch.bind(this));
+               this._cancelButton.addEventListener(WCF_CLICK_EVENT, this._cancelSearch.bind(this));
        };
        Core.inherit(MediaManagerSearch, MediaSearch, {
                /**
index 0a3ed32e13a0e34224d2341280da3882e1d86607..4e0924df1feae4707b8b69a11682da7c1ddc877d 100644 (file)
@@ -27,7 +27,7 @@ define(['Core', 'Dom/Traverse', 'Language', 'ObjectMap', 'Ui/Dialog', 'WoltLab/W
                        if (store) {
                                var storeElement = elById(store);
                                if (storeElement && storeElement.tagName === 'INPUT') {
-                                       this._buttons[i].addEventListener('click', this._click.bind(this));
+                                       this._buttons[i].addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
                                        
                                        this._storeElements.set(button, storeElement);
                                }
@@ -50,7 +50,7 @@ define(['Core', 'Dom/Traverse', 'Language', 'ObjectMap', 'Ui/Dialog', 'WoltLab/W
                                var chooseIcon = elByClass('jsMediaSelectIcon', listItem)[0];
                                if (chooseIcon) {
                                        chooseIcon.classList.remove('jsMediaSelectIcon');
-                                       chooseIcon.addEventListener('click', this._chooseMedia.bind(this));
+                                       chooseIcon.addEventListener(WCF_CLICK_EVENT, this._chooseMedia.bind(this));
                                }
                        }
                },
index 6dc909a9b8ceaefb287ef9b294d2d31a6255010c..ceec34dfea227e6632c7a495599bcd946d150a16 100644 (file)
@@ -27,7 +27,7 @@ define(['Ajax', 'Dom/Traverse', 'Dom/Util', 'Language', 'Ui/SimpleDropdown'], fu
                                        this._fileType = initialFileType;
                                }
                                
-                               this._fileTypes[i].addEventListener('click', selectFileType);
+                               this._fileTypes[i].addEventListener(WCF_CLICK_EVENT, selectFileType);
                        }
                        
                        if (initialFileType && initialFileType.length) {
index d833122fc815b60e69e73dbeb58124f11905a02c..6e63317d0260f5c9a65bc19e96a7f7d452981dd5 100644 (file)
@@ -147,7 +147,7 @@ define(
                                        fileIcon.classList.add('pointer');
                                        
                                        file.classList.add('uploadFailed');
-                                       file.addEventListener('click', function() {
+                                       file.addEventListener(WCF_CLICK_EVENT, function() {
                                                elRemove(this);
                                        });
                                        
index 5df68bdb51d8468435a0306bae89594612de87d9..e9325bae1dc78302edf30c9e455b1007dad8d03a 100644 (file)
@@ -19,7 +19,7 @@ define(['CallbackList'], function(CallbackList) {
                 * Sets up global event listener for bubbled clicks events.
                 */
                setup: function() {
-                       document.body.addEventListener('click', this.execute.bind(this));
+                       document.body.addEventListener(WCF_CLICK_EVENT, this.execute.bind(this));
                },
                
                /**
index 9a59796275268c1bb2fcb8189b382ac39e06b7d2..84c8a447dceca6d9aaaca47370b9d399485eba3c 100644 (file)
@@ -113,12 +113,12 @@ define(['Core', 'Language', 'Ui/Dialog'], function(Core, Language, UiDialog) {
                        _confirmButton = elCreate('button');
                        _confirmButton.classList.add('buttonPrimary');
                        _confirmButton.textContent = Language.get('wcf.global.confirmation.confirm');
-                       _confirmButton.addEventListener('click', this._confirm.bind(this));
+                       _confirmButton.addEventListener(WCF_CLICK_EVENT, this._confirm.bind(this));
                        formSubmit.appendChild(_confirmButton);
                        
                        var cancelButton = elCreate('button');
                        cancelButton.textContent = Language.get('wcf.global.confirmation.cancel');
-                       cancelButton.addEventListener('click', function() { UiDialog.close('wcfSystemConfirmation'); });
+                       cancelButton.addEventListener(WCF_CLICK_EVENT, function() { UiDialog.close('wcfSystemConfirmation'); });
                        formSubmit.appendChild(cancelButton);
                        
                        document.body.appendChild(dialog);
index 207057dcc3ef1aaa81c74f285a2a11baaa33abfe..c98dfcd9e9614f6fe26c7ce10ff6a2c4f1d31a4f 100644 (file)
@@ -42,7 +42,7 @@ define(
                        _container = elCreate('div');
                        _container.classList.add('dialogOverlay');
                        elAttr(_container, 'aria-hidden', 'true');
-                       _container.addEventListener('click', this._closeOnBackdrop.bind(this));
+                       _container.addEventListener(WCF_CLICK_EVENT, this._closeOnBackdrop.bind(this));
                        
                        elById('content').appendChild(_container);
                        
@@ -80,7 +80,7 @@ define(
                                        ((function(button, container) {
                                                container.classList.remove('jsStaticDialogContent');
                                                elHide(container);
-                                               button.addEventListener('click', this.openStatic.bind(this, container.id, null, { title: elData(container, 'title') }));
+                                               button.addEventListener(WCF_CLICK_EVENT, this.openStatic.bind(this, container.id, null, { title: elData(container, 'title') }));
                                        }).bind(this))(button, container);
                                }
                        }
@@ -288,7 +288,7 @@ define(
                                closeButton.className = 'dialogCloseButton jsTooltip';
                                elAttr(closeButton, 'title', options.closeButtonLabel);
                                elAttr(closeButton, 'aria-label', options.closeButtonLabel);
-                               closeButton.addEventListener('click', this._close.bind(this));
+                               closeButton.addEventListener(WCF_CLICK_EVENT, this._close.bind(this));
                                header.appendChild(closeButton);
                                
                                var span = elCreate('span');
index 617b163202b286d4824fe48097164e3960e27c30..a4f3cd148b214d7a5f828356cb06b41f8b6a5f17 100644 (file)
@@ -173,10 +173,10 @@ define(['Core', 'Dictionary', 'Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util',
                                        var item = elCreate('li');
                                        item.innerHTML = hiddenItem.innerHTML;
                                        
-                                       item.addEventListener('click', (function(event) {
+                                       item.addEventListener(WCF_CLICK_EVENT, (function(event) {
                                                event.preventDefault();
                                                
-                                               Core.triggerEvent(elBySel('a', hiddenItem), 'click');
+                                               Core.triggerEvent(elBySel('a', hiddenItem), WCF_CLICK_EVENT);
                                                
                                                // force a rebuild to guarantee the active item being visible
                                                setTimeout(function() {
index 8acd1af504c28e6f3992d63158b5d473d5d80f33..57a986e764d69f212eb8f32c252f0a62d56ed8bb 100644 (file)
@@ -180,7 +180,7 @@ define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'WoltLab/WCF/Ui/Sugges
                        var list = elCreate('ol');
                        list.className = 'inputItemList';
                        elData(list, 'element-id', element.id);
-                       list.addEventListener('click', function(event) {
+                       list.addEventListener(WCF_CLICK_EVENT, function(event) {
                                if (event.target === list) element.focus();
                        });
                        
@@ -347,7 +347,7 @@ define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'WoltLab/WCF/Ui/Sugges
                        
                        var button = elCreate('a');
                        button.className = 'icon icon16 fa-times';
-                       button.addEventListener('click', _callbackRemoveItem);
+                       button.addEventListener(WCF_CLICK_EVENT, _callbackRemoveItem);
                        listItem.appendChild(content);
                        listItem.appendChild(button);
                        
index ed593e75d6a58cbb372c947f1e0b41b0fd736da2..a3d4a401949a098310f08a68aca0624bac1574f0 100644 (file)
@@ -126,7 +126,7 @@ define(
                                        
                                        summaryContent = elCreate('span');
                                        summaryContent.className = 'likesSummaryContent';
-                                       summaryContent.addEventListener('click', this._showSummary.bind(this, element));
+                                       summaryContent.addEventListener(WCF_CLICK_EVENT, this._showSummary.bind(this, element));
                                        summary.appendChild(summaryContent);
                                        
                                        if (this._options.summaryPrepend) {
@@ -148,7 +148,7 @@ define(
                                badge = elCreate('a');
                                badge.href = '#';
                                badge.className = 'wcfLikeCounter jsTooltip' + (this._options.badgeClassNames ? ' ' + this._options.badgeClassNames : '');
-                               badge.addEventListener('click', this._showSummary.bind(this, element));
+                               badge.addEventListener(WCF_CLICK_EVENT, this._showSummary.bind(this, element));
                                
                                if (badgeContainer.nodeName === 'OL' || badgeContainer.nodeName === 'UL') {
                                        listItem = elCreate('li');
@@ -204,7 +204,7 @@ define(
                        button.href = '#';
                        button.title = title;
                        button.innerHTML = '<span class="icon icon16 fa-thumbs-o-' + (isLike ? 'up' : 'down') + '" /> <span class="invisible">' + title + '</span>';
-                       button.addEventListener('click', this._like.bind(this, element));
+                       button.addEventListener(WCF_CLICK_EVENT, this._like.bind(this, element));
                        elData(button, 'type', (isLike ? 'like' : 'dislike'));
                        
                        listItem.appendChild(button);
index 3cce87563dfb6eba8191c5cc1daf9ff9795ef09f..79bc1d12d30187b1c76df9a8a8a494a77206a4a8 100644 (file)
@@ -69,7 +69,7 @@ define(
                                        canEdit = elDataBool(element, 'can-edit');
                                        
                                        if (this._options.canEditInline) {
-                                               button.addEventListener('click', this._clickDropdown.bind(this, element));
+                                               button.addEventListener(WCF_CLICK_EVENT, this._clickDropdown.bind(this, element));
                                                button.classList.add('jsDropdownEnabled');
                                                
                                                if (canEdit) {
@@ -77,7 +77,7 @@ define(
                                                }
                                        }
                                        else if (canEdit) {
-                                               button.addEventListener('click', this._click.bind(this, element));
+                                               button.addEventListener(WCF_CLICK_EVENT, this._click.bind(this, element));
                                        }
                                }
                                
@@ -142,7 +142,7 @@ define(
                        button.classList.add('dropdownToggle');
                        button.parentNode.classList.add('dropdown');
                        (function(button, element) {
-                               button.addEventListener('click', (function(event) {
+                               button.addEventListener(WCF_CLICK_EVENT, (function(event) {
                                        event.preventDefault();
                                        event.stopPropagation();
                                        
@@ -169,7 +169,7 @@ define(
                        }
                        
                        setTimeout(function() {
-                               Core.triggerEvent(button, 'click');
+                               Core.triggerEvent(button, WCF_CLICK_EVENT);
                        }, 10);
                },
                
@@ -197,10 +197,10 @@ define(
                                        listItem.appendChild(label);
                                        
                                        if (item.item === 'editItem') {
-                                               listItem.addEventListener('click', this._click.bind(this, null));
+                                               listItem.addEventListener(WCF_CLICK_EVENT, this._click.bind(this, null));
                                        }
                                        else {
-                                               listItem.addEventListener('click', callbackClick);
+                                               listItem.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                        }
                                }
                                
@@ -340,15 +340,15 @@ define(
                        var formSubmit = elBySel('.formSubmit', editor);
                        
                        var buttonSave = elBySel('button[data-type="save"]', formSubmit);
-                       buttonSave.addEventListener('click', this._save.bind(this));
+                       buttonSave.addEventListener(WCF_CLICK_EVENT, this._save.bind(this));
                        
                        if (this._options.extendedForm) {
                                var buttonExtended = elBySel('button[data-type="extended"]', formSubmit);
-                               buttonExtended.addEventListener('click', this._prepareExtended.bind(this));
+                               buttonExtended.addEventListener(WCF_CLICK_EVENT, this._prepareExtended.bind(this));
                        }
                        
                        var buttonCancel = elBySel('button[data-type="cancel"]', formSubmit);
-                       buttonCancel.addEventListener('click', this._restoreMessage.bind(this));
+                       buttonCancel.addEventListener(WCF_CLICK_EVENT, this._restoreMessage.bind(this));
                        
                        EventHandler.add('com.woltlab.wcf.redactor', 'submitEditor_' + id, (function(data) {
                                data.cancel = true;
index 6594e0298eb5fd4be21a3f0e693a7434348061f9..3e6a6573a0988ebe19107ff6cc4f4c79b0369d92 100644 (file)
@@ -87,7 +87,7 @@ define(
                _initSearchBar: function() {
                        var _searchBar = elBySel('.searchBar');
                        
-                       _searchBar.addEventListener('click', function() {
+                       _searchBar.addEventListener(WCF_CLICK_EVENT, function() {
                                if (_enabled) {
                                        _searchBar.classList.add('searchBarOpen');
                                        
@@ -97,7 +97,7 @@ define(
                                return false;
                        });
                        
-                       _main.addEventListener('click', function() { _searchBar.classList.remove('searchBarOpen'); });
+                       _main.addEventListener(WCF_CLICK_EVENT, function() { _searchBar.classList.remove('searchBarOpen'); });
                },
                
                _initButtonGroupNavigation: function() {
@@ -115,7 +115,7 @@ define(
                                button.appendChild(span);
                                
                                (function(button) {
-                                       button.addEventListener('click', function(ev) {
+                                       button.addEventListener(WCF_CLICK_EVENT, function(ev) {
                                                var next = button.nextElementSibling;
                                                if (next !== null) {
                                                        next.classList.toggle('open');
index c2012dbe953829799c9590fc45cb1edd4d233e58..8e1747083a61768e7a6370ecfce024ef5cfbf013 100644 (file)
@@ -57,7 +57,7 @@ define(['Language'], function(Language) {
                                _notificationElement.id = 'systemNotification';
                                
                                _message = elCreate('p');
-                               _message.addEventListener('click', _callbackHide);
+                               _message.addEventListener(WCF_CLICK_EVENT, _callbackHide);
                                _notificationElement.appendChild(_message);
                                
                                document.body.appendChild(_notificationElement);
index f922e4214bff8181d7fb15a62221c22341ab2d1b..b78c97da2fffe690ff8220da359c8636776cda19 100644 (file)
@@ -46,7 +46,7 @@ define(['Language', 'ObjectMap', 'Ui/Dialog'], function(Language, ObjectMap, UiD
                        if (!_elements.has(element)) {
                                var jumpTo = elBySel('.jumpTo', element);
                                if (jumpTo !== null) {
-                                       jumpTo.addEventListener('click', this._click.bind(this, element));
+                                       jumpTo.addEventListener(WCF_CLICK_EVENT, this._click.bind(this, element));
                                        
                                        _elements.set(element, { callback: callback });
                                }
@@ -128,7 +128,7 @@ define(['Language', 'ObjectMap', 'Ui/Dialog'], function(Language, ObjectMap, UiD
                                                _description = elByTag('small', content)[0];
                                                
                                                _buttonSubmit = elByTag('button', content)[0];
-                                               _buttonSubmit.addEventListener('click', this._submit.bind(this));
+                                               _buttonSubmit.addEventListener(WCF_CLICK_EVENT, this._submit.bind(this));
                                        }).bind(this),
                                        title: Language.get('wcf.global.page.pagination')
                                },
index f286043312d58fc330f5dd31976d9177bb3af0c4..77db0749a11214cf6024cc2269c183619ef9b801 100644 (file)
@@ -32,7 +32,7 @@ define(['Environment', 'Language', './Action'], function(Environment, Language,
                        elAttr(button, 'title', Language.get('wcf.global.scrollUp'));
                        button.innerHTML = '<span class="icon icon16 fa-arrow-up"></span>';
                        
-                       button.addEventListener('click', this._jump.bind(this));
+                       button.addEventListener(WCF_CLICK_EVENT, this._jump.bind(this));
                        
                        PageAction.add('toTop', button);
                        
index f060b302fbc6cf720043db76545238eda06f9d02..5b3a03230bcff503d4a30f335b246f47991908ac 100644 (file)
@@ -68,7 +68,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                                link.title = Language.get('wcf.global.page.previous');
                                listItem.appendChild(link);
                                
-                               link.addEventListener('click', this.switchPage.bind(this, this._options.activePage - 1));
+                               link.addEventListener(WCF_CLICK_EVENT, this.switchPage.bind(this, this._options.activePage - 1));
                        }
                        else {
                                listItem.innerHTML = '<span class="' + iconClassNames + '"></span>';
@@ -166,7 +166,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                                link.title = Language.get('wcf.global.page.next');
                                listItem.appendChild(link);
                                
-                               link.addEventListener('click', this.switchPage.bind(this, this._options.activePage + 1));
+                               link.addEventListener(WCF_CLICK_EVENT, this.switchPage.bind(this, this._options.activePage + 1));
                        }
                        else {
                                listItem.innerHTML = '<span class="' + iconClassNames + '"></span>';
@@ -193,7 +193,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLab/WCF/Ui/Page/Jump
                        if (pageNo !== this._options.activePage) {
                                var link = elCreate('a');
                                link.textContent = StringUtil.addThousandsSeparator(pageNo);
-                               link.addEventListener('click', this.switchPage.bind(this, pageNo));
+                               link.addEventListener(WCF_CLICK_EVENT, this.switchPage.bind(this, pageNo));
                                listItem.appendChild(link);
                        }
                        else {
index 557aada9369cd35e250751695f5468b04255a672..b23defc07f74d6f6bf83717bc84fd4e37bf23a08 100644 (file)
@@ -242,7 +242,7 @@ define(['Ajax', 'Environment', 'EventHandler', 'Ui/Alignment'], function(Ajax, E
                                
                                listItem = elCreate('li');
                                link = elCreate('a');
-                               link.addEventListener('click', callbackClick);
+                               link.addEventListener(WCF_CLICK_EVENT, callbackClick);
                                link.className = 'box16';
                                link.innerHTML = '<span>' + user.icon + '</span> <span>' + user.label + '</span>';
                                elData(link, 'user-id', user.objectID);
index 17ba838124d8e09a891c09ddb25c560eb6baa38a..5928e7af84560e48d78450d312f5dfa99d288988 100644 (file)
@@ -53,7 +53,7 @@ define(['Ajax', 'Core', 'Ui/SimpleDropdown'], function(Ajax, Core, UiSimpleDropd
                                throw new Error("Expected a valid callback for option 'callbackSelect'.");
                        }
                        
-                       this._element.addEventListener('click', function(event) { event.stopPropagation(); });
+                       this._element.addEventListener(WCF_CLICK_EVENT, function(event) { event.stopPropagation(); });
                        this._element.addEventListener('keydown', this._keyDown.bind(this));
                        this._element.addEventListener('keyup', this._keyUp.bind(this));
                },
@@ -224,7 +224,7 @@ define(['Ajax', 'Core', 'Ui/SimpleDropdown'], function(Ajax, Core, UiSimpleDropd
                                        anchor = elCreate('a');
                                        anchor.textContent = item.label;
                                        elData(anchor, 'object-id', item.objectID);
-                                       anchor.addEventListener('click', this._select.bind(this));
+                                       anchor.addEventListener(WCF_CLICK_EVENT, this._select.bind(this));
                                        
                                        listItem = elCreate('li');
                                        if (i === 0) listItem.className = 'active';
index d320c0d6291e1c629646eff7641368b508db51fe..c5902a46407ed7fdbf11513c568d5f11c936d2ac 100644 (file)
@@ -123,7 +123,7 @@ define(['Dictionary', 'EventHandler', 'Dom/Traverse', 'Dom/Util'], function(Dict
                        // bind listeners
                        this._tabs.forEach((function(tab) {
                                if (!oldTabs || oldTabs.get(elData(tab, 'name')) !== tab) {
-                                       tab.children[0].addEventListener('click', this._onClick.bind(this));
+                                       tab.children[0].addEventListener(WCF_CLICK_EVENT, this._onClick.bind(this));
                                }
                        }).bind(this));
                        
index 7e31b98bed7de84751761a558459d2342bf84b75..3a96674328eb4fb0cb8e9bb03dc46fae4da73eb9 100644 (file)
@@ -63,7 +63,7 @@ define(['Environment', 'Dom/ChangeListener', 'Ui/Alignment'], function(Environme
                                        
                                        element.addEventListener('mouseenter', this._mouseEnter.bind(this));
                                        element.addEventListener('mouseleave', this._mouseLeave.bind(this));
-                                       element.addEventListener('click', this._mouseLeave.bind(this));
+                                       element.addEventListener(WCF_CLICK_EVENT, this._mouseLeave.bind(this));
                                }
                        }
                },