HTML code editor for not rich edition
|
|
@ -66,10 +66,15 @@ if ($user->isAuthenticated()) {
|
|||
$_POST["description"] = addslashes($_POST["description"]);
|
||||
}
|
||||
|
||||
/*
|
||||
$textile = new Textile();
|
||||
|
||||
$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"],true));
|
||||
$_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
|
||||
*/
|
||||
|
||||
$_POST["title"] = removeBadTags($_POST["title"],true);
|
||||
$_POST["description"] = removeBadTags($_POST["description"]);
|
||||
|
||||
if (isset($_POST["id_post"])) {
|
||||
$tumble->modifyPost($_POST, $_POST["id_post"]);
|
||||
|
|
@ -112,12 +117,29 @@ if ($user->isAuthenticated()) {
|
|||
if($conf->richText) {
|
||||
?>
|
||||
<script src="<?php echo $conf->urlGelato;?>/admin/scripts/nicEdit.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
bkLib.onDomLoaded(nicEditors.allTextAreas);
|
||||
</script>
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/jquery.markitup.pack.js"></script>
|
||||
<script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/set.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/skins/simple/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/style.css" />
|
||||
|
||||
<script type="text/javascript" >
|
||||
$(document).ready(function() {
|
||||
$("#description").markItUp(my_html);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
|
||||
@import "<?php echo $conf->urlGelato;?>/admin/css/lightbox.css";
|
||||
|
|
@ -292,11 +314,16 @@ if ($user->isAuthenticated()) {
|
|||
?>
|
||||
<p>
|
||||
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
|
||||
<a href="http://hobix.com/textile/">Textile</a> <?php echo __("syntax is supported.")?>
|
||||
<br />
|
||||
Bookmarklet - <a href="javascript:var w; setTimeout('w.focus()',100);w=window.open('<?php echo $conf->urlGelato; ?>/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(window.getSelection()),'bookmarklet','toolbar=0,resizable=0,status=1,width=650,height=460,dependent=yes' ); w.focus();"><?php echo __("add to gelato")?></a>
|
||||
</span>
|
||||
</p>
|
||||
<?php echo __("Some HTML allowed")?>:<br />
|
||||
|
||||
<code>
|
||||
<strong> <em> <del> <ul> <ol> <li> <a>
|
||||
<br />
|
||||
<blockquote>
|
||||
<code> <pre> <img>
|
||||
<code>
|
||||
<br />
|
||||
Bookmarklet - <a href="javascript:var w; setTimeout('w.focus()',100);w=window.open('<?php echo $conf->urlGelato; ?>/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(window.getSelection()),'bookmarklet','toolbar=0,resizable=0,status=1,width=650,height=460,dependent=yes' ); w.focus();"><?php echo __("add to gelato")?></a> </span> </p>
|
||||
<p>
|
||||
<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
|
||||
</p>
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 304 B |
|
After Width: | Height: | Size: 667 B |
|
After Width: | Height: | Size: 859 B |
|
After Width: | Height: | Size: 567 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 304 B |
|
After Width: | Height: | Size: 306 B |
|
After Width: | Height: | Size: 293 B |
|
After Width: | Height: | Size: 304 B |
|
After Width: | Height: | Size: 310 B |
|
After Width: | Height: | Size: 516 B |
|
After Width: | Height: | Size: 223 B |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 344 B |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 357 B |
|
After Width: | Height: | Size: 650 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 606 B |
|
After Width: | Height: | Size: 537 B |
|
After Width: | Height: | Size: 743 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 273 B |
|
After Width: | Height: | Size: 957 B |
|
|
@ -0,0 +1,35 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// markItUp!
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2008 Jay Salvat
|
||||
// http://markitup.jaysalvat.com/
|
||||
// ----------------------------------------------------------------------------
|
||||
// Html tags
|
||||
// http://en.wikipedia.org/wiki/html
|
||||
// ----------------------------------------------------------------------------
|
||||
// Basic set. Feel free to add more tags
|
||||
// ----------------------------------------------------------------------------
|
||||
my_html = {
|
||||
nameSpace: "my_html", // Used to prevent multi-instances CSS conflict
|
||||
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
|
||||
onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
|
||||
onTab: {keepDefault:false, openWith:' '},
|
||||
markupSet: [
|
||||
{name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
|
||||
{separator:'---------------' },
|
||||
{name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
|
||||
{name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
|
||||
{name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
|
||||
{separator:'---------------' },
|
||||
{name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n' },
|
||||
{name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n' },
|
||||
{name:'Li', openWith:'<li>', closeWith:'</li>' },
|
||||
{separator:'---------------' },
|
||||
{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
|
||||
{separator:'---------------' },
|
||||
{name:'Quote block', openWith:'<blockquote>\n', closeWith:'</blockquote>\n' },
|
||||
{name:'Code block', openWith:'<code>\n', closeWith:'</code>\n' },
|
||||
{separator:'---------------' },
|
||||
{name:'Clean', replaceWith:function(h) { return h.selection.replace(/<(.*?)>/g, "") } }
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* -------------------------------------------------------------------
|
||||
// markItUp!
|
||||
// By Jay Salvat - http://markitup.jaysalvat.com/
|
||||
// ------------------------------------------------------------------*/
|
||||
.markItUpButton1 a {
|
||||
background-image:url(images/paragraph.png);
|
||||
}
|
||||
.markItUpButton2 a {
|
||||
background-image:url(images/bold.png);
|
||||
}
|
||||
.markItUpButton3 a {
|
||||
background-image:url(images/italic.png);
|
||||
}
|
||||
.markItUpButton4 a {
|
||||
background-image:url(images/stroke.png);
|
||||
}
|
||||
.markItUpButton5 a {
|
||||
background-image:url(images/list-bullet.png);
|
||||
}
|
||||
.markItUpButton6 a {
|
||||
background-image:url(images/list-numeric.png);
|
||||
}
|
||||
.markItUpButton7 a {
|
||||
background-image:url(images/list-item.png);
|
||||
}
|
||||
|
||||
.markItUpButton8 a {
|
||||
background-image:url(images/link.png);
|
||||
}
|
||||
.markItUpButton9 a {
|
||||
background-image:url(images/quotes.png);
|
||||
}
|
||||
.markItUpButton10 a {
|
||||
background-image:url(images/code.png);
|
||||
}
|
||||
|
||||
.markItUpButton11 a {
|
||||
background-image:url(images/clean.png);
|
||||
}
|
||||
|
After Width: | Height: | Size: 258 B |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 240 B |
|
|
@ -0,0 +1,131 @@
|
|||
#poststuff {
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
#submitpost {
|
||||
position: absolute !important;
|
||||
right: 0px !important;
|
||||
float: none !important;
|
||||
}
|
||||
|
||||
.markItUp * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
.markItUp a:link,
|
||||
.markItUp a:visited {
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
}
|
||||
.markItUp {
|
||||
width:700px;
|
||||
margin:5px 0 5px 0;
|
||||
}
|
||||
.markItUpContainer {
|
||||
font:11px Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.markItUpEditor {
|
||||
font:12px 'Courier New', Courier, monospace;
|
||||
padding:5px;
|
||||
width:690px;
|
||||
height:320px;
|
||||
clear:both; display:block;
|
||||
line-height:18px;
|
||||
overflow:auto;
|
||||
}
|
||||
.markItUpPreviewFrame {
|
||||
overflow:auto;
|
||||
background-color:#FFF;
|
||||
width:99.9%;
|
||||
height:300px;
|
||||
margin:5px 0;
|
||||
}
|
||||
.markItUpFooter {
|
||||
width:100%;
|
||||
}
|
||||
.markItUpResizeHandle {
|
||||
overflow:hidden;
|
||||
width:22px; height:5px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
background-image:url(images/handle.png);
|
||||
cursor:n-resize;
|
||||
}
|
||||
/***************************************************************************************/
|
||||
/* first row of buttons */
|
||||
.markItUpHeader ul li {
|
||||
list-style:none;
|
||||
float:left;
|
||||
position:relative;
|
||||
}
|
||||
.markItUpHeader ul li:hover > ul{
|
||||
display:block;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu {
|
||||
background:transparent url(images/menu.png) no-repeat 115% 50%;
|
||||
margin-right:5px;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu li {
|
||||
margin-right:0px;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:18px; left:0px;
|
||||
background:#FFF;
|
||||
border:1px solid #000;
|
||||
}
|
||||
.markItUpHeader ul ul li {
|
||||
float:none;
|
||||
border-bottom:1px solid #000;
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpDropMenu {
|
||||
background:#FFF url(images/submenu.png) no-repeat 100% 50%;
|
||||
}
|
||||
.markItUpHeader ul .markItUpSeparator {
|
||||
margin:0 10px;
|
||||
width:1px;
|
||||
height:16px;
|
||||
overflow:hidden;
|
||||
background-color:#CCC;
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpSeparator {
|
||||
width:auto; height:1px;
|
||||
margin:0px;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul ul {
|
||||
position:absolute;
|
||||
top:-1px; left:150px;
|
||||
}
|
||||
.markItUpHeader ul ul ul li {
|
||||
float:none;
|
||||
}
|
||||
.markItUpHeader ul a {
|
||||
display:block;
|
||||
width:16px; height:16px;
|
||||
text-indent:-10000px;
|
||||
background-repeat:no-repeat;
|
||||
padding:3px;
|
||||
margin:0px;
|
||||
}
|
||||
.markItUpHeader ul ul a {
|
||||
display:block;
|
||||
padding-left:0px;
|
||||
text-indent:0;
|
||||
width:120px;
|
||||
padding:5px 5px 5px 25px;
|
||||
background-position:2px 50%;
|
||||
}
|
||||
.markItUpHeader ul ul a:hover {
|
||||
color:#FFF;
|
||||
background-color:#000;
|
||||
}
|
||||
|
|
@ -403,7 +403,7 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
if($secure){
|
||||
$validTags ='<abbr><acronym><em><i><strong><b><span>';
|
||||
} else {
|
||||
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strong><b><br><span><div><img>';
|
||||
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strong><b><del><br><span><div><img>';
|
||||
}
|
||||
$source = strip_tags($source, $validTags);
|
||||
return preg_replace('/<(.*?)>/ie', "'<'.removeBadAtributes('\\1').'>'", $source);
|
||||
|
|
|
|||