<html>
<head>
- <title><!--~$title show {~-->~$host~ Admin: <!--~listings once_if {~-->Pages Listing<!--~}~--><!--~form {~--><!--~id {~-->Add a new page<!--~}~--><!--~id unset {~-->Edit page "~title html~"<!--~}~--><!--~}~--><!--~}~--></title>
+ <title><!--~$title show {~-->~$host~ Admin: <!--~listing {~-->Manage Pages<!--~}~--><!--~form {~--><!--~id unset {~-->Add a new page<!--~}~--><!--~id {~-->Edit page "~title html~"<!--~}~--><!--~}~--><!--~}~--></title>
<!--~$head {~-->
- <script src="inc/ckeditor/ckeditor.js"></script>
+ <script src="inc/ckeditor/ckeditor.js?t=F0RD"></script>
<style>
/* icon in cke buttons */
.cke_button_icon.cke_button__wfpl_images_icon {
- background-image: url(/inc/ckeditor/plugins/icons.png?t=D5AC);
- background-position: 0 -1504px;
+ background-image: url(/inc/ckeditor/plugins/icons.png?t=F0RD);
+ background-position: 0 -936px;
}
.cke_wfpl_images_dialog * {
white-space: normal !important;
</style>
<script>
window.cke_wfpl_images = {
- images: [~wfpl_images {~
- {
- thumb: "~image thumb_src jsdq~",
- image: "~image image_src jsdq~",
- image_width: ~image image_width~,
- image_height: ~image image_height~,
- sizes: "~sizes jsdq~",
- caption: "~caption jsdq~"
- }~ sep {~,~}~~}~
- ],
+ images: ~wfpl_images_json~,
next_id: 0,
selected: [],
editors: []
};
+ var enc_html = function(str) {
+ return str.replace(/[<>&]/g, function(i) { return '&#' + i.charCodeAt(0) + ';'; });
+ };
function cke_wfpl_images_thumb_click(plugin_id, element, image_id) {
var thumbs = element.parentNode.children;
var i, thumb;
width = image.image_width;
height = image.image_height;
src = image.image;
- caption = image.caption;
- if (caption == '') {
+ if (image.caption == '') {
caption = ' ';
+ } else {
+ caption = enc_html(image.caption);
}
if (align != 'full') {
var wh = size.split('x');
size = '' + wh[0] + '-' + wh[1]; // dash instead of x
src = src.substr(0, src.length - 4) + '-' + size + src.substr(src.length - 4);
}
+ height += 4;
code += ' style="background-image: url(/' + src + ');';
code += ' width: ' + width + 'px;';
code += ' padding-top: ' + height + 'px;';
toolbar: 'insert'
});
CKEDITOR.dialog.add('wfpl_images_dialog', function (api) {
+ var i, im, selected, thumbs;
+ selected = 'selected ';
+ thumbs = '<div class="cke_wfpl_thumbs">'
+ for (i in window.cke_wfpl_images.images) {
+ im = window.cke_wfpl_images.images[i];
+ thumbs += '<div class="'+selected+'cke_wfpl_thumb" onclick="return window.cke_wfpl_images_thumb_click('+plugin_id+', this, '+im.id+')" style="background-image: url('+im.thumb+')">'+ enc_html(im.name.length > 0 ? im.name : im.caption) + '</div>';
+ selected = '';
+ }
+ thumbs += '</div>'
return {
title: 'Insert Image',
minWidth: 700,
type: 'html',
html: '<div class="cke_wfpl_images_dialog">'
+ '<h3>Step 1: Choose an image to insert:</h3>'
- + "<div class=\"cke_wfpl_thumbs\">~wfpl_images {~ <div class=\"~ first {~selected ~}~cke_wfpl_thumb\" onclick=\"return window.cke_wfpl_images_thumb_click("+plugin_id+", this, ~id~)\" style=\"background-image: url(~image thumb_src attr jsdq~)\">~caption empty {~~name html jsdq~~}~~caption nonempty {~~caption html jsdq~~}~</div>~}~</div>"
+ + thumbs
+ '<p>If you\'d like to insert an image not shown above, you can <a href="admin_images?new=1" target="_blank">upload it here</a>. Sorry, it won\'t appear here until you reload this editor page (hit Save below, then "edit this page" again.)</p>'
+ '</div>'
}
{ name: 'Subsection Headline', element: 'h3'},
{ name: 'Tagline (under headline)', element: 'h4', attributes: { class: 'tagline'}},
{ name: 'Quote', element: 'p', attributes: { class: 'quote'}},
- { name: 'Quote Author', element: 'p', attributes: { class: 'attrib'}}
+ { name: 'Quote Author', element: 'p', attributes: { class: 'attrib'}},
+ { name: 'div (generic box)', element: 'div'}
],
'uiColor': '#ccccff',
'removePlugins': 'forms,templates,smiley,pagebreak,save,newpage,preview,print',
<!--~$body show {~-->
<!--~form {~-->
+ <h1>~$host~ Admin Control Panel</h1>
+
<h2><!--~id unset {~-->Add a new page<!--~}~--><!--~id {~-->Edit page "~title html~"<!--~}~--></h2>
<form action="admin_pages" method="post"><!--~id {~--><div style="display: none"><input type="hidden" name="edit_id" value="~id attr~"></div><!--~}~-->
<div class="field_notes">(<!--~editing {~-->Careful: if you change this, be sure to update all links to this page<!--~}~--><!--~editing unset {~-->Please use only a-z, 0-9 and _ (underscore) in your filename. Please, no capitals, punctuation or spaces.<!--~}~-->)</div>
<div class="field"><input type="text" name="filename" value="~filename attr~"></div>
- <div class="caption">Show in navigation links</div>
- <div class="field_notes">(On the left of every page.)</div>
+ <div class="caption">Show in site-wide navigation links (optional)</div>
<div class="field"><select name="navbar"><!--~navbar options~--></select></div>
<div class="caption">Navigation Link Text</div>
</div>
<div class="field"><textarea class="html_editor" rows="20" cols="50" id="content" name="content">~content html~</textarea><script>make_wysiwyg('content');</script></div>
+ <!--
<div class="caption">Description</div>
<div class="field_notes">(Hidden description of this page, primarily for search engines.)</div>
<div class="field"><textarea rows="9" cols="22" name="description">~description html~</textarea></div>
<div class="caption">Keywords</div>
<div class="field_notes">(Hidden words (up to 30) with commas between them for search engines)</div>
<div class="field"><textarea rows="9" cols="22" name="keywords">~keywords html~</textarea></div>
+ -->
<div class="caption"> </div>
<div class="field"><input type="submit" name="save" value="Save"></div>
<div class="field"><a href="~filename nonempty {~~filename attr~~}~~filename empty {~admin_pages~id {~?id=~id~~}~~}~">Cancel</a></div>
<!--~}~-->
- <!--~listings once {~-->
- <!--~listings once_if {~-->
+ <!--~listing {~-->
+ <h1>~$host~ Admin Control Panel</h1>
+ <h2>Manage Pages</h2>
+
+ <!--~rows once_if {~-->
<p><a href="admin_pages?new=1">[Add a new page]</a></p>
<table cellspacing="0" cellpadding="4" border="0" summary="" class="evenodd">
- <tr><th>Title</th><th>Filename</th><th> </th></tr>
- <!--~listings {~-->
<tr>
- <td class="listing"><a href="admin_pages?edit_id=~id~">~title html~<!--~title empty {~--><em>(untitled)</em><!--~}~--></a></td>
+ <th><a href="?sort=~sorting-by-filename~filename">Filename</a></th>
+ <th><a href="?sort=~sorting-by-title~title">Title</a></th>
+ <th> </th>
+ </tr><!--~rows {~-->
+ <tr>
<td class="listing"><a href="admin_pages?edit_id=~id~">~filename html~<!--~filename empty {~--><em>(offline)</em><!--~}~--></a></td>
- <td><a href="admin_pages?admin_pages_delete_id=~id~" onclick="return confirm('Permanently delete?')">[delete this page]</a></td>
- </tr>
- <!--~}~-->
+ <td class="listing"><a href="admin_pages?edit_id=~id~">~title html~<!--~title empty {~--><em>(untitled)</em><!--~}~--></a></td>
+ <td><a href="admin_pages?admin_pages_delete_id=~id~" onclick="return confirm('Permanently delete?')">[delete]</a></td>
+ </tr><!--~}~-->
</table>
<!--~}~-->
- <!--~listings once_else {~-->
+ <!--~rows once_else {~-->
<p>No pages in database.</p>
<!--~}~-->