]> spindle.queued.net Git - midori/commitdiff
Drop dialing from keyboard in speed dial for now
authorPaweł Forysiuk <tuxator@o2.pl>
Tue, 11 Sep 2012 14:28:56 +0000 (16:28 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 12 Sep 2012 12:12:08 +0000 (14:12 +0200)
data/speeddial-head.html
midori/midori-speeddial.vala
tests/speeddial.vala

index 7e7f21728f5995dd4190c6d68b31581f5704b758..b40fbb7a97ddab00fa387a963e3cd235ed3f4397 100644 (file)
         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;
         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;
     </script>
 </head>
 <body>
-    <div class="osd" >
-        <span id="dialing"></span>
-    </div>
     <div id="content">
index 07eef4c985a6d298b0bf1e9dd953d6de87e97c4a..6df4191da24ec7230c48070067d8d2f8648f3180 100644 (file)
@@ -232,10 +232,10 @@ namespace Midori {
                                     get_thumb (tile, uri);
                             }
                             markup.append_printf ("""
-                                <div class="shortcut" id="s%u"><div class="preview">
-                                <a class="cross" href="#" onclick='clearShortcut("s%u");'></a>
+                                <div class="shortcut" id="%u"><div class="preview">
+                                <a class="cross" href="#" onclick='clearShortcut("%u");'></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 ?? "");
                         }
@@ -246,8 +246,8 @@ namespace Midori {
                 }
 
                 markup.append_printf ("""
-                    <div class="shortcut" id="s%u"><div class="preview new">
-                    <a class="add" href="#" onclick='return getAction("s%u");'></a>
+                    <div class="shortcut" id="%u"><div class="preview new">
+                    <a class="add" href="#" onclick='return getAction("%u");'></a>
                     </div><div class="title">%s</div></div>
                     """,
                     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");
index 00c49d1fffb963755e4909e71316491f0a224394..5663c23bf9addebb1e5d192dd49c6490f44ec777 100644 (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_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");
 }