mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
fall back to bbcode-less quotes
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9835 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
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
|
||||
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
|
||||
@@ -14,7 +15,6 @@ var clientVer = parseInt(navigator.appVersion); // Get browser version
|
||||
|
||||
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
|
||||
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
|
||||
|
||||
var baseHeight;
|
||||
|
||||
/**
|
||||
@@ -250,12 +250,59 @@ 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/
|
||||
*/
|
||||
|
@@ -5,6 +5,11 @@
|
||||
</h3>
|
||||
|
||||
<div id="topicreview">
|
||||
<script>
|
||||
// <![CDATA[
|
||||
bbcodeEnabled = {S_BBCODE_ALLOWED};
|
||||
// ]]>
|
||||
</script>
|
||||
<!-- BEGIN topic_review_row -->
|
||||
|
||||
<!-- IF topic_review_row.S_IGNORE_POST -->
|
||||
|
Reference in New Issue
Block a user