Skip to content
Permalink
Browse files

update ui control&url

  • Loading branch information...
Aivier
Aivier committed Feb 27, 2015
1 parent e98bdc3 commit 7ccc5917e3cd4dc9b944894ce3fc29de39643f73
@@ -0,0 +1,120 @@
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\vx.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,51 @@
<%@ WebHandler Language="C#" Class="Rule" %>

using System;
using System.Web;
using System.IO;

public class Rule : IHttpHandler {

public void ProcessRequest (HttpContext context) {
var req = context.Request;
var res = context.Response;
var query = req.QueryString;

var root = context.Server.MapPath("~/") + @"..\configs\";
string file = "";
string rule = "";

if (query["new"] != null) {
file = root + "new-rule-cmd";
rule = query["new"];
}
else if (query["del"] != null) {
file = root + "del-rule-cmd";
rule = query["del"];
}

var ruleCommandWatcher = new FileSystemWatcher(Path.GetDirectoryName(file), Path.GetFileName(file));
File.WriteAllText(file, rule);
var result = (!ruleCommandWatcher.WaitForChanged(WatcherChangeTypes.Deleted, 10000).TimedOut).ToString().ToLower();

string text;
if (query["callback"] != null) {
res.ContentType = "text/javascript";
text = query["callback"] + "(" + result + ");";
}
else {
if (query["type"] != null) {
res.ContentType = query["type"];
}
text = result.ToString();
}
res.Write(text);
}

public bool IsReusable {
get {
return false;
}
}

}
@@ -0,0 +1,48 @@
<%@ WebHandler Language="C#" Class="Transmit" %>

using System;
using System.Web;

public class Transmit : IHttpHandler {

public void ProcessRequest (HttpContext context) {
var req = context.Request;
var res = context.Response;
var query = req.QueryString;

if (query["file"] != null) {
if (query["type"] != null) {
res.ContentType = query["type"];
}
if (query["nocache"] != null) {
res.Cache.SetCacheability(HttpCacheability.NoCache);
res.Cache.SetNoStore();
}
res.BinaryWrite(System.IO.File.ReadAllBytes(context.Server.MapPath("~/") + @"..\resources\" + query["file"]));
}
else if (query["config"] != null) {
string text;
var config = System.IO.File.ReadAllText(context.Server.MapPath("~/") + @"..\configs\" + query["config"]);
if (query["callback"] != null) {
res.ContentType = "text/javascript";
text = query["callback"] + "(" + config + ");";
}
else {
if (query["type"] != null) {
res.ContentType = query["type"];
}
text = config;
}
res.Cache.SetCacheability(HttpCacheability.NoCache);
res.Cache.SetNoStore();
res.Write(text);
}
}

public bool IsReusable {
get {
return false;
}
}

}
@@ -0,0 +1,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>

0 comments on commit 7ccc591

Please sign in to comment.
You can’t perform that action at this time.