[typo] typo admin shows up on google.

Trejkaz trejkaz at trypticon.org
Thu Jul 28 20:33:04 EDT 2005


Quoting Shawn Liu <shawn at iridesco.com>:
> Sorry, I should of checked the source code before writing the email.
>
> So here's the hidden HTML,
>
> <div class="post" onmouseover="if (getCookie('is_admin') == 'yes') { 
> Element.show('admin_article'); }" 
> onmouseout="Element.hide('admin_article');" >
>   <a class="admintools" href="/admin/content/edit/80" 
> id="admin_article" style="display: none">edit</a>
>
> ----
>
> I think it'd be better if we can just check the session variable in 
> the Rails code and have the logic there, as opposed to changing the 
> style on client side.  Or is there a compelling reason for doing it 
> this way?

I guess the only benefit of doing it this way is that the page is the same for
all users (so the cache can be used for the admin users as well.)  But in
reality, the admin users are the tiny minority, so caching wouldn't 
really help
that much.

I agree... it should work server-side so that admin elements are only 
put in the
HTML if the user is an admin in the first place.  It doesn't actually seem
useful to have an "is_admin" cookie when the server already knows the user is
an admin.

To divert a bit, I also think that this show/hide script is something 
which CSS
can do...

    #admin_article { display: none; }
    div.post:hover #admin_article { display: block; /* or whatever */ }

...but I understand that when you have a hammer (JavaScript), 
everything starts
to look like a nail. :-)

TX


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Typo-list mailing list