Just a quick suggestion: is it possible to keep the code short and
concise, since the intent is to clarify some conceptual stuff ?
==
On Thu, Nov 27, 2008 at 10:22 AM, Bharat <[EMAIL PROTECTED]> wrote:
>
> Thanks for reviewing this. Based on your feedback and help, I came up
> with the following. Is the javascript filter OK? What about
> Javascript code indentation? Is that also necessary?
>
> - column_div :type => :primary do
> %h2 Sign In
> - form_tag session_path do
> #standard
> .form_row
> %label{:for => "email"} Email address
> = text_field_tag 'email', nil, :maxlength =>
> Person::MAX_EMAIL
> = set_focus_to 'email'
> .form_row
> %label{:for => "password"} Password
> = password_field_tag 'password', params
> [:password], :maxlength => Person::MAX_PASSWORD
> #openid.form_row
> %label{:for => 'openid_url'} OpenID
> = text_field_tag 'openid_url'
> .form_row
> %label.checkbox{:for => 'remember_me'} Remember me:
> = check_box_tag 'remember_me', '1', true, :class => "checkbox"
> .form_row
> = submit_tag 'Sign in', :class => "button"
> %div{:style => "text-align: center; font-size: 12px; padding:
> 10px;"}
> = link_to "or Sign up", signup_path
> %br/
> -if global_prefs.can_send_email?
> = link_to "I forgot my password!", new_password_reminder_path
> %span{:id="noscript", :style="display:none;"}
> %span#openid_link
> %a{:href => "#", :onclick => "show_openid(); return false;"}
> Login using OpenID
> %span#standard_link
> %a{:href => "#", onclick => "show_openid(); return false;"}
> Login using OpenID
>
> :javascript
> $(document).ready(function() {
> show_openid = function() {
> $('#openid').show();
> $('#standard').hide();
> $('#openid_link').hide();
> $('#standard_link').show();
> createCookie('use_openid', 1, 30);
> $('#openid_url').value = 'http://';
> }
> show_standard = function() {
> $('#openid').hide();
> $('#standard').show();
> $('#openid_link').show();
> $('#standard_link').hide();
> eraseCookie('use_openid');
> $('#openid_url').value = '';
> }
> $('#openid').hide();
> $('#standard_link').hide();
> $('#noscript').show();
>
> if (readCookie('use_openid')){
> show_openid();
> }
>
> function createCookie(name,value,days) {
> if (days) {
> var date = new Date();
> date.setTime(date.getTime()+(days*24*60*60*1000));
> var expires = "; expires="+date.toGMTString();
> }
> else var expires = "";
> document.cookie = name+"="+value+expires+"; path=/";
> }
>
> function readCookie(name) {
> var nameEQ = name + "=";
> var ca = document.cookie.split(';');
> for(var i=0;i < ca.length;i++) {
> var c = ca[i];
> while (c.charAt(0)==' ') c = c.substring(1,c.length);
> if (c.indexOf(nameEQ) == 0) return c.substring
> (nameEQ.length,c.length);
> }
> return null;
> }
>
> function eraseCookie(name) {
> createCookie(name,"",-1);
> }
> })
> >
>
--
http://ngty77.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---