Fix filter text box bugs reported by BentMyWookie and a bit more cleanup

This commit is contained in:
Malcolm Jarvis
2008-08-09 04:38:51 +00:00
parent 20eaeb6818
commit 27bcd35267
3 changed files with 26 additions and 24 deletions
+8 -8
View File
@@ -8,8 +8,8 @@
<link rel="apple-touch-icon" href="./images/webclip-icon.png"/>
<link href="./images/favicon.ico" rel="SHORTCUT ICON" />
<script type="text/javascript" src="./javascript/jquery/jquery.min.js"></script>
<link media="only screen and (max-device-width: 480px)" href="./stylesheets/iphone.css" type= "text/css" rel="stylesheet">
<link media="screen and (min-device-width: 481px)" href="./stylesheets/common.css" type="text/css" rel="stylesheet">
<link media="only screen and (max-device-width: 480px)" href="./stylesheets/iphone.css" type= "text/css" rel="stylesheet" />
<link media="screen and (min-device-width: 481px)" href="./stylesheets/common.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="./javascript/jquery/jquery.transmenu.min.js"></script>
<script type="text/javascript" src="./javascript/jquery/jquery.contextmenu.min.js"></script>
<script type="text/javascript" src="./javascript/menu.js"></script>
@@ -47,12 +47,12 @@
<div id="torrent_filter_bar">
<ul>
<li><a href='#all' id='filter_all_link' class='active'>All</a></li>
<li><a href='#downloading' id='filter_downloading_link'>Downloading</a></li>
<li><a href='#seeding' id='filter_seeding_link'>Seeding</a></li>
<li><a href='#paused' id='filter_paused_link'>Paused</a></li>
<li><a href="#all" id="filter_all_link" class="active">All</a></li>
<li><a href="#downloading" id="filter_downloading_link">Downloading</a></li>
<li><a href="#seeding" id="filter_seeding_link">Seeding</a></li>
<li><a href="#paused" id="filter_paused_link">Paused</a></li>
</ul>
<input type='text' id='torrent_search' class='blur' />
<input type="search" id="torrent_search" class="blur" autosave="Clutch" results="0" />
</div>
<div id="torrent_inspector" style="display:none;">
@@ -193,7 +193,7 @@
<form action='#' method='post' id='torrent_upload_form'
enctype='multipart/form-data' target='torrent_upload_frame'>
<div class="dialog_message">
Please select a .torrent file to upload:
Please select a torrent file to upload:
<input type='file' name='torrent_file' id='torrent_upload_file'/>
</div>
<a href="#upload" id="upload_confirm_button">Upload</a>
+1 -3
View File
@@ -47,9 +47,7 @@ $(document).ready( function() {
// firefox so have to be safari-specific
$('#torrent_inspector').css('height', '100%');
// Set Filter input to type search (nicely styled input field)
$('#torrent_search')[0].type = 'search';
$('#torrent_search')[0].placeholder = 'Filter';
// Move search field's margin down for the styled input
$('#torrent_search').css('margin-top', 3);
}
if (!Safari3 && !iPhone) {
+17 -13
View File
@@ -166,21 +166,25 @@ Transmission.prototype =
{
var tr = this;
var search_box = $('#torrent_search');
search_box[0].value = 'filter';
search_box.bind('keyup', {transmission: this}, function(event) {
search_box.bind('keyup click', {transmission: this}, function(event) {
tr.setSearch(this.value);
}).bind('blur', {transmission: this}, function(event) {
if (this.value == '') {
$(this).addClass('blur');
this.value = 'filter';
tr.setSearch(null);
}
}).bind('focus', {}, function(event) {
if ($(this).is('.blur')) {
this.value = '';
$(this).removeClass('blur');
}
});
if (!$.browser.safari)
{
search_box[0].value = 'Filter';
search_box.bind('blur', {transmission: this}, function(event) {
if (this.value == '') {
$(this).addClass('blur');
this.value = 'Filter';
tr.setSearch(null);
}
}).bind('focus', {}, function(event) {
if ($(this).is('.blur')) {
this.value = '';
$(this).removeClass('blur');
}
});
}
},
contextStopSelected: function( ) {