/
url-info.html
155 lines (142 loc) · 5.71 KB
/
url-info.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<link rel="shortcut icon" href="http://localhost:14220/transmit.ashx?file=icon.ico&type=image/x-icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="http://localhost:14220/transmit.ashx?file=style.css&type=text/css" />
</head>
<body>
<div id="header-wrapper">
<div id="header">
<a id="logo-wrapper" href="http://x-wall.org/">
<img id="logo" alt="X-Wall Logo" src="http://localhost:14220/transmit.ashx?file=logo.png&type=image/png" />
<h1 id="title">X-WALL</h1>
<span id="domain">x-wall.org</span>
</a>
<ul id="nav">
<li>
<a href="http://www.privoxy.org/" target="_blank">Privoxy</a>
</li>
</ul>
</div>
</div>
<div id="main-wrapper">
<div id="body-wrapper">
<div id="content-wrapper">
<div data-lang="en-US" data-title="View the Action for a URL">
<h3>View Whether a URL Will Be Forwarded</h3>
<div id="result-wrapper-en-us" style="display: none;">
<h4>Forward Settings:</h4>
<p>Fetching...</p>
</div>
<h4>Please enter a URL:</h4>
<form method="GET">
<p>
<input type="text" name="url" style="width: 300px;" value="">
<button type="submit">Submit</button>
</p>
</form>
</div>
<div data-lang="zh-CN" data-title="查看 URL 对应的行为">
<h3>查看 URL 是否会被转发</h3>
<div id="result-wrapper-zh-cn" style="display: none;">
<h4>转发设置:</h4>
<p>获取中...</p>
</div>
<h4>请输入一个 URL:</h4>
<form method="GET">
<p>
<input type="text" name="url" style="width: 300px;" value="">
<button type="submit">提交</button>
</p>
</form>
</div>
</div>
<div id="sidebar-wrapper">
<div data-lang="en-US" class="item dark">
<h2>More Operation</h2>
<ul>
<li>
<a href="">View the action for a URL</a>
</li>
</ul>
</div>
<div data-lang="zh-CN" class="item dark">
<h2>更多操作</h2>
<ul>
<li>
<a href="">查看 URL 对应的行为</a>
</li>
</ul>
</div>
</div>
</div>
<div id="footer">
<div>©2015 <a href="javascript:void(0);" target="_blank">VILIC VANE</a></div>
</div>
</div>
<script>
var lang;
var langs = {
"en-US": {
wrapperId: "result-wrapper-en-us",
forwardDescription: 'Request for <a href="{url}">{url}</a> will be forwarded through {type} proxy {host}.',
directDescription: 'Request for <a href="{url}">{url}</a> will be made directly, no forwarding settings would be applied.'
},
"zh-CN": {
wrapperId: "result-wrapper-zh-cn",
forwardDescription: '请求 <a href="{url}">{url}</a> 将会通过 {type} 代理 {host} 转发.',
directDescription: '请求 <a href="{url}">{url}</a> 将会直接连接, 没有转发设置被应用.'
}
};
window.onlangready = function () {
lang = langs[pageLang];
var wrapper = document.getElementById(lang.wrapperId);
var p = wrapper.getElementsByTagName("p")[0];
if (/[&?]url=[^&].*/.test(window.location.search)) {
wrapper.style.display = "block";
require("http://config.privoxy.org/show-url-info" + window.location.search, function (info) {
var description;
if (info.forward.type) {
description = lang.forwardDescription;
}
else {
description = lang.directDescription;
}
description = description.replace(/\{url\}/g, info.url);
if (info.forward.type) {
description = description.replace(/\{type\}/g, info.forward.type.toUpperCase());
description = description.replace(/\{host\}/g, info.forward.host + ":" + info.forward.port);
}
p.innerHTML = description;
}, undefined, "urlInfoCallback");
}
};
function require(url, callback, callbackQueryName, callbackName) {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.type = "text/javascript";
script.async = true;
if (arguments.length < 4) {
callbackName = "callback_" + Math.floor(Math.random() * 9999999999999999);
if (arguments.length < 3) {
callbackQueryName = "callback";
}
}
if (callbackQueryName) {
url += "&" + callbackQueryName + "=" + callbackName;
}
script.src = url;
window[callbackName] = function () {
window[callbackName] = undefined;
head.removeChild(script);
callback.apply(this, arguments);
};
head.insertBefore(script, head.firstChild);
}
</script>
<script src="http://localhost:14220/transmit.ashx?file=privoxy-templates/lang-helper.js&type=text/javascript"></script>
</body>
</html>