Find-tags-as-you-type

Discussion corner for Developers of Serendipity.
Post Reply
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Find-tags-as-you-type

Post by mattsches » Mon Feb 12, 2007 6:23 pm

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.
Last edited by mattsches on Tue Feb 13, 2007 4:28 pm, edited 1 time in total.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Find-tags-as-you-type

Post by garvinhicking » Tue Feb 13, 2007 10:45 am

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches » Tue Feb 13, 2007 12:26 pm

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

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Post by stm999999999 » Tue Feb 13, 2007 9:33 pm

I would be very happy to get this function (optionally) into s9y!
Ciao, Stephan

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches » Sun Mar 18, 2007 5:48 pm

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

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Mon Mar 19, 2007 12:04 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches » Mon Mar 19, 2007 12:21 pm

Ok, I will do that later this week. Thanks for the reply, Garvin.

- Mattsches

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches » Wed Mar 28, 2007 10:44 am

'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

Post Reply