forked from Scalpelcn/Farbox-Simple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor.html
133 lines (111 loc) · 4.43 KB
/
editor.html
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Editor</title>
{% if not request.is_login %}
<style type="text/css">
.buttons{
margin: 80px 0;
text-align: center;
}
.buttons a small{
font-size: 0.6em;
}
.buttons a{
margin: 0 60px;
padding: 15px 40px;
font-size: 19px;
color: #fff;
border: 1px solid #1c74b3;
border-top-color: #2c8ed1;
border-bottom-color: #0d5b97;
background: #2181cf;
text-decoration: none;
border-radius: 5px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#37a3eb", endColorstr="#2181cf");
background: -webkit-gradient(linear, left top, left bottom, from(#37a3eb), to(#2181cf));
background: -moz-linear-gradient(top, #37a3eb, #2181cf);
-moz-box-shadow: 0 1px 0 #ddd,inset 0 1px 0 rgba(255,255,255,0.2);
-webkit-box-shadow: 0 1px 0 #ddd,inset 0 1px 0 rgba(255,255,255,0.2);
box-shadow: 0 1px 0 #ddd,inset 0 1px 0 rgba(255,255,255,0.2);
text-shadow: rgba(0,0,0,0.2) 0 1px 0;
-webkit-text-shadow: rgba(0,0,0,0.2) 0 1px 0;
-moz-text-shadow: rgba(0,0,0,0.2) 0 1px 0;
}
.buttons a:hover{
box-shadow: 10px 2px 10px rgb(255, 255, 255), 0 1px 15px rgba(86, 86, 86, 0.39) inset;
text-shadow: rgba(255,255,255,0.3) 0 -1px 5px;
}
h1{
text-align: center;
font-size: 38px;
color: #555;
margin: 150px auto 120px auto;
letter-spacing: 2px;
}
</style>
{% else %}
<link href="{{ resource_host }}/css/editor.css?version={{ resource_version }}" rel="stylesheet" type="text/css" />
<link href="http://resource.farbox.com/css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{{ resource_host }}/lib/jquery/1.8.1-jquery.min.js"></script>
<script type="text/javascript" src="{{ resource_host }}/lib/knockout-2.2.1.js"></script>
<script type="text/javascript" src="{{ resource_host }}/fb/editor.js?version={{ resource_version }}"></script>
{% endif %}
</head>
<body>
{% if not request.is_login %}
<h1>
“极简,非一种态度;而是一种能力”
</h1>
<div class="buttons">
{% if request.args.site_id %}
<a class="button" href="http://www.farbox.com/service/google/auth">使用Google Drive 登录 </a>
<a class=" button" href="http://www.farbox.com/service/dropbox/auth" >使用Dropbox 登录</a>
{% else %}
{% if site.service == 'google' %}
<a class="button" href="http://www.farbox.com/service/google/auth">使用Google Drive 登录 </a>
{% elif site.service == 'dropbox' %}
<a class=" button" href="http://www.farbox.com/service/dropbox/auth" >使用Dropbox 登录</a>
{% else %}
<a class=" button" href="#" >不支持的云盘</a>
{% endif %}
{% endif %}
</div>
{% else %}
<div id="main">
<div id="preview" data-bind="visible: show_preview">
<a target="_blank" data-bind="attr: {href: preview_url}, event:{mouseover: sync}"><i class="icon-eye-open"></i> 浏览</a>
</div>
<div id="controls">
<div class="cmds">
<a id="manager" data-bind="attr: {href: manager_url}" target="_blank">
<i class="icon-cloud"></i>管理
</a>
<a href="#" data-bind="click: create_post">
<i class="icon-plus"></i>
新文章
</a>
</div>
<ul id="posts" data-bind="foreach: posts" class="posts">
<li>
<a href="#" data-bind="click: edit">
<span data-bind="text: title"></span>
</a>
</li>
</ul>
</div>
<div id="editor">
<textarea id="textarea" data-bind="event:{keyup: count_editor_text_length}"></textarea>
</div>
</div>
<script type="text/javascript">
{% if request.args.site_id and request.args.service %}
run_editor("{{request.args.site_id}}", "{{ request.args.service }}");
{% elif request.host not in ['www.farbox.com', 'farbox.com'] %}
run_editor("{{site._id}}", "{{ site.service }}");
{% endif %}
</script>
{% endif %}
</body>
</html>