Searchable tag reference


#1

Ok I really want to submit this to the Mental branch please
Can somebody explain to me how to upload files with a ticket?

I decided that the tag reference was too long to scroll through, so I
added a search box to it.

To use my search box, modify edit.rhtml like so:

===================================================================
— edit.rhtml (revision 326)
+++ edit.rhtml (working copy)
@@ -190,7 +192,12 @@
<% end %>

-

Available Tags for <%= @page.class.display_name %>

+ +
search tags:
+ + +

Available Tags for <%= @page.class.display_name %>

+
<%= tag_reference(@page.class.name) %>

<%= link_to_function 'Close', "Element.hide('tag-reference-popup')", :class => 'close-link' %>

This will add a search box and include my div_text_search.js (seperate
file)
Which you can grab here:

http://jotapajaro.com/dump/div_text_search.js


#2

Now in Trac:

http://dev.radiantcms.org/radiant/attachment/ticket/481/searchable-tag-ref.diff


#3

Jacob B. wrote:

Now in Trac:

http://dev.radiantcms.org/radiant/attachment/ticket/481/searchable-tag-ref.diff

Very interesting. Can you clean up the Javascript so that it uses the
built in prototype.js functions?


John L.
http://wiseheartdesign.com


#4

John W. Long wrote:

Very interesting. Can you clean up the Javascript so that it uses the
built in prototype.js functions?

What sort of cleanup did you have in mind?

I just learned the other day (after I had already written this) that you
can find elements like this:
$$(‘div.tag-reference’)

I could use that to replace my getAllDivsOfClass

Did you see any other places where Prototype could help?


#5

Jacob B. wrote:

I could use that to replace my getAllDivsOfClass
I think that’s the main area that should be cleaned up, though
document.getElementsByClassName() may be faster than
$$(‘div.tag-reference’).


John L.
http://wiseheartdesign.com