git-svn-id: file:///svn/phpbb/trunk@6665 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Dominik Dröscher 2006-11-27 10:26:38 +00:00
parent d5593b154e
commit 0bc076a0c3
2 changed files with 40 additions and 41 deletions

View file

@ -548,9 +548,9 @@
var text_name = 'signature'; var text_name = 'signature';
// Define the bbCode tags // Define the bbCode tags
bbcode = new Array(); bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->); bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
imageTag = false; imageTag = false;
// Helpline messages // Helpline messages
var help_line = { var help_line = {
@ -566,7 +566,9 @@ var help_line = {
s: '{LA_BBCODE_S_HELP}', s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}', f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}', e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}' d: '{LA_BBCODE_D_HELP}',
t: '{LA_BBCODE_T_HELP}',
tip: '{L_STYLES_TIP}'
<!-- BEGIN custom_tags --> <!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}' ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}'
<!-- END custom_tags --> <!-- END custom_tags -->
@ -589,24 +591,25 @@ var help_line = {
<legend>{L_SIGNATURE}</legend> <legend>{L_SIGNATURE}</legend>
<p>{L_SIGNATURE_EXPLAIN}</p> <p>{L_SIGNATURE_EXPLAIN}</p>
<div id="format-buttons"> <div id="format-buttons">
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" /> <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" /> <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" /> <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /> <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG --> <!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED --> <!-- IF S_LINKS_ALLOWED -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_BBCODE_FLASH --> <!-- IF S_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /> <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
{L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> {L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
<option value="7">{L_FONT_TINY}</option> <option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option> <option value="9">{L_FONT_SMALL}</option>
<option value="12" selected="selected">{L_FONT_NORMAL}</option> <option value="12" selected="selected">{L_FONT_NORMAL}</option>
@ -622,14 +625,8 @@ var help_line = {
</div> </div>
<p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p> <p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p>
<dl> <div style="text-align: left;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></div>
<dt style="width: 95px;"><script type="text/javascript"><!-- <div><!-- IF S_BBCODE_ALLOWED -->
colorPalette('v', 17, 13);
//--></script>
</dt>
<dd style="text-align: left; margin-left: 95px;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
<dd style="text-align: left; margin-left: 95px;">
<!-- IF S_BBCODE_ALLOWED -->
<input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp; <input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED --> <!-- IF S_SMILIES_ALLOWED -->
@ -639,8 +636,7 @@ var help_line = {
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp; <input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS} <br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
</dd> </div>
</dl>
</fieldset> </fieldset>
<fieldset class="quick"> <fieldset class="quick">

View file

@ -118,20 +118,20 @@ function bbfontstyle(bbopen, bbclose)
insert_text(bbopen + bbclose); insert_text(bbopen + bbclose);
// Center the cursor when we don't have a selection // Center the cursor when we don't have a selection
// IE & Opera // Gecko and proper browsers
if (document.selection) if (!isNaN(textarea.selectionStart))
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
}
// IE
else if (document.selection)
{ {
var range = textarea.createTextRange(); var range = textarea.createTextRange();
range.move("character", new_pos); range.move("character", new_pos);
range.select(); range.select();
storeCaret(document.forms[form_name].elements[text_name]); storeCaret(document.forms[form_name].elements[text_name]);
} }
//Gecko
else if (!isNaN(textarea.selectionStart))
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
}
document.forms[form_name].elements[text_name].focus(); document.forms[form_name].elements[text_name].focus();
return; return;
@ -155,13 +155,8 @@ function insert_text(text, spaces, popup)
{ {
text = ' ' + text + ' '; text = ' ' + text + ' ';
} }
if (textarea.createTextRange && textarea.caretPos)
{
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
} if (!isNaN(textarea.selectionStart))
else if (!isNaN(textarea.selectionStart))
{ {
var sel_start = textarea.selectionStart; var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd; var sel_end = textarea.selectionEnd;
@ -170,6 +165,14 @@ function insert_text(text, spaces, popup)
textarea.selectionStart = sel_start + text.length; textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length; textarea.selectionEnd = sel_end + text.length;
} }
else if (textarea.createTextRange && textarea.caretPos)
{
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
}
else else
{ {
textarea.value = textarea.value + text; textarea.value = textarea.value + text;
@ -372,7 +375,7 @@ function getCaretPosition(txtarea)
// get current selection // get current selection
var range = document.selection.createRange(); var range = document.selection.createRange();
// create a selection of the whole textarea // a new selection of the whole textarea
var range_all = document.body.createTextRange(); var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea); range_all.moveToElementText(txtarea);