提交 951f927a 编写于 作者: D ddavison

Taking out the `defaulted` js logic with the search-box, and embracing CSS3's...

Taking out the `defaulted` js logic with the search-box, and embracing CSS3's 'placeholder' attribute.
Prettying up the search box
上级 b086943a
......@@ -45,7 +45,7 @@ THE SOFTWARE.
This was originally added to allow plugins to load their stylesheets, but
*the use of thie attribute is discouraged now.*
plugins should now do so by inserting <style> elements and/or <script> elements
plugins should now do so by inserting <style> elements and/or <script> elementsg
in <l:header/> tag.
</st:attribute>
<st:attribute name="permission">
......@@ -170,7 +170,7 @@ ${h.initPageVariables(context)}
<!-- this div is used to calculate the width of the text box -->
<div id="search-box-sizer"/>
<div id="searchform">
<input name="q" value="${%search}" id="search-box" class="has-default-text defaulted" />
<input name="q" placeholder="${%search}" id="search-box" />
<st:nbsp />
<a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" height="16" width="16" /></a>
<div id="search-box-completion" />
......
......@@ -894,10 +894,10 @@ DIV.yahooTree td {
padding-left: 20px;
width: 15em;
position: static;
}
#search-box.defaulted {
color: gray;
border: 1px solid #DDD;
border-radius: 4px;
box-shadow: 0 0 5px #DDD inset;
outline: none;
}
#search-box-completion {
......
......@@ -607,25 +607,6 @@ var jenkinsRules = {
e = null; // avoid memory leak
},
// scripting for having default value in the input field
"INPUT.has-default-text" : function(e) {
var defaultValue = e.value;
Element.addClassName(e, "defaulted");
e.onfocus = function() {
if (this.value == defaultValue) {
this.value = "";
Element.removeClassName(this, "defaulted");
}
}
e.onblur = function() {
if (this.value == "") {
this.value = defaultValue;
Element.addClassName(this, "defaulted");
}
}
e = null; // avoid memory leak
},
// <label> that doesn't use ID, so that it can be copied in <repeatable>
"LABEL.attach-previous" : function(e) {
e.onclick = function() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册