Commit 321fb384bc3ea608619389ebaee4c4f15f33af57
1 parent
81eb23f2
Exists in
master
and in
28 other branches
Use jquery hint for text inputs
This allow simples hints for inputs in Noosfero. Later a search input will receive use this plugin for hints.
Showing
3 changed files
with
6 additions
and
11 deletions
Show diff stats
app/views/layouts/application-ng.rhtml
| ... | ... | @@ -66,15 +66,9 @@ |
| 66 | 66 | </div> |
| 67 | 67 | </span> |
| 68 | 68 | <form action="/search" class="search_form" method="get" class="clean"> |
| 69 | - <input name="query" size="15" value="<%=_('Search...')%>" | |
| 70 | - onfocus="this.form.className='focused'; | |
| 71 | - if(this.value=='<%=_('Search...')%>'){this.value=''}" | |
| 72 | - onblur="this.form.className=''; | |
| 73 | - if(/^\s*$/.test(this.value)){ | |
| 74 | - this.value='<%=_('Search...')%>'; | |
| 75 | - this.form.className='clean' | |
| 76 | - }" /> | |
| 69 | + <input name="query" size="15" title="<%=_('Search...')%>" /> | |
| 77 | 70 | <div><%=_('Press <strong>Enter</strong> to send the search query.')%></div> |
| 71 | + <%= javascript_tag 'jQuery("#user form input").hint();' %> | |
| 78 | 72 | </form> |
| 79 | 73 | </div><!-- end id="user" --> |
| 80 | 74 | ... | ... |
public/designs/themes/base/style.css
| ... | ... | @@ -108,14 +108,14 @@ body, th, td, input { |
| 108 | 108 | margin-left: 20px; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | -#user form input { | |
| 111 | +#user form input .blur { | |
| 112 | 112 | width: 160px; |
| 113 | 113 | border: 1px solid #BBB; |
| 114 | 114 | -moz-border-radius: 3px; |
| 115 | 115 | -webkit-border-radius: 3px; |
| 116 | 116 | color: #CCC; |
| 117 | 117 | } |
| 118 | -#user form.focused input { | |
| 118 | +#user form input { | |
| 119 | 119 | border: 1px solid #888; |
| 120 | 120 | color: #555; |
| 121 | 121 | } | ... | ... |
public/stylesheets/application.css