diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2010-04-11 01:37:42 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-16 19:14:36 +0200 |
commit | d147bdcd73cea2dd43e54526e589f7aee6f34d4c (patch) | |
tree | 877c7e9dbb77569c790f78ac09b7ccfada30afc5 | |
parent | 03d50a2e83cc631779a7574acd4db8b77f29d547 (diff) | |
download | forums-d147bdcd73cea2dd43e54526e589f7aee6f34d4c.tar forums-d147bdcd73cea2dd43e54526e589f7aee6f34d4c.tar.gz forums-d147bdcd73cea2dd43e54526e589f7aee6f34d4c.tar.bz2 forums-d147bdcd73cea2dd43e54526e589f7aee6f34d4c.tar.xz forums-d147bdcd73cea2dd43e54526e589f7aee6f34d4c.zip |
[ticket/9530] Subsilver2 is missing BBCode-less quotes fallback-option when bbcodes are disabled.
PHPBB3-9530
-rw-r--r-- | phpBB/styles/subsilver2/template/editor.js | 52 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/posting_topic_review.html | 5 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_pm_history.html | 5 |
3 files changed, 61 insertions, 1 deletions
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 2d157caada..37c6360cb5 100644 --- a/phpBB/styles/subsilver2/template/editor.js +++ b/phpBB/styles/subsilver2/template/editor.js @@ -6,6 +6,7 @@ // Startup variables var imageTag = false; var theSelection = false; +var bbcodeEnabled = true; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html @@ -250,12 +251,61 @@ function addquote(post_id, username) if (theSelection) { - insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + if (bbcodeEnabled) + { + insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + } + else + { + var lines = split_lines(theSelection); + for (i = 0; i < lines.length; i++) + { + insert_text('> ' + lines[i] + '\n'); + } + } } return; } + +function split_lines(text) +{ + var lines = text.split('\n'); + var splitLines = new Array(); + var j = 0; + for(i = 0; i < lines.length; i++) + { + if (lines[i].length <= 80) + { + splitLines[j] = lines[i]; + j++; + } + else + { + var line = lines[i]; + do + { + var splitAt = line.indexOf(' ', 80); + + if (splitAt == -1) + { + splitLines[j] = line; + j++; + } + else + { + splitLines[j] = line.substring(0, splitAt); + line = line.substring(splitAt); + j++; + } + } + while(splitAt != -1); + } + } + return splitLines; +} + /** * From http://www.massless.org/mozedit/ */ diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index d1af72b522..b241362a22 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -1,3 +1,8 @@ +<script type="text/javascript"> +// <![CDATA[ + bbcodeEnabled = {S_BBCODE_ALLOWED}; +// ]]> +</script> <table class="tablebg" width="100%" cellspacing="1"> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html index cb87d1892a..7027d4533d 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_history.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html @@ -1,3 +1,8 @@ +<script type="text/javascript"> +// <![CDATA[ + bbcodeEnabled = {S_BBCODE_ALLOWED}; +// ]]> +</script> <table class="tablebg" width="100%" cellspacing="1"> <tr> |