Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## app/views/shared/_add_new_item_form.rhtml::Line 56 <input id="todo_context_name" name="context_name" autocomplete="off" tabindex="4" size="30" type="text" <%= textfield_hint(@initial_context_name.to_s) %> /> ## Added to applcation_helper.rb def textfield_hint(hint) "class=\"blank\" onblur=\"if (this.value.match(/^ *$/)){this.value='#{hint}';$(this).addClassName('blank'); };\" onfocus=\"if (this.value == '#{hint}') { this.value=''; $(this).removeClassName('blank'); };\" value=\"#{hint}\"" end
This paste will be private.
From the Design Piracy series on my blog: