}
#content {
- margin-top: 40px;
+ margin-top: 10px;
}
div.shortcut {
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">
var buildSpeeddial = function ()
{
var width = 3;
- if (sc.width != undefined)
+ if (sc.width)
{
width = sc.width;
$('wrap').style.width = (width * 220) + 'px';
});
}
+ 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 ();
});
</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>
"{click_to_add}", _("Click to add a shortcut"),
"{enter_shortcut_address}", _("Enter shortcut address"),
"{enter_shortcut_name}", _("Enter shortcut title"),
- "{are_you_sure}", _("Are you sure you want to delete this shortcut?"), NULL);
+ "{are_you_sure}", _("Are you sure you want to delete this shortcut?"),
+ "{set_dial_width}", _("Set number of columns"),
+ "{enter_dial_width}", _("Enter number of columns:"),
+ "{set_shortcut_count}", _("Set number of shortcuts"),
+ "{enter_shortcut_count}", _("Enter number of shortcuts:"), NULL);
midori_view_load_alternate_string (view,