2009-05-07 20:22:43 +00:00
|
|
|
<!--
|
|
|
|
Speed Dial head template for Midori.
|
|
|
|
Copyright (C) 2009 Jean-François Guchens <zcx000@gmail.com>
|
|
|
|
This file is licensed under the terms of the expat license, see the file EXPAT.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<title>{title}</title>
|
2011-08-09 17:48:50 +00:00
|
|
|
<script type="text/javascript" src="res://mootools.js"></script>
|
2009-05-09 14:41:01 +00:00
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
<style>
|
2009-05-13 21:56:55 +00:00
|
|
|
html, body, #content {
|
|
|
|
margin: 0px;
|
|
|
|
padding: 0px
|
|
|
|
}
|
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
body {
|
|
|
|
text-align: center;
|
|
|
|
background-color: #fefefe;
|
|
|
|
font-family: sans-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
#wrap {
|
|
|
|
width: 660px;
|
2009-05-15 21:47:32 +00:00
|
|
|
height: 500px;
|
2009-05-07 20:22:43 +00:00
|
|
|
margin: 0px auto;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
2009-05-15 21:47:32 +00:00
|
|
|
#content {
|
2010-06-01 21:56:04 +00:00
|
|
|
margin-top: 40px;
|
2009-05-15 21:47:32 +00:00
|
|
|
}
|
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
div.shortcut {
|
|
|
|
float: left;
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
position: relative;
|
2009-05-13 21:56:55 +00:00
|
|
|
margin: 20px 20px 0px 0px;
|
2009-05-07 20:22:43 +00:00
|
|
|
background-color: #fff;
|
|
|
|
-webkit-border-radius: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.right {
|
|
|
|
margin-right: 0px;
|
|
|
|
margin-left: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.top {
|
|
|
|
margin-top: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 50px;
|
|
|
|
font-weight: bold;
|
|
|
|
margin: 0px;
|
|
|
|
padding: 10px 0px 0px 0px;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
h4 {
|
|
|
|
font-size: 11px;
|
|
|
|
font-weight: bold
|
|
|
|
margin: 10px 0px 0px 0px;
|
|
|
|
padding: 10px 5px 0px;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
h4 span:before {
|
|
|
|
content: "{click_to_add}";
|
|
|
|
font-size: 11px;
|
|
|
|
}
|
|
|
|
|
|
|
|
h4 span {
|
|
|
|
font-size: 11px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.shortcut a {
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
display: block;
|
|
|
|
margin: 15px auto 0px;
|
|
|
|
background-color: #fafafa;
|
|
|
|
color: #aaa;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
div.shortcut a img {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
div.shortcut a:hover {
|
|
|
|
border: 1px solid #999;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.shortcut p {
|
|
|
|
font-size: 12px;
|
|
|
|
margin: 0px;
|
|
|
|
padding: 5px 0px 0px;
|
|
|
|
color: #222;
|
2011-03-22 21:59:56 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2009-05-07 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
div.clear {
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.activated {
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cross {
|
2009-05-15 21:10:48 +00:00
|
|
|
height: 16px;
|
|
|
|
width: 16px;
|
2009-05-07 20:22:43 +00:00
|
|
|
margin-bottom: -17px;
|
|
|
|
margin-top: 2px;
|
2011-08-09 17:48:50 +00:00
|
|
|
background: url(stock://1/gtk-close) 98% 70% no-repeat;
|
2009-05-07 20:22:43 +00:00
|
|
|
cursor: pointer;
|
|
|
|
z-index: -4;
|
2009-05-15 21:10:48 +00:00
|
|
|
opacity: 0.6;
|
2009-05-07 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.cross:hover {
|
2009-05-15 21:10:48 +00:00
|
|
|
opacity: 1;
|
2009-05-07 20:22:43 +00:00
|
|
|
}
|
2009-05-09 14:41:01 +00:00
|
|
|
|
|
|
|
.activated p {
|
|
|
|
cursor: text;
|
2011-08-09 17:48:50 +00:00
|
|
|
background: url(stock://1/gtk-edit) 98% 70% no-repeat;
|
2009-05-13 21:56:55 +00:00
|
|
|
opacity: 0.6;
|
|
|
|
color: rgba(0,0,0,1);
|
|
|
|
}
|
|
|
|
|
|
|
|
.activated p:hover {
|
|
|
|
opacity: 1;
|
|
|
|
color: rgba(0,0,0,0.5);
|
2009-05-09 14:41:01 +00:00
|
|
|
}
|
2010-05-16 15:56:22 +00:00
|
|
|
|
|
|
|
div.config {
|
2010-06-01 21:56:04 +00:00
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
2010-05-16 15:56:22 +00:00
|
|
|
padding: 12px;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.config span {
|
|
|
|
color: #ccc;
|
2010-06-01 21:56:04 +00:00
|
|
|
margin-right: 10px;
|
|
|
|
margin-right: 10px;
|
2010-05-16 15:56:22 +00:00
|
|
|
}
|
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
div.config span.config_option:hover {
|
2010-05-16 15:56:22 +00:00
|
|
|
color: #999;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2010-06-01 21:56:04 +00:00
|
|
|
|
|
|
|
div.config span.config_label {
|
|
|
|
color: #ccc;
|
|
|
|
cursor: default;
|
|
|
|
margin-right: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.config span.config_option {
|
|
|
|
margin-left: 0px;
|
|
|
|
margin-right: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2009-05-07 20:22:43 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2009-05-13 21:56:55 +00:00
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
var getAction = function (id)
|
|
|
|
{
|
|
|
|
var a = $(id).getFirst ();
|
|
|
|
if (a.getProperty ('href') != "#" )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
var url = prompt ("{enter_shortcut_address}", "http://");
|
|
|
|
if (!url) return false;
|
2010-06-06 21:29:08 +00:00
|
|
|
if (url.indexOf ("://") == -1)
|
|
|
|
url = "http://" + url;
|
2009-05-07 20:22:43 +00:00
|
|
|
|
|
|
|
var name = prompt ("{enter_shortcut_name}", "");
|
|
|
|
if (!name) name = "";
|
|
|
|
|
2011-03-22 21:59:56 +00:00
|
|
|
console.log ("speed_dial-save-add " + id + " " + url + " " + name);
|
2009-05-07 20:22:43 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-05-13 21:56:55 +00:00
|
|
|
var renameShortcut = function (id)
|
2009-05-09 14:41:01 +00:00
|
|
|
{
|
2011-03-22 21:59:56 +00:00
|
|
|
var name = prompt ("{enter_shortcut_name}", $(id).getLast ().get ('html', name));
|
2010-06-01 21:56:04 +00:00
|
|
|
if (!name) return;
|
2009-05-13 21:56:55 +00:00
|
|
|
|
2009-05-09 14:41:01 +00:00
|
|
|
$(id).getLast ().set ('html', name);
|
2009-05-09 21:29:35 +00:00
|
|
|
|
2011-03-22 21:59:56 +00:00
|
|
|
console.log ("speed_dial-save-rename " + id + " " + name);
|
2009-05-09 14:41:01 +00:00
|
|
|
}
|
2009-05-07 20:22:43 +00:00
|
|
|
|
|
|
|
var clearShortcut = function (id)
|
|
|
|
{
|
|
|
|
if(!confirm("{are_you_sure}"))
|
|
|
|
return;
|
|
|
|
|
2011-03-22 21:59:56 +00:00
|
|
|
console.log ("speed_dial-save-delete " + id);
|
2009-05-09 21:29:35 +00:00
|
|
|
}
|
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
var setSize = function ()
|
2010-05-16 15:56:22 +00:00
|
|
|
{
|
2011-03-22 21:59:56 +00:00
|
|
|
|
|
|
|
var size = prompt ("{enter_dial_size}", columns + 'x' + rows);
|
2010-05-16 15:56:22 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
if (!size) return;
|
2010-05-16 15:56:22 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
var pos = size.indexOf('x');
|
2010-05-16 15:56:22 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
if (pos <= 0)
|
|
|
|
{
|
|
|
|
alert ("{invalid_dial_size}");
|
|
|
|
return;
|
|
|
|
}
|
2010-05-16 15:56:22 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
var cols = size.substr(0, pos);
|
|
|
|
rows = size.substr(pos+1);
|
|
|
|
|
|
|
|
if (isNaN (cols) || isNaN (rows) || cols == 0 || rows == 0)
|
|
|
|
{
|
|
|
|
alert ("{invalid_dial_size}");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size.indexOf('.') >= 0)
|
|
|
|
{
|
|
|
|
alert ("{invalid_dial_size}");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-03-22 21:59:56 +00:00
|
|
|
console.log ("speed_dial-save-size " + cols + " " + rows);
|
2010-05-16 15:56:22 +00:00
|
|
|
}
|
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
var setThumbSize = function (size)
|
|
|
|
{
|
2011-03-22 21:59:56 +00:00
|
|
|
console.log ("speed_dial-save-thumbsize " + size);
|
2010-06-01 21:56:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var key_id = 's';
|
|
|
|
var key_timeout;
|
|
|
|
|
2010-05-14 20:59:21 +00:00
|
|
|
document.onkeypress = function ()
|
|
|
|
{
|
2010-06-01 21:56:04 +00:00
|
|
|
key_id = key_id + String.fromCharCode (event.which);
|
2010-05-14 20:59:21 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
clearTimeout (key_timeout);
|
|
|
|
|
|
|
|
$('dialing').innerText = key_id.substr(1);
|
|
|
|
$('dialing').style.visibility = 'visible';
|
|
|
|
|
|
|
|
if ($(key_id))
|
2010-05-14 20:59:21 +00:00
|
|
|
{
|
2011-04-03 22:15:58 +00:00
|
|
|
if (key_id.substr(1) > 9)
|
2010-06-01 21:56:04 +00:00
|
|
|
{
|
|
|
|
if (getAction (key_id))
|
|
|
|
document.location = $(key_id).children[1];
|
|
|
|
key_id = 's';
|
|
|
|
}
|
|
|
|
else
|
2011-04-03 22:15:58 +00:00
|
|
|
key_timeout = setTimeout ('if (getAction (key_id)) document.location = $(key_id).children[1]; key_id = \'s\'', 1000);
|
2010-05-14 20:59:21 +00:00
|
|
|
}
|
2010-06-01 21:56:04 +00:00
|
|
|
else
|
|
|
|
key_id = 's';
|
|
|
|
|
|
|
|
if (key_id.length <= 1)
|
|
|
|
$('dialing').style.visibility = 'hidden';
|
2010-05-14 20:59:21 +00:00
|
|
|
|
2010-06-01 21:56:04 +00:00
|
|
|
return false;
|
2010-05-14 20:59:21 +00:00
|
|
|
}
|
|
|
|
|
2009-05-08 00:56:26 +00:00
|
|
|
</script>
|
2009-05-07 20:22:43 +00:00
|
|
|
</head>
|
2009-05-09 21:29:35 +00:00
|
|
|
<body>
|
2010-06-01 21:56:04 +00:00
|
|
|
<div class="osd" >
|
|
|
|
<span id="dialing"></span>
|
|
|
|
</div>
|
2010-05-16 15:56:22 +00:00
|
|
|
<div class="config">
|
2010-06-01 21:56:04 +00:00
|
|
|
<span onclick="javascript:setSize()" class="config_option">{set_dial_size}</span>
|
|
|
|
<span class="config_label">{set_thumb_size}</span>
|
|
|
|
<span onclick="javascript:setThumbSize(80)" class="config_option">{set_thumb_small}</span>
|
|
|
|
<span onclick="javascript:setThumbSize(160)" class="config_option">{set_thumb_normal}</span>
|
|
|
|
<span onclick="javascript:setThumbSize(240)" class="config_option">{set_thumb_big}</span>
|
2010-05-16 15:56:22 +00:00
|
|
|
</div>
|
2009-05-09 21:29:35 +00:00
|
|
|
<div id="wrap">
|
2009-05-13 21:56:55 +00:00
|
|
|
<div id="content">
|