2009-05-07 20:22:43 +00:00
|
|
|
<!--
|
|
|
|
Speed Dial head template for Midori.
|
|
|
|
Copyright (C) 2009 Jean-François Guchens <zcx000@gmail.com>
|
2011-10-14 17:42:29 +00:00
|
|
|
Copyright (C) 2011 Paweł Forysiuk <tuxator@o2.pl>
|
|
|
|
Copyright (C) 2011 Cassidy James <email@cassidyjames.com>
|
2009-05-07 20:22:43 +00:00
|
|
|
This file is licensed under the terms of the expat license, see the file EXPAT.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<title>{title}</title>
|
|
|
|
<style>
|
2011-11-17 00:18:03 +00:00
|
|
|
|
|
|
|
/* Animations */
|
|
|
|
|
|
|
|
@-webkit-keyframes popin {
|
|
|
|
0% { opacity: 0.0; -webkit-transform: scale(0.00); }
|
|
|
|
75% { opacity: 0.5; -webkit-transform: scale(1.15); }
|
|
|
|
100% { opacity: 1.0; -webkit-transform: scale(1.00); }
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Styles */
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
* {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
cursor: default;
|
|
|
|
font-size: 13px;
|
|
|
|
color: #4d4d4d;
|
2009-05-13 21:56:55 +00:00
|
|
|
}
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
html, body {
|
2009-05-07 20:22:43 +00:00
|
|
|
font-family: sans-serif;
|
2011-10-09 23:38:39 +00:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
outline: 0;
|
2011-11-17 00:19:10 +00:00
|
|
|
background: #E1E1E1;
|
2009-05-07 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
2009-05-15 21:47:32 +00:00
|
|
|
#content {
|
2011-11-17 00:19:10 +00:00
|
|
|
width: 96%;
|
|
|
|
height: 85%;
|
2011-10-09 23:38:39 +00:00
|
|
|
margin: 0 auto;
|
2011-11-17 00:19:10 +00:00
|
|
|
padding-top: 5%;
|
|
|
|
padding-left: 2%;
|
2009-05-15 21:47:32 +00:00
|
|
|
}
|
|
|
|
|
2009-05-07 20:22:43 +00:00
|
|
|
div.shortcut {
|
2011-10-09 23:38:39 +00:00
|
|
|
width: 25%;
|
|
|
|
height: 33%;
|
2009-05-07 20:22:43 +00:00
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
div.shortcut .preview {
|
2011-11-17 00:19:10 +00:00
|
|
|
width: 85%;
|
|
|
|
height: 75%;
|
|
|
|
margin: auto;
|
|
|
|
-webkit-box-shadow: 0 4px 18px rgba(0,0,0,.3), 0 0 2px #fff inset;
|
2011-10-09 23:38:39 +00:00
|
|
|
background-image: -webkit-gradient(
|
|
|
|
linear, center top, center bottom,
|
|
|
|
from(#f6f6f6), to(#e3e3e3));
|
2011-11-17 00:19:10 +00:00
|
|
|
border: 1px solid #bcbcbc;
|
2011-10-09 23:38:39 +00:00
|
|
|
border-bottom-color: #a0a0a0;
|
2011-10-10 23:52:39 +00:00
|
|
|
position: relative;
|
2011-11-17 00:19:10 +00:00
|
|
|
-webkit-border-radius: 3px;
|
2011-10-10 23:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
div.shortcut .preview img {
|
|
|
|
width: 100%;
|
2011-11-17 00:19:10 +00:00
|
|
|
height: 100%;
|
2011-10-10 23:52:39 +00:00
|
|
|
cursor: pointer;
|
2011-11-17 00:19:10 +00:00
|
|
|
-webkit-border-radius: 3px;
|
2009-05-07 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
div.shortcut .preview.new .add {
|
2009-05-07 20:22:43 +00:00
|
|
|
display: block;
|
2010-06-01 21:56:04 +00:00
|
|
|
height: 100%;
|
2011-10-09 23:38:39 +00:00
|
|
|
width: 50%;
|
|
|
|
margin: 0 auto;
|
|
|
|
cursor: pointer;
|
2010-06-01 21:56:04 +00:00
|
|
|
}
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
.title {
|
|
|
|
text-align: center;
|
2011-11-17 00:19:10 +00:00
|
|
|
margin: 8px;
|
2011-03-22 21:59:56 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2009-05-09 14:41:01 +00:00
|
|
|
cursor: text;
|
2011-11-17 00:19:10 +00:00
|
|
|
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
|
2010-05-16 15:56:22 +00:00
|
|
|
}
|
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
.cross {
|
|
|
|
display: block;
|
|
|
|
width: 27px;
|
|
|
|
height: 27px;
|
|
|
|
top: -14px;
|
2011-10-12 23:40:39 +00:00
|
|
|
right: -14px;
|
2011-10-09 23:38:39 +00:00
|
|
|
background: url(res://close.png);
|
2011-10-10 23:52:39 +00:00
|
|
|
position: absolute;
|
2010-05-16 15:56:22 +00:00
|
|
|
cursor: pointer;
|
2011-10-10 23:52:39 +00:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
2011-10-14 17:42:29 +00:00
|
|
|
div.shortcut .preview:hover .cross {
|
2011-11-17 00:18:03 +00:00
|
|
|
-webkit-animation: popin 250ms ease-in-out;
|
2011-10-10 23:52:39 +00:00
|
|
|
opacity: 1;
|
2010-05-16 15:56:22 +00:00
|
|
|
}
|
2010-06-01 21:56:04 +00:00
|
|
|
|
2011-10-09 23:38:39 +00:00
|
|
|
.box.added {
|
|
|
|
display:none;
|
2010-06-01 21:56:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2012-01-05 23:27:07 +00:00
|
|
|
|
|
|
|
.selected {
|
|
|
|
outline: 1px dotted black;
|
|
|
|
background-color: #eef;
|
|
|
|
}
|
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)
|
|
|
|
{
|
2011-10-18 16:59:44 +00:00
|
|
|
var s = document.getElementById(id).childNodes[0];
|
|
|
|
if (s.className == 'preview')
|
2009-05-07 20:22:43 +00:00
|
|
|
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
|
|
|
|
2011-10-10 23:53:12 +00:00
|
|
|
console.log ("speed_dial-save-add " + id + " " + url + " ");
|
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-10-09 23:38:39 +00:00
|
|
|
var old_name = document.getElementById(id).childNodes[1].textContent;
|
2009-05-13 21:56:55 +00:00
|
|
|
|
2011-09-06 20:50:20 +00:00
|
|
|
var name = prompt ("{enter_shortcut_name}", old_name);
|
|
|
|
if (!name) return;
|
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 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);
|
|
|
|
|
2011-09-06 20:50:20 +00:00
|
|
|
document.getElementById('dialing').innerText = key_id.substr(1);
|
|
|
|
document.getElementById('dialing').style.visibility = 'visible';
|
2010-06-01 21:56:04 +00:00
|
|
|
|
2011-09-06 20:50:20 +00:00
|
|
|
var div = document.getElementById(key_id);
|
|
|
|
if (div)
|
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))
|
2011-10-18 16:59:44 +00:00
|
|
|
document.location = div.childNodes[0].childNodes[1].href;
|
2010-06-01 21:56:04 +00:00
|
|
|
key_id = 's';
|
|
|
|
}
|
|
|
|
else
|
2011-10-18 16:59:44 +00:00
|
|
|
key_timeout = setTimeout ('if (getAction (key_id)) document.location = document.getElementById(key_id).childNodes[0].childNodes[1].href; 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)
|
2011-09-06 20:50:20 +00:00
|
|
|
document.getElementById('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
|
|
|
}
|
|
|
|
|
2011-12-18 00:51:10 +00:00
|
|
|
var firstNode, secondNode;
|
|
|
|
var cursor;
|
|
|
|
var dial = document.getElementsByClassName("shortcut");
|
|
|
|
|
2012-01-05 23:27:07 +00:00
|
|
|
var get_dial_div = function (ele) {
|
|
|
|
var dial_div;
|
|
|
|
if (ele.nodeName == 'IMG')
|
|
|
|
dial_div = ele.parentNode.parentNode.parentNode;
|
|
|
|
if (ele.className == 'title')
|
|
|
|
dial_div = ele.parentNode;
|
|
|
|
if (ele.className.indexOf ('shortcut') != -1)
|
|
|
|
dial_dir = ele;
|
|
|
|
return dial_div;
|
|
|
|
}
|
2011-12-18 00:51:10 +00:00
|
|
|
var click = function (ev) {
|
|
|
|
ev.preventDefault();
|
|
|
|
var ele = ev.target;
|
|
|
|
cursor = ele.style.cursor;
|
|
|
|
ele.style.cursor = 'move';
|
|
|
|
|
2012-01-05 23:27:07 +00:00
|
|
|
var eparent = get_dial_div (ele);
|
2011-12-18 00:51:10 +00:00
|
|
|
if (eparent != undefined) {
|
2012-01-05 23:27:07 +00:00
|
|
|
eparent.className = 'shortcut selected';
|
2011-12-18 00:51:10 +00:00
|
|
|
firstNode = eparent.id;
|
|
|
|
}
|
|
|
|
out();
|
|
|
|
remove();
|
|
|
|
};
|
|
|
|
|
|
|
|
var remove = function () {
|
|
|
|
document.RemoveEventListener('click', click, false);
|
|
|
|
document.RemoveEventListener('mouseout', out, false);
|
|
|
|
};
|
|
|
|
|
|
|
|
var up = function (ev) {
|
|
|
|
ele = ev.target;
|
2012-01-05 23:27:07 +00:00
|
|
|
var eparent = get_dial_div (ele);
|
2011-12-18 00:51:10 +00:00
|
|
|
|
|
|
|
ele.style.cursor = cursor;
|
|
|
|
secondNode = eparent.id;
|
|
|
|
|
|
|
|
/* ommit just mere clicking the dial */
|
|
|
|
if (firstNode != secondNode && firstNode != undefined)
|
|
|
|
swap();
|
|
|
|
};
|
|
|
|
|
|
|
|
var over = function (ev) {
|
|
|
|
var ele = ev.target;
|
2012-01-05 23:27:07 +00:00
|
|
|
var eparent = get_dial_div (ele);
|
2011-12-18 00:51:10 +00:00
|
|
|
|
|
|
|
if (firstNode != undefined)
|
|
|
|
{
|
2012-01-05 23:27:07 +00:00
|
|
|
eparent.className = 'shortcut selected';
|
2011-12-18 00:51:10 +00:00
|
|
|
for (var i = 0; i <= dial.length; i++) {
|
|
|
|
if (eparent.id != firstNode.id && dial[i].id != eparent.id) {
|
2012-01-05 23:27:07 +00:00
|
|
|
dial[i].className = 'shortcut';
|
2011-12-18 00:51:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ele.style.cursor = cursor;
|
|
|
|
}
|
|
|
|
var out = function (ev) {
|
2012-01-05 23:27:07 +00:00
|
|
|
var ele = ev.target;
|
|
|
|
var eparent = get_dial_div (ev);
|
2011-12-18 00:51:10 +00:00
|
|
|
if (firstNode != undefined) {
|
|
|
|
for (var i = 0; i <= dial.length; i++) {
|
|
|
|
if (eparent.id != firstNode.id && dial[i].id != eparent.id) {
|
2012-01-05 23:27:07 +00:00
|
|
|
dial[i].className = 'shortcut';
|
2011-12-18 00:51:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ele.style.cursor = cursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
function swap () {
|
|
|
|
console.log ("speed_dial-save-swap " + firstNode + " " + secondNode);
|
|
|
|
};
|
|
|
|
|
|
|
|
document.addEventListener('mousedown', click, false);
|
|
|
|
document.addEventListener('mouseup', up, false);
|
|
|
|
document.addEventListener('mouseover', over, false);
|
|
|
|
document.addEventListener('mouseout', out, false);
|
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>
|
2011-10-09 23:38:39 +00:00
|
|
|
<div id="content">
|