20181018提交

This commit is contained in:
皓月 2018-10-18 23:06:30 +08:00
parent 0792aaed0f
commit 044001e337
8 changed files with 359 additions and 38 deletions

51
CodeShowWeb/CodeShow.aspx Normal file
View File

@ -0,0 +1,51 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CodeShow.aspx.cs" Inherits="CodeShowWeb.CodeShow" %>
<!DOCTYPE html>
<html>
<head>
<title>highlight</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" href="styles/default.css">
<script src="highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
代码配色方案:<div id="changeStyleSelect"></div>
<div ><pre>
<code class="java">
<%=GetCode() %>
</code>
</pre>
</div>
<script>
styleArr = ["<%=GetCodeStyle() %>",//第一个放自己喜欢的23333
"agate.css", "androidstudio.css", "arduino-light.css", "arta.css", "ascetic.css", "atelier-cave-dark.css", "atelier-cave-light.css", "atelier-dune-dark.css", "atelier-dune-light.css", "atelier-estuary-dark.css", "atelier-estuary-light.css", "atelier-forest-dark.css", "atelier-forest-light.css", "atelier-heath-dark.css", "atelier-heath-light.css", "atelier-lakeside-dark.css", "atelier-lakeside-light.css", "atelier-plateau-dark.css", "atelier-plateau-light.css", "atelier-savanna-dark.css", "atelier-savanna-light.css", "atelier-seaside-dark.css", "atelier-seaside-light.css", "atelier-sulphurpool-dark.css", "atelier-sulphurpool-light.css", "brown-paper.css", "codepen-embed.css", "color-brewer.css", "dark.css", "darkula.css", "default.css", "docco.css", "dracula.css", "far.css", "foundation.css", "github.css", "github-gist.css", "googlecode.css", "grayscale.css", "gruvbox-dark.css", "gruvbox-light.css", "hopscotch.css", "hybrid.css", "idea.css", "ir-black.css", "kimbie.dark.css", "kimbie.light.css", "magula.css", "mono-blue.css", "monokai.css", "monokai-sublime.css", "obsidian.css", "paraiso-dark.css", "paraiso-light.css", "pojoaque.css", "purebasic.css", "qtcreator_dark.css", "qtcreator_light.css", "railscasts.css", "rainbow.css", "school-book.css", "solarized-dark.css", "solarized-light.css", "sunburst.css", "tomorrow.css", "tomorrow-night.css", "tomorrow-night-blue.css", "tomorrow-night-bright.css", "tomorrow-night-eighties.css", "vs.css", "xcode.css", "xt256.css", "zenburn.css"];
selectHtml = [];
selectHtml.push('<select id="changeStyle">');
for (i in styleArr) {
OptionValue = styleArr[i];
selectHtml.push('<option value="' + OptionValue + '" >' + OptionValue + '</option>');
}
selectHtml.push('</select>');
selectHtmlString = selectHtml.join("");
document.getElementById('changeStyleSelect').innerHTML = selectHtmlString;
obj = document.getElementById('changeStyle');
obj.addEventListener("change", function (event) {
var value = this.options[this.options.selectedIndex].value;
l = document.createElement('link');
l.setAttribute('href', 'styles/' + value);
l.setAttribute('rel', 'stylesheet');
document.head.appendChild(l);
});
//首先载入自己喜欢的
l = document.createElement('link');
l.setAttribute('href', 'styles/' +"<%=GetCodeStyle() %>");
l.setAttribute('rel','stylesheet');
document.head.appendChild(l);
</script>
</body>
</html>

View File

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoderEngine;
namespace CodeShowWeb
{
public partial class CodeShow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string GetCode()
{
string CodeLang = GetLang();
if (CodeLang == "Java")
{
return GetJavaCode();
}
else if (CodeLang == "swift")
{
return GetSwiftCode();
}
return "代码语言尚未支持";
}
public string GetLang()
{
var lang = Request.QueryString["Lang"];
if (lang != null && lang != "")
{
return lang;
}
else
return "Java";
}
public string GetCodeStyle()
{
string CodeLang = GetLang();
if (CodeLang == "Java")
{
return "androidstudio.css";
}
else if (CodeLang == "swift")
{
return "xcode.css";
}
return "代码语言尚未支持";
}
public string GetJavaCode()
{
string JavaCode = new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A");
return JavaCode;
}
public string GetSwiftCode()
{
string SwiftCode = new SwiftCodeWrite().ModelToSwiftCode("CoderEngine", "A");
return SwiftCode;
}
}
}

