Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-03-08 17:24:47

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

My smiley-plugin

Hi guys.

I'm not much of a javascript programmer, however I managed to build a smiley-plugin for HtmlArea with a lot of trial and error. I am very excited about Xinha so naturally I tried to implement my smiley-thingy. But it won't pop up :-( Could someone please have a look at my code and see what's wrong with it ? It works in HtmlArea 3..

This actually shows the smiley-button :

smilie:      [ "Smiley", "smiles.gif", false, function(e) {e.execCommand("Smilie");} ],

but nothing happens when you press it :

// Called when the user clicks on "Smilie" button

HTMLArea.prototype._Smilie = function()
{
    var editor = this;  // for nested functions
    this._popupDialog( "smilies.php", function( entity )

    {
        if ( !entity )
        { 
            //user must have pressed Cancel
            return false;
        }
       
        editor.insertHTML( entity );
               
    }, null);
};

Many thanks !

Offline

#2 2005-03-10 02:31:03

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: My smiley-plugin

smilie:      [ "Smiley", "smiles.gif", false, function(e) {e.execCommand("Smilie");} ],

should be

smilie:      [ "Smiley", "smiles.gif", false, function(e) {e.execCommand("_Smilie");} ],

James Sleeman

Offline

#3 2005-03-10 12:49:54

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: My smiley-plugin

Unfortunately this doesn't do the trick. As a matter of fact, I can remove the smiley-function, doesn't make a difference.

Perhaps it is better for me to use the plugin-approach. With a lot of trial of error :-(

Offline

#4 2005-03-11 00:27:37

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: My smiley-plugin

Ecco wrote:

Unfortunately this doesn't do the trick. As a matter of fact, I can remove the smiley-function, doesn't make a difference.

Perhaps it is better for me to use the plugin-approach. With a lot of trial of error :-(

That would be great, then you can contribute it to Xinha! Probably the closest plugin to base smilie off is CharacterMap, it pops up a window and allows to insert various characters, you'rs wants to popup a window and allows to insert various images.  Should be almost identical smile


James Sleeman

Offline

#5 2005-03-24 12:38:28

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: My smiley-plugin

That's how I started smile

Does anybody have a plugin-tutorial somewhere as I can't even get a renamed CharacterMap working. Damn damn damn.

Offline

#6 2005-03-24 12:41:31

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: My smiley-plugin

BTW I have some sort of a preview available at http://www.400bis.nl/1liner/index.php?editor=wysiwyg (Internet Explorer only); just press the smiley. There's about 2600 of them.

Offline

#7 2005-03-24 22:18:52

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: My smiley-plugin

yyyyyyes! YES! I got it !  People, when renaming a plugin, also rewrite the language files cool

Oh don't those smilies look lovely in Xinha smile Just a liiiitle bit longer... Almost there...

Offline

#8 2005-03-27 10:30:12

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: My smiley-plugin

I've put a preliminary, not even bèta, "works for me wink" version at http://www.eccovogels.nl/xinha/

Last edited by Ecco (2005-03-27 10:31:38)

Offline

#9 2005-03-27 19:03:46

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: My smiley-plugin

Why did I make a database-based smiley-replacement function? I could have waited for your plugin. I won't include it in our actual project, but will surely use it in future projects when needed smile

Offline

#10 2005-03-31 11:01:16

JAC
Xinha Community Member
Registered: 2005-03-16
Posts: 11

Re: My smiley-plugin

THANK YOU!! Not for the smilies so much as for providing an example - between you and CharacterMap, I managed to get my "InsertField" plugin working.

smile

Offline

Board footer

Powered by FluxBB