From: Alexander Ebert Date: Tue, 7 Jul 2015 13:15:30 +0000 (+0200) Subject: Unified method names X-Git-Tag: 3.0.0_Beta_1~2218 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a25ebfc0c0de124163cabcd4bce206bb3c9d59e;p=GitHub%2FWoltLab%2FWCF.git Unified method names --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js index 00f312e58b..413ac4c145 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js @@ -33,7 +33,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa item = stack[i]; if (typeof item === 'object') { - value = this._replace(stack, item, i); + value = this._convert(stack, item, i); if (Array.isArray(value)) { stack[i] = (value[0] === null ? item.source : value[0]); stack[item.pair] = (value[1] === null ? stack[item.pair].source : value[1]); @@ -78,15 +78,15 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa tt: 'kbd', // callback replacement - attach: this._replaceAttachment.bind(this), - color: this._replaceColor.bind(this), - code: this._replaceCode.bind(this), - email: this._replaceEmail.bind(this), - list: this._replaceList.bind(this), - quote: this._replaceQuote.bind(this), - size: this._replaceSize.bind(this), - url: this._replaceUrl.bind(this), - img: this._replaceImage.bind(this) + attach: this._convertAttachment.bind(this), + color: this._convertColor.bind(this), + code: this._convertCode.bind(this), + email: this._convertEmail.bind(this), + list: this._convertList.bind(this), + quote: this._convertQuote.bind(this), + size: this._convertSize.bind(this), + url: this._convertUrl.bind(this), + img: this._convertImage.bind(this) }; _removeNewlineAfter = ['quote', 'table', 'td', 'tr']; @@ -99,7 +99,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa }); }, - _replace: function(stack, item, index) { + _convert: function(stack, item, index) { var replace = _bbcodes[item.name], tmp; if (replace === undefined) { @@ -136,7 +136,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa } // replace smilies - this._replaceSmilies(stack); + this._convertSmilies(stack); if (typeof replace === 'string') { return ['<' + replace + '>', '']; @@ -146,7 +146,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa } }, - _replaceAttachment: function(stack, item, index) { + _convertAttachment: function(stack, item, index) { var attachmentId = 0, attributes = item.attributes, length = attributes.length; if (!_options.attachments.url) { length = 0; @@ -190,7 +190,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa ]; }, - _replaceCode: function(stack, item, index) { + _convertCode: function(stack, item, index) { var attributes = item.attributes, filename = '', highlighter = 'auto', lineNumber = 0; // parse arguments @@ -273,7 +273,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa ]; }, - _replaceColor: function(stack, item, index) { + _convertColor: function(stack, item, index) { if (!item.attributes.length || !item.attributes[0].match(/^[a-z0-9#]+$/i)) { return [null, null]; } @@ -281,7 +281,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa return ['', '']; }, - _replaceEmail: function(stack, item, index) { + _convertEmail: function(stack, item, index) { var email = ''; if (item.attributes.length) { email = item.attributes[0]; @@ -309,7 +309,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa return ['', '']; }, - _replaceImage: function(stack, item, index) { + _convertImage: function(stack, item, index) { var float = 'none', source = '', width = 0; switch (item.attributes.length) { @@ -355,7 +355,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa return ['', '']; }, - _replaceList: function(stack, item, index) { + _convertList: function(stack, item, index) { var type = (items.attributes.length) ? item.attributes[0] : ''; // replace list items @@ -376,7 +376,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa return ['']; }, - _replaceQuote: function(stack, item, index) { + _convertQuote: function(stack, item, index) { var author = '', link = ''; if (item.attributes.length > 1) { author = item.attributes[0]; @@ -417,7 +417,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa ]; }, - _replaceSmilies: function(stack) { + _convertSmilies: function(stack) { var altValue, item, regexp; for (var i = 0, length = stack.length; i < length; i++) { item = stack[i]; @@ -440,7 +440,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa } }, - _replaceSize: function(stack, item, index) { + _convertSize: function(stack, item, index) { if (!item.attributes.length || ~~item.attributes[0] === 0) { return [null, null]; } @@ -448,7 +448,7 @@ define(['Core', 'EventHandler', 'Language', 'StringUtil', 'WoltLab/WCF/BBCode/Pa return ['', '']; }, - _replaceUrl: function(stack, item, index) { + _convertUrl: function(stack, item, index) { // ignore url bbcode without arguments if (!item.attributes.length) { return [null, null];