diff options
author | Yorhel <git@yorhel.nl> | 2015-11-01 14:28:07 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-11-01 14:28:07 +0100 |
commit | bf391c804fbbd6469d2e2892c29f98cc7204d251 (patch) | |
tree | 2659133a79f2ac85e501dc6f39a270f92d9c8cfe | |
parent | 86d6c5744c4aa208ee22eafb16b9dbe973bb5521 (diff) |
Use HTML5 'placeholder' attribute for main search box
Instead of the JS hack.
-rw-r--r-- | data/js/misc.js | 15 | ||||
-rw-r--r-- | data/style.css | 2 | ||||
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 2 |
3 files changed, 2 insertions, 17 deletions
diff --git a/data/js/misc.js b/data/js/misc.js index a1e86827..f41e8140 100644 --- a/data/js/misc.js +++ b/data/js/misc.js @@ -1,18 +1,3 @@ -// search box -byId('sq').onfocus = function () { - if(this.value == mt('_menu_emptysearch')) { - this.value = ''; - this.style.fontStyle = 'normal' - } -}; -byId('sq').onblur = function () { - if(this.value.length < 1) { - this.value = mt('_menu_emptysearch'); - this.style.fontStyle = 'italic' - } -}; - - function ulist_redirect(type, path, formcode, args) { var r = new RegExp('/('+type+'[0-9]+).*$'); location.href = location.href.replace(r, '/$1')+path diff --git a/data/style.css b/data/style.css index 095ea98c..d8843187 100644 --- a/data/style.css +++ b/data/style.css @@ -154,7 +154,7 @@ table.formtable tr.newpart td { padding-top: 20px; font-weight: bold; } #menulist p { text-align: center; } #menulist input.text { width: 100px; margin-left: 15px; } #menulist input.submit { width: 90px; margin-left: 20px; } -#menulist #search input.text { width: 133px; margin: 0 0 3px 7px; font-style: italic; } +#menulist #search input.text { width: 133px; margin: 0 0 3px 7px } #menulist #search input.submit { display: none; } #dd_box abbr { margin: 2px 5px 2px 0!important; } #menulist .notifyget { display: inline-block; width: 125px; padding: 4px; background: $warnbg$; border: 1px solid $warnborder$; } diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index fcd26346..505d03a8 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -76,7 +76,7 @@ sub _menu { form action => '/v/all', method => 'get', id => 'search'; fieldset; legend 'Search'; - input type => 'text', class => 'text', id => 'sq', name => 'sq', value => $o{search}||mt('_menu_emptysearch'); + input type => 'text', class => 'text', id => 'sq', name => 'sq', value => $o{search}, placeholder => mt('_menu_emptysearch'); input type => 'submit', class => 'submit', value => 'Search'; end; end; |