Skip to content

Commit 3bff0b6

Browse files
author
Yuri Buyanov
committedMay 31, 2011
icon switch
1 parent 5a79df3 commit 3bff0b6

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed
 

‎scripts/search.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66

77
google.load('visualization', '1', {'packages':['corechart']});
88
var type="search";
9-
var typeStrings = {
10-
"search" : "twitter search query",
11-
"user" : "user's tweets"
12-
}
9+
var types = {
10+
"search" : {
11+
"title" : "twitter search query",
12+
"icon" : "url(images/search.png) no-repeat 5px 5px"
13+
},
14+
"user" : {
15+
"title" : "user's tweets",
16+
"icon" : "url(images/@.png) no-repeat 5px 5px"
17+
}
18+
};
19+
20+
1321

1422
//extract source
1523
var resMap = function(item) {
@@ -52,7 +60,8 @@ var swapType = function() {
5260
type = "search";
5361
}
5462

55-
$('#type').text(typeStrings[type]);
63+
$('#type').text(types[type].title);
64+
$('#term').css("background", types[type].icon);
5665
};
5766

5867
var doSearch = function(searchTerm) {

‎styles/style.css

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#controls div {
4949
margin-top: 1em;
5050
width: auto;
51+
line-height: 28px;
5152
}
5253

5354

@@ -67,6 +68,11 @@
6768

6869
#controls #term {
6970
width: 400px;
71+
border: 1px solid black;
72+
height: 28px;
73+
background: url(../images/search.png) no-repeat 5px 5px;
74+
padding-left: 25px;
75+
7076
}
7177

7278

0 commit comments

Comments
 (0)
Please sign in to comment.