</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
- require(['Language', 'WoltLab/WCF/ACP/Bootstrap'], function(Language, ACPBootstrap) {
+ require(['Language', 'WoltLab/WCF/Acp/Bootstrap'], function(Language, AcpBootstrap) {
Language.addObject({
'__days': [ '{lang}wcf.date.day.sunday{/lang}', '{lang}wcf.date.day.monday{/lang}', '{lang}wcf.date.day.tuesday{/lang}', '{lang}wcf.date.day.wednesday{/lang}', '{lang}wcf.date.day.thursday{/lang}', '{lang}wcf.date.day.friday{/lang}', '{lang}wcf.date.day.saturday{/lang}' ],
'__daysShort': [ '{lang}wcf.date.day.sun{/lang}', '{lang}wcf.date.day.mon{/lang}', '{lang}wcf.date.day.tue{/lang}', '{lang}wcf.date.day.wed{/lang}', '{lang}wcf.date.day.thu{/lang}', '{lang}wcf.date.day.fri{/lang}', '{lang}wcf.date.day.sat{/lang}' ],
{event name='javascriptLanguageImport'}
});
- ACPBootstrap.setup();
+ AcpBootstrap.setup();
});
});
</script>
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/ACP/Bootstrap
+ * @module WoltLab/WCF/Acp/Bootstrap
*/
define(['WoltLab/WCF/Bootstrap'], function(Bootstrap) {
"use strict";
/**
* ACP Boostrapper.
*
- * @exports WoltLab/WCF/ACP/Bootstrap
+ * @exports WoltLab/WCF/Acp/Bootstrap
*/
- var ACPBootstrap = {
+ var AcpBootstrap = {
/**
* Bootstraps general modules and frontend exclusive ones.
*
}
};
- return ACPBootstrap;
+ return AcpBootstrap;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Ajax/Request
*/
-define(['Core', 'Language', 'DOM/ChangeListener', 'DOM/Util', 'UI/Dialog', 'WoltLab/WCF/Ajax/Status'], function(Core, Language, DOMChangeListener, DOMUtil, UIDialog, AjaxStatus) {
+define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'WoltLab/WCF/Ajax/Status'], function(Core, Language, DomChangeListener, DomUtil, UiDialog, AjaxStatus) {
"use strict";
var _didInit = false;
var html = '<div class="ajaxDebugMessage"><p>' + message + '</p>' + details + '</div>';
- UIDialog.openStatic(DOMUtil.getUniqueId(), html, {
+ UiDialog.openStatic(DomUtil.getUniqueId(), html, {
title: Language.get('wcf.global.error.title')
});
}
this._previousXhr = null;
- DOMChangeListener.trigger();
+ DomChangeListener.trigger();
// fix anchor tags generated through WCF::getAnchor()
var links = document.querySelectorAll('a[href*="#"]');
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/BBCode/FromHtml
+ * @module WoltLab/WCF/Bbcode/FromHtml
*/
-define(['EventHandler', 'StringUtil', 'DOM/Traverse'], function(EventHandler, StringUtil, DOMTraverse) {
+define(['EventHandler', 'StringUtil', 'Dom/Traverse'], function(EventHandler, StringUtil, DomTraverse) {
"use strict";
var _converter = [];
}
/**
- * @module WoltLab/WCF/BBCode/FromHtml
+ * @module WoltLab/WCF/Bbcode/FromHtml
*/
- var BBCodeFromHtml = {
+ var BbcodeFromHtml = {
/**
* Converts a message containing HTML elements into BBCodes.
*
}
}
- var header = DOMTraverse.childByTag(element, 'HEADER');
+ var header = DomTraverse.childByTag(element, 'HEADER');
if (header !== null) element.removeChild(header);
- var divs = DOMTraverse.childrenByTag(element, 'DIV');
+ var divs = DomTraverse.childrenByTag(element, 'DIV');
for (var i = 0, length = divs.length; i < length; i++) {
divs[i].outerHTML = divs[i].innerHTML + '\n';
}
elements[0].outerHTML = '\n[tr]\n' + elements[0].innerHTML + '[/tr]';
}
- var tbody = DOMTraverse.childByTag(element, 'TBODY');
+ var tbody = DomTraverse.childByTag(element, 'TBODY');
var innerHtml = (tbody === null) ? element.innerHTML : tbody.innerHTML;
element.outerHTML = '\n[table]' + innerHtml + '\n[/table]\n';
},
var filename = element.getAttribute('data-filename').trim() || '';
var highlighter = element.getAttribute('data-highlighter') || '';
window.dtdesign = element;
- var list = DOMTraverse.childByTag(element.children[0], 'OL');
+ var list = DomTraverse.childByTag(element.children[0], 'OL');
var lineNumber = ~~list.getAttribute('start') || 1;
var content = '';
}
};
- return BBCodeFromHtml;
+ return BbcodeFromHtml;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/BBCode/Parser
+ * @module WoltLab/WCF/Bbcode/Parser
*/
define([], function() {
"use strict";
/**
- * @module WoltLab/WCF/BBCode/Parser
+ * @module WoltLab/WCF/Bbcode/Parser
*/
- var BBCodeParser = {
+ var BbcodeParser = {
/**
* Parses a message and returns an XML-conform linear tree.
*
}
};
- return BBCodeParser;
+ return BbcodeParser;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/BBCode/ToHtml
+ * @module WoltLab/WCF/Bbcode/ToHtml
*/
-define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Parser'], function(Core, EventHandler, Language, StringUtil, BBCodeParser) {
+define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/Bbcode/Parser'], function(Core, EventHandler, Language, StringUtil, BbcodeParser) {
"use strict";
var _bbcodes = null;
}
/**
- * @module WoltLab/WCF/BBCode/ToHtml
+ * @module WoltLab/WCF/Bbcode/ToHtml
*/
- var BBCodeToHtml = {
+ var BbcodeToHtml = {
/**
* Converts a message containing BBCodes to HTML.
*
this._convertSpecials(message);
- var stack = BBCodeParser.parse(message);
+ var stack = BbcodeParser.parse(message);
if (stack.length) {
this._initBBCodes();
}
};
- return BBCodeToHtml;
+ return BbcodeToHtml;
});
define(
[
'favico', 'enquire', 'perfect-scrollbar', 'WoltLab/WCF/Date/Time/Relative',
- 'UI/SimpleDropdown', 'WoltLab/WCF/UI/Mobile', 'WoltLab/WCF/UI/TabMenu', 'WoltLab/WCF/UI/FlexibleMenu',
- 'UI/Dialog', 'WoltLab/WCF/UI/Tooltip', 'WoltLab/WCF/Language', 'WoltLab/WCF/Environment',
+ 'Ui/SimpleDropdown', 'WoltLab/WCF/Ui/Mobile', 'WoltLab/WCF/Ui/TabMenu', 'WoltLab/WCF/Ui/FlexibleMenu',
+ 'Ui/Dialog', 'WoltLab/WCF/Ui/Tooltip', 'WoltLab/WCF/Language', 'WoltLab/WCF/Environment',
'WoltLab/WCF/Date/Picker'
],
function(
favico, enquire, perfectScrollbar, DateTimeRelative,
- UISimpleDropdown, UIMobile, UITabMenu, UIFlexibleMenu,
- UIDialog, UITooltip, Language, Environment,
+ UiSimpleDropdown, UiMobile, UiTabMenu, UiFlexibleMenu,
+ UiDialog, UiTooltip, Language, Environment,
DatePicker
)
{
DateTimeRelative.setup();
DatePicker.init();
- UISimpleDropdown.setup();
- UIMobile.setup();
- UITabMenu.setup();
- UIFlexibleMenu.setup();
- UIDialog.setup();
- UITooltip.setup();
+ UiSimpleDropdown.setup();
+ UiMobile.setup();
+ UiTabMenu.setup();
+ UiFlexibleMenu.setup();
+ UiDialog.setup();
+ UiTooltip.setup();
// convert method=get into method=post
var forms = document.querySelectorAll('form[method=get]');
define(
[
'Ajax', 'Core', 'Dictionary', 'EventHandler',
- 'Language', 'List', 'ObjectMap', 'DOM/ChangeListener',
- 'DOM/Traverse', 'DOM/Util', 'UI/Confirmation', 'UI/SimpleDropdown'
+ 'Language', 'List', 'ObjectMap', 'Dom/ChangeListener',
+ 'Dom/Traverse', 'Dom/Util', 'Ui/Confirmation', 'Ui/SimpleDropdown'
],
function(
Ajax, Core, Dictionary, EventHandler,
- Language, List, ObjectMap, DOMChangeListener,
- DOMTraverse, DOMUtil, UIConfirmation, UISimpleDropdown
+ Language, List, ObjectMap, DomChangeListener,
+ DomTraverse, DomUtil, UiConfirmation, UiSimpleDropdown
)
{
"use strict";
this._loadMarkedItems();
}
- DOMChangeListener.add('WoltLab/WCF/Controller/Clipboard', this._initContainers.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Controller/Clipboard', this._initContainers.bind(this));
},
/**
_initContainers: function() {
for (var i = 0, length = _elements.length; i < length; i++) {
var container = _elements[i];
- var containerId = DOMUtil.identify(container);
+ var containerId = DomUtil.identify(container);
var containerData = _containers.get(containerId);
if (containerData === undefined) {
}
}
catch (e) {
- throw new Error("Expected a valid 'data-type' attribute for element '" + DOMUtil.identify(editor) + "'.");
+ throw new Error("Expected a valid 'data-type' attribute for element '" + DomUtil.identify(editor) + "'.");
}
return [];
}
}
- var clipboardObject = DOMTraverse.parentByClass(checkbox, 'jsClipboardObject');
+ var clipboardObject = DomTraverse.parentByClass(checkbox, 'jsClipboardObject');
if (clipboardObject !== null) {
clipboardObject.classList[(isMarked ? 'addClass' : 'removeClass')]('jsMarked');
}
var data = _containers.get(containerId);
var type = data.element.getAttribute('data-type');
- var clipboardObject = DOMTraverse.parentByClass(checkbox, 'jsClipboardObject');
+ var clipboardObject = DomTraverse.parentByClass(checkbox, 'jsClipboardObject');
data.markedObjectIds[(isMarked ? 'add' : 'delete')](objectId);
clipboardObject.classList[(isMarked) ? 'add' : 'remove']('jsMarked');
if (confirmMessage.length) {
var template = (typeof data.internalData.template === 'string') ? data.internalData.template : '';
- UIConfirmation.show({
+ UiConfirmation.show({
confirm: (function() {
var formData = {};
if (template.length) {
- var items = UIConfirmation.getContentElement().querySelectorAll('input, select, textarea');
+ var items = UiConfirmation.getContentElement().querySelectorAll('input, select, textarea');
for (var i = 0, length = items.length; i < length; i++) {
var item = items[i];
var name = item.getAttribute('name');
else if (confirmMessage.length) {
fireEvent = false;
- UIConfirmation.show({
+ UiConfirmation.show({
confirm: triggerEvent,
message: confirmMessage
});
var typeData = data.returnValues.items[typeName];
var editor = _editors.get(typeName);
- var lists = DOMTraverse.childrenByTag(editor, 'UL');
+ var lists = DomTraverse.childrenByTag(editor, 'UL');
var list = lists[0] || null;
if (list === null) {
list = document.createElement('ul');
unmarkAll.addEventListener('click', _callbackUnmarkAll);
editor.appendChild(fragment);
- UISimpleDropdown.init(toggleButton, false);
+ UiSimpleDropdown.init(toggleButton, false);
}
},
for (var i = 0, length = data.checkboxes.length; i < length; i++) {
var checkbox = data.checkboxes[i];
- var clipboardObject = DOMTraverse.parentByClass(checkbox, 'jsClipboardObject');
+ var clipboardObject = DomTraverse.parentByClass(checkbox, 'jsClipboardObject');
var isMarked = (objectIds.indexOf(~~checkbox.getAttribute('data-object-id')) !== -1);
if (!isMarked) markAll = false;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/Popover
*/
-define(['Ajax', 'Dictionary', 'Environment', 'DOM/ChangeListener', 'DOM/Util', 'UI/Alignment'], function(Ajax, Dictionary, Environment, DOMChangeListener, DOMUtil, UIAlignment) {
+define(['Ajax', 'Dictionary', 'Environment', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Alignment'], function(Ajax, Dictionary, Environment, DomChangeListener, DomUtil, UiAlignment) {
"use strict";
var _activeId = null;
this._hide(true);
}).bind(this));
- DOMChangeListener.add('WoltLab/WCF/Controller/Popover', this._init.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Controller/Popover', this._init.bind(this));
},
/**
for (var i = 0, length = elements.length; i < length; i++) {
var element = elements[i];
- var id = DOMUtil.identify(element);
+ var id = DomUtil.identify(element);
if (_cache.has(id)) {
return;
}
throw new Error("Unable to find element for object id '" + objectId + "' (identifier: '" + identifier + "').");
}
- data.content = DOMUtil.createFragmentFromHtml(content);
+ data.content = DomUtil.createFragmentFromHtml(content);
data.state = STATE_READY;
if (_activeId) {
_timeoutEnter = null;
}
- var id = DOMUtil.identify(event.currentTarget);
+ var id = DomUtil.identify(event.currentTarget);
if (_activeId === id && _timeoutLeave !== null) {
window.clearTimeout(_timeoutLeave);
_timeoutLeave = null;
}
}
- UIAlignment.set(_popover, _elements.get(_activeId).element, {
+ UiAlignment.set(_popover, _elements.get(_activeId).element, {
pointer: true,
vertical: 'top',
verticalOffset: 3
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/Sitemap
*/
-define(['Ajax', 'EventHandler', 'Language', 'DOM/Util', 'UI/Dialog', 'UI/TabMenu'], function(Ajax, EventHandler, Language, DOMUtil, UIDialog, UITabMenu) {
+define(['Ajax', 'EventHandler', 'Language', 'Dom/Util', 'Ui/Dialog', 'Ui/TabMenu'], function(Ajax, EventHandler, Language, DomUtil, UiDialog, UiTabMenu) {
"use strict";
var _cache = [];
_click: function(event) {
event.preventDefault();
- UIDialog.open(this);
+ UiDialog.open(this);
},
_ajaxSetup: function() {
_cache.push(data.returnValues.sitemapName);
var tabMenuContainer = content.querySelector('.tabMenuContainer');
- var menuId = DOMUtil.identify(tabMenuContainer);
+ var menuId = DomUtil.identify(tabMenuContainer);
- UITabMenu.getTabMenu(menuId).select('sitemap_' + data.returnValues.sitemapName);
+ UiTabMenu.getTabMenu(menuId).select('sitemap_' + data.returnValues.sitemapName);
EventHandler.add('com.woltlab.wcf.simpleTabMenu_' + menuId, 'select', this.showTab.bind(this));
}).bind(this)
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/Style/Changer
*/
-define(['Ajax', 'Language', 'UI/Dialog'], function(Ajax, Language, UIDialog) {
+define(['Ajax', 'Language', 'Ui/Dialog'], function(Ajax, Language, UiDialog) {
"use strict";
/**
showDialog: function(event) {
event.preventDefault();
- UIDialog.open(this);
+ UiDialog.open(this);
},
_dialogSetup: function() {
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Controller/User/Notification/Settings
*/
-define(['Dictionary', 'Language', 'DOM/Traverse', 'UI/SimpleDropdown'], function(Dictionary, Language, DOMTraverse, UISimpleDropdown) {
+define(['Dictionary', 'Language', 'Dom/Traverse', 'Ui/SimpleDropdown'], function(Dictionary, Language, DomTraverse, UiSimpleDropdown) {
"use strict";
var _data = new Dictionary();
var enabledNotification = document.getElementById('settings_' + groupId + '_enabled');
enabledNotification.addEventListener('click', function() { mailSetting.classList.add('active'); });
- var mailValue = DOMTraverse.childByTag(mailSetting, 'INPUT');
+ var mailValue = DomTraverse.childByTag(mailSetting, 'INPUT');
- var button = DOMTraverse.childByTag(mailSetting, 'A');
+ var button = DomTraverse.childByTag(mailSetting, 'A');
button.setAttribute('data-object-id', groupId);
button.addEventListener('click', _callbackClick);
button.parentNode.classList.add('dropdown');
button.parentNode.appendChild(data.dropdownMenu);
- UISimpleDropdown.init(button, true);
+ UiSimpleDropdown.init(button, true);
}
else {
- var items = DOMTraverse.childrenByTag(data.dropdownMenu, 'LI'), value = data.mailValue.value;
+ var items = DomTraverse.childrenByTag(data.dropdownMenu, 'LI'), value = data.mailValue.value;
for (var i = 0; i < 4; i++) {
items[i].classList[(items[i].getAttribute('data-value') === value) ? 'add' : 'remove']('active');
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Date/Picker
*/
-define(['DateUtil', 'Language', 'ObjectMap', 'DOM/ChangeListener', 'UI/Alignment', 'WoltLab/WCF/UI/CloseOverlay'], function(DateUtil, Language, ObjectMap, DOMChangeListener, UIAlignment, UICloseOverlay) {
+define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment', 'WoltLab/WCF/Ui/CloseOverlay'], function(DateUtil, Language, ObjectMap, DomChangeListener, UiAlignment, UiCloseOverlay) {
"use strict";
var _didInit = false;
_firstDayOfWeek = ~~Language.get('wcf.date.firstDayOfTheWeek');
_callbackOpen = this._open.bind(this);
- DOMChangeListener.add('WoltLab/WCF/Date/Picker', this.init.bind(this));
- UICloseOverlay.add('WoltLab/WCF/Date/Picker', this._close.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Date/Picker', this.init.bind(this));
+ UiCloseOverlay.add('WoltLab/WCF/Date/Picker', this._close.bind(this));
},
/**
this._renderPicker(date.getDate(), date.getMonth(), date.getFullYear());
- UIAlignment.set(_datePicker, _input, { pointer: true });
+ UiAlignment.set(_datePicker, _input, { pointer: true });
},
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Date/Time/Relative
*/
-define(['DOM/ChangeListener', 'Language', 'WoltLab/WCF/Date/Util', 'WoltLab/WCF/Timer/Repeating'], function(DOMChangeListener, Language, DateUtil, Repeating) {
+define(['Dom/ChangeListener', 'Language', 'WoltLab/WCF/Date/Util', 'WoltLab/WCF/Timer/Repeating'], function(DomChangeListener, Language, DateUtil, Repeating) {
"use strict";
var _elements = document.getElementsByTagName('time');
new Repeating(this._refresh.bind(this), 60000);
- DOMChangeListener.add('WoltLab/WCF/Date/Time/Relative', this._refresh.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Date/Time/Relative', this._refresh.bind(this));
},
_refresh: function() {
* @author Tim Duesterhus
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/DOM/Change/Listener
+ * @module WoltLab/WCF/Dom/Change/Listener
*/
define(['CallbackList'], function(CallbackList) {
"use strict";
var _hot = false;
/**
- * @exports WoltLab/WCF/DOM/Change/Listener
+ * @exports WoltLab/WCF/Dom/Change/Listener
*/
var Listener = {
/**
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/DOM/Traverse
+ * @module WoltLab/WCF/Dom/Traverse
*/
-define(['DOM/Util'], function(DOMUtil) {
+define(['Dom/Util'], function(DomUtil) {
"use strict";
/** @const */ var NONE = 0;
var _probe = [
function(el, none) { return true; },
- function(el, selector) { return DOMUtil.matches(el, selector); },
+ function(el, selector) { return DomUtil.matches(el, selector); },
function(el, className) { return el.classList.contains(className); },
function(el, tagName) { return el.nodeName === tagName; }
];
};
/**
- * @exports WoltLab/WCF/DOM/Traverse
+ * @exports WoltLab/WCF/Dom/Traverse
*/
- var DOMTraverse = {
+ var DomTraverse = {
/**
* Examines child elements and returns the first child matching the given selector.
*
}
};
- return DOMTraverse;
+ return DomTraverse;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/DOM/Util
+ * @module WoltLab/WCF/Dom/Util
*/
define([], function() {
"use strict";
var _idCounter = 0;
/**
- * @exports WoltLab/WCF/DOM/Util
+ * @exports WoltLab/WCF/Dom/Util
*/
- var DOMUtil = {
+ var DomUtil = {
/**
* Returns a DocumentFragment containing the provided HTML string as DOM nodes.
*
};
// expose on window object for backward compatibility
- window.bc_wcfDOMUtil = DOMUtil;
+ window.bc_wcfDomUtil = DomUtil;
- return DOMUtil;
+ return DomUtil;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/Language/Input
*/
-define(['Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'DOM/Traverse', 'DOM/Util', 'UI/SimpleDropdown'], function(Dictionary, Language, ObjectMap, StringUtil, DOMTraverse, DOMUtil, UISimpleDropdown) {
+define(['Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'Dom/Traverse', 'Dom/Util', 'Ui/SimpleDropdown'], function(Dictionary, Language, ObjectMap, StringUtil, DomTraverse, DomUtil, UiSimpleDropdown) {
"use strict";
var _elements = new Dictionary();
var dropdownMenu = document.createElement('ul');
dropdownMenu.className = 'dropdownMenu';
- DOMUtil.insertAfter(dropdownMenu, button);
+ DomUtil.insertAfter(dropdownMenu, button);
var callbackClick = (function(event, isInit) {
var languageId = ~~event.currentTarget.getAttribute('data-language-id');
- var activeItem = DOMTraverse.childByClass(dropdownMenu, 'active');
+ var activeItem = DomTraverse.childByClass(dropdownMenu, 'active');
if (activeItem !== null) activeItem.classList.remove('active');
if (languageId) event.currentTarget.classList.add('active');
}
}
- UISimpleDropdown.init(button);
- UISimpleDropdown.registerCallback(container.id, _callbackDropdownToggle);
+ UiSimpleDropdown.init(button);
+ UiSimpleDropdown.registerCallback(container.id, _callbackDropdownToggle);
_elements.set(elementId, {
buttonLabel: button.children[0],
});
// bind to submit event
- var submit = DOMTraverse.parentByTag(element, 'FORM');
+ var submit = DomTraverse.parentByTag(element, 'FORM');
if (submit !== null) {
submit.addEventListener('submit', _callbackSubmit);
return;
}
- var dropdownMenu = UISimpleDropdown.getDropdownMenu(containerId);
+ var dropdownMenu = UiSimpleDropdown.getDropdownMenu(containerId);
var elementId = document.getElementById(containerId).getAttribute('data-input-id');
var values = _values.get(elementId);
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Alignment
+ * @module WoltLab/WCF/Ui/Alignment
*/
-define(['Core', 'Language', 'DOM/Traverse', 'DOM/Util'], function(Core, Language, DOMTraverse, DOMUtil) {
+define(['Core', 'Language', 'Dom/Traverse', 'Dom/Util'], function(Core, Language, DomTraverse, DomUtil) {
"use strict";
/**
- * @exports WoltLab/WCF/UI/Alignment
+ * @exports WoltLab/WCF/Ui/Alignment
*/
- var UIAlignment = {
+ var UiAlignment = {
/**
* Sets the alignment for target element relatively to the reference element.
*
if (['both', 'horizontal', 'vertical', 'none'].indexOf(options.allowFlip) === -1) options.allowFlip = 'both';
// place element in the upper left corner to prevent calculation issues due to possible scrollbars
- DOMUtil.setStyles(el, {
+ DomUtil.setStyles(el, {
bottom: 'auto !important',
left: '0 !important',
right: 'auto !important',
top: '0 !important'
});
- var elDimensions = DOMUtil.outerDimensions(el);
- var refDimensions = DOMUtil.outerDimensions((options.refDimensionsElement instanceof Element ? options.refDimensionsElement : ref));
- var refOffsets = DOMUtil.offset(ref);
+ var elDimensions = DomUtil.outerDimensions(el);
+ var refDimensions = DomUtil.outerDimensions((options.refDimensionsElement instanceof Element ? options.refDimensionsElement : ref));
+ var refOffsets = DomUtil.offset(ref);
var windowHeight = window.innerHeight;
var windowWidth = document.body.clientWidth;
// set pointer position
if (options.pointer) {
- var pointer = DOMTraverse.childrenByClass(el, 'elementPointer');
+ var pointer = DomTraverse.childrenByClass(el, 'elementPointer');
pointer = pointer[0] || null;
if (pointer === null) {
throw new Error("Expected the .elementPointer element to be a direct children.");
el.classList[(left === 'auto' ? 'add' : 'remove')](options.pointerClassNames[pointerRight]);
}
- DOMUtil.setStyles(el, {
+ DomUtil.setStyles(el, {
bottom: bottom + (bottom !== 'auto' ? 'px' : ''),
left: left + (left !== 'auto' ? 'px' : ''),
right: right + (right !== 'auto' ? 'px' : ''),
}
};
- return UIAlignment;
+ return UiAlignment;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/CloseOlveray
+ * @module WoltLab/WCF/Ui/CloseOlveray
*/
define(['CallbackList'], function(CallbackList) {
"use strict";
var _callbackList = new CallbackList();
/**
- * @exports WoltLab/WCF/UI/CloseOverlay
+ * @exports WoltLab/WCF/Ui/CloseOverlay
*/
- var UICloseOverlay = {
+ var UiCloseOverlay = {
/**
* Sets up global event listener for bubbled clicks events.
*/
}
};
- UICloseOverlay.setup();
+ UiCloseOverlay.setup();
- return UICloseOverlay;
+ return UiCloseOverlay;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Collapsible/Sidebar
+ * @module WoltLab/WCF/Ui/Collapsible/Sidebar
*/
-define(['Ajax', 'Language', 'DOM/Util'], function(Ajax, Language, DOMUtil) {
+define(['Ajax', 'Language', 'Dom/Util'], function(Ajax, Language, DomUtil) {
"use strict";
var _isOpen = false;
var _name = '';
/**
- * @module WoltLab/WCF/UI/Collapsible/Sidebar
+ * @module WoltLab/WCF/Ui/Collapsible/Sidebar
*/
- var UICollapsibleSidebar = {
+ var UiCollapsibleSidebar = {
/**
* Sets up the toggle button.
*/
var span = document.createElement('span');
span.appendChild(button);
- DOMUtil.prepend(span, sidebar);
+ DomUtil.prepend(span, sidebar);
button.addEventListener('click', this._click.bind(this));
},
}
};
- return UICollapsibleSidebar;
+ return UiCollapsibleSidebar;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Confirmation
+ * @module WoltLab/WCF/Ui/Confirmation
*/
-define(['Core', 'Language', 'UI/Dialog'], function(Core, Language, UIDialog) {
+define(['Core', 'Language', 'Ui/Dialog'], function(Core, Language, UiDialog) {
"use strict";
var _active = false;
/**
* Confirmation dialog overlay.
*
- * @exports WoltLab/WCF/UI/Confirmation
+ * @exports WoltLab/WCF/Ui/Confirmation
*/
- var UIConfirmation = {
+ var UiConfirmation = {
/**
* Shows the confirmation dialog.
*
* @param {object<string, *>} options confirmation options
*/
show: function(options) {
- if (UIDialog === undefined) UIDialog = require('UI/Dialog');
+ if (UiDialog === undefined) UiDialog = require('Ui/Dialog');
if (_active) {
return;
_active = true;
- UIDialog.open(this);
+ UiDialog.open(this);
},
_dialogSetup: function() {
var cancelButton = document.createElement('button');
cancelButton.textContent = Language.get('wcf.global.confirmation.cancel');
- cancelButton.addEventListener('click', function() { UIDialog.close('wcfSystemConfirmation'); });
+ cancelButton.addEventListener('click', function() { UiDialog.close('wcfSystemConfirmation'); });
formSubmit.appendChild(cancelButton);
document.body.appendChild(dialog);
}
_active = false;
- UIDialog.close('wcfSystemConfirmation');
+ UiDialog.close('wcfSystemConfirmation');
},
/**
}
};
- return UIConfirmation;
+ return UiConfirmation;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Dialog
+ * @module WoltLab/WCF/Ui/Dialog
*/
define(
[
'enquire', 'Ajax', 'Core', 'Dictionary',
- 'Environment', 'Language', 'ObjectMap', 'DOM/ChangeListener',
- 'DOM/Util', 'UI/Confirmation'
+ 'Environment', 'Language', 'ObjectMap', 'Dom/ChangeListener',
+ 'Dom/Util', 'Ui/Confirmation'
],
function(
enquire, Ajax, Core, Dictionary,
- Environment, Language, ObjectMap, DOMChangeListener,
- DOMUtil, UIConfirmation
+ Environment, Language, ObjectMap, DomChangeListener,
+ DomUtil, UiConfirmation
)
{
"use strict";
var _keyupListener = null;
/**
- * @exports WoltLab/WCF/UI/Dialog
+ * @exports WoltLab/WCF/Ui/Dialog
*/
- var UIDialog = {
+ var UiDialog = {
/**
* Sets up global container and internal variables.
*/
if (!options.closable) options.backdropCloseOnClick = false;
if (options.closeConfirmMessage) {
options.onBeforeClose = (function(id) {
- UIConfirmation.show({
+ UiConfirmation.show({
confirm: this.close.bind(this, id),
message: options.closeConfirmMessage
});
throw new Error("Expected a valid dialog id, '" + id + "' does not match any active dialog.");
}
- var header = DOMTraverse.childrenByTag(data.dialog, 'HEADER');
- DOMTraverse.childrenByTag(header[0], 'SPAN').textContent = title;
+ var header = DomTraverse.childrenByTag(data.dialog, 'HEADER');
+ DomTraverse.childrenByTag(header[0], 'SPAN').textContent = title;
},
/**
dialog.appendChild(header);
if (options.title) {
- var titleId = DOMUtil.getUniqueId();
+ var titleId = DomUtil.getUniqueId();
dialog.setAttribute('aria-labelledby', titleId);
var title = document.createElement('span');
onShow: options.onShow
});
- DOMUtil.prepend(dialog, _container);
+ DomUtil.prepend(dialog, _container);
if (createOnly !== true) {
this._updateDialog(id, null);
}
}
- DOMChangeListener.trigger();
+ DomChangeListener.trigger();
},
/**
contentContainer.classList.add('dialogForm');
formSubmit.classList.add('dialogFormSubmit');
- unavailableHeight += DOMUtil.outerHeight(formSubmit);
+ unavailableHeight += DomUtil.outerHeight(formSubmit);
contentContainer.style.setProperty('margin-bottom', unavailableHeight + 'px');
}
else {
contentContainer.classList.remove('dialogForm');
}
- unavailableHeight += DOMUtil.outerHeight(data.header);
+ unavailableHeight += DomUtil.outerHeight(data.header);
var maximumHeight = (window.innerHeight * (_dialogFullHeight ? 1 : 0.8)) - unavailableHeight;
contentContainer.style.setProperty('max-height', ~~maximumHeight + 'px');
}
};
- return UIDialog;
+ return UiDialog;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Dropdown/Simple
+ * @module WoltLab/WCF/Ui/Dropdown/Simple
*/
define(
- [ 'CallbackList', 'Core', 'Dictionary', 'UI/Alignment', 'DOM/ChangeListener', 'DOM/Traverse', 'DOM/Util', 'UI/CloseOverlay'],
- function(CallbackList, Core, Dictionary, UIAlignment, DOMChangeListener, DOMTraverse, DOMUtil, UICloseOverlay)
+ [ 'CallbackList', 'Core', 'Dictionary', 'Ui/Alignment', 'Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util', 'Ui/CloseOverlay'],
+ function(CallbackList, Core, Dictionary, UiAlignment, DomChangeListener, DomTraverse, DomUtil, UiCloseOverlay)
{
"use strict";
var _menuContainer = null;
/**
- * @exports WoltLab/WCF/UI/Dropdown/Simple
+ * @exports WoltLab/WCF/Ui/Dropdown/Simple
*/
var SimpleDropdown = {
/**
this.initAll();
- UICloseOverlay.add('WoltLab/WCF/UI/Dropdown/Simple', this.closeAll.bind(this));
- DOMChangeListener.add('WoltLab/WCF/UI/Dropdown/Simple', this.initAll.bind(this));
+ UiCloseOverlay.add('WoltLab/WCF/Ui/Dropdown/Simple', this.closeAll.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Ui/Dropdown/Simple', this.initAll.bind(this));
document.addEventListener('scroll', this._onScroll.bind(this));
return false;
}
- var dropdown = DOMTraverse.parentByClass(button, 'dropdown');
+ var dropdown = DomTraverse.parentByClass(button, 'dropdown');
if (dropdown === null) {
- throw new Error("Invalid dropdown passed, button '" + DOMUtil.identify(button) + "' does not have a parent with .dropdown.");
+ throw new Error("Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a parent with .dropdown.");
}
- var menu = DOMTraverse.nextByClass(button, 'dropdownMenu');
+ var menu = DomTraverse.nextByClass(button, 'dropdownMenu');
if (menu === null) {
- throw new Error("Invalid dropdown passed, button '" + DOMUtil.identify(button) + "' does not have a menu as next sibling.");
+ throw new Error("Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a menu as next sibling.");
}
// move menu into global container
_menuContainer.appendChild(menu);
- var containerId = DOMUtil.identify(dropdown);
+ var containerId = DomUtil.identify(dropdown);
if (!_dropdowns.has(containerId)) {
button.classList.add('jsDropdownEnabled');
button.addEventListener('click', this._toggle.bind(this));
return;
}
- var containerId = DOMUtil.identify(dropdown);
+ var containerId = DomUtil.identify(dropdown);
_dropdowns.set(containerId, dropdown);
_menuContainer.appendChild(menu);
refDimensionsElement = button;
}
- UIAlignment.set(dropdownMenu, dropdown, {
+ UiAlignment.set(dropdownMenu, dropdown, {
pointerClassNames: ['dropdownArrowBottom', 'dropdownArrowRight'],
refDimensionsElement: refDimensionsElement
});
for (var i = 0, length = dropdowns.length; i < length; i++) {
var dropdown = dropdowns[i];
- var containerId = DOMUtil.identify(dropdown);
- var offset = DOMUtil.offset(dropdown);
- var dialogOffset = DOMUtil.offset(dialogContent);
+ var containerId = DomUtil.identify(dropdown);
+ var offset = DomUtil.offset(dropdown);
+ var dialogOffset = DomUtil.offset(dialogContent);
// check if dropdown toggle is still (partially) visible
if (offset.top + dropdown.clientHeight <= dialogOffset.top) {
// the dropdown toggle is in an overlay
var dropdown = _dropdowns.get(targetId);
if (dropdown !== undefined && dropdown.getAttribute('data-is-overlay-dropdown-button') === null) {
- var dialogContent = DOMTraverse.parentByClass(dropdown, 'dialogContent');
+ var dialogContent = DomTraverse.parentByClass(dropdown, 'dialogContent');
dropdown.setAttribute('data-is-overlay-dropdown-button', (dialogContent !== null));
if (dialogContent !== null) {
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/FlexibleMenu
+ * @module WoltLab/WCF/Ui/FlexibleMenu
*/
-define(['Core', 'Dictionary', 'DOM/ChangeListener', 'DOM/Traverse', 'DOM/Util', 'UI/SimpleDropdown'], function(Core, Dictionary, DOMChangeListener, DOMTraverse, DOMUtil, SimpleDropdown) {
+define(['Core', 'Dictionary', 'Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util', 'Ui/SimpleDropdown'], function(Core, Dictionary, DomChangeListener, DomTraverse, DomUtil, SimpleDropdown) {
"use strict";
var _containers = new Dictionary();
var _itemLists = new Dictionary();
/**
- * @exports WoltLab/WCF/UI/FlexibleMenu
+ * @exports WoltLab/WCF/Ui/FlexibleMenu
*/
- var UIFlexibleMenu = {
+ var UiFlexibleMenu = {
/**
* Register default menus and set up event listeners.
*/
setup: function() {
if (document.getElementById('mainMenu') !== null) this.register('mainMenu');
var navigationHeader = document.querySelector('.navigationHeader');
- if (navigationHeader !== null) this.register(DOMUtil.identify(navigationHeader));
+ if (navigationHeader !== null) this.register(DomUtil.identify(navigationHeader));
window.addEventListener('resize', this.rebuildAll.bind(this));
- DOMChangeListener.add('WoltLab/WCF/UI/FlexibleMenu', this.registerTabMenus.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Ui/FlexibleMenu', this.registerTabMenus.bind(this));
},
/**
return;
}
- var list = DOMTraverse.childByTag(container, 'UL');
+ var list = DomTraverse.childByTag(container, 'UL');
if (list === null) {
throw "Expected an <ul> element as child of container '" + containerId + "'.";
}
var tabMenus = document.querySelectorAll('.tabMenuContainer:not(.jsFlexibleMenuEnabled), .messageTabMenu:not(.jsFlexibleMenuEnabled)');
for (var i = 0, length = tabMenus.length; i < length; i++) {
var tabMenu = tabMenus[i];
- var nav = DOMTraverse.childByTag(tabMenu, 'NAV');
+ var nav = DomTraverse.childByTag(tabMenu, 'NAV');
if (nav !== null) {
tabMenu.classList.add('jsFlexibleMenuEnabled');
- this.register(DOMUtil.identify(nav));
+ this.register(DomUtil.identify(nav));
}
}
},
var styles = window.getComputedStyle(container);
var availableWidth = container.parentNode.clientWidth;
- availableWidth -= DOMUtil.styleAsInt(styles, 'margin-left');
- availableWidth -= DOMUtil.styleAsInt(styles, 'margin-right');
+ availableWidth -= DomUtil.styleAsInt(styles, 'margin-left');
+ availableWidth -= DomUtil.styleAsInt(styles, 'margin-right');
var list = _itemLists.get(containerId);
- var items = DOMTraverse.childrenByTag(list, 'LI');
+ var items = DomTraverse.childrenByTag(list, 'LI');
var dropdown = _dropdowns.get(containerId);
var dropdownWidth = 0;
if (dropdown !== undefined) {
}
if (dropdown.parentNode !== null) {
- dropdownWidth = DOMUtil.outerWidth(dropdown);
+ dropdownWidth = DomUtil.outerWidth(dropdown);
}
}
}
};
- return UIFlexibleMenu;
+ return UiFlexibleMenu;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/ItemList
+ * @module WoltLab/WCF/Ui/ItemList
*/
-define(['Core', 'Dictionary', 'Language', 'DOM/Traverse', 'WoltLab/WCF/UI/Suggestion'], function(Core, Dictionary, Language, DOMTraverse, UISuggestion) {
+define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'WoltLab/WCF/Ui/Suggestion'], function(Core, Dictionary, Language, DomTraverse, UiSuggestion) {
"use strict";
var _activeId = '';
var _callbackRemoveItem = null;
/**
- * @exports WoltLab/WCF/UI/ItemList
+ * @exports WoltLab/WCF/Ui/ItemList
*/
- var UIItemList = {
+ var UiItemList = {
/**
* Initializes an item list.
*
submitFieldName: ''
}, options);
- var form = DOMTraverse.parentByTag(element, 'FORM');
+ var form = DomTraverse.parentByTag(element, 'FORM');
if (form !== null) {
if (options.isCSV === false) {
if (!options.submitFieldName.length && typeof options.callbackSubmit !== 'function') {
this._setup();
var data = this._createUI(element, options, values);
- var suggestion = new UISuggestion(elementId, {
+ var suggestion = new UiSuggestion(elementId, {
ajax: options.ajax,
callbackSelect: this._addItem.bind(this),
excludedSearchValues: options.excludedSearchValues
}
var data = _data.get(elementId);
- var items = DOMTraverse.childrenByClass(data.list, 'item');
+ var items = DomTraverse.childrenByClass(data.list, 'item');
var values = [], value, item;
for (var i = 0, length = items.length; i < length; i++) {
item = items[i];
value = {
objectId: item.getAttribute('data-object-id'),
- value: DOMTraverse.childByTag(item, 'SPAN').textContent
+ value: DomTraverse.childByTag(item, 'SPAN').textContent
};
values.push(value);
}
};
- return UIItemList;
+ return UiItemList;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/ItemList/User
+ * @module WoltLab/WCF/Ui/ItemList/User
*/
-define(['WoltLab/WCF/UI/ItemList'], function(UIItemList) {
+define(['WoltLab/WCF/Ui/ItemList'], function(UiItemList) {
"use strict";
/**
- * @exports WoltLab/WCF/UI/ItemList/User
+ * @exports WoltLab/WCF/Ui/ItemList/User
*/
- var UIItemListUser = {
+ var UiItemListUser = {
/**
* Initializes user suggestion support for an element.
*
* @param {object} options option list
*/
init: function(elementId, options) {
- UIItemList.init(elementId, [], {
+ UiItemList.init(elementId, [], {
ajax: {
className: 'wcf\\data\\user\\UserAction',
parameters: {
},
/**
- * @see WoltLab/WCF/UI/ItemList::getValues()
+ * @see WoltLab/WCF/Ui/ItemList::getValues()
*/
getValues: function(elementId) {
- return UIItemList.getValues(elementId);
+ return UiItemList.getValues(elementId);
}
};
- return UIItemListUser;
+ return UiItemListUser;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Mobile
+ * @module WoltLab/WCF/Ui/Mobile
*/
define(
- [ 'enquire', 'Environment', 'Language', 'DOM/ChangeListener', 'DOM/Traverse', 'UI/CloseOverlay'],
- function(enquire, Environment, Language, DOMChangeListener, DOMTraverse, UICloseOverlay)
+ [ 'enquire', 'Environment', 'Language', 'Dom/ChangeListener', 'Dom/Traverse', 'Ui/CloseOverlay'],
+ function(enquire, Environment, Language, DomChangeListener, DomTraverse, UiCloseOverlay)
{
"use strict";
var _sidebar = null;
/**
- * @exports WoltLab/WCF/UI/Mobile
+ * @exports WoltLab/WCF/Ui/Mobile
*/
- var UIMobile = {
+ var UiMobile = {
/**
* Initializes the mobile UI using enquire.js.
*/
this._initSearchBar();
this._initButtonGroupNavigation();
- UICloseOverlay.add('WoltLab/WCF/UI/Mobile', this._closeAllMenus.bind(this));
- DOMChangeListener.add('WoltLab/WCF/UI/Mobile', this._initButtonGroupNavigation.bind(this));
+ UiCloseOverlay.add('WoltLab/WCF/Ui/Mobile', this._closeAllMenus.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Ui/Mobile', this._initButtonGroupNavigation.bind(this));
},
_initSidebarToggleButtons: function() {
button.appendChild(span);
button.addEventListener('click', function(ev) {
- var next = DOMTraverse.next(button);
+ var next = DomTraverse.next(button);
if (next !== null) {
next.classList.toggle('open');
}
};
- return UIMobile;
+ return UiMobile;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Suggestion
+ * @module WoltLab/WCF/Ui/Suggestion
*/
-define(['Ajax', 'Core', 'UI/SimpleDropdown'], function(Ajax, Core, UISimpleDropdown) {
+define(['Ajax', 'Core', 'Ui/SimpleDropdown'], function(Ajax, Core, UiSimpleDropdown) {
"use strict";
/**
* @param {string} elementId input element id
* @param {object<mixed>} options option list
*/
- function UISuggestion(elementId, options) { this.init(elementId, options); };
- UISuggestion.prototype = {
+ function UiSuggestion(elementId, options) { this.init(elementId, options); };
+ UiSuggestion.prototype = {
/**
* Initializes a new suggestion input.
*
* @param {object} event event object
*/
_keyDown: function(event) {
- if (this._dropdownMenu === null || !UISimpleDropdown.isOpen(this._element.id)) {
+ if (this._dropdownMenu === null || !UiSimpleDropdown.isOpen(this._element.id)) {
return true;
}
if (event.keyCode === 13) {
// Enter
- UISimpleDropdown.close(this._element.id);
+ UiSimpleDropdown.close(this._element.id);
this._select(active);
}
else if (event.keyCode === 27) {
- if (UISimpleDropdown.isOpen(this._element.id)) {
- UISimpleDropdown.close(this._element.id);
+ if (UiSimpleDropdown.isOpen(this._element.id)) {
+ UiSimpleDropdown.close(this._element.id);
}
else {
// let the event pass through
}
else if (value.length < this._options.treshold) {
if (this._dropdownMenu !== null) {
- UISimpleDropdown.close(this._element.id);
+ UiSimpleDropdown.close(this._element.id);
}
this._value = value;
this._dropdownMenu = document.createElement('div');
this._dropdownMenu.className = 'dropdownMenu';
- UISimpleDropdown.initFragment(this._element, this._dropdownMenu);
+ UiSimpleDropdown.initFragment(this._element, this._dropdownMenu);
}
else {
this._dropdownMenu.innerHTML = '';
this._dropdownMenu.appendChild(listItem);
}
- UISimpleDropdown.open(this._element.id);
+ UiSimpleDropdown.open(this._element.id);
}
else {
- UISimpleDropdown.close(this._element.id);
+ UiSimpleDropdown.close(this._element.id);
}
}
};
- return UISuggestion;
+ return UiSuggestion;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/TabMenu
+ * @module WoltLab/WCF/Ui/TabMenu
*/
-define(['Dictionary', 'DOM/ChangeListener', 'DOM/Util', './TabMenu/Simple'], function(Dictionary, DOMChangeListener, DOMUtil, SimpleTabMenu) {
+define(['Dictionary', 'Dom/ChangeListener', 'Dom/Util', './TabMenu/Simple'], function(Dictionary, DomChangeListener, DomUtil, SimpleTabMenu) {
"use strict";
var _tabMenus = new Dictionary();
/**
- * @exports WoltLab/WCF/UI/TabMenu
+ * @exports WoltLab/WCF/Ui/TabMenu
*/
- var UITabMenu = {
+ var UiTabMenu = {
/**
* Sets up tab menus and binds listeners.
*/
this._init();
this._selectErroneousTabs();
- DOMChangeListener.add('WoltLab/WCF/UI/TabMenu', this._init.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Ui/TabMenu', this._init.bind(this));
},
/**
var tabMenus = document.querySelectorAll('.tabMenuContainer:not(.staticTabMenuContainer)');
for (var i = 0, length = tabMenus.length; i < length; i++) {
var container = tabMenus[i];
- var containerId = DOMUtil.identify(container);
+ var containerId = DomUtil.identify(container);
if (_tabMenus.has(containerId)) {
continue;
}
};
- return UITabMenu;
+ return UiTabMenu;
});
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/TabMenu/Simple
+ * @module WoltLab/WCF/Ui/TabMenu/Simple
*/
-define(['Dictionary', 'DOM/Traverse', 'DOM/Util', 'EventHandler'], function(Dictionary, DOMTraverse, DOMUtil, EventHandler) {
+define(['Dictionary', 'Dom/Traverse', 'Dom/Util', 'EventHandler'], function(Dictionary, DomTraverse, DomUtil, EventHandler) {
"use strict";
/**
return false;
}
- var nav = DOMTraverse.childByTag(this._container, 'NAV');
+ var nav = DomTraverse.childByTag(this._container, 'NAV');
if (nav === null) {
return false;
}
return false;
}
- var containers = DOMTraverse.childrenByTag(this._container, 'DIV');
+ var containers = DomTraverse.childrenByTag(this._container, 'DIV');
for (var i = 0, length = containers.length; i < length; i++) {
var container = containers[i];
var name = container.getAttribute('data-name');
if (!name) {
- name = DOMUtil.identify(container);
+ name = DomUtil.identify(container);
}
container.setAttribute('data-name', name);
* @author Alexander Ebert
* @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLab/WCF/UI/Tooltip
+ * @module WoltLab/WCF/Ui/Tooltip
*/
-define(['Environment', 'DOM/ChangeListener', 'UI/Alignment'], function(Environment, DOMChangeListener, UIAlignment) {
+define(['Environment', 'Dom/ChangeListener', 'Ui/Alignment'], function(Environment, DomChangeListener, UiAlignment) {
"use strict";
var _elements = null;
var _tooltip = null;
/**
- * @exports WoltLab/WCF/UI/Tooltip
+ * @exports WoltLab/WCF/Ui/Tooltip
*/
- var UITooltip = {
+ var UiTooltip = {
/**
* Initializes the tooltip element and binds event listener.
*/
this.init();
- DOMChangeListener.add('WoltLab/WCF/UI/Tooltip', this.init.bind(this));
+ DomChangeListener.add('WoltLab/WCF/Ui/Tooltip', this.init.bind(this));
},
/**
_text.textContent = title;
- UIAlignment.set(_tooltip, element, {
+ UiAlignment.set(_tooltip, element, {
horizontal: 'center',
pointer: true,
pointerClassNames: ['inverse'],
}
};
- return UITooltip;
+ return UiTooltip;
});
'Core': 'WoltLab/WCF/Core',
'DateUtil': 'WoltLab/WCF/Date/Util',
'Dictionary': 'WoltLab/WCF/Dictionary',
- 'DOM/ChangeListener': 'WoltLab/WCF/DOM/Change/Listener',
- 'DOM/Traverse': 'WoltLab/WCF/DOM/Traverse',
- 'DOM/Util': 'WoltLab/WCF/DOM/Util',
+ 'Dom/ChangeListener': 'WoltLab/WCF/Dom/Change/Listener',
+ 'Dom/Traverse': 'WoltLab/WCF/Dom/Traverse',
+ 'Dom/Util': 'WoltLab/WCF/Dom/Util',
'Environment': 'WoltLab/WCF/Environment',
'EventHandler': 'WoltLab/WCF/Event/Handler',
'Language': 'WoltLab/WCF/Language',
'List': 'WoltLab/WCF/List',
'ObjectMap': 'WoltLab/WCF/ObjectMap',
'StringUtil': 'WoltLab/WCF/StringUtil',
- 'UI/Alignment': 'WoltLab/WCF/UI/Alignment',
- 'UI/CloseOverlay': 'WoltLab/WCF/UI/CloseOverlay',
- 'UI/Confirmation': 'WoltLab/WCF/UI/Confirmation',
- 'UI/Dialog': 'WoltLab/WCF/UI/Dialog',
- 'UI/SimpleDropdown': 'WoltLab/WCF/UI/Dropdown/Simple',
- 'UI/TabMenu': 'WoltLab/WCF/UI/TabMenu'
+ 'Ui/Alignment': 'WoltLab/WCF/Ui/Alignment',
+ 'Ui/CloseOverlay': 'WoltLab/WCF/Ui/CloseOverlay',
+ 'Ui/Confirmation': 'WoltLab/WCF/Ui/Confirmation',
+ 'Ui/Dialog': 'WoltLab/WCF/Ui/Dialog',
+ 'Ui/SimpleDropdown': 'WoltLab/WCF/Ui/Dropdown/Simple',
+ 'Ui/TabMenu': 'WoltLab/WCF/Ui/TabMenu'
}
}
});