Remove submodule
This commit is contained in:
parent
f969dbb290
commit
89b74e8ef8
50 changed files with 32051 additions and 10 deletions
119
resources/pagedown/demo/browser/demo.css
Normal file
119
resources/pagedown/demo/browser/demo.css
Normal file
|
@ -0,0 +1,119 @@
|
|||
body
|
||||
{
|
||||
background-color: White;
|
||||
}
|
||||
|
||||
.wmd-panel
|
||||
{
|
||||
margin-left: 25%;
|
||||
margin-right: 25%;
|
||||
width: 50%;
|
||||
min-width: 500px;
|
||||
}
|
||||
|
||||
.wmd-button-bar
|
||||
{
|
||||
width: 100%;
|
||||
background-color: Silver;
|
||||
}
|
||||
|
||||
.wmd-input
|
||||
{
|
||||
height: 300px;
|
||||
width: 100%;
|
||||
background-color: Gainsboro;
|
||||
border: 1px solid DarkGray;
|
||||
}
|
||||
|
||||
.wmd-preview
|
||||
{
|
||||
background-color: #c0e0ff;
|
||||
}
|
||||
|
||||
.wmd-button-row
|
||||
{
|
||||
position: relative;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-top: 10px;
|
||||
padding: 0px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.wmd-spacer
|
||||
{
|
||||
width: 1px;
|
||||
height: 20px;
|
||||
margin-left: 14px;
|
||||
|
||||
position: absolute;
|
||||
background-color: Silver;
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.wmd-button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding-left: 2px;
|
||||
padding-right: 3px;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wmd-button > span {
|
||||
background-image: url(../../wmd-buttons.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0px 0px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wmd-spacer1
|
||||
{
|
||||
left: 50px;
|
||||
}
|
||||
.wmd-spacer2
|
||||
{
|
||||
left: 175px;
|
||||
}
|
||||
.wmd-spacer3
|
||||
{
|
||||
left: 300px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.wmd-prompt-background
|
||||
{
|
||||
background-color: Black;
|
||||
}
|
||||
|
||||
.wmd-prompt-dialog
|
||||
{
|
||||
border: 1px solid #999999;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.wmd-prompt-dialog > div {
|
||||
font-size: 0.8em;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
.wmd-prompt-dialog > form > input[type="text"] {
|
||||
border: 1px solid #999999;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.wmd-prompt-dialog > form > input[type="button"]{
|
||||
border: 1px solid #888888;
|
||||
font-family: trebuchet MS, helvetica, sans-serif;
|
||||
font-size: 0.8em;
|
||||
font-weight: bold;
|
||||
}
|
83
resources/pagedown/demo/browser/demo.html
Normal file
83
resources/pagedown/demo/browser/demo.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>PageDown Demo Page</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="demo.css" />
|
||||
|
||||
<script type="text/javascript" src="../../Markdown.Converter.js"></script>
|
||||
<script type="text/javascript" src="../../Markdown.Sanitizer.js"></script>
|
||||
<script type="text/javascript" src="../../Markdown.Editor.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="wmd-panel">
|
||||
<div id="wmd-button-bar"></div>
|
||||
<textarea class="wmd-input" id="wmd-input">
|
||||
This is the *first* editor.
|
||||
------------------------------
|
||||
|
||||
Just plain **Markdown**, except that the input is sanitized:
|
||||
|
||||
<marquee>I'm the ghost from the past!</marquee>
|
||||
</textarea>
|
||||
</div>
|
||||
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
|
||||
|
||||
<br /> <br />
|
||||
|
||||
<div class="wmd-panel">
|
||||
<div id="wmd-button-bar-second"></div>
|
||||
<textarea class="wmd-input" id="wmd-input-second">
|
||||
This is the *second* editor.
|
||||
------------------------------
|
||||
|
||||
It has a plugin hook registered that surrounds all words starting with the
|
||||
letter A with asterisks before doing the Markdown conversion. Another one gives bare links
|
||||
a nicer link text. User input isn't sanitized here:
|
||||
|
||||
<marquee>I'm the ghost from the past!</marquee>
|
||||
|
||||
http://google.com
|
||||
|
||||
http://stackoverflow.com
|
||||
|
||||
It also includes a help button.
|
||||
|
||||
Finally, note that when you press Ctrl-Q or click the "Blockquote" button (without having a
|
||||
selection), this editor creates an example text that's different from the first editor.
|
||||
</textarea>
|
||||
</div>
|
||||
<div id="wmd-preview-second" class="wmd-panel wmd-preview"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var converter1 = Markdown.getSanitizingConverter();
|
||||
var editor1 = new Markdown.Editor(converter1);
|
||||
editor1.run();
|
||||
|
||||
var converter2 = new Markdown.Converter();
|
||||
|
||||
converter2.hooks.chain("preConversion", function (text) {
|
||||
return text.replace(/\b(a\w*)/gi, "*$1*");
|
||||
});
|
||||
|
||||
converter2.hooks.chain("plainLinkText", function (url) {
|
||||
return "This is a link to " + url.replace(/^https?:\/\//, "");
|
||||
});
|
||||
|
||||
var help = function () { alert("Do you need help?"); }
|
||||
var options = {
|
||||
helpButton: { handler: help },
|
||||
strings: { quoteexample: "whatever you're quoting, put it right here" }
|
||||
};
|
||||
var editor2 = new Markdown.Editor(converter2, "-second", options);
|
||||
|
||||
editor2.run();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
44
resources/pagedown/demo/node/demo.js
Normal file
44
resources/pagedown/demo/node/demo.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
// NOTE: This is just a demo -- in a production environment,
|
||||
// be sure to spend a few more thoughts on sanitizing user input.
|
||||
// (also, you probably wouldn't use a get request)
|
||||
|
||||
var http = require("http"),
|
||||
url = require("url"),
|
||||
querystring = require("querystring"),
|
||||
Converter = require("../../Markdown.Converter").Converter,
|
||||
getSanitizingConverter = require("../../Markdown.Sanitizer").getSanitizingConverter,
|
||||
conv = new Converter(),
|
||||
saneConv = getSanitizingConverter();
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
|
||||
var route = url.parse(req.url);
|
||||
if (route.pathname !== "/") {
|
||||
res.writeHead(404);
|
||||
res.end("Page not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var query = querystring.parse(route.query);
|
||||
|
||||
res.writeHead(200, { "Content-type": "text/html" });
|
||||
res.write("<html><body>");
|
||||
|
||||
var markdown = query.md || "## Hello!\n\n<marquee>I'm walking</marquee>\n\nVisit [Stack Overflow](http://stackoverflow.com)\n\n<b><i>This is never closed!";
|
||||
|
||||
res.write("<h1>Your output, sanitized:</h1>\n" + saneConv.makeHtml(markdown))
|
||||
res.write("<h1>Your output, unsanitized:</h1>\n" + conv.makeHtml(markdown))
|
||||
|
||||
res.write(
|
||||
"<h1>Enter Markdown</h1>\n" +
|
||||
"<form method='get' action='/'>" +
|
||||
"<textarea cols=50 rows=10 name='md'>" +
|
||||
markdown.replace(/</g, "<") +
|
||||
"</textarea><br>" +
|
||||
"<input type='submit' value='Convert!'>" +
|
||||
"</form>"
|
||||
);
|
||||
|
||||
res.end("</body></html>");
|
||||
|
||||
}).listen(8000);
|
Loading…
Add table
Add a link
Reference in a new issue