mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/10620] Add more whitespace to long quotes in JS
PHPBB3-10620
This commit is contained in:
parent
4c9507e20a
commit
5a55ce3f68
1 changed files with 4 additions and 1 deletions
|
@ -241,6 +241,7 @@ function addquote(post_id, username, l_wrote, attributes) {
|
||||||
* @return {!string} Quote block to be used in a new post/text
|
* @return {!string} Quote block to be used in a new post/text
|
||||||
*/
|
*/
|
||||||
function generateQuote(text, attributes) {
|
function generateQuote(text, attributes) {
|
||||||
|
text = text.replace(/^\s+/, '').replace(/\s+$/, '');
|
||||||
var quote = '[quote';
|
var quote = '[quote';
|
||||||
if (attributes.author) {
|
if (attributes.author) {
|
||||||
// Add the author as the BBCode's default attribute
|
// Add the author as the BBCode's default attribute
|
||||||
|
@ -253,7 +254,9 @@ function generateQuote(text, attributes) {
|
||||||
quote += ' ' + name + '=' + formatAttributeValue(value.toString());
|
quote += ' ' + name + '=' + formatAttributeValue(value.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
quote += ']' + text + '[/quote]';
|
quote += ']';
|
||||||
|
var newline = ((quote + text + '[/quote]').length > 80 || text.indexOf('\n') > -1) ? '\n' : '';
|
||||||
|
quote += newline + text + newline + '[/quote]';
|
||||||
|
|
||||||
return quote;
|
return quote;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue