Commit d9609e44 by Aleksandar Hristov

added sub-section templates in tinymce

1 parent 2ad2c705
......@@ -21,18 +21,20 @@ $db = new SQLite3('wiki.db');
$url=$_SERVER['REQUEST_URI'];
//gotta solve this, it's not certain that there's a page with id=1
//if there's no "?page#id" string in the URL then show the page with the lowest ID from the database (should be the first created one)
if (strpos($url, '?') === false)
{
$current_page=$db->querySingle("SELECT MIN (id) FROM pages");
}
//else if there's "?page#id" string in the URL get the page
else
{
$current_page = explode ('?', $url);
$current_page=$current_page[1];
}
//assign smarty variables and display the index.tpl
$smarty->assign("current_page", $current_page);
$smarty->assign("page_id", main_page("page_id", $current_page));
$smarty->assign("page_title", main_page("page_title", $current_page));
......
......@@ -144,3 +144,15 @@ label
width: 100%;
height: 100%;
}
.sub-title
{
margin-left:10px;
font-size: 20px;
}
.sub-sub-title
{
margin-left:20px;
font-size: 18px;
}
\ No newline at end of file
......@@ -6,8 +6,6 @@ $("p").addClass('editable');
$("img").addClass('img-responsive');
//Sidebar dropdown; it allows sub-menus to drop on click
( function( $ ) {
$( document ).ready(function() {
......
......@@ -27,8 +27,9 @@
<ul>
<li>Choose what element you want to edit (page or section);</li>
<li>Choose the specific element you want to edit (the search field is your friend!);</li>
<li>Give it a new title if needed;</li>
<li>Type the new text using Markdown Extra (cheat sheet shown below);</li>
<li>Click the "Edit" button to open the Editor;</li>
<li>Give the page/section a new title if needed;</li>
<li>Type the new text;</li>
<li>Click the "Submit" button.</li>
</ul>
<h5>3. Removing a page/section</h5>
......
......@@ -39,6 +39,18 @@
tinymce.init({
selector: "textarea",
height: 500,
browser_spellcheck : true,
templates : [
{
title: "Sub-section title",
url: "tpl/tinymce_templates/sub-title.html",
description: "Enter the number in front (e.g. 2.7 Test) and add it in the id='' part of its source code."
},
{
title: "Sub-sub-section title",
url: "tpl/tinymce_templates/sub-sub-title.html",
description: "Enter the number in front (e.g. 2.7.7 Test) and add it in the id='' part of its source code."
}],
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!