From: Alexander Ebert Date: Wed, 26 Jun 2019 10:40:32 +0000 (+0200) Subject: Merge branch 'master' into next X-Git-Tag: 5.2.0_Alpha_1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=056a6ddf7866a0c4e5d3e15facde9f52a147bb16;p=GitHub%2FWoltLab%2FWCF.git Merge branch 'master' into next --- 056a6ddf7866a0c4e5d3e15facde9f52a147bb16 diff --cc com.woltlab.wcf/templates/register.tpl index 82eb8177b3,6d5ab2a695..7946618a2c --- a/com.woltlab.wcf/templates/register.tpl +++ b/com.woltlab.wcf/templates/register.tpl @@@ -16,17 -16,19 +16,19 @@@
- +
- + *
- + - {if $errorType.username|isset} + {if $errorType[username]|isset} - {if $errorType.username == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if} - {if $errorType.username == 'invalid'}{lang}wcf.user.username.error.invalid{/lang}{/if} - {if $errorType.username == 'notUnique'}{lang}wcf.user.username.error.notUnique{/lang}{/if} + {if $errorType[username] == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.user.username.error.{$errorType[username]}{/lang} + {/if} {/if} {lang}wcf.user.username.description{/lang} @@@ -66,9 -68,9 +68,9 @@@

{lang}wcf.user.email{/lang}

- +
- + *
@@@ -82,9 -86,9 +86,9 @@@
- +
- + *
@@@ -103,31 -107,34 +107,34 @@@

{lang}wcf.user.password{/lang}

- +
- + *
- + - {if $errorType.password|isset} + {if $errorType[password]|isset} - {if $errorType.password == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if} - {if $errorType.password == 'notSecure'}{lang}wcf.user.password.error.notSecure{/lang}{/if} + {if $errorType[password] == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.user.password.error.{$errorType[password]}{/lang} + {/if} {/if} {lang}wcf.user.password.description{/lang}
- +
- + *
- + - {if $errorType.confirmPassword|isset} + {if $errorType[confirmPassword]|isset} - {if $errorType.confirmPassword == 'notEqual'}{lang}wcf.user.confirmPassword.error.notEqual{/lang}{/if} + {lang}wcf.user.confirmPassword.error.{$errorType[confirmPassword]}{/lang} {/if}
diff --cc wcfsetup/install/files/js/3rdParty/redactor2/redactor.js index a9f5d6e201,232a598a2a..b6bc074c4c --- a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js @@@ -4640,185 -5461,220 +4640,201 @@@ newInline = this.inline.insertInline(tag); newInline = this.inline.setParams(newInline, params); } - else - { - var $first = this.inline.insertBreakpoint(inline, currentTag); - this.caret.after($first); - } - } - else - { - newInline = this.inline.insertInline(tag); - newInline = this.inline.setParams(newInline, params); - } - }, - formatUncollapsed: function(tag, params) - { - this.selection.save(); - - var nodes = this.inline.getClearedNodes(); - this.inline.setNodesStriked(nodes, tag, params); - - this.selection.restore(); - - document.execCommand('strikethrough'); + else { + var $first = this.inline.insertBreakpoint(inline, currentTag); + this.caret.after($first); + - this.selection.saveInstant(); + } + } + else { + newInline = this.inline.insertInline(tag); + newInline = this.inline.setParams(newInline, params); + } + }, + formatUncollapsed: function (tag, params) { + this.selection.save(); + + var nodes = this.inline.getClearedNodes(); + this.inline.setNodesStriked(nodes, tag, params); + + this.selection.restore(); + + document.execCommand('strikethrough'); + + this.selection.saveInstant(); + + // WoltLab: Chrome misbehaves in some cases, causing the `` element for + // contained elements to be stripped. Instead, those children are assigned the + // CSS style `text-decoration-line: line-through`. + var chromeElements = this.core.editor()[0].querySelectorAll('[style*="line-through"]'), element, strike; + for (var i = 0, length = chromeElements.length; i < length; i++) { + element = chromeElements[0]; - ++ + strike = document.createElement('strike'); + element.parentNode.insertBefore(strike, element); + strike.appendChild(element); - ++ + // Remove the bogus style attribute. + element.style.removeProperty('text-decoration'); + } var self = this; - this.core.editor().find('strike').each(function() - { - var $el = self.utils.replaceToTag(this, tag); - self.inline.setParams($el[0], params); - - var $inside = $el.find(tag); - var $parent = $el.parent(); - var $parentAround = $parent.parent(); - - // revert formatting (safari bug) - if ($parentAround.length !== 0 && $parentAround[0].tagName.toLowerCase() === tag && $parentAround.html() == $parent[0].outerHTML) - { - $el.replaceWith(function() { return $(this).contents(); }); - $parentAround.replaceWith(function() { return $(this).contents(); }); - - return; - } - - // remove inside - if ($inside.length !== 0) self.inline.cleanInsideOrParent($inside, params); - - // same parent - if ($parent.html() == $el[0].outerHTML) self.inline.cleanInsideOrParent($parent, params); - - // bugfix: remove empty inline tags after selection - if (self.detect.isFirefox()) - { - self.core.editor().find(tag + ':empty').remove(); - } - }); - - this.selection.restoreInstant(); - }, - cleanInsideOrParent: function($el, params) - { - if (params) - { - for (var key in params.data) - { - this.inline.removeSpecificAttr($el, key, params.data[key]); - } - } - }, - getClearedNodes: function() - { - var nodes = this.selection.nodes(); - var newNodes = []; - var len = nodes.length; - var started = 0; - - // find array slice - for (var i = 0; i < len; i++) - { - if ($(nodes[i]).hasClass('redactor-selection-marker')) - { - started = i + 2; - break; + this.core.editor().find('strike').each(function () { + var $el = self.utils.replaceToTag(this, tag); + self.inline.setParams($el[0], params); + + var $inside = $el.find(tag); + var $parent = $el.parent(); + var $parentAround = $parent.parent(); + + // revert formatting (safari bug) + if ($parentAround.length !== 0 && $parentAround[0].tagName.toLowerCase() === tag && $parentAround.html() == $parent[0].outerHTML) { + $el.replaceWith(function () { return $(this).contents(); }); + $parentAround.replaceWith(function () { return $(this).contents(); }); + + return; + } + + // remove inside + if ($inside.length !== 0) { + self.inline.cleanInsideOrParent($inside, params); + } + + // same parent + if ($parent.html() == $el[0].outerHTML) { + self.inline.cleanInsideOrParent($parent, params); + } + + // bugfix: remove empty inline tags after selection + if (self.detect.isFirefox()) { + self.core.editor().find(tag + ':empty').remove(); + } + }); + + this.selection.restoreInstant(); + }, + cleanInsideOrParent: function ($el, params) { + if (params) { + for (var key in params.data) { + this.inline.removeSpecificAttr($el, key, params.data[key]); } } - - // find selected inline & text nodes - for (var i = 0; i < len; i++) - { - if (i >= started && !this.utils.isBlockTag(nodes[i].tagName)) - { - newNodes.push(nodes[i]); + }, + getClearedNodes: function () { + var nodes = this.selection.nodes(); + var newNodes = []; + var len = nodes.length; + var started = 0; + + // find array slice + for (var i = 0; i < len; i++) { + if ($(nodes[i]).hasClass('redactor-selection-marker')) { + started = i + 2; + break; } } - + + // find selected inline & text nodes + for (var i = 0; i < len; i++) { + if (i >= started && !this.utils.isBlockTag(nodes[i].tagName)) { + newNodes.push(nodes[i]); + } + } + return newNodes; - }, - isConvertableAttr: function(node, name, value) - { - var nodeAttrValue = $(node).attr(name); - if (nodeAttrValue) - { - if (name === 'style') - { - value = $.trim(value).replace(/;$/, '') - - var rules = value.split(';'); - var count = 0; - for (var i = 0; i < rules.length; i++) - { - var arr = rules[i].split(':'); - var ruleName = $.trim(arr[0]); - var ruleValue = $.trim(arr[1]); - - if (ruleName.search(/color/) !== -1) - { - var val = $(node).css(ruleName); - if (val && (val === ruleValue || this.utils.rgb2hex(val) === ruleValue)) - { - count++; - } - } - else if ($(node).css(ruleName) === ruleValue) - { - count++; - } - } - - if (count === rules.length) - { - return 1; - } - } - else if (nodeAttrValue === value) - { - return 1; - } - } - - return 0; - - }, - isConvertable: function(node, nodeTag, tag, params) - { - if (nodeTag === tag) - { - if (params) - { - var count = 0; - for (var key in params.data) - { - count += this.inline.isConvertableAttr(node, key, params.data[key]); - } - - if (count === Object.keys(params.data).length) - { - return true; - } - } - else - { - return true; - } - } - - return false; - }, - setNodesStriked: function(nodes, tag, params) - { - for (var i = 0; i < nodes.length; i++) - { - var nodeTag = (nodes[i].tagName) ? nodes[i].tagName.toLowerCase() : undefined; - - var parent = nodes[i].parentNode; - var parentTag = (parent && parent.tagName) ? parent.tagName.toLowerCase() : undefined; - - var convertable = this.inline.isConvertable(parent, parentTag, tag, params); - if (convertable) - { - var $el = $(parent).replaceWith(function() - { - return $('').append($(this).contents()); - }); - - $el.attr('data-redactor-inline-converted'); - } - - var convertable = this.inline.isConvertable(nodes[i], nodeTag, tag, params); - if (convertable) - { - var $el = $(nodes[i]).replaceWith(function() - { - return $('').append($(this).contents()); - }); - } - } - }, - insertBreakpoint: function(inline, currentTag) - { + }, + isConvertableAttr: function (node, name, value) { + var nodeAttrValue = $(node).attr(name); + if (nodeAttrValue) { + if (name === 'style') { + value = $.trim(value).replace(/;$/, ''); + + var rules = value.split(';'); + var count = 0; + for (var i = 0; i < rules.length; i++) { + var arr = rules[i].split(':'); + var ruleName = $.trim(arr[0]); + var ruleValue = $.trim(arr[1]); + + if (ruleName.search(/color/) !== -1) { + var val = $(node).css(ruleName); + if (val && (val === ruleValue || this.utils.rgb2hex( + val) === ruleValue)) { + count++; + } + } + else if ($(node).css(ruleName) === ruleValue) { + count++; + } + } + + if (count === rules.length) { + return 1; + } + } + else if (nodeAttrValue === value) { + return 1; + } + } + + return 0; + + }, + isConvertable: function (node, nodeTag, tag, params) { + if (nodeTag === tag) { + if (params) { + var count = 0; + for (var key in params.data) { + count += this.inline.isConvertableAttr(node, + key, + params.data[key] + ); + } + + if (count === Object.keys(params.data).length) { + return true; + } + } + else { + return true; + } + } + + return false; + }, + setNodesStriked: function (nodes, tag, params) { + for (var i = 0; i < nodes.length; i++) { + var nodeTag = (nodes[i].tagName) ? nodes[i].tagName.toLowerCase() : undefined; + + var parent = nodes[i].parentNode; + var parentTag = (parent && parent.tagName) ? parent.tagName.toLowerCase() : undefined; + + var convertable = this.inline.isConvertable(parent, + parentTag, + tag, + params + ); + if (convertable) { + var $el = $(parent).replaceWith(function () { + return $('').append($(this).contents()); + }); + + $el.attr('data-redactor-inline-converted'); + } + + var convertable = this.inline.isConvertable(nodes[i], + nodeTag, + tag, + params + ); + if (convertable) { + var $el = $(nodes[i]).replaceWith(function () { + return $('').append($(this).contents()); + }); + } + } + }, + insertBreakpoint: function (inline, currentTag) { var breakpoint = document.createElement('span'); breakpoint.id = 'redactor-inline-breakpoint'; breakpoint = this.insert.node(breakpoint); @@@ -9228,48 -11688,46 +9244,47 @@@ this.$element.css(this.prefixes[len] + 'animation-iteration-count', iterate); this.$element.css(this.prefixes[len] + 'animation-timing-function', timing); } - + }, - clean: function() - { + clean: function () { this.$element.removeClass('redactor-animated'); this.$element.removeClass(this.opts.prefix + this.queue[0]); - + this.set('', '', '', ''); - + }, - complete: function(type, make, callback) - { - this.$element.one(type.toLowerCase() + ' webkit' + type + ' o' + type + ' MS' + type, $.proxy(function() - { - if (typeof make === 'function') - { - make(); - } - - if (typeof callback === 'function') - { - callback(this); - } - - // hide - var effects = ['fadeOut', 'slideUp', 'zoomOut', 'slideOutUp', 'slideOutRight', 'slideOutLeft']; - if ($.inArray(this.animation, effects) !== -1) - { - this.$element.css('display', 'none'); - } - - // slide - if (this.slide) - { - this.$element.css('height', ''); - } - - }, this)); - + complete: function (type, make, callback) { + this.$element.one(type.toLowerCase() + ' webkit' + type + ' o' + type + ' MS' + type, + $.proxy(function () { + if (typeof make === 'function') { + make(); + } + + if (typeof callback === 'function') { + callback(this); + } + + // hide + var effects = [ + 'fadeOut', + 'slideUp', + 'zoomOut', + 'slideOutUp', + 'slideOutRight', + 'slideOutLeft' + ]; + if ($.inArray(this.animation, effects) !== -1) { + this.$element.css('display', 'none'); + } + + // slide + if (this.slide) { + this.$element.css('height', ''); + } + + }, this) + ); + } }; - - })(jQuery); diff --cc wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index 3830e7fecb,d69ee45908..61cd89a700 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@@ -72,14 -71,22 +72,27 @@@ class HtmlInputNodeProcessor extends Ab 'ul', 'ol', 'li', // other - 'a', 'kbd', 'woltlab-quote', 'woltlab-spoiler', 'pre', 'sub', 'sup' + 'a', 'kbd', 'woltlab-quote', 'woltlab-spoiler', 'pre', 'sub', 'sup', ]; + /** + * list of tag names that represent inline content in the HTML 5 standard + * @var string[] + */ + public static $inlineElements = [ + 'a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button', + 'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', + 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'mark', 'meter', + 'noscript', 'object', 'output', 'picture', 'progress', 'q', 'ruby', 's', + 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'sub', 'sup', + 'svg', 'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr', + ]; + + /** + * @var HtmlNodePlainLink[] + */ + public $plainLinks = []; + /** * list of embedded content grouped by type * @var array