[Xfce4-commits] <midori:master> Implement keyboard access and dynamic columns in speed dial
Christian Dywan
noreply at xfce.org
Sat May 15 01:08:03 CEST 2010
Updating branch refs/heads/master
to 1e10607cb5860c9cc4c0473143200a62028aeaff (commit)
from bab6124cff457692b7052fe53592c05b0d342a21 (commit)
commit 1e10607cb5860c9cc4c0473143200a62028aeaff
Author: Peter de Ridder <peter at xfce.org>
Date: Fri May 14 22:59:21 2010 +0200
Implement keyboard access and dynamic columns in speed dial
data/speeddial-head.html | 36 +++++++++++++++++++++++++++++-------
1 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/data/speeddial-head.html b/data/speeddial-head.html
index 955535e..8152afe 100644
--- a/data/speeddial-head.html
+++ b/data/speeddial-head.html
@@ -167,7 +167,7 @@
a.setProperty('href', url);
a.getNext().set('text', name);
- var num = id.charAt (1) - 1;
+ var num = id.substr (1) - 1;
sc.shortcuts[num].title = name;
a.empty();
@@ -204,7 +204,7 @@
var p = a.getNext ();
p.setProperty('onclick', 'javascript:renameShortcut("' + id + '");');
- var num = id.charAt (1) - 1;
+ var num = id.substr (1) - 1;
sc.shortcuts[num].href = href;
sc.shortcuts[num].img = data;
@@ -216,7 +216,7 @@
var name = prompt ("{enter_shortcut_name}", "");
if (!name) return;
- var num = id.charAt (1) - 1;
+ var num = id.substr (1) - 1;
$(id).getLast ().set ('html', name);
sc.shortcuts[num].title = name;
@@ -229,7 +229,7 @@
if(!confirm("{are_you_sure}"))
return;
- var num = id.charAt (1);
+ var num = id.substr (1);
var div = $(id);
var cross = div.getFirst ();
var a = cross.getNext ();
@@ -251,13 +251,20 @@
var buildSpeeddial = function ()
{
+ var width = 3;
+ if (sc.width != undefined)
+ {
+ width = sc.width;
+ $('wrap').style.width = (width * 220) + 'px';
+ }
+
sc.shortcuts.each (function (item, index, sc)
{
var cl = "shortcut";
- if (index == 0 || index == 1 || index == 2)
+ if (index < width)
cl += " top";
- if (index == 2 || index == 5 || index == 8)
+ if ((index % width) == (width - 1))
cl += " right";
var div = new Element ('div', {
@@ -279,7 +286,7 @@
});
if (item.href == "#")
- a.set ('html', '<h1>' + item.id.charAt (1) + '</h1><h4><span/></h4>');
+ a.set ('html', '<h1>' + item.id.substr (1) + '</h1><h4><span/></h4>');
else
{
div.addClass ('activated');
@@ -301,6 +308,21 @@
window.addEvent ('domready', function () {
buildSpeeddial ();
});
+
+ document.onkeypress = function ()
+ {
+ var id = $('s' + String.fromCharCode (event.which));
+
+ if ($(id))
+ {
+ if (getAction (id))
+ document.location = $(id).children[1];
+ return false;
+ }
+
+ return true
+ }
+
</script>
</head>
<body>
More information about the Xfce4-commits
mailing list