Add Create New Page dialog

This commit is contained in:
Eston Bond
2010-12-08 15:40:45 -08:00
parent 53c2fee24f
commit 079917449a
3 changed files with 25 additions and 3 deletions
@@ -24,6 +24,28 @@ $(document).ready(function() {
);
}
if ($('#minibutton-new-page').length) {
$('#minibutton-new-page').click(function() {
$.GollumDialog.init({
title: 'Create New Page',
fields: [
{
id: 'name',
name: 'Page Name',
type: 'text'
}
],
OK: function( res ) {
var n = 'New Page';
if ( res['name'] )
var n = res['name'];
n = encodeURIComponent( n );
window.location = '/' + n;
}
});
});
}
if ($('#wiki-wrapper').hasClass('history')) {
$('#wiki-history td.checkbox input').click(highlightChecked);
@@ -38,8 +60,8 @@ $(document).ready(function() {
var truncatedSha = commitSha.toString().substr(0, 7);
// revert action
$.GollumDialog.init({
title: 'Revert to ' + truncatedSha + '?',
body: 'Are you sure you wish to revert to commit <code>' +
title: 'Reset to ' + truncatedSha + '?',
body: 'Are you sure you wish to reset to commit <code>' +
truncatedSha + '</code>' +
' ? This will overwrite any previous changes.',
OK: function() {
@@ -15,7 +15,6 @@
<script type="text/javascript" src="/javascript/gollum.js"></script>
<script type="text/javascript" src="/javascript/gollum.dialog.js"></script>
<script type="text/javascript" src="/javascript/gollum.placeholder.js"></script>
<script type="text/javascript" src="/javascript/gollum.fx.js"></script>
<script type="text/javascript"
src="/javascript/gollum-editor/gollum.editor.js"></script>
@@ -2,6 +2,7 @@
<div id="head">
<h1>{{title}}</h1>
<ul class="actions">
<li class="minibutton"><a href="#" id="minibutton-new-page">New Page</a></li>
<li class="minibutton"><a href="/edit/{{escaped_name}}"
class="action-edit-page">Edit Page</a></li>
<li class="minibutton"><a href="/history/{{escaped_name}}"