diff options
author | Peter de Ridder <peter@xfce.org> | 2010-05-19 00:58:03 +0200 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2010-05-19 00:58:03 +0200 |
commit | 9bef97e6d2d69188d0ee6e0ce448a6c87b3279a9 (patch) | |
tree | cdbaab6cf158b1550985de09263337e45e23baad /data/speeddial-head.html | |
parent | d1818a1d162a3219cb3e835fc464fb1e21312ce4 (diff) | |
download | midori-9bef97e6d2d69188d0ee6e0ce448a6c87b3279a9.tar.gz |
Allow custom shortcut and column count in speed dial
Diffstat (limited to 'data/speeddial-head.html')
-rw-r--r-- | data/speeddial-head.html | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/data/speeddial-head.html b/data/speeddial-head.html index 8152afe1..2e015076 100644 --- a/data/speeddial-head.html +++ b/data/speeddial-head.html @@ -30,7 +30,7 @@ } #content { - margin-top: 40px; + margin-top: 10px; } div.shortcut { @@ -140,6 +140,20 @@ opacity: 1; color: rgba(0,0,0,0.5); } + + div.config { + padding: 12px; + text-align: left; + } + + div.config span { + color: #ccc; + } + + div.config span:hover { + color: #999; + cursor: pointer; + } </style> <script type="text/javascript"> @@ -252,7 +266,7 @@ var buildSpeeddial = function () { var width = 3; - if (sc.width != undefined) + if (sc.width) { width = sc.width; $('wrap').style.width = (width * 220) + 'px'; @@ -305,6 +319,39 @@ }); } + var setWidth = function () + { + var width = prompt ("{enter_dial_width}", ""); + if (!width || isNaN (width)) return; + + sc.width = width; + + $('content').empty (); + buildSpeeddial (); + + console.log ("speed_dial-save '" + encodeSafe (sc) + "'"); + } + + var setCount = function () + { + var count = prompt ("{enter_shortcut_count}", ""); + if (!count || isNaN (count)) return; + + sc.shortcuts = sc.shortcuts.slice (0, count); + + var i = sc.shortcuts.length; + while (i < count) + { + i++; + sc.shortcuts.push ({"id" : "s" + i, "href" : "#", "title" : "", "img" : ""}); + } + + $('content').empty (); + buildSpeeddial (); + + console.log ("speed_dial-save '" + encodeSafe (sc) + "'"); + } + window.addEvent ('domready', function () { buildSpeeddial (); }); @@ -326,6 +373,10 @@ </script> </head> <body> + <div class="config"> + <span onclick="javascript:setWidth()">{set_dial_width}</span> + <span onclick="javascript:setCount()">{set_shortcut_count}</span> + </div> <div id="wrap"> <div id="content"> </div> |