Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,158 changes: 0 additions & 6,158 deletions static/css/bootstrap.css

This file was deleted.

786 changes: 786 additions & 0 deletions static/css/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@import url(bootstrap.css);
@import url(prettify.css);
@import url(codemirror.css);

body {
background: #EBEEF1 url(../img/noise.png);
font-size: 13px;
Expand Down Expand Up @@ -66,6 +62,7 @@ code, pre {
background-color: #C1CFDC;
text-shadow: 0 1px 0 #FFFFFF;
border-radius: 4px;
margin-bottom: 5px;
}
#sidebar .inner {
padding: 20px;
Expand Down Expand Up @@ -197,4 +194,4 @@ code, pre {
}
#logo:hover .bubble {
bottom: 40px;
}
}
Binary file modified static/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 4 additions & 30 deletions views/index.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<title>Wikiraptor</title>
<base href="<?php echo BASE_URL; ?>/" />

<link rel="stylesheet" href="static/css/main.css" />
<script type="text/javascript" src="static/js/jquery.min.js"></script>

<link rel="shortcut icon" href="static/img/favicon.ico" />
</head>
<body>
<div id="main">
<div class="inner">
<div class="container-fluid">
<div class="row-fluid">
<div class="span4 offset4">
<div id="sidebar">
<div class="inner">
<h2><span>Wikiraptor</span></h2>
<?php include('tree.php') ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<h1>Welcome to Wikitten!</h1>
<p>
You're looking at this page because you haven't created a <code><?php echo LIBRARY . DIRECTORY_SEPARATOR . 'index.md' ?></code> file yet.
</p>
25 changes: 13 additions & 12 deletions views/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
<html>
<head>
<title><?php echo APP_NAME ?></title>
<base href="<?php echo BASE_URL; ?>/" />
<base href="<?php echo BASE_URL; ?>/">

<link rel="stylesheet" href="static/css/main.css" />
<link rel="shortcut icon" href="static/img/favicon.ico">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/prettify.css">
<link rel="stylesheet" href="static/css/codemirror.css">
<link rel="stylesheet" href="static/css/main.css">

<script type="text/javascript" src="static/js/jquery.min.js"></script>
<script type="text/javascript" src="static/js/prettify.js"></script>

<script type="text/javascript" src="static/js/codemirror.min.js"></script>

<link rel="shortcut icon" href="static/img/favicon.ico" />
<script src="static/js/jquery.min.js"></script>
<script src="static/js/prettify.js"></script>
<script src="static/js/codemirror.min.js"></script>
</head>
<body>
<div id="main">
<a href="http://wikitten.vizuina.com" id="logo" target="_blank">
<img src="static/img/logo.png" alt="" />
<a href="http://wikitten.vizuina.com" id="logo" target="_blank" class="hidden-phone">
<img src="static/img/logo.png" alt="">
<div class="bubble">Remember to check for updates!</div>
</a>
<div class="inner">
Expand All @@ -41,12 +42,12 @@
</div>
</div>
</div>
<script type="text/javascript">
<script>
$(document).ready(function () {
$('#logo').delay(2000).animate({
left: '20px'
}, 600);
});
</script>
</body>
</html>
</html>
5 changes: 3 additions & 2 deletions views/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<li>
<a href="<?php echo BASE_URL; ?>"><i class="icon-home icon-white"></i> /wiki</a>
</li>
<?php $i = 0; ?>
<?php foreach ($parts as $part): ?>
<?php $path[] = $part; ?>
<li>
Expand All @@ -30,7 +31,7 @@
<div id="render">
<?php echo $html; ?>
</div>
<script type="text/javascript">
<script>
$('#render pre').addClass('prettyprint linenums');
prettyPrint();

Expand All @@ -44,7 +45,7 @@
<div id="source">
<textarea id="editor" class="input-block-level" rows="<?php echo substr_count($source, "\n") + 1; ?>"><?php echo $source; ?></textarea>
</div>
<script type="text/javascript">
<script>
<?php if ($html) { ?>
CodeMirror.defineInitHook(function () {
$('#source').hide();
Expand Down
2 changes: 1 addition & 1 deletion views/tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function tree($array, $parent, $parts = array(), $step = 0) {

<?php echo tree($this->_getTree(), BASE_URL, $parts); ?>

<script type="text/javascript">
<script>
$('#sidebar a[data-role="directory"]').click(function (event) {
event.preventDefault();

Expand Down
4 changes: 4 additions & 0 deletions views/uhoh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h1>Uh oh!</h1>
<p>
An <strong>error</strong> ocurred: <code><?php echo $error ?></code>
</p>
14 changes: 9 additions & 5 deletions wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function _getRenderer($extension)
protected function _render($page)
{
$not_found = function () use ($page) {
throw new Exception("Page $page not found");
$page = htmlspecialchars($page, ENT_QUOTES);
throw new Exception("Page '$page' was not found");
};

$path = realpath(LIBRARY . DIRECTORY_SEPARATOR . $page);
Expand Down Expand Up @@ -60,6 +61,7 @@ protected function _render($page)
$extension = pathinfo($path, PATHINFO_EXTENSION);
$renderer = $this->_getRenderer($extension);

$html = false;
if ($renderer) {
$html = $renderer($source);
}
Expand Down Expand Up @@ -185,15 +187,17 @@ public function indexAction()
return $this->_render('index.md');
}

return $this->_view('index', array('layout' => false));
return $this->_view('index');
}

try {
return $this->_render($page);

} catch (Exception $e) {
// TODO: friendly error page
echo $e->getMessage();
$this->_view('uhoh', array(
'error' => $e->getMessage(),
'parts' => array('Uh-oh')
));
exit();
}
}
Expand All @@ -211,4 +215,4 @@ static public function instance()
return $instance;
}

}
}