Bug fixes
This commit is contained in:
parent
83ec140297
commit
c10e09c5f9
@ -2,7 +2,7 @@
|
||||
|
||||
<?php makeNavbar('users'); ?>
|
||||
|
||||
<form method="post" action="" class="forms">
|
||||
<form method="post" action="" class="forms" autocomplete="off">
|
||||
<label>
|
||||
<?php $Language->p('Username') ?>
|
||||
<input type="text" name="username" class="width-50" value="<?php echo (isset($_POST['username'])?$_POST['username']:'') ?>">
|
||||
|
@ -333,7 +333,9 @@ function install($adminPassword, $email)
|
||||
PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
|
||||
$dataHead.json_encode(
|
||||
array(
|
||||
'position'=>0
|
||||
'position'=>0,
|
||||
'tabSize'=>4,
|
||||
'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
|
||||
),
|
||||
JSON_PRETTY_PRINT),
|
||||
LOCK_EX
|
||||
|
@ -67,12 +67,16 @@ class dbTags extends dbJSON
|
||||
$tagName = trim($tagName);
|
||||
$tagKey = Text::cleanUrl($tagName);
|
||||
|
||||
if( isset($tagsIndex[$tagKey]) ) {
|
||||
array_push($tagsIndex[$tagKey]['posts'], $postKey);
|
||||
}
|
||||
else {
|
||||
$tagsIndex[$tagKey]['name'] = $tagName;
|
||||
$tagsIndex[$tagKey]['posts'] = array($postKey);
|
||||
// If the tag is not empty.
|
||||
if(Text::isNotEmpty($tagName))
|
||||
{
|
||||
if( isset($tagsIndex[$tagKey]) ) {
|
||||
array_push($tagsIndex[$tagKey]['posts'], $postKey);
|
||||
}
|
||||
else {
|
||||
$tagsIndex[$tagKey]['name'] = $tagName;
|
||||
$tagsIndex[$tagKey]['posts'] = array($postKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,29 +52,6 @@ class Text {
|
||||
return $text;
|
||||
}
|
||||
|
||||
/*
|
||||
public static function cleanUrl($string, $separator='-')
|
||||
{
|
||||
// Delete characters
|
||||
$string = str_replace(array("“", "”", "!", "*", "'", """, "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]", "|"),'',$string);
|
||||
$string = preg_replace('![^\\pL\d]+!u', $separator, $string);
|
||||
|
||||
// Remove spaces
|
||||
$string = str_replace(' ',$separator, $string);
|
||||
|
||||
//remove any additional characters that might appear after translit
|
||||
//$string = preg_replace('![^-\w]+!', '', $string);
|
||||
|
||||
// Replace multiple dashes
|
||||
$string = preg_replace('/-{2,}/', $separator, $string);
|
||||
|
||||
// Make a string lowercase
|
||||
$string = self::lowercase($string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
*/
|
||||
|
||||
public static function cleanUrl($string, $separator='-')
|
||||
{
|
||||
if(function_exists('iconv')) {
|
||||
@ -181,4 +158,4 @@ class Text {
|
||||
$string);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
4
plugins/simplemde/css/simplemde.min.css
vendored
4
plugins/simplemde/css/simplemde.min.css
vendored
File diff suppressed because one or more lines are too long
17
plugins/simplemde/js/simplemde.min.js
vendored
17
plugins/simplemde/js/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -8,5 +8,8 @@
|
||||
"website": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
||||
"version": "0.1",
|
||||
"releaseDate": "2015-08-27"
|
||||
}
|
||||
},
|
||||
"toolbar": "Toolbar",
|
||||
"tab-size": "Tab size"
|
||||
|
||||
}
|
@ -9,10 +9,33 @@ class pluginsimpleMDE extends Plugin {
|
||||
'edit-page'
|
||||
);
|
||||
|
||||
public function adminHead()
|
||||
public function init()
|
||||
{
|
||||
$this->dbFields = array(
|
||||
'tabSize'=>'2',
|
||||
'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
|
||||
);
|
||||
}
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $Site;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$Language->get('Toolbar').'</label>';
|
||||
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Tab size').'</label>';
|
||||
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getDbField('tabSize').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function adminHead()
|
||||
{
|
||||
global $layout;
|
||||
|
||||
$html = '';
|
||||
@ -20,16 +43,20 @@ class pluginsimpleMDE extends Plugin {
|
||||
// Load CSS and JS only on Controllers in array.
|
||||
if(in_array($layout['controller'], $this->loadWhenController))
|
||||
{
|
||||
$language = $Site->shortLanguage();
|
||||
// Path plugin.
|
||||
$pluginPath = $this->htmlPath();
|
||||
|
||||
// Load CSS
|
||||
$html .= '<link rel="stylesheet" href="'.$pluginPath.'css/simplemde.min.css">';
|
||||
|
||||
// Load Javascript
|
||||
$html .= '<script src="'.$pluginPath.'js/simplemde.min.js"></script>';
|
||||
|
||||
//$html = '<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">';
|
||||
//$html .= '<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">';
|
||||
//$html .= '<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>';
|
||||
|
||||
// Hack for Bludit
|
||||
$html .= '<style>
|
||||
.editor-toolbar::before { margin-bottom: 2px !important }
|
||||
.editor-toolbar::after { margin-top: 2px !important }
|
||||
</style>';
|
||||
|
||||
}
|
||||
|
||||
@ -38,8 +65,6 @@ class pluginsimpleMDE extends Plugin {
|
||||
|
||||
public function adminBodyEnd()
|
||||
{
|
||||
global $Language;
|
||||
global $Site;
|
||||
global $layout;
|
||||
|
||||
$html = '';
|
||||
@ -47,7 +72,6 @@ class pluginsimpleMDE extends Plugin {
|
||||
// Load CSS and JS only on Controllers in array.
|
||||
if(in_array($layout['controller'], $this->loadWhenController))
|
||||
{
|
||||
$language = $Site->shortLanguage();
|
||||
$pluginPath = $this->htmlPath();
|
||||
|
||||
$html = '<script>$(document).ready(function() { ';
|
||||
@ -60,12 +84,13 @@ class pluginsimpleMDE extends Plugin {
|
||||
autofocus: false,
|
||||
lineWrapping: false,
|
||||
indentWithTabs: true,
|
||||
tabSize: 4,
|
||||
spellChecker: false
|
||||
tabSize: '.$this->getDbField('tabSize').',
|
||||
spellChecker: false,
|
||||
toolbar: ['.Sanitize::htmlDecode($this->getDbField('toolbar')).']
|
||||
});';
|
||||
$html .= '}); </script>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user