1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

Returned to instantiation of ucp object ... perhaps this approach is better? Altered basic info for ucp_modules, updated editor to allow alternative form and textarea names ... still lots of fudginess, hhhmmmm fudge, uuuuugggghhh

git-svn-id: file:///svn/phpbb/trunk@4003 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2003-05-10 17:19:27 +00:00
parent db56a55808
commit 549537b9d5
16 changed files with 612 additions and 399 deletions

View File

@@ -20,7 +20,7 @@ var is_mac = (clientPC.indexOf("mac")!=-1);
// Shows the help messages in the helpline window
function helpline(help) {
document.post.helpbox.value = eval(help + "_help");
document.forms[form_name].helpbox.value = eval(help + "_help");
}
// Replacement for arrayname.length property
@@ -49,13 +49,13 @@ function arraypop(thearray) {
function emoticon(text) {
text = ' ' + text + ' ';
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) {
var caretPos = document.forms[form_name].elements[text_name].caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
} else {
document.post.message.value += text;
document.post.message.focus();
document.forms[form_name].elements[text_name].value += text;
document.forms[form_name].elements[text_name].focus();
}
}
@@ -63,19 +63,19 @@ function bbfontstyle(bbopen, bbclose) {
if ((clientVer >= 4) && is_ie && is_win) {
theSelection = document.selection.createRange().text;
if (!theSelection) {
document.post.message.value += bbopen + bbclose;
document.post.message.focus();
document.forms[form_name].elements[text_name].value += bbopen + bbclose;
document.forms[form_name].elements[text_name].focus();
return;
}
document.selection.createRange().text = bbopen + theSelection + bbclose;
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
return;
} else {
document.post.message.value += bbopen + bbclose;
document.post.message.focus();
document.forms[form_name].elements[text_name].value += bbopen + bbclose;
document.forms[form_name].elements[text_name].focus();
return;
}
storeCaret(document.post.message);
storeCaret(document.forms[form_name].message);
}
@@ -88,19 +88,19 @@ function bbstyle(bbnumber) {
if (bbnumber == -1) { // Close all open tags & default button names
while (bbcode[0]) {
butnumber = arraypop(bbcode) - 1;
document.post.message.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1];
buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value');
if (buttext != "[*]")
{
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
}
document.post.addbbcode10.value = "List";
document.forms[form_name].addbbcode10.value = "List";
bbtags[10] = "[list]";
document.post.addbbcode12.value = "List=";
document.forms[form_name].addbbcode12.value = "List=";
bbtags[12] = "[list=]";
imageTag = false; // All tags are closed including image tags :D
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
return;
}
@@ -110,7 +110,7 @@ function bbstyle(bbnumber) {
if (theSelection) {
// Add tags around selection
document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
theSelection = '';
return;
}
@@ -127,7 +127,7 @@ function bbstyle(bbnumber) {
{
if (donotinsert)
{
document.post.addbbcode12.value = "List=";
document.forms[form_name].addbbcode12.value = "List=";
tmp_help = o_help;
o_help = e_help;
e_help = tmp_help;
@@ -135,7 +135,7 @@ function bbstyle(bbnumber) {
}
else
{
document.post.addbbcode12.value = "[*]";
document.forms[form_name].addbbcode12.value = "[*]";
tmp_help = o_help;
o_help = e_help;
e_help = tmp_help;
@@ -147,7 +147,7 @@ function bbstyle(bbnumber) {
{
if (donotinsert)
{
document.post.addbbcode10.value = "List";
document.forms[form_name].addbbcode10.value = "List";
tmp_help = l_help;
l_help = e_help;
e_help = tmp_help;
@@ -155,7 +155,7 @@ function bbstyle(bbnumber) {
}
else
{
document.post.addbbcode10.value = "[*]";
document.forms[form_name].addbbcode10.value = "[*]";
tmp_help = l_help;
l_help = e_help;
e_help = tmp_help;
@@ -168,43 +168,43 @@ function bbstyle(bbnumber) {
butnumber = arraypop(bbcode) - 1;
if (bbtags[butnumber] != "[*]")
{
document.post.message.value += bbtags[butnumber + 1];
document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1];
}
else
{
document.post.message.value += bbtags[butnumber];
document.forms[form_name].elements[text_name].value += bbtags[butnumber];
}
buttext = eval('document.post.addbbcode' + butnumber + '.value');
buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value');
if (bbtags[butnumber] != "[*]")
{
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
imageTag = false;
}
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
return;
} else { // Open tags
if (imageTag && (bbnumber != 14)) { // Close image tag before adding another
document.post.message.value += bbtags[15];
document.forms[form_name].elements[text_name].value += bbtags[15];
lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
document.post.addbbcode14.value = "Img"; // Return button back to normal state
document.forms[form_name].addbbcode14.value = "Img"; // Return button back to normal state
imageTag = false;
}
// Open tag
document.post.message.value += bbtags[bbnumber];
document.forms[form_name].elements[text_name].value += bbtags[bbnumber];
if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
if (bbtags[bbnumber] != "[*]")
{
arraypush(bbcode,bbnumber+1);
eval('document.post.addbbcode'+bbnumber+'.value += "*"');
eval('document.forms[form_name].addbbcode'+bbnumber+'.value += "*"');
}
document.post.message.focus();
document.forms[form_name].elements[text_name].focus();
return;
}
storeCaret(document.post.message);
storeCaret(document.forms[form_name].message);
}
// Insert at Claret position. Code from

View File

@@ -3,6 +3,9 @@
<script language="javascript" type="text/javascript">
<!--
var form_name = 'post';
var text_name = 'message';
// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[flash]','[/flash]','[url]','[/url]');

View File

@@ -1,7 +1,38 @@
<!-- $Id$ -->
<!-- INCLUDE overall_header.html -->
<form method="post" name="ucp" action="{S_UCP_ACTION}" {S_FORM_ENCTYPE}><table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<script language="javascript" type="text/javascript">
<!--
var form_name = 'ucp';
var text_name = 'signature';
// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[flash]','[/flash]','[url]','[/url]');
imageTag = false;
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";
e_help = "{L_BBCODE_E_HELP}";
//-->
</script>
<script language="javascript" type="text/javascript" src="templates/subSilver/editor.js"></script>
<form method="post" name="ucp" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}><table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td class="nav" colspan="2" align="left" valign="middle"><a href="{U_INDEX}">{L_INDEX}</a></td>
</tr>

View File

@@ -3,7 +3,7 @@
<!-- INCLUDE ucp_header.html -->
<tr>
<td width="20%" valign="top"><table width="100%" cellspacing="1" cellpadding="4" border="0">
<td width="20%" height="100%"><table width="100%" height="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
<th>Options</th>
</tr>
@@ -12,13 +12,19 @@
<!-- IF ucp_subsection.S_SELECTED -->
<td class="row1" height="25" nowrap="nowrap"><span class="nav"><b>{ucp_subsection.L_TITLE}</b>
<!-- ELSE -->
<td class="row2" height="25" nowrap="nowrap"><a class="nav" href="{ucp_subsection.U_TITLE}">{ucp_subsection.L_TITLE}</a>
<td class="row2" height="25" nowrap="nowrap" onmouseover="this.className='row1'" onmouseout="this.className='row2'"><a class="nav" href="{ucp_subsection.U_TITLE}">{ucp_subsection.L_TITLE}</a>
<!-- ENDIF -->
</td>
</tr>
<!-- END ucp_subsection -->
<tr>
<td class="row2" height="100%">&nbsp;</td>
</tr>
<tr>
<td class="cat" height="28">&nbsp;</td>
</tr>
</table></td>
<td width="80%" valign="top"><table width="100%" cellspacing="1" cellpadding="4" border="0">
<td class="row3"><img src="images/spacer.gif" width="1" alt="" /></td> <td width="80%" valign="top"><table width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
<th colspan="2" height="25" valign="middle">{L_TITLE}</th>
</tr>
@@ -31,60 +37,60 @@
<!-- IF S_DISPLAY_PERSONAL -->
<tr>
<td class="row1"><span class="gen">{L_PUBLIC_VIEW_EMAIL}:</span></td>
<td class="row1"><b class="genmed">{L_PUBLIC_VIEW_EMAIL}:</b></td>
<td class="row2">
<input type="radio" name="viewemail" value="1" {VIEW_EMAIL_YES} />
<input type="radio" name="viewemail" value="1"{VIEW_EMAIL_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="viewemail" value="0" {VIEW_EMAIL_NO} />
<input type="radio" name="viewemail" value="0"{VIEW_EMAIL_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_HIDE_USER}:</span></td>
<td class="row1"><b class="genmed">{L_HIDE_USER}:</b></td>
<td class="row2">
<input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />
<input type="radio" name="hideonline" value="1"{HIDE_USER_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />
<input type="radio" name="hideonline" value="0"{HIDE_USER_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_REPLY}:</span><br />
<td class="row1"><b class="genmed">{L_NOTIFY_ON_REPLY}:</b><br />
<span class="gensmall">{L_NOTIFY_ON_REPLY_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="notifyreply" value="1" {NOTIFY_REPLY_YES} />
<input type="radio" name="notifyreply" value="1"{NOTIFY_REPLY_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="notifyreply" value="0" {NOTIFY_REPLY_NO} />
<input type="radio" name="notifyreply" value="0"{NOTIFY_REPLY_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_NOTIFY_ON_PRIVMSG}:</span></td>
<td class="row1"><b class="genmed">{L_NOTIFY_ON_PRIVMSG}:</b></td>
<td class="row2">
<input type="radio" name="notifypm" value="1" {NOTIFY_PM_YES} />
<input type="radio" name="notifypm" value="1"{NOTIFY_PM_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="notifypm" value="0" {NOTIFY_PM_NO} />
<input type="radio" name="notifypm" value="0"{NOTIFY_PM_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_POPUP_ON_PRIVMSG}:</span><br /><span class="gensmall">{L_POPUP_ON_PRIVMSG_EXPLAIN}</span></td>
<td class="row1"><b class="genmed">{L_POPUP_ON_PRIVMSG}:</b><br /><span class="gensmall">{L_POPUP_ON_PRIVMSG_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="popup_pm" value="1" {POPUP_PM_YES} />
<input type="radio" name="popup_pm" value="1"{POPUP_PM_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="popup_pm" value="0" {POPUP_PM_NO} />
<input type="radio" name="popup_pm" value="0"{POPUP_PM_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>
<td class="row2"><select name="language">{LANGUAGE_SELECT}</select></td>
<td class="row1"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td>
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_BOARD_STYLE}:</span></td>
<td class="row2"><select name="style">{STYLE_SELECT}</select></td>
<td class="row1"><b class="genmed">{L_BOARD_STYLE}:</b></td>
<td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_TIMEZONE}:</span></td>
<td class="row2"><select name="timezone">{TIMEZONE_SELECT}</select></td>
<td class="row1"><b class="genmed">{L_TIMEZONE}:</b></td>
<td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_DATE_FORMAT}:</span><br />
<td class="row1"><b class="genmed">{L_DATE_FORMAT}:</b><br />
<span class="gensmall">{L_DATE_FORMAT_EXPLAIN}</span></td>
<td class="row2">
<input type="text" name="dateformat" value="{DATE_FORMAT}" maxlength="14" class="post" />
@@ -95,35 +101,35 @@
<!-- IF S_DISPLAY_POST -->
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ADD_SIGNATURE}:</span></td>
<td class="row1"><b class="genmed">{L_ALWAYS_ADD_SIGNATURE}:</b></td>
<td class="row2">
<input type="radio" name="attachsig" value="1" {ALWAYS_ADD_SIGNATURE_YES} />
<input type="radio" name="attachsig" value="1"{ALWAYS_ADD_SIGNATURE_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="attachsig" value="0" {ALWAYS_ADD_SIGNATURE_NO} />
<input type="radio" name="attachsig" value="0"{ALWAYS_ADD_SIGNATURE_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_BBCODE}:</span></td>
<td class="row1"><b class="genmed">{L_ALWAYS_ALLOW_BBCODE}:</b></td>
<td class="row2">
<input type="radio" name="allowbbcode" value="1" {ALWAYS_ALLOW_BBCODE_YES} />
<input type="radio" name="allowbbcode" value="1"{ALWAYS_ALLOW_BBCODE_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="allowbbcode" value="0" {ALWAYS_ALLOW_BBCODE_NO} />
<input type="radio" name="allowbbcode" value="0"{ALWAYS_ALLOW_BBCODE_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_HTML}:</span></td>
<td class="row1"><b class="genmed">{L_ALWAYS_ALLOW_HTML}:</b></td>
<td class="row2">
<input type="radio" name="allowhtml" value="1" {ALWAYS_ALLOW_HTML_YES} />
<input type="radio" name="allowhtml" value="1"{ALWAYS_ALLOW_HTML_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="allowhtml" value="0" {ALWAYS_ALLOW_HTML_NO} />
<input type="radio" name="allowhtml" value="0"{ALWAYS_ALLOW_HTML_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_SMILIES}:</span></td>
<td class="row1"><b class="genmed">{L_ALWAYS_ALLOW_SMILIES}:</b></td>
<td class="row2">
<input type="radio" name="allowsmilies" value="1" {ALWAYS_ALLOW_SMILIES_YES} />
<input type="radio" name="allowsmilies" value="1"{ALWAYS_ALLOW_SMILIES_YES} />
<span class="gen">{L_YES}</span>&nbsp;&nbsp;
<input type="radio" name="allowsmilies" value="0" {ALWAYS_ALLOW_SMILIES_NO} />
<input type="radio" name="allowsmilies" value="0"{ALWAYS_ALLOW_SMILIES_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
<!-- ENDIF -->

View File

@@ -1,41 +1,4 @@
<!-- $Id$ -->
<script language="javascript" type="text/javascript">
<!--
// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[flash]','[/flash]','[url]','[/url]');
imageTag = false;
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";
e_help = "{L_BBCODE_E_HELP}";
function checkForm()
{
if (document.post.message.value.length < 2) {
alert('{L_EMPTY_MESSAGE}');
return false;
} else {
// document.post.post.disabled = true;
return true;
}
}
//-->
</script>
<script language="javascript" type="text/javascript" src="templates/subSilver/editor.js"></script>
<!-- INCLUDE ucp_header.html -->
<tr>
@@ -99,22 +62,22 @@ function checkForm()
<!-- IF S_DISPLAY_PROFILE -->
<tr>
<td class="row2" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
<td class="row3" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_ICQ}: </b></td>
<td class="row1"><b class="genmed">{L_UCP_ICQ}: </b></td>
<td class="row2"><input class="post" type="text" name="icq" size="30" maxlength="15" value="{ICQ}" /></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_AIM}: </b></td>
<td class="row1"><b class="genmed">{L_UCP_AIM}: </b></td>
<td class="row2"><input class="post" type="text" name="aim" size="30" maxlength="255" value="{AIM}" /></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_MSNM}: </b></td>
<td class="row1"><b class="genmed">{L_UCP_MSNM}: </b></td>
<td class="row2"><input class="post" type="text" name="msn" size="30" maxlength="255" value="{MSN}" /></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_YIM}: </b></td>
<td class="row1"><b class="genmed">{L_UCP_YIM}: </b></td>
<td class="row2"><input class="post" type="text" name="yim" size="30" maxlength="255" value="{YIM}" /></td>
</tr>
<tr>
@@ -175,7 +138,7 @@ function checkForm()
</table></td>
</tr>
<tr>
<td colspan="10" width="450"><input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /></td>
<td colspan="10" width="450"><input class="helpline" type="text" name="helpbox" size="45" maxlength="100" style="width:450px;font-size:10px" value="{L_STYLES_TIP}" /></td>
</tr>
<tr>
<td colspan="10" align="center"><textarea class="post" name="signature" rows="6" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td>