All pastes #2052224 Raw Edit

speeddial-head.html

public html v1 · immutable
#2052224 ·published 2011-04-30 12:04 UTC
rendered paste body
<!-- Speed Dial head template for Midori. Copyright (C) 2009 Jean-Franois 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>    <script type="text/javascript" src="{res}/mootools.js"></script>    <style>    html, body, #content {        margin: 0px;        padding: 0px    }    body {        text-align: center;        background-color: #fefefe;        font-family: sans-serif;    }    #wrap {        width: 90%;        height: 80%;        margin: 0px auto;        text-align: center;    }    #content {        margin: 10px;    }    div.shortcut {        border: 1px solid #ccc;        margin: 1%;        display: inline-block;        width: 30%;        background-color: #fff;        -webkit-border-radius: 10px;    }    div.shortcut a {        border: 1px solid #ccc;        display: block;        margin: 15px 15px 0px 15px;        background-color: #fafafa;        color: #aaa;        text-decoration: none;    }    div.shortcut a img {        width: 100%;        height: auto%;    }    div.shortcut a:hover {        border: 1px solid #999;    }    div.shortcut p {        font-size: 12px;        margin: 0px;        padding: 5px 0px 0px;        color: #222;        white-space: nowrap;        text-overflow: ellipsis;        overflow: hidden;    }    div.activated {        background-color: #f5f5f5;    }    .cross {        height: 16px;        margin-bottom: -18px;        margin-top: 2px;        background: url({stock}/1/gtk-close) 100% 50% no-repeat;        z-index: -4;        opacity: 0.6;        /* visibility: hidden; */    }    .cross:hover {        opacity: 1;    }    /* .activated .cross {        visibility: visible;    } */    .activated p {        cursor: default;        background: url({stock}/1/gtk-edit) 100% 50% no-repeat;        opacity: 0.6;        color: rgba(0,0,0,1);    }    .activated p:hover {        opacity: 1;        color: rgba(0,0,0,0.5);    }    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;    }    </style>    <script type="text/javascript">    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;        if (url.indexOf ("://") == -1)            url = "http://" + url;        var name = prompt ("{enter_shortcut_name}", "");        if (!name) name = "";        console.log ("speed_dial-save-add " + id + " " + url + " " + name);        return false;    }    var renameShortcut = function (id)    {        var name = prompt ("{enter_shortcut_name}", $(id).getLast ().get ('html', name));        if (!name) return;        $(id).getLast ().set ('html', name);        console.log ("speed_dial-save-rename " + id + " " + name);    }    var clearShortcut = function (id)    {        if(!confirm("{are_you_sure}"))            return;        console.log ("speed_dial-save-delete " + id);    }    var setSize = function ()    {        var size = prompt ("{enter_dial_size}", columns + 'x' + rows);        if (!size) return;        var pos = size.indexOf('x');        if (pos <= 0)        {            alert ("{invalid_dial_size}");            return;        }        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;        }        console.log ("speed_dial-save-size " + cols  + " " + rows);    }    var key_id = 's';    var key_timeout;    document.onkeypress = function ()    {        key_id = key_id + String.fromCharCode (event.which);        clearTimeout (key_timeout);        $('dialing').innerText = key_id.substr(1);        $('dialing').style.visibility = 'visible';        if ($(key_id))        {            if (key_id.substr(1) > 9)            {                if (getAction (key_id))                    document.location = $(key_id).children[1];                key_id = 's';            }            else                key_timeout = setTimeout ('if (getAction (key_id)) document.location = $(key_id).children[1]; key_id = \'s\'', 1000);        }        else            key_id = 's';        if (key_id.length <= 1)            $('dialing').style.visibility = 'hidden';        return false;    }    </script></head><body>    <div class="osd" >        <span id="dialing"></span>    </div>    <div id="wrap">        <div id="content">