From 5f43dceef0ae5dca03ba34235c1ff8aed735453e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Tue, 11 Sep 2012 16:28:56 +0200 Subject: [PATCH] Drop dialing from keyboard in speed dial for now --- data/speeddial-head.html | 51 ------------------------------------ midori/midori-speeddial.vala | 14 +++++----- tests/speeddial.vala | 4 +-- 3 files changed, 9 insertions(+), 60 deletions(-) diff --git a/data/speeddial-head.html b/data/speeddial-head.html index 7e7f2172..b40fbb7a 100644 --- a/data/speeddial-head.html +++ b/data/speeddial-head.html @@ -114,22 +114,6 @@ 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 { outline: 1px dotted black; background-color: #eef; @@ -171,38 +155,6 @@ 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 cursor; @@ -273,7 +225,4 @@ -
- -
diff --git a/midori/midori-speeddial.vala b/midori/midori-speeddial.vala index 07eef4c9..6df4191d 100644 --- a/midori/midori-speeddial.vala +++ b/midori/midori-speeddial.vala @@ -232,10 +232,10 @@ namespace Midori { get_thumb (tile, uri); } markup.append_printf (""" -
- +
+ -
%s
+
%s
""", slot, slot, uri, encoded ?? "", title, slot, title ?? ""); } @@ -246,8 +246,8 @@ namespace Midori { } markup.append_printf (""" -
- +
+
%s
""", slot_count + 1, slot_count + 1, _("Click to add a shortcut")); @@ -267,7 +267,7 @@ namespace Midori { if (action == "add" || action == "rename" || 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); if (action == "delete") { @@ -286,7 +286,7 @@ namespace Midori { keyfile.set_string (dial_id, "title", title); } 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 uri = keyfile.get_string (dial_id, "uri"); diff --git a/tests/speeddial.vala b/tests/speeddial.vala index 00c49d1f..5663c23b 100644 --- a/tests/speeddial.vala +++ b/tests/speeddial.vala @@ -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_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"); - 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"); } -- 2.39.5