Commit 69fefce9 by Aleksandar Hristov

Some changes left from earlier

1 parent bee2eb2f
......@@ -43,7 +43,7 @@ else
if($to_edit == "page")
{
//get the old title of the page (currently in the database) we want to edit
$page_to_edit = $_POST['old_title'];
$page_to_edit = urldecode($_POST['old_title']);
//if theres no title value display the failure template with the error message
if(empty($page_to_edit))
......@@ -104,7 +104,7 @@ else
$id = $db->querySingle("SELECT id FROM sections WHERE page_id = '$page_id' AND title = '$section_to_edit'");
//get the new values for the text and title and update the row for this section in the database
$title = $_POST['new_title'];
$title = urldecode($_POST['new_title']);
$text = $db->escapeString($_POST['new_text']);
$query = $db->exec("UPDATE sections SET title = '$title', text = '$text' WHERE id = '$id'");
......
......@@ -35,7 +35,7 @@ if($to_edit == "page")
{
//assign the old text, page_id, old title etc. and display the editor template
$page_to_edit = $_POST['page_to_edit'];
$smarty->assign("old_title", $page_to_edit);
$smarty->assign("old_title", urlencode($page_to_edit));
$old_text = $db->querySingle("SELECT text FROM pages WHERE title='$page_to_edit'");
$smarty->assign("old_text", $old_text);
$smarty->assign("page_id", "");
......
......@@ -113,20 +113,6 @@ label
box-shadow: none;
}
#textarea1, #textarea2
{
margin-bottom:20px;
margin-top:20px;
resize:none;
height:200px;
}
.editor-icon
{
cursor: pointer !important;
padding-right:10px !important;
}
.responsive-video {
position: relative;
......@@ -206,4 +192,4 @@ label
.navbar-default .navbar-nav .open .dropdown-menu > li > a, .navbar-default .navbar-nav .open .dropdown-menu > li > a
{
color:#fff;
}
\ No newline at end of file
}
/**
* plugin.js
*
* Copyright, Dmitry A Karasev (dima at karasev dot pro)
*
*/
/*global tinymce:true */
tinymce.PluginManager.add("fieldsetcontrols", function(editor) {
editor.addButton("addfieldset", {
text: "+FieldSet",
icon: false,
tooltip: "Insert/edit fieldset",
onclick: function() {
var data = {};
var selection = editor.selection;
var dom = editor.dom;
var selectedElm, anchorElm;
selectedElm = selection.getNode();
anchorElm = dom.getParent(selectedElm,"fieldset");
data.class = "";
data.legend = "";
if(anchorElm) {
data.class = anchorElm.className;
if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
data.legend = anchorElm.firstChild.innerText;
}
}
}
editor.windowManager.open({
title: "Insert/edit fieldset",
data: data,
body: [
{ type: "textbox", name: "legend", label: "Legend" },
{ type: "listbox", name: "class", label: "Class", values: [{text:"None",value:""},{text:"spoiler",value:"spoiler"}] }
],
width: 600,
height: 130,
onsubmit: function(e) {
data = tinymce.extend(data,e.data);
data.legend = data.legend ? data.legend : "Legend";
var fieldsetAttrs = {
class: data.class ? data.class : null
};
if(anchorElm) {
editor.focus();
dom.setAttribs(anchorElm,fieldsetAttrs);
if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
anchorElm.firstChild.innerText = data.legend;
}
else {
anchorElm.insertBefore(dom.create("legend",null,data.legend),anchorElm.firstChild);
}
}
else {
dom.add(anchorElm,"legend",null,data.legend);
dom.add(anchorElm,"p",null," ");
}
}
else {
editor.insertContent(dom.createHTML("fieldset",fieldsetAttrs,"<legend>"+data.legend+"</legend>"+selection.getContent({format:"html"})+"<p>&nbsp;</p>")+"<p>&nbsp;</p>");
}
}
});
},
stateSelector: "fieldset"
});
editor.addButton("delfieldset", {
text: "-FieldSet",
icon: false,
tooltip: "Remove fieldset",
onclick: function() {
var data = {};
var selection = editor.selection;
var dom = editor.dom;
var selectedElm, anchorElm;
selectedElm = selection.getNode();
anchorElm = dom.getParent(selectedElm,"fieldset");
if(anchorElm) {
editor.focus();
if(dom.isEmpty(selectedElm) && anchorElm.lastChild==selectedElm) {
if(anchorElm.firstChild!=selectedElm) {
dom.insertAfter(selectedElm,anchorElm);
selection.setCursorLocation(selectedElm,0);
}
else {
if(anchorElm.firstChild.nodeName=="LEGEND") {
dom.rename(anchorElm.firstChild,"p");
}
dom.remove(anchorElm,true);
}
}
else if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
dom.rename(anchorElm.firstChild,"p");
}
dom.remove(anchorElm,true);
}
}
},
stateSelector: "fieldset"
});
});
/**
* plugin.js
*
* Copyright, Dmitry A Karasev (dima at karasev dot pro)
*
*/
/*global tinymce:true */
tinymce.PluginManager.add("fieldsetcontrols", function(editor) {
editor.addButton("addfieldset", {
text: "+FieldSet",
icon: false,
tooltip: "Insert/edit fieldset",
onclick: function() {
var data = {};
var selection = editor.selection;
var dom = editor.dom;
var selectedElm, anchorElm;
selectedElm = selection.getNode();
anchorElm = dom.getParent(selectedElm,"fieldset");
data.class = "";
data.legend = "";
if(anchorElm) {
data.class = anchorElm.className;
if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
data.legend = anchorElm.firstChild.innerText;
}
}
}
editor.windowManager.open({
title: "Insert/edit fieldset",
data: data,
body: [
{ type: "textbox", name: "legend", label: "Legend" },
{ type: "listbox", name: "class", label: "Class", values: [{text:"None",value:""},{text:"spoiler",value:"spoiler"}] }
],
width: 600,
height: 130,
onsubmit: function(e) {
data = tinymce.extend(data,e.data);
data.legend = data.legend ? data.legend : "Legend";
var fieldsetAttrs = {
class: data.class ? data.class : null
};
if(anchorElm) {
editor.focus();
dom.setAttribs(anchorElm,fieldsetAttrs);
if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
anchorElm.firstChild.innerText = data.legend;
}
else {
anchorElm.insertBefore(dom.create("legend",null,data.legend),anchorElm.firstChild);
}
}
else {
dom.add(anchorElm,"legend",null,data.legend);
dom.add(anchorElm,"p",null,"&nbsp;");
}
}
else {
editor.insertContent(dom.createHTML("fieldset",fieldsetAttrs,"<legend>"+data.legend+"</legend>"+selection.getContent({format:"html"})+"<p>&nbsp;</p>")+"<p>&nbsp;</p>");
}
}
});
},
stateSelector: "fieldset"
});
editor.addButton("delfieldset", {
text: "-FieldSet",
icon: false,
tooltip: "Remove fieldset",
onclick: function() {
var data = {};
var selection = editor.selection;
var dom = editor.dom;
var selectedElm, anchorElm;
selectedElm = selection.getNode();
anchorElm = dom.getParent(selectedElm,"fieldset");
if(anchorElm) {
editor.focus();
if(dom.isEmpty(selectedElm) && anchorElm.lastChild==selectedElm) {
if(anchorElm.firstChild!=selectedElm) {
dom.insertAfter(selectedElm,anchorElm);
selection.setCursorLocation(selectedElm,0);
}
else {
if(anchorElm.firstChild.nodeName=="LEGEND") {
dom.rename(anchorElm.firstChild,"p");
}
dom.remove(anchorElm,true);
}
}
else if(anchorElm.firstChild) {
if(anchorElm.firstChild.nodeName=="LEGEND") {
dom.rename(anchorElm.firstChild,"p");
}
dom.remove(anchorElm,true);
}
}
},
stateSelector: "fieldset"
});
});
<!----------------------------------------------------- Sidebar ---------------------------------------------------->
<!----------------------------------------------------- Admin Sidebar ---------------------------------------------------->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
......
......@@ -11,20 +11,6 @@
</div>
<div id="page-content-wrapper">
<div class="pull-right">
<!-- In this table we display the date and time (desktop devices only) -->
<table id="datetime">
<tr>
<td id="date-container">
<span id="day"></span><br><span id="datetime-number">&nbsp;<span id="datum">&nbsp;</span>&nbsp;</span><span id="month">&nbsp;</span>&nbsp;
</td>
<td id="time-container">
<span id="hour">&nbsp;</span>&nbsp;:&nbsp;<span id="minute">&nbsp;</span>
</td>
</tr>
</table>
</div>
<div id="container2">
<h1 id="container2-header">Slimspots Wiki - Create</h1>
</div>
......
......@@ -10,20 +10,6 @@
</div>
<div id="page-content-wrapper">
<div class="pull-right">
<!-- In this table we display the date and time (desktop devices only) -->
<table id="datetime">
<tr>
<td id="date-container">
<span id="day"></span><br><span id="datetime-number">&nbsp;<span id="datum">&nbsp;</span>&nbsp;</span><span id="month">&nbsp;</span>&nbsp;
</td>
<td id="time-container">
<span id="hour">&nbsp;</span>&nbsp;:&nbsp;<span id="minute">&nbsp;</span>
</td>
</tr>
</table>
</div>
<div id="container2">
<h1 id="container2-header">Error!</h1>
</div>
......
......@@ -36,10 +36,36 @@
<script type="text/javascript" src="static/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
var viewportwidth;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined')
{
viewportwidth = window.innerWidth
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
{
viewportwidth = document.documentElement.clientWidth
}
// older versions of IE
else
{
viewportwidth = document.getElementsByTagName('body')[0].clientWidth
}
tinymce.init({
selector: "textarea",
height: 500,
browser_spellcheck : true,
plugin_preview_width : viewportwidth,
templates : [
{
title: "Sub-section title",
......@@ -57,7 +83,7 @@
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern autosave"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons fontsizeselect",
toolbar1: "insertfile undo redo print preview | media link image emoticons | bold italic forecolor backcolor fontsizeselect | alignleft aligncenter alignright alignjustify outdent indent | bullist numlist | charmap searchreplace visualblocks visualchars template",
content_css : ["static/bootstrap/css/bootstrap.min.css","static/css/slimspots-wiki.css", "static/css/styles.css", "static/select2/select2.css", "static/select2/select2-bootstrap.css", "static/font-awesome/css/font-awesome.min.css"]
});
</script>
......
......@@ -48,20 +48,20 @@
</div>
<div class="col-xs-6" id="search-container">
<form name="#" method="#" action="#" class="form-search">
<input type="text" class="pull-right" name="#" id="search-rounded" placeholder="Suche">
<input type="text" class="pull-right" name="search_param" id="search-rounded" placeholder="Suche">
</form>
</div>
</div>
<div id="page-content-wrapper">
<div class="pull-right">
<!-- In this table we display the date and time (desktop devices only) -->
<table id="datetime">
<tbody>
<tr>
<td id="date-container"><span id="date-container-day"></span><br><span id="date-container-date"></span>.&nbsp;<span id="date-container-month"></span></td>
<td id="time-container"></td>
</tr>
</tbody>
</table>
</div>
\ No newline at end of file
<!--<div class="pull-right">-->
<!-- <!-- In this table we display the date and time (desktop devices only) -->
<!-- <table id="datetime">-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <td id="date-container"><span id="date-container-day"></span><br><span id="date-container-date"></span>.&nbsp;<span id="date-container-month"></span></td>-->
<!-- <td id="time-container"></td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!--</div>-->
\ No newline at end of file
......@@ -11,20 +11,6 @@
</div>
<div id="page-content-wrapper">
<div class="pull-right">
<!-- In this table we display the date and time (desktop devices only) -->
<table id="datetime">
<tr>
<td id="date-container">
<span id="day"></span><br><span id="datetime-number">&nbsp;<span id="datum">&nbsp;</span>&nbsp;</span><span id="month">&nbsp;</span>&nbsp;
</td>
<td id="time-container">
<span id="hour">&nbsp;</span>&nbsp;:&nbsp;<span id="minute">&nbsp;</span>
</td>
</tr>
</table>
</div>
<div id="container2">
<h1 id="container2-header">Slimspots Wiki - Remove</h1>
</div>
......
......@@ -10,20 +10,6 @@
</div>
<div id="page-content-wrapper">
<div class="pull-right">
<!-- In this table we display the date and time (desktop devices only) -->
<table id="datetime">
<tr>
<td id="date-container">
<span id="day"></span><br><span id="datetime-number">&nbsp;<span id="datum">&nbsp;</span>&nbsp;</span><span id="month">&nbsp;</span>&nbsp;
</td>
<td id="time-container">
<span id="hour">&nbsp;</span>&nbsp;:&nbsp;<span id="minute">&nbsp;</span>
</td>
</tr>
</table>
</div>
<div id="container2">
<h1 id="container2-header">Success!</h1>
</div>
......
......@@ -2,7 +2,7 @@
<div id="sidebar-wrapper" class="hidden-xs">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
<a href="http://slimspots.com">
<img src="static/gfx/logo.svg" class="img-responsive"/>
</a>
</li>
......@@ -30,7 +30,7 @@
</li>
{/section}
<li id="copyright">© 2013 - 2015 slimspots.com</li>
<li id="copyright">© 2015 slimspots.com</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!