Forum: Radiant CMS Searchable tag reference

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dc893f8ae12045dc71048a0c6a56fc01?d=identicon&s=25 Jacob Burkhart (igotimac)
on 2007-02-10 18:16
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 %>
   </div>
   <div class="popup" id="tag-reference-popup" style="display:none;">
-    <h3>Available Tags for <span id="page-type"><%=
@page.class.display_name %></span></h3>
+
+       <div style="float:right">search tags:<input type="text"
id="search-tag-reference"></div>
+    <script src="/javascripts/div_text_search.js"
type="text/javascript"></script>
+
+       <h3>Available Tags for <span id="page-type"><%=
@page.class.display_name %></span></h3>
+
     <div id="tag-reference"><%= tag_reference(@page.class.name)
%></div>
     <p><%= link_to_function 'Close',
"Element.hide('tag-reference-popup')", :class => 'close-link' %></p>
   </div>



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
Dc893f8ae12045dc71048a0c6a56fc01?d=identicon&s=25 Jacob Burkhart (igotimac)
on 2007-02-19 16:26
6ec6f77ea603dd75b3a7a7775b059e79?d=identicon&s=25 John W. Long (Guest)
on 2007-02-20 20:27
(Received via mailing list)
Jacob Burkhart wrote:
> Now in Trac:
>
> http://dev.radiantcms.org/radiant/attachment/ticke...
>

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

--
John Long
http://wiseheartdesign.com
Dc893f8ae12045dc71048a0c6a56fc01?d=identicon&s=25 Jacob Burkhart (igotimac)
on 2007-02-20 20:45
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?
6ec6f77ea603dd75b3a7a7775b059e79?d=identicon&s=25 John W. Long (Guest)
on 2007-02-20 20:57
(Received via mailing list)
Jacob Burkhart 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 Long
http://wiseheartdesign.com
This topic is locked and can not be replied to.