more input focusing improvements in popup dialogs

This commit is contained in:
Andrew Dolgov 2010-02-03 16:54:17 +03:00
parent f2a648e1b2
commit 3393238de2
5 changed files with 18 additions and 15 deletions

View File

@ -2147,3 +2147,12 @@ function addLabel() {
} }
} }
function quickAddFeed() {
displayDlg('quickAddFeed', '',
function () {$('feed_url').focus();});
}
function quickAddFilter() {
displayDlg('quickAddFilter', '',
function () {document.forms['filter_add_form'].reg_exp.focus();});
}

View File

@ -1177,10 +1177,10 @@
__('Search')."</button> __('Search')."</button>
</div>"; </div>";
print "<button onclick=\"javascript:displayDlg('quickAddFeed')\">" print "<button onclick=\"quickAddFeed()\">"
.__('Subscribe to feed')."</button> "; .__('Subscribe to feed')."</button> ";
print "<button onclick=\"javascript:editSelectedFeed()\">". print "<button onclick=\"editSelectedFeed()\">".
__('Edit feeds')."</button> "; __('Edit feeds')."</button> ";
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (get_pref($link, 'ENABLE_FEED_CATS')) {

View File

@ -311,7 +311,7 @@
<img style='vertical-align : top;' src='".theme_image($link, "images/sign_quest.png")."'></a> <img style='vertical-align : top;' src='".theme_image($link, "images/sign_quest.png")."'></a>
</div>"; </div>";
print "<button onclick=\"return displayDlg('quickAddFilter', false)\">". print "<button onclick=\"return quickAddFilter()\">".
__('Create filter')."</button> "; __('Create filter')."</button> ";
print "<button onclick=\"return editSelectedFilter()\">". print "<button onclick=\"return editSelectedFilter()\">".

View File

@ -400,6 +400,7 @@ function editFeed(feed) {
parameters: query, parameters: query,
onComplete: function(transport) { onComplete: function(transport) {
infobox_callback2(transport); infobox_callback2(transport);
document.forms["edit_feed_form"].title.focus();
} }); } });
} catch (e) { } catch (e) {
@ -1446,20 +1447,15 @@ function pref_hotkey_handler(e) {
hotkey_prefix = false; hotkey_prefix = false;
if (keycode == 70) { // f if (keycode == 70) { // f
displayDlg("quickAddFilter"); quickAddFilter();
return false; return false;
} }
if (keycode == 83) { // s if (keycode == 83) { // s
displayDlg("quickAddFeed"); quickAddFeed();
return false; return false;
} }
/* if (keycode == 76) { // l
displayDlg("quickAddLabel");
return false;
} */
if (keycode == 85) { // u if (keycode == 85) { // u
// no-op // no-op
} }

View File

@ -534,8 +534,7 @@ function quickMenuGo(opid) {
} }
if (opid == "qmcAddFeed") { if (opid == "qmcAddFeed") {
displayDlg('quickAddFeed', '', quickAddFeed();
function () {$('feed_url').focus();});
return; return;
} }
@ -791,6 +790,7 @@ function editFeedDlg(feed) {
parameters: query, parameters: query,
onComplete: function(transport) { onComplete: function(transport) {
infobox_callback2(transport); infobox_callback2(transport);
document.forms["edit_feed_form"].title.focus();
} }); } });
} catch (e) { } catch (e) {
@ -1236,9 +1236,7 @@ function hotkey_handler(e) {
} }
if (keycode == 83) { // s if (keycode == 83) { // s
displayDlg('quickAddFeed', '', quickAddFeed();
function () {$('feed_url').focus();});
return false; return false;
} }