15
CodeShowWeb/CodeShow.aspx.designer.cs generated Normal file
View File

@ -0,0 +1,15 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace CodeShowWeb {
public partial class CodeShow {
}
}

View File

@ -58,6 +58,9 @@
<Reference Include="System.EnterpriseServices" /> <Reference Include="System.EnterpriseServices" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="CodeShow.aspx" />
<Content Include="Pub\css\lanrenzhijia.css" />
<Content Include="Pub\js\lanrenzhijia.js" />
<Content Include="Pub\showdown-master\bower.json" /> <Content Include="Pub\showdown-master\bower.json" />
<Content Include="Pub\showdown-master\CHANGELOG.md" /> <Content Include="Pub\showdown-master\CHANGELOG.md" />
<Content Include="Pub\showdown-master\CONTRIBUTING.md" /> <Content Include="Pub\showdown-master\CONTRIBUTING.md" />
@ -243,6 +246,13 @@
<Content Include="Web.config" /> <Content Include="Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CodeShow.aspx.cs">
<DependentUpon>CodeShow.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CodeShow.aspx.designer.cs">
<DependentUpon>CodeShow.aspx</DependentUpon>
</Compile>
<Compile Include="Index.aspx.cs"> <Compile Include="Index.aspx.cs">
<DependentUpon>Index.aspx</DependentUpon> <DependentUpon>Index.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

View File

