Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Smiley MOD WWF v7
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Smiley MOD WWF v7

 Post Reply Post Reply
Author
zjieb View Drop Down
Newbie
Newbie


Joined: 25 April 2003
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote zjieb Quote  Post ReplyReply Direct Link To This Post Topic: Smiley MOD WWF v7
    Posted: 15 May 2003 at 6:01pm

When you don't use the WYSIWIG HTML Editor and you want to insert a smiley in the message, it's position will be at the end of the message. This is really annoying when you're replying to a PM, because the original message will be at the bottom, all smileys end up at the bottom of the message. (i.e. you have to cut&past the smiley-code to get the right position)

In message_form_js.asp change:

replace the AddSmileyIcon function at line 136 with the following code:

Originally posted by JAVASCRIPT JAVASCRIPT wrote:

function AddSmileyIcon(iconCode) {
 var txtarea = document.frmAddMessage.message;
 iconCode = ' ' + iconCode + ' ';
 if (txtarea.createTextRange && txtarea.caretPos) {
  var caretPos = txtarea.caretPos;
  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? iconCode + ' ' : iconCode;
  txtarea.focus();
 } else {
  txtarea.value  += iconCode;
  txtarea.focus();
 }
}

// Insert at Claret position.
function storeCaret(textEl) {
 if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

In includes/message_form_inc.asp change:

Replace the textarea-code in line 309 with the following code:

Originally posted by HTML HTML wrote:

<textarea name="message" cols="57" rows="12" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">

The file emoticon_smilies.asp also needs a change to function properly, see my post below!!!!

Now smileys will get the right position!



Edited by zjieb
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 7:11pm
Cool! Maybe -boRg- should look at this and add it to v7.02!
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2003 at 2:17am
Many thanks zjieb, I'll have to look into adding such functionality to a new version, it maybe worth looking at getting to work with the bold, underline, etc. buttons.
Back to Top
zjieb View Drop Down
Newbie
Newbie


Joined: 25 April 2003
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote zjieb Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2003 at 7:21am

had to change the emoticons_smilies.asp too...

At line 79 replace the existing smiley-function with this one:

Originally posted by JAVASCRIPT JAVASCRIPT wrote:

function AddSmileyIcon(iconCode) {
 var txtarea = window.opener.document.frmAddMessage.message;
 iconCode = ' ' + iconCode + ' ';
 if (txtarea.createTextRange && txtarea.caretPos) {
  var caretPos = txtarea.caretPos;
  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? iconCode + ' ' : iconCode;
  txtarea.focus();
 } else {
  txtarea.value  += iconCode;
  txtarea.focus();
 }
}

// Insert at Claret position.
function storeCaret(textEl) {
 if (textEl.createTextRange) textEl.caretPos = window.opener.document.selection.createRange().duplicate();
}

Back to Top
zjieb View Drop Down
Newbie
Newbie


Joined: 25 April 2003
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote zjieb Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2003 at 7:23am

Originally posted by -boRg- -boRg- wrote:

Many thanks zjieb, I'll have to look into adding such functionality to a new version, it maybe worth looking at getting to work with the bold, underline, etc. buttons.

I was working on this...

There's only ONE problem with adding the [b] and [/b] tag in BASIC MODE: this script determines the cursor position, if you add the tags it puts the [b] AND [/b] at the cursor position, so you still have to put the [/b] at the right position. One solution is adding a [/b] button: if you clicked the [b] button once, it will be replaced with a [/b] button... (I personally think it's too much work for me to add so much new code, maybe someone else???)

PROMPT MODE works fine...

 



Edited by zjieb
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2003 at 8:19am
I had a look at the code and my only concern is that it only works in IE.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.