Page 1 of 1

Find-tags-as-you-type

Posted: Mon Feb 12, 2007 5:23 pm
by mattsches
I've accumulated quite a number of tags over time, and it's not always easy to determine if I've used some peculiar tag before. Neither is it undemanding to pick the correct tag out of the list by using the mouse pointer. So, after reading about the Simple Tagging plugin for Wordpress, I decided to add some find-as-you-type functionality to our beloved freetag plugin. It's not yet as sophisticated (feature-laden) as the WP plugin, but it does its job quite well using the WICK library.

Instructions: Download the WICK lib, extract it, and copy wick.js and wick.css to your freetag plugin dir. Then you need to patch two files, serendipity_admin.php in your blog's root dir, and serendipity_event_freetag.php in your freetag plugin dir.

Add something along the lines of

Code: Select all

        <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['baseURL'] . 'plugins/serendipity_event_freetag/wick.css'; ?>" />
to the HTML head in serendipity_admin.php.

Finally, apply this patch to (the current version of) serendipity_event_freetag.php. Now you should be done. Please report if anything doesn't work and/or if it works perfectly for you :wink:

- Mattsches

Updated patch because nopaste.php-q.net seems to be down.

Re: Find-tags-as-you-type

Posted: Tue Feb 13, 2007 9:45 am
by garvinhicking
Hi!

'Wick' is a BSD licesned application, so we could bundle it with the plugin. I would love to have that type-ahead functionality (if it does not break anything) by default in the freetag plugin...?

The wick.css code could be moved to the 'css_backend' event hook of the freetag plugin?

Best regards,
Garvin

Posted: Tue Feb 13, 2007 11:26 am
by mattsches
Hi Garvin,

Ok, I'm am still experiencing problems in one of my blogs, so I'll have to test it a little more. It doesn't break anything, but throws JS errors (and doesn't work right because of that). I'll move the css code to css_backend, too. I'd be happy if we included this feature in the freetag plugin.

Regards,
- Mattsches

Posted: Tue Feb 13, 2007 8:33 pm
by stm999999999
I would be very happy to get this function (optionally) into s9y!

Posted: Sun Mar 18, 2007 4:48 pm
by mattsches
After weeks of testing, this works flawlessly for me, and I do not want to blog without it anymore. So I got the latest version of the freetag plugin from cvs and created another patch. Also, wick.js is required.

Is anyone wiling to test the new feature? Or how do we proceed from here? I can push it to cvs, but since it's not my plugin, I'd rather have Garvin commit it ... but, still, I would want a second opinion on this :wink:

- Mattsches

Posted: Mon Mar 19, 2007 11:04 am
by garvinhicking
Hi!

sure, go ahead and commit :)

Only replace

Code: Select all

$this->get_config('admin_ftayt')
with

Code: Select all

serendipity_db_bool($this->get_config('admin_ftayt'))
for postgresql compatibility (also the other get_config call). Also please commit the wick.js file to the plugin :)

Best regards,
Garvin

Posted: Mon Mar 19, 2007 11:21 am
by mattsches
Ok, I will do that later this week. Thanks for the reply, Garvin.

- Mattsches

Posted: Wed Mar 28, 2007 10:44 am
by mattsches
'kay, I committed my stuff to CVS yesterday. The encoding of the lang_de file had been wrong for a couple of hours, but I corrected that, too (and made a note to myself: never commit to CVS after midnight).

So, now there are two more options for event_freetag. You can enable the new feature, and you can hide the list of your tags if it's become too long ... this saves space, and you won't need the list anymore if you enable find-tags-as-you-type :wink:

- Mattsches