Advertise Here

Author Topic: [Solution][Bug]Extra Smiley's (Cursor Spawns into the wrong place)  (Read 2343 times)

0 Members and 1 Guest are viewing this topic.

Offline whity

  • SMF For Free Newbie
  • *
  • Posts: 13
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Forum Url: http://rrprforum.smfforfree.com
K I never said it wasn't a great ad-don to your forum :angel:
But still I found a small bug.. I always mind about details :knuppel2:
So if there bad :D
Naah kidding :buck2:
I wanted to fix this great thing and eventually I found out what the problem was
First of all I will give you the new code :smitten: :smitten: :smitten:

The answer to our problem was very simple I will explain :P
Old Code
<a href="javascript:void(0);" onclick="surroundText('',
document.forms.postmodify.message);

New code
<a href="javascript:void(0);" onclick="surroundText('', '',
document.forms.postmodify.message);

SurroundText [Before Cursor], [After Cursor], [Goal]
The problem was that only IMG was before the cursor..
So the cursor will spawn right after IMG and this will *censored*  up your code if you want to add more smiley's at once..
So You needed to put whole the the IMG**/IMG in the before cursor place then you need to put your , to go to your next tag the "after cursor tag" You needed to leave that empty so the cursor will spawn right after /img

Well I got 1 more thing to say Enjoy it and add it now :smitten: :smitten: :smitten:


NEW CODE
Code: [Select]
<!--  Begin Clickable Xtra Smileys  Place this code in your HEADER -->

<script language="javascript">
  function toggle_it(itemID){
      // Toggle visibility between none and inline
      if ((document.getElementById(itemID).style.display == 'none'))
      {
        document.getElementById(itemID).style.display = 'inline';
      } else {
        document.getElementById(itemID).style.display = 'none';
      }
  }
</script>

     <table width="200px" class="tborder" cellpadding="1" cellspacing="1">
        <tr>
             <td class="catbg" align="left">
               Xtra Smileys
             </td>
             <td  class="catbg" align="right">
                <center><a href="#smileys" onClick="toggle_it('prsmileys')">[Open] </a></center>
             </td>
         </tr>
    </table>
 
<div align="left" style="position: absolute;  z-index: 2; visibility: show;">
    <table class="tborder" width="200px" id="prsmileys" style="display:none;"  align="left" border="0">
        <tr>
            <td class="catbg" align="right">
                <a href="#smileys" onClick="toggle_it('prsmileys')">[Close]</a>
            </td>
         </tr>
          <tr>
              <TD class="windowbg2" align="center" >

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/smiley.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/smiley.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/wink.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/wink.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/cheesy.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/cheesy.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/grin.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/grin.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/angry.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/angry.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/shocked.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/shocked.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/cool.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/cool.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/huh.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/huh.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/rolleyes.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/rolleyes.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/tongue.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/tongue.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/lipsrsealed.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/lipsrsealed.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/lipsrsealed.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/lipsrsealed.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/undecided.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/undecided.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/kiss.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/kiss.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/cry.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/cry.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/evil.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/evil.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/angel.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/angel.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/laugh.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/laugh.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/azn.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/azn.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/afro.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/afro.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/police.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/police.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/2funny.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/2funny.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/buck2.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/buck2.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/coolsmiley.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/coolsmiley.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/crazy2.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/crazy2.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/idiot2.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/idiot2.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/knuppel2.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/knuppel2.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/smiley6600.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/smiley6600.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/tickedoff.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/tickedoff.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://smfsupport.com/support/Smileys/smfnew/smitten.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://smfsupport.com/support/Smileys/smfnew/smitten.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>

<a href="javascript:void(0);" onclick="surroundText('[img] http://www.smfboards.com/Smileys//smf/uglystupid2.gif [/img]', '',
document.forms.postmodify.message); return false;"><img src="http://www.smfboards.com/Smileys//smf/uglystupid2.gif" align="bottom" 
alt="Insert Image" title="Insert Image" /></a>
    </TD>
   </TR>
  </TABLE>
 </div>
</a>
<!-- End Clickable Show/Hide Smileys Script -->

« Last Edit: August 04, 2008, 11:47:14 am by simply sibyl »

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Solution][Bug]Extra Smiley's (Cursor Spawns into the wrong place)
« Reply #1 on: August 04, 2008, 11:34:37 am »
thanks whitey ya saved me some work.. was gonna check thru it today ;)

I tested it then updated the code ... thanks again!

Offline whity

  • SMF For Free Newbie
  • *
  • Posts: 13
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Solution][Bug]Extra Smiley's (Cursor Spawns into the wrong place)
« Reply #2 on: August 04, 2008, 11:39:18 am »
thanks whitey ya saved me some work.. was gonna check thru it today ;)

I tested it then updated the code ... thanks again!
Your welcome I explained it too its the italic text :coolsmiley: ;)
If you need me or if I got some crazy suggestion I will be around somewhere :angel:

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
7213 Views
Last post December 16, 2008, 07:38:38 pm
by simply sibyl
0 Replies
711 Views
Last post December 19, 2007, 05:36:34 pm
by Agent Moose Jr.
3 Replies
1008 Views
Last post August 23, 2008, 12:17:04 pm
by LisaTLC
0 Replies
543 Views
Last post May 27, 2012, 12:55:18 am
by junker
1 Replies
1048 Views
Last post February 11, 2016, 09:16:33 pm
by SMF For Free