@ -9,27 +9,24 @@
<script src="highlight.pack.js"></script> <script src="highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script> <script>hljs.initHighlightingOnLoad();</script>
</head> </head>
<body> <body style="background-color:black">
<div>
<h2>皓月代码转换引擎 Ver 0.1.0</h2> <h2>服务端参数跨语言代码转换引擎 Ver 0.1.0 -- 皓月</h2>
<h4>是一个C#服务端API参数实体类、转换成于各类语言客户端解析参数代码减少客户端重复工作量</h4> <h4>是一个C#服务端API参数实体类、转换成于各类语言客户端解析参数代码减少客户端开发人员重复工作量</h4>
<h4>目前支持转换到的目标语言Java...</h4> <h4>请选择目前支持转换到的目标语言:</h4>
<h3><a href="/Index.aspx?lang=Java">Java/Android</a>、<a href="/Index.aspx?lang=swift">Swift/iOS</a>、<a href="/Index.aspx?lang=JavaScript">Ajax/Javascript</a>、<a href="/Index.aspx?lang=PHP">PHP</a>、<a href="/Index.aspx?lang=Golang">Golang</a>、...</h3>
<h4>选择你喜欢的代码配色方案<div id="changeStyleSelect"></div></h4> <h4>选择你喜欢的代码配色方案<div id="changeStyleSelect"></div></h4>
<div> <h2>已转换为目标语种为"<%=GetLang() %>"代码结果:</h2>
<pre>
<code class="java"> <div ><pre>
<%=GetJavaCode() %> <code class="<%=GetLang() %>"">
<%=GetCode() %>
</code> </code>
</pre> </pre>
</div> </div>
<div>
<pre>
<code class="swift">
<%=GetSwiftCode() %>
</code>
</pre>
</div>
</div>
<style> <style>
@font-face @font-face
@ -41,36 +38,40 @@ src: url('KawkabMono-Regular.ttf'),
body body
{ {
font-family:myFirstFont; font-family:myFirstFont;
color:#ffffff;
} }
a{color:#52cbf8}
.div-inline{ display:inline;}
</style> </style>
<script> <script>
styleArr = ["hybrid.css",//第一个放自己喜欢的23333 styleArr = ["<%=GetCodeStyle() %>",//第一个放自己喜欢的23333
"agate.css", "androidstudio.css", "arduino-light.css", "arta.css", "ascetic.css", "atelier-cave-dark.css", "atelier-cave-light.css", "atelier-dune-dark.css", "atelier-dune-light.css", "atelier-estuary-dark.css", "atelier-estuary-light.css", "atelier-forest-dark.css", "atelier-forest-light.css", "atelier-heath-dark.css", "atelier-heath-light.css", "atelier-lakeside-dark.css", "atelier-lakeside-light.css", "atelier-plateau-dark.css", "atelier-plateau-light.css", "atelier-savanna-dark.css", "atelier-savanna-light.css", "atelier-seaside-dark.css", "atelier-seaside-light.css", "atelier-sulphurpool-dark.css", "atelier-sulphurpool-light.css", "brown-paper.css", "codepen-embed.css", "color-brewer.css", "dark.css", "darkula.css", "default.css", "docco.css", "dracula.css", "far.css", "foundation.css", "github.css", "github-gist.css", "googlecode.css", "grayscale.css", "gruvbox-dark.css", "gruvbox-light.css", "hopscotch.css", "hybrid.css", "idea.css", "ir-black.css", "kimbie.dark.css", "kimbie.light.css", "magula.css", "mono-blue.css", "monokai.css", "monokai-sublime.css", "obsidian.css", "paraiso-dark.css", "paraiso-light.css", "pojoaque.css", "purebasic.css", "qtcreator_dark.css", "qtcreator_light.css", "railscasts.css", "rainbow.css", "school-book.css", "solarized-dark.css", "solarized-light.css", "sunburst.css", "tomorrow.css", "tomorrow-night.css", "tomorrow-night-blue.css", "tomorrow-night-bright.css", "tomorrow-night-eighties.css", "vs.css", "xcode.css", "xt256.css", "zenburn.css"]; "agate.css", "androidstudio.css", "arduino-light.css", "arta.css", "ascetic.css", "atelier-cave-dark.css", "atelier-cave-light.css", "atelier-dune-dark.css", "atelier-dune-light.css", "atelier-estuary-dark.css", "atelier-estuary-light.css", "atelier-forest-dark.css", "atelier-forest-light.css", "atelier-heath-dark.css", "atelier-heath-light.css", "atelier-lakeside-dark.css", "atelier-lakeside-light.css", "atelier-plateau-dark.css", "atelier-plateau-light.css", "atelier-savanna-dark.css", "atelier-savanna-light.css", "atelier-seaside-dark.css", "atelier-seaside-light.css", "atelier-sulphurpool-dark.css", "atelier-sulphurpool-light.css", "brown-paper.css", "codepen-embed.css", "color-brewer.css", "dark.css", "darkula.css", "default.css", "docco.css", "dracula.css", "far.css", "foundation.css", "github.css", "github-gist.css", "googlecode.css", "grayscale.css", "gruvbox-dark.css", "gruvbox-light.css", "hopscotch.css", "hybrid.css", "idea.css", "ir-black.css", "kimbie.dark.css", "kimbie.light.css", "magula.css", "mono-blue.css", "monokai.css", "monokai-sublime.css", "obsidian.css", "paraiso-dark.css", "paraiso-light.css", "pojoaque.css", "purebasic.css", "qtcreator_dark.css", "qtcreator_light.css", "railscasts.css", "rainbow.css", "school-book.css", "solarized-dark.css", "solarized-light.css", "sunburst.css", "tomorrow.css", "tomorrow-night.css", "tomorrow-night-blue.css", "tomorrow-night-bright.css", "tomorrow-night-eighties.css", "vs.css", "xcode.css", "xt256.css", "zenburn.css"];
selectHtml = []; selectHtml = [];
selectHtml.push('<select id="changeStyle">'); selectHtml.push('<select id="changeStyle">');
for(i in styleArr) { for (i in styleArr) {
OptionValue = styleArr[i]; OptionValue = styleArr[i];
selectHtml.push('<option value="' + OptionValue +'" >'+ OptionValue +'</option>'); selectHtml.push('<option value="' + OptionValue + '" >' + OptionValue + '</option>');
} }
selectHtml.push('</select>'); selectHtml.push('</select>');
selectHtmlString = selectHtml.join(""); selectHtmlString = selectHtml.join("");
document.getElementById('changeStyleSelect').innerHTML = selectHtmlString; document.getElementById('changeStyleSelect').innerHTML = selectHtmlString;
obj = document.getElementById('changeStyle'); obj = document.getElementById('changeStyle');
obj.addEventListener("change",function(event){ obj.addEventListener("change", function (event) {
var value = this.options[this.options.selectedIndex].value; var value = this.options[this.options.selectedIndex].value;
l = document.createElement('link'); l = document.createElement('link');
l.setAttribute('href','styles/'+value); l.setAttribute('href', 'styles/' + value);
l.setAttribute('rel','stylesheet'); l.setAttribute('rel', 'stylesheet');
document.head.appendChild(l); document.head.appendChild(l);
}); });
//首先载入自己喜欢的 //首先载入自己喜欢的
l = document.createElement('link'); l = document.createElement('link');
l.setAttribute('href','styles/'+"hybrid.css"); l.setAttribute('href', 'styles/' +"<%=GetCodeStyle() %>");
l.setAttribute('rel','stylesheet'); l.setAttribute('rel', 'stylesheet');
document.head.appendChild(l); document.head.appendChild(l);
</script> </script>
</body> </body>

