Skip to content

Commit

Permalink
change multiline string format of aspen
Browse files Browse the repository at this point in the history
  • Loading branch information
wakamori committed Nov 29, 2011
1 parent 3522558 commit 3c073a7
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 101 deletions.
69 changes: 35 additions & 34 deletions wakamori/aspen/cgi-bin/aspen.k
Expand Up @@ -19,40 +19,41 @@ SCRIPT_DIR = "";
BUG_DIR = "";
TMP_DIR = "";

string admin_menu = ##<!DOCTYPE html>
##<html lang="ja">
##<head>
##<meta charset="UTF-8">
##<title>Admin Menu - Aspen</title>
##<style>
##body { padding: 1em; margin: auto; }
##table, td, th { border: 1px black solid; border-spacing: 0px;}
##td, th { padding: 3px; }
##</style>
##</head>
##<body>
##<header>
##<h1>Admin Menu</h1>
##</header>
##<form action="aspen.k" method="POST">
##<input type="hidden" name="type" value="update">
##<table>
##<caption>
##<strong>You can modify user roles by filling the form below.</strong>
##</caption>
##<thead>
##<tr><th>User ID</th><th>Screen Name</th><th>Role</th><th>New Role</th></tr>
##</thead>
##<tbody>
##%body%
##</tbody>
##</table>
##<p><input type="submit" value="Update Roles">
##<input type="reset" value="Reset"></p>
##<p><a href="doc">Back to editor</a></p>
##</form>
##</body>
##</html>
string admin_menu = """
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Admin Menu - Aspen</title>
<style>
body { padding: 1em; margin: auto; }
table, td, th { border: 1px black solid; border-spacing: 0px;}
td, th { padding: 3px; }
</style>
</head>
<body>
<header>
<h1>Admin Menu</h1>
</header>
<form action="aspen.k" method="POST">
<input type="hidden" name="type" value="update">
<table>
<caption>
<strong>You can modify user roles by filling the form below.</strong>
</caption>
<thead>
<tr><th>User ID</th><th>Screen Name</th><th>Role</th><th>New Role</th></tr>
</thead>
<tbody>
%body%
</tbody>
</table>
<p><input type="submit" value="Update Roles">
<input type="reset" value="Reset"></p>
<p><a href="doc">Back to editor</a></p>
</form>
</body>
</html>"""

void alarm_handler(int signum) {
throw new Security!!("too long");
Expand Down
136 changes: 69 additions & 67 deletions wakamori/aspen/cgi-bin/doc
Expand Up @@ -11,74 +11,76 @@ if (not defined INCLUDE_STORAGE) {
include "storage.k";
}

string html = ##<!DOCTYPE html>
##<html lang="ja">
## <head>
## <meta charset="UTF-8">
## <title>Aspen - An online KonohaScript editor</title>
##
## <!-- for IE compatibility -->
## <!--[if lt IE 9]>
## <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
## <![endif]-->
##
## <!-- codemirror -->
## <script src="%p%js/codemirror.js"></script>
## <script src="%p%js/autocompletion.js"></script>
## <link rel="stylesheet" href="%p%css/codemirror.css">
##
## <!-- syntax highlight -->
## <script src="%p%js/konoha.js"></script>
## <link rel="stylesheet" href="%p%css/konoha.css">
##
## <!-- mootools -->
## <script src="%p%js/mootools-core-1.3.2-full-compat.js"></script>
## <script src="%p%js/mootools-more-1.3.2.1.js"></script>
##
## <!-- shadowbox -->
## <script src="%p%lib/shadowbox-3.0.3/shadowbox.js"></script>
## <link rel="stylesheet" href="%p%lib/shadowbox-3.0.3/shadowbox.css">
##
## <!-- tab pane -->
## <script src="%p%js/TabPane.js"></script>
##
## <!-- aspen -->
## <script src="%p%js/aspen.js"></script>
## <link rel="stylesheet" href="%p%css/aspen.css">
## </head>
## <body>
## <!-- header menu -->
## <header>
## <div id="topmenu_l">
## <div class="menubutton"><a id="new" href="#new">New</a></div>
## <div class="menubutton"><a id="open" href="#open">Open</a></div>
## <div class="menubutton"><a id="save" href="#save">Save</a></div>
## <div class="menubutton"><a id="eval" href="#run">Run</a></div>
## </div>
## <div id="topmenu_r">
## <img src="http://img.tweetimag.es/i/%user%_m" alt="%user%"
## align="top" />
## <div class="userinfo" id="user">%user%</div>
## %admin%
## <div class="menubutton"><a id="sign_out" href="#signout">Sign
## out</a></div>
## </div>
## </header>
##
## <!-- result -->
## <div id="result">
## <span class="message"></span>
## </div>
##
## <!-- editor body -->
## <div id="tabpane">
## <ul id="tabs" class="tabs">
## </ul>
## </div>
## </body>
##</html>
string html = """
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Aspen - An online KonohaScript editor</title>

string admin = ##<div class="menubutton"><a id="admin" href="%p%cgi-bin/aspen.k?type=admin">Admin</a></div>
<!-- for IE compatibility -->
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->

<!-- codemirror -->
<script src="%p%js/codemirror.js"></script>
<script src="%p%js/autocompletion.js"></script>
<link rel="stylesheet" href="%p%css/codemirror.css">

<!-- syntax highlight -->
<script src="%p%js/konoha.js"></script>
<link rel="stylesheet" href="%p%css/konoha.css">

<!-- mootools -->
<script src="%p%js/mootools-core-1.3.2-full-compat.js"></script>
<script src="%p%js/mootools-more-1.3.2.1.js"></script>

<!-- shadowbox -->
<script src="%p%lib/shadowbox-3.0.3/shadowbox.js"></script>
<link rel="stylesheet" href="%p%lib/shadowbox-3.0.3/shadowbox.css">

<!-- tab pane -->
<script src="%p%js/TabPane.js"></script>

<!-- aspen -->
<script src="%p%js/aspen.js"></script>
<link rel="stylesheet" href="%p%css/aspen.css">
</head>
<body>
<!-- header menu -->
<header>
<div id="topmenu_l">
<div class="menubutton"><a id="new" href="#new">New</a></div>
<div class="menubutton"><a id="open" href="#open">Open</a></div>
<div class="menubutton"><a id="save" href="#save">Save</a></div>
<div class="menubutton"><a id="eval" href="#run">Run</a></div>
</div>
<div id="topmenu_r">
<img src="http://img.tweetimag.es/i/%user%_m" alt="%user%"
align="top" />
<div class="userinfo" id="user">%user%</div>
%admin%
<div class="menubutton"><a id="sign_out" href="#signout">Sign
out</a></div>
</div>
</header>

<!-- result -->
<div id="result">
<span class="message"></span>
</div>

<!-- editor body -->
<div id="tabpane">
<ul id="tabs" class="tabs">
</ul>
</div>
</body>
</html>"""

string admin = """
<div class="menubutton"><a id="admin" href="%p%cgi-bin/aspen.k?type=admin">Admin</a></div>"""

void redirect()
{
Expand Down

0 comments on commit 3c073a7

Please sign in to comment.