forked from zhouqicf/code-cola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.html
162 lines (162 loc) · 4.52 KB
/
options.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Code Cola Options</title>
<style>
html,body,h1,pre,h2{
padding:0;
margin:0;
}
p{
margin:2px 0 4px;
line-height:1.231;
}
body{
font:12px/1 Arial, Helvetica, sans-serif;
}
h2{
font:bold 14px/1 Georgia, "Times New Roman", Times, serif;
margin-bottom:10px;
}
code{
font-family:"Courier New", "Andale Mono", monospace;
}
a,
a:visited{
color:#000;
}
a:hover{
color:#f60;
}
pre{
word-wrap:break-word;
}
header h1{
font-family:Georgia, "Times New Roman", Times, serif;
font-size:150px;
color:#ddd;
font-weight:normal;
font-style:italic;
text-align:center;
}
input,label{
font:28px/1 Georgia, "Times New Roman", Times, serif;
padding:2px 8px 0 6px;
vertical-align:middle;
}
input[type="url"]{
font-family:Arial, Helvetica, sans-serif;
border-color:#ccc #aaa #aaa #ccc;
border-style:solid;
border-width:1px;
width:550px;
font-size:14px;
padding:9px 5px;
-webkit-box-shadow:1px 1px 0 #ddd;
}
.version{
font-size:50px;
}
section,
footer{
border-top:4px double #eee;
width:800px;
margin:0 auto;
padding:20px 0 0;
}
footer{
padding-top:10px;
overflow:hidden;
}
#codecola-doc::before{
content:url("cc-on.png");
width:22px;
height:22px;
margin-right:5px;
vertical-align:middle;
}
#codecola-author{
font-size: 10px;
-webkit-text-size-adjust: none;
}
.success{
color:green;
}
.fail{
color:red;
}
#option{
padding:10px 10px 0;
margin:10px 0;
background-color:#f0f0f0;
border:1px solid #ddd;
}
.note{
color:#f90;
}
.string{
color:#c00;
}
.keyword{
color:#00f;
}
.item{
padding-bottom:25px;
}
</style>
</head>
<body>
<header>
<h1>Code Cola<sup class="version">V3.5.0</sup></h1>
</header>
<section id="main">
<aside>
<p>This is a config for the <strong><q>Get Link</q> function</strong>, when user click the <q>Get Link</q> button, codecola will send the whole modified page to <strong>server action page</strong>, then the action will save the page to a folder of server which you set in the server action page.</p>
<p><strong>It's very dangerous, anyone can send any content to your server, make sure only someone you trust have access to visit the action page</strong>.</p>
</aside>
<div id="option">
<div class="item">
<h2>1. Upload "codecola.php" to Server</h2>
<p>Here is the <strong><a href="codecola.php">codecola.php</a></strong>, download it, then upload it to a folder of <strong>PHP server</strong>.</p>
</div>
<div class="item">
<h2>2. Config</h2>
<pre><code><span class="note">//Users can visit modified pages through this address. And pages will save in this folder, so make sure the directory has access to write.</span>
$path = <span class="string">"http://kxt.koubei.com/codecola/"</span>;
<span class="note">//Set filename. Filename use timestamp by default.</span>
$fileName = <span class="keyword">time</span>();</code></pre>
</div>
<div class="item">
<h2>3. Set Action Url</h2>
<form id="form">
<input type="url" id="action" required autofocus placeholder="For example: http://kxt.koubei.com/codecola/action.php" pattern="^([^:]+):\/\/(?:([^:@]+):?([^@]*)@)?(?:([^/?#:]+):?(\d*))([^?#]*)(?:\?([^#]+))?(?:#(.+))?$">
<input type="submit" value="save">
<span id="info"></span>
</form>
</div>
</div>
</section>
<footer>
<p id="codecola-doc">Code Cola <a href="http://www.zhouqicf.com/code-cola" target="_blank">Documentation</a>, <a href="https://chrome.google.com/extensions/detail/lomkpheldlbkkfiifcbfifipaofnmnkn" target="_blank">Chrome extension</a>, <a href="https://github.com/zhouqicf/code-cola" target="_blank">Source</a></p>
<p id="codecola-author">© 2010-2013 - created by <a href="http://www.zhouqicf.com/about" target="_blank">Zhou Qi</a></p>
</footer>
<script>
var info = document.getElementById("info");
document.getElementById("form").addEventListener("submit",
function(e) {
e.preventDefault();
var action = document.getElementById("action").value;
if (/^([^:]+):\/\/(?:([^:@]+):?([^@]*)@)?(?:([^/?#:]+):?(\d*))([^?#]*)(?:\?([^#]+))?(?:#(.+))?$/.test(action)) {
localStorage["codecola_save_action"] = action;
info.innerHTML = "Options Saved.";
info.className = "success";
} else {
info.innerHTML = "invalid url.";
info.className = "fail";
}
},
false);</script>
</body>
</html>