View File

@ -15,6 +15,48 @@ namespace CodeShowWeb
} }
public string GetCode()
{
string CodeLang = GetLang();
if (CodeLang == "Java")
{
return GetJavaCode();
}
else if (CodeLang == "swift")
{
return GetSwiftCode();
}
return "代码语言尚未支持";
}
public string GetLang()
{
var lang = Request.QueryString["Lang"];
if (lang != null && lang != "")
{
return lang;
}
else
return "Java";
}
public string GetCodeStyle()
{
string CodeLang = GetLang();
if (CodeLang == "Java")
{
return "androidstudio.css";
}
else if (CodeLang == "swift")
{
return "xcode.css";
}
return "代码语言尚未支持";
}
public string GetJavaCode() public string GetJavaCode()
{ {
string JavaCode = new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A"); string JavaCode = new JavaCodeWrite().ModelToJavaCode("CoderEngine", "A");

View File

@ -0,0 +1,114 @@
@charset "utf-8";
/* 代码整理:懒人之家 www.lanrenzhijia.com */
html, body {
height: 100%;
padding: 0;
margin: 0;
}
body {
min-height: 600px;
}
body * {
font-family: Arial, Geneva, SunSans-Regular, sans-serif;
font-size: 14px;
color: #333;
line-height: 22px;
}
#wrapper {
background-color: #F4F0EE;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
width: 100%;
height: 275px;
padding-top: 25px;
margin: -150px 0 0 0;
position: absolute;
left: 0;
top: 50%;
}
#tabs > div {
width: 700px;
height: 250px;
float: left;
overflow: hidden;
}
#tabs img {
display: block;
margin: 0 25px 0 0;
float: left;
}
#tabs h3 {
font-size: 30px;
line-height: 20px;
margin: 60px 0 20px 0;
}
#tabs #blue img {
margin-top: 30px;
}
#tabs #pink img {
margin-top: 0;
}
#tabs #white img {
margin-top: 50px;
}
#pager {
width: 700px;
margin: -76px auto 25px auto;
text-align: center;
}
#pager a {
border: 1px solid transparent;
border-bottom: none;
border-left: none;
border-color: #ccc;
color: #999;
font-size: 20px;
text-decoration: none;
line-height: 30px;
display: inline-block;
height: 30px;
padding: 10px 30px;
}
#pager a:hover {
color: #666;
}
#pager a:first-child {
border-left: 1px solid #ccc;
}
#pager a.selected {
background-color: #F4F0EE;
color: #333;
}
#source {
text-align: center;
width: 400px;
margin: 0 0 0 -200px;
position: absolute;
bottom: 10px;
left: 50%;
}
#source, #source a {
color: #999;
font-size: 12px;
}
#donate-spacer {
height: 100%;
}
#donate {
border-top: 1px solid #999;
width: 750px;
padding: 50px 75px;
margin: 0 auto;
overflow: hidden;
}
#donate p, #donate form {
margin: 0;
float: left;
}
#donate p {
width: 650px;
}
#donate form {
width: 100px;
}
/* 代码整理:懒人之家 www.lanrenzhijia.com */

File diff suppressed because one or more lines are too long