[ticket/9530] Subsilver2 is missing BBCode-less quotes fallback-option when bbcodes are disabled.

PHPBB3-9530
This commit is contained in:
Joas Schilling 2010-04-11 01:37:42 +02:00 committed by Nils Adermann
parent 03d50a2e83
commit d147bdcd73
3 changed files with 61 additions and 1 deletions

View file

@ -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
@ -249,13 +250,62 @@ function addquote(post_id, username)
}
if (theSelection)
{
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/
*/

View file

@ -1,3 +1,8 @@
<script type="text/javascript">
// <![CDATA[
bbcodeEnabled = {S_BBCODE_ALLOWED};
// ]]>
</script>
<table class="tablebg" width="100%" cellspacing="1">
<tr>

View file

@ -1,3 +1,8 @@
<script type="text/javascript">
// <![CDATA[
bbcodeEnabled = {S_BBCODE_ALLOWED};
// ]]>
</script>
<table class="tablebg" width="100%" cellspacing="1">
<tr>