diff options
author | Nils Adermann <naderman@naderman.de> | 2010-05-16 19:17:25 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-16 19:17:25 +0200 |
commit | 321f7a9946d68d589749d550fceb50970d1e2d47 (patch) | |
tree | 90a19c72c1458757fb98af91b1f7d88f1f1d994e /phpBB | |
parent | Merge branch 'ticket/nickvergessen/9531' into develop-olympus (diff) | |
parent | [ticket/9530] The prosilver problem in #9531 exists in subsilver2 editor.js (diff) | |
download | phpbb-321f7a9946d68d589749d550fceb50970d1e2d47.tar.gz phpbb-321f7a9946d68d589749d550fceb50970d1e2d47.tar.bz2 phpbb-321f7a9946d68d589749d550fceb50970d1e2d47.zip |
Merge branch 'ticket/nickvergessen/9530' into develop-olympus
* ticket/nickvergessen/9530:
[ticket/9530] The prosilver problem in #9531 exists in subsilver2 editor.js
[ticket/9530] Subsilver2 is missing BBCode-less quotes fallback-option when bbcodes are disabled.
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/styles/subsilver2/template/editor.js | 55 | ||||
-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, 63 insertions, 2 deletions
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 2d157caada..54bd3450d0 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 @@ -195,7 +196,7 @@ function attach_inline(index, filename) /** * Add quote text to message */ -function addquote(post_id, username) +function addquote(post_id, username, l_wrote) { var message_name = 'message_' + post_id; var theSelection = ''; @@ -250,12 +251,62 @@ function addquote(post_id, username) if (theSelection) { - insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + if (bbcodeEnabled) + { + insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + } + else + { + insert_text(username + ' ' + l_wrote + ':' + '\n'); + 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 c252f7d8e9..5456ad09b6 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 3f326257fc..d11822cc39 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> |