jquery and font awasome for developers
This commit is contained in:
parent
c3271298eb
commit
0884a98649
File diff suppressed because one or more lines are too long
|
@ -20,7 +20,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="<?php echo HTML_PATH_ADMIN_THEME.'css/jquery.datetimepicker.css?version='.BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- Javascript -->
|
||||
<script charset="utf-8" src="<?php echo HTML_PATH_ADMIN_THEME.'js/jquery.min.js?version='.BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="<?php echo HTML_PATH_CORE_JS.'jquery.min.js?version='.BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="<?php echo HTML_PATH_ADMIN_THEME.'js/uikit/uikit.min.js?version='.BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="<?php echo HTML_PATH_ADMIN_THEME.'js/uikit/upload.min.js?version='.BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="<?php echo HTML_PATH_ADMIN_THEME.'js/jquery.datetimepicker.js?version='.BLUDIT_VERSION ?>"></script>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,7 +11,7 @@ header('Content-Type: application/json');
|
|||
// slug: valid slug text
|
||||
|
||||
$text = isset($_POST['text']) ? $_POST['text'] : '';
|
||||
$parent = isset($_POST['parent']) ? $_POST['parent'] : NO_PARENT_CHAR;
|
||||
$parent = isset($_POST['parent']) ? $_POST['parent'] : PARENT;
|
||||
$key = isset($_POST['key']) ? $_POST['key'] : '';
|
||||
|
||||
if( $_POST['type']==='page' ) {
|
||||
|
|
|
@ -32,6 +32,7 @@ define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
|||
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
||||
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
||||
define('PATH_JS', PATH_KERNEL.'js'.DS);
|
||||
define('PATH_CSS', PATH_KERNEL.'css'.DS);
|
||||
|
||||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||
|
@ -109,7 +110,7 @@ define('CLI_STATUS', 'published');
|
|||
define('CLI_USERNAME', 'admin');
|
||||
|
||||
// Filename
|
||||
define('FILENAME', 'index.txt');
|
||||
define('FILENAME', 'index.md');
|
||||
|
||||
// Database date format
|
||||
define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
|
||||
|
@ -248,6 +249,9 @@ define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/');
|
|||
define('HTML_PATH_ADMIN_THEME_CSS', HTML_PATH_ADMIN_THEME.'css/');
|
||||
define('HTML_PATH_ADMIN_THEME_IMG', HTML_PATH_ADMIN_THEME.'img/');
|
||||
|
||||
define('HTML_PATH_CORE_JS', HTML_PATH_ROOT.'bl-kernel/js/');
|
||||
define('HTML_PATH_CORE_CSS', HTML_PATH_ROOT.'bl-kernel/css/');
|
||||
|
||||
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'bl-content/uploads/');
|
||||
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS.'profiles/');
|
||||
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS.'thumbnails/');
|
||||
|
@ -287,6 +291,8 @@ define('THEME_DIR_LANG', THEME_DIR.'languages'.DS);
|
|||
// This paths are absolutes for the user / web browsing.
|
||||
define('DOMAIN', $Site->domain());
|
||||
define('DOMAIN_BASE', DOMAIN.HTML_PATH_ROOT);
|
||||
define('DOMAIN_CORE_JS', DOMAIN.HTML_PATH_CORE_JS);
|
||||
define('DOMAIN_CORE_CSS', DOMAIN.HTML_PATH_CORE_CSS);
|
||||
define('DOMAIN_THEME', DOMAIN.HTML_PATH_THEME);
|
||||
define('DOMAIN_THEME_CSS', DOMAIN.HTML_PATH_THEME_CSS);
|
||||
define('DOMAIN_THEME_JS', DOMAIN.HTML_PATH_THEME_JS);
|
||||
|
|
|
@ -5,34 +5,80 @@
|
|||
// ============================================================================
|
||||
|
||||
// Array with pages, each page is a Page Object
|
||||
// Filtered by pagenumber, amount of items per page and sorted by date/position
|
||||
/*
|
||||
array(
|
||||
0 => Page Object,
|
||||
1 => Page Object,
|
||||
...
|
||||
N => Page Object
|
||||
)
|
||||
*/
|
||||
$pages = array();
|
||||
|
||||
// Array with pages, each page is a Page Object
|
||||
// Filtered by pagenumber and amount of items per page
|
||||
/*
|
||||
array(
|
||||
"pageKey1" => Page Object,
|
||||
"pageKey2" => Page Object,
|
||||
...
|
||||
"pageKeyN" => Page Object,
|
||||
)
|
||||
*/
|
||||
$pagesByKey = array();
|
||||
|
||||
// Page filtered by the user, is a Page Object
|
||||
$page = $Page = false;
|
||||
|
||||
// Array with pages order by parent
|
||||
// This variable is initializade only when the site is order by position to not degradate the peromance on blogs
|
||||
// Sorted by position or date
|
||||
/*
|
||||
array(
|
||||
PARENT => array(), // all parent pages
|
||||
parentKey1 => array(), // all children of parentKey1
|
||||
parentKey2 => array(), // all children of parentKey2
|
||||
PARENT => array(
|
||||
0 => Page Object,
|
||||
...,
|
||||
N => Page Object),
|
||||
"parentKey1" => array(
|
||||
0 => Page Object,
|
||||
...,
|
||||
N => Page Object),
|
||||
"parentKey2" => array(
|
||||
0 => Page Object,
|
||||
...,
|
||||
N => Page Object),
|
||||
...
|
||||
parentKeyN => array(), // all children of parentKeyN
|
||||
"parentKeyN" => array(
|
||||
0 => Page Object,
|
||||
...,
|
||||
N => Page Object),
|
||||
)
|
||||
*/
|
||||
$pagesByParent = array(PARENT=>array());
|
||||
|
||||
// Array with pages,
|
||||
// Array with pages order by parent and by key
|
||||
/*
|
||||
array(
|
||||
pageKey1 => Page Object,
|
||||
pageKey2 => Page Object,
|
||||
PARENT => array(
|
||||
"parentKey1" => Page Object,
|
||||
...,
|
||||
"parentKeyN" => Page Object),
|
||||
"parentKey1" => array(
|
||||
"childKeyA" => Page Object,
|
||||
...,
|
||||
"childKeyB" => Page Object),
|
||||
"parentKey2" => array(
|
||||
"childKeyJ" => Page Object,
|
||||
...,
|
||||
"childKeyO" => Page Object),
|
||||
...
|
||||
pageKeyN => Page Object,
|
||||
"parentKeyN" => array(
|
||||
"childKeyW" => Page Object,
|
||||
...,
|
||||
"childKeyZ" => Page Object),
|
||||
)
|
||||
*/
|
||||
$pagesByKey = array();
|
||||
$pagesByParentByKey = array(PARENT=>array());
|
||||
|
||||
// ============================================================================
|
||||
// Main
|
||||
|
@ -53,10 +99,16 @@ if( $dbPages->scheduler() ) {
|
|||
));
|
||||
}
|
||||
|
||||
// Generate pages parent tree, only published pages
|
||||
buildPagesByParent(false);
|
||||
|
||||
// Set home page is the user defined one
|
||||
if( $Site->homepage() && $Url->whereAmI()==='home' ) {
|
||||
$Url->setWhereAmI('page');
|
||||
$slug = $Site->homepage();
|
||||
$Url->setSlug($slug);
|
||||
$pageKey = $Site->homepage();
|
||||
if( $dbPages->exists($pageKey) ) {
|
||||
$Url->setSlug($pageKey);
|
||||
$Url->setWhereAmI('page');
|
||||
}
|
||||
}
|
||||
|
||||
// Build specific page
|
||||
|
@ -89,11 +141,6 @@ elseif( $Url->whereAmI()==='admin' ) {
|
|||
buildPagesForAdmin();
|
||||
}
|
||||
|
||||
if(ORDER_BY==='position') {
|
||||
$allPages = false; // All pages are published, draft, scheduled
|
||||
buildPagesByParent(false);
|
||||
}
|
||||
|
||||
// Set page 404 not found
|
||||
if( $Url->notFound() ) {
|
||||
$Url->setWhereAmI('page');
|
||||
|
|
|
@ -147,9 +147,12 @@ function buildPagesFor($for, $categoryKey=false, $tagKey=false)
|
|||
return $pages;
|
||||
}
|
||||
|
||||
// Generate the global variable $pagesByParent, defined on 69.pages.php
|
||||
// (boolean) $allPages, TRUE include all status, FALSE only include published status
|
||||
function buildPagesByParent($allPages=true) {
|
||||
global $dbPages;
|
||||
global $pagesByParent;
|
||||
global $pagesByParentByKey;
|
||||
|
||||
$keys = array_keys($dbPages->db);
|
||||
foreach($keys as $pageKey) {
|
||||
|
@ -160,11 +163,13 @@ function buildPagesByParent($allPages=true) {
|
|||
// FALSE if the page is parent
|
||||
if($parentKey===false) {
|
||||
array_push($pagesByParent[PARENT], $page);
|
||||
$pagesByParentByKey[PARENT][$page->key()] = $page;
|
||||
} else {
|
||||
if( !isset($pagesByParent[$parentKey]) ) {
|
||||
$pagesByParent[$parentKey] = array();
|
||||
}
|
||||
array_push($pagesByParent[$parentKey], $page);
|
||||
$pagesByParentByKey[$parentKey][$page->key()] = $page;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +269,7 @@ function editPage($args) {
|
|||
}
|
||||
|
||||
if(!isset($args['parent'])) {
|
||||
$args['parent'] = NO_PARENT_CHAR;
|
||||
$args['parent'] = '';
|
||||
}
|
||||
|
||||
$key = $dbPages->edit($args);
|
||||
|
|
|
@ -103,10 +103,21 @@ class Theme {
|
|||
return '<link rel="shortcut icon" href="'.DOMAIN_THEME.$file.'" type="'.$typeIcon.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function fontAwesome()
|
||||
{
|
||||
return '<link rel="stylesheet" href="'.DOMAIN_CORE_CSS.'font-awesome/font-awesome.min.css'.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function jquery($cdn=false)
|
||||
{
|
||||
if($cdn) {
|
||||
return '<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>';
|
||||
}
|
||||
return '<script src="'.DOMAIN_CORE_JS.'jquery.min.js'.'"></script>'.PHP_EOL;
|
||||
}
|
||||
|
||||
// ---- OLD
|
||||
|
||||
|
||||
|
||||
public static function keywords($keywords, $echo=true)
|
||||
{
|
||||
if(is_array($keywords)) {
|
||||
|
@ -122,27 +133,7 @@ class Theme {
|
|||
return $tmp;
|
||||
}
|
||||
|
||||
public static function jquery($echo=true)
|
||||
{
|
||||
$tmp = '<script src="'.HTML_PATH_ADMIN_THEME_JS.'jquery.min.js'.'"></script>'.PHP_EOL;
|
||||
|
||||
if($echo) {
|
||||
echo $tmp;
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
public static function fontAwesome($echo=true, $online=false)
|
||||
{
|
||||
$tmp = '<link rel="stylesheet" href="'.HTML_PATH_ADMIN_THEME_CSS.'font-awesome.min.css'.'">'.PHP_EOL;
|
||||
|
||||
if($echo) {
|
||||
echo $tmp;
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ 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_UPLOADS = "'.HTML_PATH_UPLOADS.'";'.PHP_EOL;
|
||||
echo 'var HTML_PATH_UPLOADS_THUMBNAILS = "'.HTML_PATH_UPLOADS_THUMBNAILS.'";'.PHP_EOL;
|
||||
echo 'var NO_PARENT_CHAR = "'.NO_PARENT_CHAR.'";'.PHP_EOL;
|
||||
echo 'var PARENT = "'.PARENT.'";'.PHP_EOL;
|
||||
|
||||
echo 'var tokenCSRF = "'.$Security->getTokenCSRF().'";'.PHP_EOL;
|
||||
|
||||
|
@ -21,7 +21,7 @@ var ajaxRequest;
|
|||
|
||||
function checkSlugPage(text, parent, oldKey, writeResponse)
|
||||
{
|
||||
parent = typeof parent !== 'undefined' ? parent : NO_PARENT_CHAR;
|
||||
parent = typeof parent !== 'undefined' ? parent : PARENT;
|
||||
oldKey = typeof oldKey !== 'undefined' ? oldKey : "";
|
||||
|
||||
checkSlug("page", text, parent, oldKey, writeResponse);
|
||||
|
|
|
@ -43,9 +43,19 @@ class Page {
|
|||
}
|
||||
|
||||
if( !empty($parts[0]) && !empty($parts[1]) ) {
|
||||
$parts[1] = trim($parts[1]);
|
||||
// remove missing dashs -
|
||||
$field = preg_replace('/[^A-Za-z]/', '', $parts[0]);
|
||||
|
||||
// remove empty spaces on borders
|
||||
$value = trim($parts[1]);
|
||||
|
||||
// position accept only integers
|
||||
if($field=='position') {
|
||||
$value = preg_replace('/[^0-9]/', '', $value);
|
||||
}
|
||||
|
||||
// Sanitize all fields, except the content
|
||||
$this->vars[$parts[0]] = Sanitize::html($parts[1]);
|
||||
$this->vars[$field] = Sanitize::html($value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,20 @@ tr {
|
|||
border-color: inherit;
|
||||
}
|
||||
|
||||
.pure-button {
|
||||
font-size: 0.9em;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
div.logo {
|
||||
}
|
||||
|
||||
img.logo {
|
||||
width: 32px;
|
||||
float: left;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {background-color: #f2f2f2}
|
||||
|
||||
tr:hover {background-color: #e7f0ff}
|
||||
|
@ -69,7 +83,7 @@ blockquote {
|
|||
}
|
||||
|
||||
.note {
|
||||
background: #FFB06C;
|
||||
background: #FBDF6B;
|
||||
color: #777;
|
||||
font-size: 0.9em;
|
||||
margin: 30px 0;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1005 B After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<pattern id="pattern-0" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse" viewBox="0 0 100 100">
|
||||
<path d="M 0 0 L 50 0 L 50 100 L 0 100 Z" style="fill: black;"/>
|
||||
</pattern>
|
||||
</defs>
|
||||
<path style="fill: rgb(255, 255, 255); stroke: rgb(0, 0, 0); stroke-miterlimit: 4; stroke-dasharray: none; stroke-width: 24.1239;" d="M 145.686 14.63 C 141.613 8.89 130.833 68.155 113.248 128.344 C 108.415 144.89 115.288 161.582 117.782 176.059 C 121.971 183.412 126.134 194.145 129.663 207.523 C 130.852 212.029 131.89 216.619 132.816 221.212 C 123.039 245.985 117.522 274.055 117.522 303.808 C 117.522 331.213 122.224 357.181 130.601 380.471 C 146.382 392.392 161.695 409.741 174.269 431.302 C 180.153 441.39 185.014 451.718 188.888 461.98 C 209.024 476.655 232.243 485.043 256.97 485.043 C 280.324 485.043 302.327 477.571 321.665 464.381 C 325.671 453.331 330.362 441.894 337.169 431.302 C 350.642 410.34 367.256 390.2 384.224 378 C 395.979 359.286 397.512 331.335 396.418 303.808 C 395.283 275.244 391.314 248.191 382.244 224.145 C 383.028 218.304 384.004 212.46 385.214 206.717 C 388.261 192.245 392.179 180.77 396.288 173.244 C 397.911 159.088 403.396 142.737 398.19 126.913 C 377.42 63.769 380.058 117.247 374.011 122.306 C 366.364 128.705 325.935 65.939 327.529 128.344 C 327.702 135.15 328.069 141.8 328.596 148.266 C 307.662 131.942 282.324 152.098 256.136 152.098 C 229.291 152.098 205.058 132.425 183.779 149.512 C 184.059 142.203 184.108 134.65 183.911 126.913 C 182.317 64.508 171.016 50.32 145.686 14.63 Z" id="path2987"/>
|
||||
<path id="path3763" d="M 256.314 390.825 C 246.312 390.825 223.405 410.421 223.405 423.826 C 223.405 427.497 224.537 430.973 226.554 434.092 C 230.352 435.689 234.037 438.012 237.065 440.902 C 238.481 442.253 239.65 443.635 240.582 445.009 C 245.429 446.974 251.018 448.098 256.97 448.098 C 262.593 448.098 267.889 447.097 272.542 445.33 C 273.509 443.851 274.748 442.358 276.274 440.902 C 279.518 437.806 283.517 435.361 287.6 433.762 C 289.485 430.731 290.537 427.367 290.537 423.826 C 290.537 410.421 266.971 390.825 256.314 390.825 Z" style="fill: rgb(0, 0, 0); stroke: rgb(0, 0, 0); stroke-miterlimit: 4; stroke-dasharray: none; stroke-width: 24.1239;"/>
|
||||
<path style="fill: rgb(0, 0, 0); stroke: rgb(0, 0, 0); stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-dasharray: none; stroke-width: 24.1239;" d="M 228.658 314.39 C 264.037 255.967 201.722 177.034 170.636 242.749 C 156.716 272.177 189.433 341.163 228.658 314.39 Z" id="path3779"/>
|
||||
<path style="fill: rgb(0, 0, 0); stroke: rgb(0, 0, 0); stroke-miterlimit: 4; stroke-width: 18;" d="M 323.461 270.414 C 323.461 276.224 318.143 280.937 311.582 280.937 C 305.022 280.937 299.702 276.224 299.702 270.414 C 299.702 264.6 305.022 259.888 311.582 259.888 C 318.143 259.888 323.461 264.6 323.461 270.414 Z" id="path3785"/>
|
||||
<path style="stroke: rgb(0, 0, 0); stroke-miterlimit: 4; fill: rgb(255, 255, 255); stroke-width: 24.1239;" d="M 232.976 268.819 C 232.976 284.42 220.013 297.069 204.021 297.069 C 188.032 297.069 175.068 284.42 175.068 268.819 C 175.068 253.21 188.032 240.565 204.021 240.565 C 220.013 240.565 232.976 253.21 232.976 268.819 Z" id="path-1"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.2 KiB |
|
@ -12,6 +12,9 @@
|
|||
echo Theme::css('css/blog.css');
|
||||
echo Theme::css('css/rainbow.github.css');
|
||||
|
||||
echo Theme::fontAwesome();
|
||||
|
||||
echo Theme::jquery();
|
||||
echo Theme::js('js/rainbow.min.js');
|
||||
|
||||
// Load plugins with the hook siteHead
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<h1 class="subhead">
|
||||
<?php
|
||||
echo $pagesByParent[PARENT][$page->parentKey()]->title();
|
||||
$parentKey = $page->parentKey();
|
||||
echo $pagesByParentByKey[PARENT][$parentKey]->title();
|
||||
echo ' -> ';
|
||||
echo $page->title();
|
||||
?>
|
||||
|
@ -11,7 +12,7 @@
|
|||
|
||||
<header class="page-header">
|
||||
<h2 class="page-title">
|
||||
<a href="<?php echo $Page->permalink() ?>"><?php echo $Page->title() ?></a>
|
||||
<?php echo $Page->title() ?>
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
|
@ -21,7 +22,8 @@
|
|||
|
||||
<div class="edit-this-page">
|
||||
<?php
|
||||
echo '<a href="'.$GITHUB_BASE_URL.$Page->key().'/'.FILENAME.'">Edit this page</a>';
|
||||
echo '<a class="pure-button pure-button-primary" href="'.$GITHUB_BASE_URL.$Page->key().'/'.FILENAME.'"><i class="fa fa-pencil"></i> Edit this page</a>';
|
||||
echo '<a class="pure-button" href="'.$GITHUB_BASE_URL.$Page->key().'/'.FILENAME.'"><i class="fa fa-info-circle"></i> How to edit this page ?</a>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<div class="sidebar-content">
|
||||
|
||||
<div class="logo">
|
||||
<img class="logo" src="<?php echo HTML_PATH_ADMIN_THEME ?>img/logo.svg" />
|
||||
<h1 class="title"><?php echo $Site->title() ?></h1>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
Loading…
Reference in New Issue