diff options
Diffstat (limited to 'phpBB/styles/subSilver/template/posting_smilies.html')
-rw-r--r-- | phpBB/styles/subSilver/template/posting_smilies.html | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/phpBB/styles/subSilver/template/posting_smilies.html b/phpBB/styles/subSilver/template/posting_smilies.html index 5536513229..42a58d1153 100644 --- a/phpBB/styles/subSilver/template/posting_smilies.html +++ b/phpBB/styles/subSilver/template/posting_smilies.html @@ -4,63 +4,10 @@ <!-- var form_name = 'post'; - -/** -* Apply clicked smiley to message body -*/ -function smiley(text) -{ - text = ' ' + text + ' '; - - if (opener.document.forms[form_name].message.createTextRange && opener.document.forms[form_name].message.caretPos) - { - var caretPos = opener.document.forms[form_name].message.caretPos; - - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; - opener.document.forms[form_name].message.focus(); - } - else - { - var selStart = opener.document.forms[form_name].message.selectionStart; - var selEnd = opener.document.forms[form_name].message.selectionEnd; - - mozWrap(opener.document.forms[form_name].message, text, '') - opener.document.forms[form_name].message.focus(); - opener.document.forms[form_name].message.selectionStart = selStart + text.length; - opener.document.forms[form_name].message.selectionEnd = selEnd + text.length; - } -} - -/** -* From http://www.massless.org/mozedit/ -*/ -function mozWrap(txtarea, open, close) -{ - var selLength = txtarea.textLength; - var selStart = txtarea.selectionStart; - var selEnd = txtarea.selectionEnd; - var scrollTop = txtarea.scrollTop; - - if (selEnd == 1 || selEnd == 2) - { - selEnd = selLength; - } - - var s1 = (txtarea.value).substring(0,selStart); - var s2 = (txtarea.value).substring(selStart, selEnd) - var s3 = (txtarea.value).substring(selEnd, selLength); - - txtarea.value = s1 + open + s2 + close + s3; - txtarea.selectionStart = selEnd + open.length + close.length; - txtarea.selectionEnd = txtarea.selectionStart; - txtarea.focus(); - txtarea.scrollTop = scrollTop; - - return; -} - +var text_name = 'message'; //--> </script> +<script language="javascript" type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script> <table width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> @@ -70,7 +17,7 @@ function mozWrap(txtarea, open, close) <th>{L_SMILIES}</th> </tr> <tr> - <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="smiley('{smiley.A_SMILEY_CODE}'); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_DESC}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> + <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_DESC}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> </tr> </table> </td> |