remove cover image function, search plugin improvments, add search to theme alternative, tinymce css content
This commit is contained in:
parent
8f2e1c5fa2
commit
8221fbb40b
|
@ -116,6 +116,9 @@
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<img id="jscoverImagePreview" style="width: 350px; height: 200px;" class="img-thumbnail" alt="coverImagePreview" src="<?php echo (empty($coverImage) ? HTML_PATH_ADMIN_THEME_IMG.'default.svg' : $page->coverImage() ) ?>" />
|
<img id="jscoverImagePreview" style="width: 350px; height: 200px;" class="img-thumbnail" alt="coverImagePreview" src="<?php echo (empty($coverImage) ? HTML_PATH_ADMIN_THEME_IMG.'default.svg' : $page->coverImage() ) ?>" />
|
||||||
|
<div class="mt-2">
|
||||||
|
<button type="button" id="jsbuttonRemoveCoverImage" class="btn btn-primary btn-sm"><?php echo $L->g('Remove cover image') ?></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
echo Bootstrap::formTitle(array('title'=>$L->g('External Cover image')));
|
echo Bootstrap::formTitle(array('title'=>$L->g('External Cover image')));
|
||||||
|
@ -406,6 +409,11 @@ $(document).ready(function() {
|
||||||
$("#jscoverImage").val( $(this).val() );
|
$("#jscoverImage").val( $(this).val() );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsbuttonRemoveCoverImage").on("click", function() {
|
||||||
|
$("#jscoverImage").val('');
|
||||||
|
$("#jscoverImagePreview").attr('src', HTML_PATH_ADMIN_THEME_IMG+'default.svg');
|
||||||
|
});
|
||||||
|
|
||||||
// Autosave interval
|
// Autosave interval
|
||||||
// Autosave works when the content of the page is bigger than 100 characters
|
// Autosave works when the content of the page is bigger than 100 characters
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group m-0">
|
<div class="form-group m-0">
|
||||||
<button id="jsmediaManagerButton" type="button" class="mt-1 btn btn-form btn-sm d-block d-sm-inline d-sm-none" data-toggle="modal" data-target="#jsbluditMediaModal"><span class="oi oi-image"></span> <?php $L->p('Media Manager') ?></button>
|
<button id="jsmediaManagerButton" type="button" class="mt-1 btn btn-form btn-sm d-block d-sm-inline d-sm-none" data-toggle="modal" data-target="#jsbluditMediaModal"><span class="oi oi-image"></span> <?php $L->p('Images') ?></button>
|
||||||
<button id="jscategoryButton" type="button" class="mt-1 btn btn-form btn-sm" data-toggle="modal" data-target="#jscategoryModal"><span class="oi oi-tag"></span> <?php $L->p('Category') ?>: <span class="option">-</span></button>
|
<button id="jscategoryButton" type="button" class="mt-1 btn btn-form btn-sm" data-toggle="modal" data-target="#jscategoryModal"><span class="oi oi-tag"></span> <?php $L->p('Category') ?>: <span class="option">-</span></button>
|
||||||
<button id="jsdescriptionButton" type="button" class="mt-1 btn btn-form btn-sm" data-toggle="modal" data-target="#jsdescriptionModal"><span class="oi oi-tag"></span> <?php $L->p('Description') ?>: <span class="option">-</span></button>
|
<button id="jsdescriptionButton" type="button" class="mt-1 btn btn-form btn-sm" data-toggle="modal" data-target="#jsdescriptionModal"><span class="oi oi-tag"></span> <?php $L->p('Description') ?>: <span class="option">-</span></button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -92,6 +92,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img id="jscoverImagePreview" style="width: 350px; height: 200px;" class="img-thumbnail" alt="coverImagePreview" src="<?php echo HTML_PATH_ADMIN_THEME_IMG ?>default.svg" />
|
<img id="jscoverImagePreview" style="width: 350px; height: 200px;" class="img-thumbnail" alt="coverImagePreview" src="<?php echo HTML_PATH_ADMIN_THEME_IMG ?>default.svg" />
|
||||||
|
<div class="mt-2">
|
||||||
|
<button type="button" id="jsbuttonRemoveCoverImage" class="btn btn-primary btn-sm"><?php echo $L->g('Remove cover image') ?></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
echo Bootstrap::formTitle(array('title'=>$L->g('External Cover Image')));
|
echo Bootstrap::formTitle(array('title'=>$L->g('External Cover Image')));
|
||||||
|
@ -350,6 +353,11 @@ $(document).ready(function() {
|
||||||
$("#jscoverImage").val( $(this).val() );
|
$("#jscoverImage").val( $(this).val() );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsbuttonRemoveCoverImage").on("click", function() {
|
||||||
|
$("#jscoverImage").val('');
|
||||||
|
$("#jscoverImagePreview").attr('src', HTML_PATH_ADMIN_THEME_IMG+'default.svg');
|
||||||
|
});
|
||||||
|
|
||||||
// Generate slug when the user type the title
|
// Generate slug when the user type the title
|
||||||
$("#jstitle").keyup(function() {
|
$("#jstitle").keyup(function() {
|
||||||
var text = $(this).val();
|
var text = $(this).val();
|
||||||
|
|
|
@ -42,12 +42,17 @@ class Theme {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the absolute URL of the site
|
||||||
|
// Ex. https://example.com the method returns https://example.com/
|
||||||
|
// Ex. https://example.com/bludit/ the method returns https://example.com/bludit/
|
||||||
public static function siteUrl()
|
public static function siteUrl()
|
||||||
{
|
{
|
||||||
global $site;
|
return DOMAIN_BASE;
|
||||||
return $site->url();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the absolute URL of admin panel
|
||||||
|
// Ex. https://example.com/admin/ the method returns https://example.com/admin/
|
||||||
|
// Ex. https://example.com/bludit/admin/ the method returns https://example.com/bludit/admin/
|
||||||
public static function adminUrl()
|
public static function adminUrl()
|
||||||
{
|
{
|
||||||
return DOMAIN_ADMIN;
|
return DOMAIN_ADMIN;
|
||||||
|
@ -180,7 +185,7 @@ class Theme {
|
||||||
|
|
||||||
$scripts = '';
|
$scripts = '';
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
$scripts .= '<script charset="utf-8" src="'.$base.$file.'?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
$scripts .= '<script src="'.$base.$file.'?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scripts;
|
return $scripts;
|
||||||
|
@ -214,12 +219,12 @@ class Theme {
|
||||||
|
|
||||||
public static function jquery()
|
public static function jquery()
|
||||||
{
|
{
|
||||||
return '<script charset="utf-8" src="'.DOMAIN_CORE_JS.'jquery.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
return '<script src="'.DOMAIN_CORE_JS.'jquery.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function jsBootstrap()
|
public static function jsBootstrap()
|
||||||
{
|
{
|
||||||
return '<script charset="utf-8" src="'.DOMAIN_CORE_JS.'bootstrap.bundle.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
return '<script src="'.DOMAIN_CORE_JS.'bootstrap.bundle.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function cssBootstrap()
|
public static function cssBootstrap()
|
||||||
|
@ -230,7 +235,7 @@ class Theme {
|
||||||
public static function jsSortable()
|
public static function jsSortable()
|
||||||
{
|
{
|
||||||
// https://github.com/psfpro/bootstrap-html5sortable
|
// https://github.com/psfpro/bootstrap-html5sortable
|
||||||
return '<script charset="utf-8" src="'.DOMAIN_CORE_JS.'jquery.sortable.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
return '<script src="'.DOMAIN_CORE_JS.'jquery.sortable.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
echo 'var HTML_PATH_ROOT = "'.HTML_PATH_ROOT.'";'.PHP_EOL;
|
echo 'var HTML_PATH_ROOT = "'.HTML_PATH_ROOT.'";'.PHP_EOL;
|
||||||
echo 'var HTML_PATH_ADMIN_ROOT = "'.HTML_PATH_ADMIN_ROOT.'";'.PHP_EOL;
|
echo 'var HTML_PATH_ADMIN_ROOT = "'.HTML_PATH_ADMIN_ROOT.'";'.PHP_EOL;
|
||||||
echo 'var HTML_PATH_ADMIN_THEME = "'.HTML_PATH_ADMIN_THEME.'";'.PHP_EOL;
|
echo 'var HTML_PATH_ADMIN_THEME = "'.HTML_PATH_ADMIN_THEME.'";'.PHP_EOL;
|
||||||
|
echo 'var HTML_PATH_ADMIN_THEME_IMG = "'.HTML_PATH_ADMIN_THEME_IMG.'";'.PHP_EOL;
|
||||||
echo 'var HTML_PATH_UPLOADS = "'.HTML_PATH_UPLOADS.'";'.PHP_EOL;
|
echo 'var HTML_PATH_UPLOADS = "'.HTML_PATH_UPLOADS.'";'.PHP_EOL;
|
||||||
echo 'var HTML_PATH_UPLOADS_THUMBNAILS = "'.HTML_PATH_UPLOADS_THUMBNAILS.'";'.PHP_EOL;
|
echo 'var HTML_PATH_UPLOADS_THUMBNAILS = "'.HTML_PATH_UPLOADS_THUMBNAILS.'";'.PHP_EOL;
|
||||||
echo 'var PARENT = "'.PARENT.'";'.PHP_EOL;
|
echo 'var PARENT = "'.PARENT.'";'.PHP_EOL;
|
||||||
|
|
|
@ -96,15 +96,13 @@ class Site extends dbJSON {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the URL of the rss.xml file
|
// DEPRECATED in v3.0, use Theme::rssUrl()
|
||||||
// You need to have enabled the plugin RSS
|
|
||||||
public function rss()
|
public function rss()
|
||||||
{
|
{
|
||||||
return DOMAIN_BASE.'rss.xml';
|
return DOMAIN_BASE.'rss.xml';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the URL of the sitemap.xml file
|
// DEPRECATED in v3.0, use Theme::sitemapUrl()
|
||||||
// You need to have enabled the plugin Sitemap
|
|
||||||
public function sitemap()
|
public function sitemap()
|
||||||
{
|
{
|
||||||
return DOMAIN_BASE.'sitemap.xml';
|
return DOMAIN_BASE.'sitemap.xml';
|
||||||
|
|
|
@ -38,8 +38,8 @@ class pluginSearch extends Plugin {
|
||||||
$html .= '<h2 class="plugin-label">'.$this->getValue('label').'</h2>';
|
$html .= '<h2 class="plugin-label">'.$this->getValue('label').'</h2>';
|
||||||
$html .= '<div class="plugin-content">';
|
$html .= '<div class="plugin-content">';
|
||||||
$html .= '<input type="text" id="plugin-search-input" /> ';
|
$html .= '<input type="text" id="plugin-search-input" /> ';
|
||||||
$html .= '<input type="button" value="Search" onClick="javascript: window.open(\'http://localhost:8000/search/\' + document.getElementById(\'plugin-search-input\').value, \'_self\');" />';
|
$html .= '<input type="button" value="Search" onClick="javascript: window.open(\''.DOMAIN_BASE.'search/\' + document.getElementById(\'plugin-search-input\').value, \'_self\');" />';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
body {
|
body {
|
||||||
padding: 10px 10%;
|
padding: 10px 5%;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,3 +24,10 @@ body {
|
||||||
.mce-content-body ul {
|
.mce-content-body ul {
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mce-content-body blockquote p {
|
||||||
|
padding: 10px 20px;
|
||||||
|
margin: 0 0 20px;
|
||||||
|
border-left: 5px solid #eee;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
|
@ -8,6 +8,20 @@
|
||||||
<?php if ($site->description()): ?>
|
<?php if ($site->description()): ?>
|
||||||
<p class="lead"><?php echo $site->description(); ?></p>
|
<p class="lead"><?php echo $site->description(); ?></p>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
<!-- Custom search form if the plugin "search" is enabled -->
|
||||||
|
<?php if (pluginActivated('pluginSearch')): ?>
|
||||||
|
<div class="form-inline d-block">
|
||||||
|
<input id="search-input" class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-primary my-2 my-sm-0" type="button" onClick="searchNow()">Search</button>
|
||||||
|
<script>
|
||||||
|
function searchNow() {
|
||||||
|
var searchURL = "<?php echo Theme::siteUrl(); ?>search/";
|
||||||
|
window.open(searchURL + document.getElementById("search-input").value, "_self");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -58,7 +72,7 @@
|
||||||
<!-- Home button -->
|
<!-- Home button -->
|
||||||
<?php if (Paginator::currentPage() > 1): ?>
|
<?php if (Paginator::currentPage() > 1): ?>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="<?php echo $site->url() ?>">Home</a>
|
<a class="page-link" href="<?php echo Theme::siteUrl() ?>">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark text-uppercase">
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark text-uppercase">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="<?php echo $site->url(); ?>">
|
<a class="navbar-brand" href="<?php echo Theme::siteUrl(); ?>">
|
||||||
<span class="text-white"><?php echo $site->title(); ?></span>
|
<span class="text-white"><?php echo $site->title(); ?></span>
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||||
|
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
|
|
||||||
<!-- Static pages -->
|
<!-- Static pages -->
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
<!-- Home button -->
|
<!-- Home button -->
|
||||||
<li class="page-item <?php if (Paginator::currentPage()==1) echo 'disabled' ?>">
|
<li class="page-item <?php if (Paginator::currentPage()==1) echo 'disabled' ?>">
|
||||||
<a class="page-link" href="<?php echo $site->url() ?>">Home</a>
|
<a class="page-link" href="<?php echo Theme::siteUrl() ?>">Home</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Next button -->
|
<!-- Next button -->
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark text-uppercase">
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark text-uppercase">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="<?php echo $site->url() ?>">
|
<a class="navbar-brand" href="<?php echo Theme::siteUrl() ?>">
|
||||||
<span class="text-white"><?php echo $site->title() ?></span>
|
<span class="text-white"><?php echo $site->title() ?></span>
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
Loading…
Reference in New Issue