diff options
author | raylu <raylu@mixpanel.com> | 2011-08-05 01:45:13 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-08-05 01:45:31 -0700 |
commit | c680bce12701298901ccd5cb3f0c366799f6a1c6 (patch) | |
tree | 922e20472b8a7ddb7f582b2d3fba4a71a56ef73a /static | |
parent | 7d59ab2eac80615a7c684ba4bfca879c55d59683 (diff) | |
download | audioaxis-c680bce12701298901ccd5cb3f0c366799f6a1c6.tar.xz |
add works
also, `name` -> `title` in the db and global db conn
Diffstat (limited to 'static')
-rw-r--r-- | static/base.css | 11 | ||||
-rw-r--r-- | static/script.js | 21 |
2 files changed, 30 insertions, 2 deletions
diff --git a/static/base.css b/static/base.css index 656d8ef..c932d6f 100644 --- a/static/base.css +++ b/static/base.css @@ -33,7 +33,8 @@ input:focus { } input[type="submit"] { background-color: #111; - padding: 2px 5px; + padding: 1px 5px; + line-height: 27px; } label { cursor: pointer; @@ -70,6 +71,7 @@ header label[for="song"] { header input#song { left: 390px; top: 50px; + width: 420px; text-align: center; } header input[type="submit"] { @@ -100,6 +102,13 @@ div#results ul li { div#results ul li:hover { background-color: #024; } +div#results ul li a { + display: block; + height: 100%; +} +div#results ul li a:hover { + text-decoration: none; +} div#results ul li img { height: 50px; width: 66px; diff --git a/static/script.js b/static/script.js index c55aff6..4766387 100644 --- a/static/script.js +++ b/static/script.js @@ -124,7 +124,12 @@ function search(query) { for (var i = 0; i < entries.length; i++) { var title = entries[i].title.$t; var id = entries[i].media$group.yt$videoid.$t; - items.push('<li id="r_' + id + '"><img src="http://i.ytimg.com/vi/' + id + '/1.jpg" alt="' + id + '">' + title + '</li>'); + var html = '<li id="r_' + id + '">'; + html += '<a href="javascript:add(\'' + id + '\', \'' + title + '\')">'; + html += '<img src="http://i.ytimg.com/vi/' + id + '/1.jpg" alt="' + id + '">'; + html += title; + html += '</a></li>'; + items.push(html); } var results = $('#results ul').html(items.join('\n')); $('#results').slideDown(100); @@ -132,3 +137,17 @@ function search(query) { ); return false; } + +function add(id, title) { + params = { + 'pid': pid, + 'yid': id, + 'title': title, + 'user': $('#user').val() + } + $.getJSON('/add/', params, + function(data) { + alert(data); + } + ); +} |