Commit d9609e44 by Aleksandar Hristov

added sub-section templates in tinymce

1 parent 2ad2c705
...@@ -21,18 +21,20 @@ $db = new SQLite3('wiki.db'); ...@@ -21,18 +21,20 @@ $db = new SQLite3('wiki.db');
$url=$_SERVER['REQUEST_URI']; $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) if (strpos($url, '?') === false)
{ {
$current_page=$db->querySingle("SELECT MIN (id) FROM pages"); $current_page=$db->querySingle("SELECT MIN (id) FROM pages");
} }
//else if there's "?page#id" string in the URL get the page
else else
{ {
$current_page = explode ('?', $url); $current_page = explode ('?', $url);
$current_page=$current_page[1]; $current_page=$current_page[1];
} }
//assign smarty variables and display the index.tpl
$smarty->assign("current_page", $current_page); $smarty->assign("current_page", $current_page);
$smarty->assign("page_id", main_page("page_id", $current_page)); $smarty->assign("page_id", main_page("page_id", $current_page));
$smarty->assign("page_title", main_page("page_title", $current_page)); $smarty->assign("page_title", main_page("page_title", $current_page));
......
...@@ -144,3 +144,15 @@ label ...@@ -144,3 +144,15 @@ label
width: 100%; width: 100%;
height: 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 \ No newline at end of file
...@@ -6,8 +6,6 @@ $("p").addClass('editable'); ...@@ -6,8 +6,6 @@ $("p").addClass('editable');
$("img").addClass('img-responsive'); $("img").addClass('img-responsive');
//Sidebar dropdown; it allows sub-menus to drop on click //Sidebar dropdown; it allows sub-menus to drop on click
( function( $ ) { ( function( $ ) {
$( document ).ready(function() { $( document ).ready(function() {
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
<ul> <ul>
<li>Choose what element you want to edit (page or section);</li> <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>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>Click the "Edit" button to open the Editor;</li>
<li>Type the new text using Markdown Extra (cheat sheet shown below);</li> <li>Give the page/section a new title if needed;</li>
<li>Type the new text;</li>
<li>Click the "Submit" button.</li> <li>Click the "Submit" button.</li>
</ul> </ul>
<h5>3. Removing a page/section</h5> <h5>3. Removing a page/section</h5>
......
...@@ -39,6 +39,18 @@ ...@@ -39,6 +39,18 @@
tinymce.init({ tinymce.init({
selector: "textarea", selector: "textarea",
height: 500, 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: [ plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak", "advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code", "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!