Find-tags-as-you-type

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

Find-tags-as-you-type

Post 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.
Last edited by mattsches on Tue Feb 13, 2007 3:28 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Find-tags-as-you-type

Post 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
# 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 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post 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
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

I would be very happy to get this function (optionally) into s9y!
Ciao, Stephan
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# 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 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

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

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

Post 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
Post Reply