<script type="text/javascript" src="{res}/mootools.js"></script>
<style>
-
html, body, #content {
margin: 0px;
padding: 0px
#wrap {
width: 660px;
- height: 550px;
+ height: 500px;
margin: 0px auto;
text-align: center;
}
+ #content {
+ margin-top: 40px;
+ }
+
div.shortcut {
float: left;
border: 1px solid #ccc;
color: #222;
}
- #search_bar {
- margin: 20px 0px 20px;
- }
-
div.clear {
clear: both;
}
- input[type=text] {
- color: #ddd;
- vertical-align: middle;
- font-size: 13px;
- }
-
- input[type=text]:active, input[type=text]:focus {
- color: #222;
- }
-
- button {
- font-size: 12px;
- padding: 5px 7px;
- vertical-align: middle;
- }
-
div.activated {
background-color: #f5f5f5;
}
sc = JSON.decode ({json_data});
+ var encodeSafe = function (obj) {
+ var str = JSON.encode (obj);
+ str = str.replace (/\'/g, '\\\'');
+ return str;
+ }
+
var getAction = function (id)
{
var a = $(id).getFirst ();
sc.shortcuts[num].href = href;
sc.shortcuts[num].img = data;
- console.log ("speed_dial-save '" + JSON.encode (sc) + "'");
+ console.log ("speed_dial-save '" + encodeSafe (sc) + "'");
}
var renameShortcut = function (id)
$(id).getLast ().set ('html', name);
sc.shortcuts[num].title = name;
- console.log ("speed_dial-save '" + JSON.encode (sc) + "'");
+ console.log ("speed_dial-save '" + encodeSafe (sc) + "'");
}
var clearShortcut = function (id)
sc.shortcuts[num].title = "";
sc.shortcuts[num].img = "";
- console.log ("speed_dial-save '" + JSON.encode (sc) + "'");
- }
-
- var speeddialSearch = function ()
- {
- var reg = new RegExp ("%s", "g");
- var search_url = $('search_bar').getProperty ('action');
- var search_content = $('search_bar').getFirst ().get ('value');
- window.location.href = search_url.replace (reg, encodeURIComponent (search_content));
- return false;
+ console.log ("speed_dial-save '" + encodeSafe (sc) + "'");
}
var buildSpeeddial = function ()
</head>
<body>
<div id="wrap">
- <form id="search_bar" name="search_bar" action="{search_uri}"
- method="get" onsubmit="javascript:return speeddialSearch();">
- <input type="text" name="q" value="{search_title}" onfocus="javascript:this.value='';"
- onblur="javascript:if(this.value=='') this.value='{search_title}';" />
- <button>{search}</button>
- </form>
<div id="content">
</div>
</div>