[Xfce4-commits] <midori:master> Drop dialing from keyboard in speed dial for now

Christian Dywan noreply at xfce.org
Wed Sep 12 14:14:06 CEST 2012


Updating branch refs/heads/master
         to 5f43dceef0ae5dca03ba34235c1ff8aed735453e (commit)
       from 55e4823c30565e196daf98ee5b843904d5b5266b (commit)

commit 5f43dceef0ae5dca03ba34235c1ff8aed735453e
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Tue Sep 11 16:28:56 2012 +0200

    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 7e7f217..b40fbb7 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 @@
     </script>
 </head>
 <body>
-    <div class="osd" >
-        <span id="dialing"></span>
-    </div>
     <div id="content">
diff --git a/midori/midori-speeddial.vala b/midori/midori-speeddial.vala
index 07eef4c..6df4191 100644
--- a/midori/midori-speeddial.vala
+++ b/midori/midori-speeddial.vala
@@ -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");
diff --git a/tests/speeddial.vala b/tests/speeddial.vala
index 00c49d1..5663c23 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");
 }
 


More information about the Xfce4-commits mailing list