Drop dialing from keyboard in speed dial for now

This commit is contained in:
Paweł Forysiuk 2012-09-11 16:28:56 +02:00 committed by Christian Dywan
parent 55e4823c30
commit 5f43dceef0
3 changed files with 9 additions and 60 deletions

View File

@ -114,22 +114,6 @@
display:none; display:none;
} }
div.osd {
top: 9px;
position: fixed;
width: 100%;
text-align: right;
}
div.osd span {
border: 1px solid #999;
background-color: #f5f5f5;
padding: 8px;
color: #999;
-webkit-border-bottom-left-radius: 10px;
visibility: hidden;
}
.selected { .selected {
outline: 1px dotted black; outline: 1px dotted black;
background-color: #eef; background-color: #eef;
@ -171,38 +155,6 @@
console.log ("speed_dial-save-delete " + id); console.log ("speed_dial-save-delete " + id);
} }
var key_id = 's';
var key_timeout;
document.onkeypress = function ()
{
key_id = key_id + String.fromCharCode (event.which);
clearTimeout (key_timeout);
document.getElementById('dialing').innerText = key_id.substr(1);
document.getElementById('dialing').style.visibility = 'visible';
var div = document.getElementById(key_id);
if (div)
{
if (key_id.substr(1) > 9)
{
if (getAction (key_id))
document.location = div.childNodes[0].childNodes[1].href;
key_id = 's';
}
else
key_timeout = setTimeout ('if (getAction (key_id)) document.location = document.getElementById(key_id).childNodes[0].childNodes[1].href; key_id = \'s\'', 1000);
}
else
key_id = 's';
if (key_id.length <= 1)
document.getElementById('dialing').style.visibility = 'hidden';
return false;
}
var firstNode, secondNode; var firstNode, secondNode;
var cursor; var cursor;
@ -273,7 +225,4 @@
</script> </script>
</head> </head>
<body> <body>
<div class="osd" >
<span id="dialing"></span>
</div>
<div id="content"> <div id="content">

View File

@ -232,10 +232,10 @@ namespace Midori {
get_thumb (tile, uri); get_thumb (tile, uri);
} }
markup.append_printf (""" markup.append_printf ("""
<div class="shortcut" id="s%u"><div class="preview"> <div class="shortcut" id="%u"><div class="preview">
<a class="cross" href="#" onclick='clearShortcut("s%u");'></a> <a class="cross" href="#" onclick='clearShortcut("%u");'></a>
<a href="%s"><img src="data:image/png;base64,%s" title='%s'></a> <a href="%s"><img src="data:image/png;base64,%s" title='%s'></a>
</div><div class="title" onclick='renameShortcut("s%u");'>%s</div></div> </div><div class="title" onclick='renameShortcut("%u");'>%s</div></div>
""", """,
slot, slot, uri, encoded ?? "", title, slot, title ?? ""); slot, slot, uri, encoded ?? "", title, slot, title ?? "");
} }
@ -246,8 +246,8 @@ namespace Midori {
} }
markup.append_printf (""" markup.append_printf ("""
<div class="shortcut" id="s%u"><div class="preview new"> <div class="shortcut" id="%u"><div class="preview new">
<a class="add" href="#" onclick='return getAction("s%u");'></a> <a class="add" href="#" onclick='return getAction("%u");'></a>
</div><div class="title">%s</div></div> </div><div class="title">%s</div></div>
""", """,
slot_count + 1, slot_count + 1, _("Click to add a shortcut")); slot_count + 1, slot_count + 1, _("Click to add a shortcut"));
@ -267,7 +267,7 @@ namespace Midori {
if (action == "add" || action == "rename" if (action == "add" || action == "rename"
|| action == "delete" || action == "swap") { || action == "delete" || action == "swap") {
uint slot_id = parts[1].next_char().to_int () ; uint slot_id = parts[1].to_int () ;
string dial_id = "Dial %u".printf (slot_id); string dial_id = "Dial %u".printf (slot_id);
if (action == "delete") { if (action == "delete") {
@ -286,7 +286,7 @@ namespace Midori {
keyfile.set_string (dial_id, "title", title); keyfile.set_string (dial_id, "title", title);
} }
else if (action == "swap") { else if (action == "swap") {
uint slot2_id = parts[2].next_char().to_int (); uint slot2_id = parts[2].to_int ();
string dial2_id = "Dial %u".printf (slot2_id); string dial2_id = "Dial %u".printf (slot2_id);
string uri = keyfile.get_string (dial_id, "uri"); string uri = keyfile.get_string (dial_id, "uri");

View File

@ -43,9 +43,9 @@ static void speeddial_load () {
Katze.assert_str_equal (json, dial_data.get_next_free_slot (), "Dial 2"); Katze.assert_str_equal (json, dial_data.get_next_free_slot (), "Dial 2");
Katze.assert_str_equal (json, dial_json.get_next_free_slot (), "Dial 2"); Katze.assert_str_equal (json, dial_json.get_next_free_slot (), "Dial 2");
dial_data.save_message ("speed_dial-save-rename s1 Lorem"); dial_data.save_message ("speed_dial-save-rename 1 Lorem");
Katze.assert_str_equal (data, dial_data.keyfile.get_string ("Dial 1", "title"), "Lorem"); Katze.assert_str_equal (data, dial_data.keyfile.get_string ("Dial 1", "title"), "Lorem");
dial_data.save_message ("speed_dial-save-delete s1"); dial_data.save_message ("speed_dial-save-delete 1");
Katze.assert_str_equal (data, dial_data.get_next_free_slot (), "Dial 1"); Katze.assert_str_equal (data, dial_data.get_next_free_slot (), "Dial 1");
} }