Print Page | Close Window

Smiley MOD WWF v7

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=2746
Printed Date: 01 April 2026 at 2:40am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Smiley MOD WWF v7
Posted By: zjieb
Subject: Smiley MOD WWF v7
Date 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!




Replies:
Posted By: MadDog
Date Posted: 15 May 2003 at 7:11pm
Cool! Maybe -boRg- should look at this and add it to v7.02!

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: WebWiz-Bruce
Date 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.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zjieb
Date 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();
}



Posted By: zjieb
Date 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...

 



Posted By: WebWiz-Bruce
Date 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.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net