/
template.jade
106 lines (89 loc) · 2.19 KB
/
template.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
html
head
title FarBox Tempalte Engine
load('jquery')
body
style(type="text/css")
body {
font-size: 14px;
font-family: "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
color: #555555;
width: 1000px;
margin: 0 auto;
-webkit-text-size-adjust:none;
}
a{
text-decoration: none;
}
#clone_template{
margin: 120px auto;
text-align: center;
}
#clone_template input{
height:35px;
width:250px;
margin-right: 30px;
font-size:18px;
color:#1c87ff;
padding: 2px 5px;
}
#clone_template .checkbox{
display: inline;
margin-top: -30px;
margin-left: -20px;
}
#clone_template .checkbox input{
width: 30px;
margin: 0;
height: 12px;
padding: 0;
}
#clone_template .checkbox label{
padding: 0;
margin-left: -13px;
font-size: 10px;
color: #888;
}
#clone_template a:hover {
background: #1c87ff;
color: #fff;
text-decoration: none;
}
#clone_template .button {
display: inline-block;
font-family: "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
font-size: 1.5em;
letter-spacing: 1px;
padding: 5px 30px;
background: #E60900;
color: #fff;
margin: 55px 0 0 45px;
border-radius: 5px;
border: 1px solid #e6e6e6;
}
#clone_template
label(for='site') Your Site Domain:
input#site(type="text")
.checkbox
input#auto_update(type="checkbox")
label Auto Update
a#redirect.button(href="#", onclick="clone_template();return false;") Clone Template
script(type="text/javascript")
$(document).ready(function(){
$('#auto_update').mousedown(function() {
if (!$(this).is(':checked')) {
this.checked = confirm("If you select `Auto Upgrade`, make sure you trust the owner of the template!");
$(this).trigger("change");
}
});
$('#site').focus();
});
function clone_template(){
var domain = $.trim($('#site').val()).toLowerCase();
if (domain.indexOf('http://')==-1){
domain = 'http://' + domain;
}
var url = domain.replace(/\/$/g, '') + '/?template_site_id={{ site._id }}';
url += '&auto_update='+ $('#auto_update').is(':checked');
window.location.href = url;
}