Merge pull request #7 from dignajar/master

New pull request
This commit is contained in:
Edi 2015-12-01 01:05:03 +01:00
commit 9c5febca69
212 changed files with 2066 additions and 350 deletions

View File

@ -243,9 +243,9 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0);
}
if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true))
if(!mkdir(PATH_PLUGINS_DATABASES.'tinymce', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde';
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tinymce';
error_log($errorText, 0);
}
@ -408,14 +408,14 @@ function install($adminPassword, $email, $timezoneOffset)
LOCK_EX
);
// File plugins/simplemde/db.php
// File plugins/tinymce/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
PATH_PLUGINS_DATABASES.'tinymce'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'tabSize'=>4,
'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code, image',
'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat image | pagebreak code fullscreen'
),
JSON_PRETTY_PRINT),
LOCK_EX
@ -531,12 +531,12 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
<link rel="shortcut icon" type="image/x-icon" href="./img/favicon.png">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="./css/uikit.almost-flat.min.css?version=<?php echo time() ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/uikit.almost-flat.min.css?version=<?php echo time() ?>">
<link rel="stylesheet" type="text/css" href="./css/installer.css?version=<?php echo time() ?>">
<!-- Javascript -->
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo time() ?>"></script>
<script charset="utf-8" src="./js/uikit.min.js?version=<?php echo time() ?>"></script>
<script charset="utf-8" src="./js/uikit/uikit.min.js?version=<?php echo time() ?>"></script>
</head>
<body class="uk-height-1-1">

View File

@ -83,7 +83,7 @@ function checkGet($args)
if( $Login->verifyUserByToken($args['username'], $args['tokenEmail']) )
{
// Renew the tokenCRFS. This token will be the same inside the session for multiple forms.
$Security->generateToken();
$Security->generateTokenCSRF();
Redirect::page('admin', 'dashboard');
return true;

View File

@ -23,7 +23,7 @@ function checkPost($args)
if( $Login->verifyUser($_POST['username'], $_POST['password']) )
{
// Renew the token. This token will be the same inside the session for multiple forms.
$Security->generateToken();
$Security->generateTokenCSRF();
Redirect::page('admin', 'dashboard');
return true;

View File

@ -0,0 +1,21 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -0,0 +1,21 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -34,16 +34,17 @@ foreach($themesPaths as $themePath)
{
$database = new dbJSON($langDefaultFile, false);
$databaseArray = $database->db;
$themeMetaData = $database->db['theme-data'];
// Check if exists locale language
if( Sanitize::pathFile($langLocaleFile) ) {
$database = new dbJSON($langLocaleFile, false);
$databaseArray['theme-data'] = array_merge($databaseArray['theme-data'], $database->db['theme-data']);
$themeMetaData = array_merge($themeMetaData, $database->db['theme-data']);
}
$databaseArray['theme-data']['dirname'] = basename($themePath);
$themeMetaData['dirname'] = basename($themePath);
// Theme data
array_push($themes, $databaseArray['theme-data']);
array_push($themes, $themeMetaData);
}
}

View File

@ -26,8 +26,13 @@
background: #1F5FC4;
}
.uk-form legend {
legend {
width: 70% !important;
margin-top: 40px !important;
}
legend.first-child {
margin-top: 0px !important;
}
.uk-navbar-nav > li > a {
@ -90,7 +95,7 @@ li.bludit-logo {
}
h2.title {
margin: 20px 0;
margin: 0 0 20px 0;
}
button.delete-button {
@ -111,16 +116,22 @@ button.delete-button:hover {
height: 400px;
}
.bl-view {
margin-top: 25px;
margin-bottom: 25px;
}
/* ----------- ALERT ----------- */
#alert {
display: none;
bottom: 20px;
color: #ffffff;
display: none;
padding: 24px;
position: fixed;
right: 20px;
text-align: center;
width: 100%;
width: 350px;
z-index: 100;
}
@ -149,7 +160,7 @@ div.login-form {
/* ----------- DASHBOARD ----------- */
div.dashboard-links {
margin: 20px 0;
margin: 0 0 25px 0;
}
div.dashboard-links h4 {

View File

@ -18,6 +18,11 @@ input[type="password"] {
/* ----------- BLUDIT ----------- */
div.login-box {
width: 400px;
max-width: calc(100% - 40px);
}
div.login-box > h1 {
font-weight: lighter;
letter-spacing: 4px;
@ -26,7 +31,6 @@ div.login-box > h1 {
}
div.login-form {
width: 400px;
text-align: left;
}

View File

@ -1,2 +0,0 @@
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#eee;overflow:hidden;line-height:20px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}

View File

@ -1,2 +1,2 @@
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}

View File

@ -0,0 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f5f5f5;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

View File

@ -1,2 +0,0 @@
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

View File

@ -12,19 +12,20 @@
<link rel="shortcut icon" type="image/x-icon" href="./img/favicon.png">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="./css/uikit.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/uikit.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/upload.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/form-file.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/placeholder.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/uikit/progress.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/jquery.datetimepicker.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/upload.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/form-file.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/placeholder.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/progress.min.css?version=<?php echo BLUDIT_VERSION ?>">
<!-- Javascript -->
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/uikit.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/uikit/uikit.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/uikit/upload.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/jquery.datetimepicker.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/upload.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<!-- Plugins -->
<?php Theme::plugins('adminHead') ?>
@ -54,9 +55,11 @@ $(document).ready(function() {
<!-- Navbar -->
<nav class="uk-navbar">
<div class="uk-container uk-container-center">
<ul class="uk-navbar-nav uk-hidden-small">
<!-- Navbar for Desktop -->
<div class="uk-container uk-container-center uk-hidden-small">
<ul class="uk-navbar-nav">
<li class="bludit-logo">BLUDIT</li>
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?> ><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><i class="uk-icon-object-ungroup"></i> <?php $L->p('Dashboard') ?></a></li>
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New post') ?></a></li>
@ -95,7 +98,7 @@ $(document).ready(function() {
</ul>
<div class="uk-navbar-flip uk-hidden-small">
<div class="uk-navbar-flip">
<ul class="uk-navbar-nav">
<li class="uk-parent" data-uk-dropdown>
<?php
@ -118,13 +121,14 @@ $(document).ready(function() {
</li>
</ul>
</div>
</div>
<!-- Navbar for Mobile -->
<a href="#offcanvas" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a>
<div class="uk-navbar-brand uk-navbar-center uk-visible-small">Bludit</div>
</div>
<div class="uk-navbar-brand uk-navbar-center uk-visible-small">BLUDIT</div>
</nav>
<!-- Offcanvas -->
<!-- Offcanvas for Mobile -->
<div id="offcanvas" class="uk-offcanvas">
<div class="uk-offcanvas-bar">
<ul class="uk-nav uk-nav-offcanvas">
@ -147,7 +151,7 @@ $(document).ready(function() {
</div>
<!-- View -->
<div class="uk-container uk-container-center">
<div class="uk-container uk-container-center bl-view">
<?php
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');

View File

@ -117,7 +117,9 @@ class HTML {
public static function legend($args)
{
$html = '<legend>'.$args['value'].'</legend>';
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
$html = '<legend '.$class.'>'.$args['value'].'</legend>';
echo $html;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});

View File

@ -1,7 +1,6 @@
<!DOCTYPE HTML>
<html class="uk-height-1-1 uk-notouch">
<head>
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex,nofollow">
@ -9,15 +8,15 @@
<title>Bludit</title>
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="./img/favicon.png">
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_ADMIN_THEME.'img/favicon.png' ?>">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="./css/uikit.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/login.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="<?php echo HTML_PATH_ADMIN_THEME.'css/uikit/uikit.almost-flat.min.css?version='.BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="<?php echo HTML_PATH_ADMIN_THEME.'css/login.css?version='.BLUDIT_VERSION ?>">
<!-- Javascript -->
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/uikit.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<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_ADMIN_THEME.'js/uikit/uikit.min.js?version='.BLUDIT_VERSION ?>"></script>
<!-- Plugins -->
<?php Theme::plugins('loginHead') ?>

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('id'=>'add-user-form', 'class'=>'uk-form-horizontal'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
HTML::formInputText(array(

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('id'=>'jsformplugin'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// Print the plugin form

View File

@ -119,7 +119,7 @@
}
else {
foreach($_scheduledPosts as $Post) {
echo '<li><span class="label-time">'.$Post->date(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></li>';
echo '<li><span class="label-time">'.$Post->dateRaw(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
}
?>

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// Key input

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// Key input
@ -94,7 +94,7 @@ echo '<div class="uk-width-large-3-10">';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->date(),
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')

View File

@ -10,7 +10,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// Security token
@ -19,7 +19,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
'value'=>$_user['username']
));
HTML::legend(array('value'=>$L->g('Profile')));
HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
HTML::formInputText(array(
'name'=>'usernameDisable',

View File

@ -2,7 +2,7 @@
<form method="post" action="" class="uk-form" autocomplete="off">
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printToken() ?>">
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printTokenCSRF() ?>">
<div class="uk-form-row">
<input name="email" class="uk-width-1-1 uk-form-large" placeholder="<?php $L->p('Email') ?>" type="text">

View File

@ -2,7 +2,7 @@
<form method="post" action="" class="uk-form" autocomplete="off">
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printToken() ?>">
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printTokenCSRF() ?>">
<div class="uk-form-row">
<input name="username" class="uk-width-1-1 uk-form-large" placeholder="<?php $L->p('Username') ?>" type="text">

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// ---- LEFT SIDE ----

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// ---- LEFT SIDE ----

View File

@ -15,8 +15,8 @@ echo '
<tbody>
';
foreach($plugins['all'] as $Plugin)
{
foreach($plugins['all'] as $Plugin)
{
echo '
<tr>
<td>
@ -29,10 +29,10 @@ echo '
echo '<a class="configure" href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'">'.$L->g('Configure').'</a>';
echo '<span class="separator"> | </span>';
}
echo '<a class="uninstall" href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'">'.$L->g('Uninstall').'</a>';
echo '<a class="uninstall" href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'">'.$L->g('Deactivate').'</a>';
}
else {
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'">'.$L->g('Install').'</a>';
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'">'.$L->g('Activate').'</a>';
}
echo '
@ -44,7 +44,7 @@ echo '
';
echo '</tr>';
}
}
echo '
</tbody>

View File

@ -6,9 +6,11 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
HTML::legend(array('value'=>$L->g('General'), 'class'=>'first-child'));
HTML::formSelect(array(
'name'=>'postsperpage',
'label'=>$L->g('Posts per page'),

View File

@ -7,9 +7,11 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
HTML::legend(array('value'=>$L->g('Site information'), 'class'=>'first-child'));
HTML::formInputText(array(
'name'=>'title',
'label'=>$L->g('Site title'),

View File

@ -6,9 +6,11 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
HTML::legend(array('value'=>$L->g('General'), 'class'=>'first-child'));
HTML::formSelect(array(
'name'=>'language',
'label'=>$L->g('Language'),
@ -35,6 +37,8 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'tip'=>$L->g('you-can-use-this-field-to-define-a-set-off')
));
HTML::legend(array('value'=>$L->g('Date and time formats')));
HTML::formInputText(array(
'name'=>'dateFormat',
'label'=>$L->g('Date format'),

View File

@ -15,8 +15,8 @@ echo '
<tbody>
';
foreach($themes as $theme)
{
foreach($themes as $theme)
{
echo '
<tr>
<td>
@ -25,7 +25,7 @@ echo '
';
if($theme['dirname']!=$Site->theme()) {
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'">'.$L->g('Install').'</a>';
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'">'.$L->g('Activate').'</a>';
}
echo '
@ -37,7 +37,7 @@ echo '
';
echo '</tr>';
}
}
echo '
</tbody>

View File

@ -7,7 +7,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
// Security token
HTML::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$Security->getToken()
'value'=>$Security->getTokenCSRF()
));
// Hidden field username

View File

@ -15,7 +15,7 @@ $layout['controller'] = $layout['view'] = $layout['slug'] = $explodeSlug[0];
unset($explodeSlug[0]);
$layout['parameters'] = implode('/', $explodeSlug);
// Disable Magic Quotes
// Disable Magic Quotes.
// Thanks, http://stackoverflow.com/questions/517008/how-to-turn-off-magic-quotes-on-shared-hosting
if ( in_array( strtolower( ini_get( 'magic_quotes_gpc' ) ), array( '1', 'on' ) ) )
{
@ -24,18 +24,19 @@ if ( in_array( strtolower( ini_get( 'magic_quotes_gpc' ) ), array( '1', 'on' ) )
$_COOKIE = array_map('stripslashes', $_COOKIE);
}
// AJAX
// --- AJAX ---
if( $layout['slug']==='ajax' )
{
// Check if the user is loggued.
if($Login->isLogged())
{
// Load AJAX file
// Load the ajax file.
if( Sanitize::pathFile(PATH_AJAX, $layout['parameters'].'.php') ) {
include(PATH_AJAX.$layout['parameters'].'.php');
}
}
}
// ADMIN AREA
// --- ADMIN AREA ---
else
{
// Boot rules
@ -47,6 +48,10 @@ else
include(PATH_RULES.'99.themes.php');
include(PATH_RULES.'99.security.php');
// Page not found.
// User not logged.
// Slug is login.
// Slug is login-email.
if($Url->notFound() || !$Login->isLogged() || ($Url->slug()==='login') || ($Url->slug()==='login-email') )
{
$layout['controller'] = 'login';
@ -59,28 +64,29 @@ else
$layout['view'] = 'login-email';
}
// Generate the token for the user not logged, when the user is loggued the token will be change.
$Security->generateToken();
// Generate the tokenCSRF for the user not logged, when the user log-in the token will be change.
$Security->generateTokenCSRF();
}
// Plugins before admin area loaded
// Load plugins before the admin area will be load.
Theme::plugins('beforeAdminLoad');
// Admin theme init.php
// Load init.php if the theme has one.
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.'init.php') ) {
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.'init.php');
}
// Load controller
// Load controller.
if( Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php') ) {
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
}
// Load view and theme
// Load view and theme.
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.$layout['template']) ) {
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.$layout['template']);
}
// Plugins after admin area loaded
// Load plugins after the admin area is loaded.
Theme::plugins('afterAdminLoad');
}

View File

@ -194,11 +194,10 @@ define('PATH_THEME_JS', PATH_THEME.'js'.DS);
define('PATH_THEME_IMG', PATH_THEME.'img'.DS);
define('PATH_THEME_LANG', PATH_THEME.'languages'.DS);
// Objects with dependency
// --- Objects with dependency ---
$Language = new dbLanguage( $Site->locale() );
$Login = new Login( $dbUsers );
$Url->checkFilters( $Site->uriFilters() );
// Objects shortcuts
// --- Objects shortcuts ---
$L = $Language;

View File

@ -28,6 +28,7 @@ function build_page($key)
global $dbPages;
global $dbUsers;
global $Parsedown;
global $Site;
// Page object, content from FILE.
$Page = new Page($key);
@ -58,6 +59,13 @@ function build_page($key)
$content = Text::imgRel2Abs($content, HTML_PATH_UPLOADS); // Parse img src relative to absolute.
$Page->setField('content', $content, true);
// Date format
$pageDate = $Page->date();
$Page->setField('dateRaw', $pageDate, true);
$pageDateFormated = $Page->dateRaw( $Site->dateFormat() );
$Page->setField('date', $pageDateFormated, true);
// Parse username for the page.
if( $dbUsers->userExists( $Page->username() ) )
{

View File

@ -63,29 +63,31 @@ function build_plugins()
{
$Plugin = new $pluginClass;
// Set Plugin data
// Default language and meta data for the plugin
$tmpMetaData = array();
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
$database = new dbJSON($languageFilename, false);
$tmpMetaData = $database->db['plugin-data'];
// Check if the plugin is translated.
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$Site->locale().'.json';
if( Sanitize::pathFile($languageFilename) )
{
$database = new dbJSON($languageFilename, false);
}
else
{
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
$database = new dbJSON($languageFilename, false);
$tmpMetaData = array_merge($tmpMetaData, $database->db['plugin-data']);
}
$databaseArray = $database->db;
$Plugin->setData( $databaseArray['plugin-data'] );
// Set plugin meta data
$Plugin->setData($tmpMetaData);
// Add words to language dictionary.
unset($databaseArray['plugin-data']);
$Language->add($databaseArray);
unset($database->db['plugin-data']);
$Language->add($database->db);
// Push Plugin to array all plugins installed and not installed.
$plugins['all'][$pluginClass] = $Plugin;
// If the plugin installed
// If the plugin is installed, order by hooks.
if($Plugin->installed())
{
foreach($pluginsEvents as $event=>$value)

View File

@ -20,9 +20,9 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$token = isset($_POST['tokenCSRF']) ? Sanitize::html($_POST['tokenCSRF']) : false;
if( !$Security->validateToken($token) )
if( !$Security->validateTokenCSRF($token) )
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying validate the tokenCSRF. Token CSRF ID: '.$token);
Log::set(__FILE__.LOG_SEP.'Error occurred when trying to validate the tokenCSRF. Token CSRF ID: '.$token);
// Destroy the session.
Session::destroy();

View File

@ -26,25 +26,27 @@ $langLocaleFile = PATH_THEME.'languages'.DS.$Site->locale().'.json';
$langDefaultFile = PATH_THEME.'languages'.DS.'en_US.json';
$database = false;
// Theme meta data from English
if( Sanitize::pathFile($langDefaultFile) ) {
$database = new dbJSON($langDefaultFile, false);
$themeMetaData = $database->db['theme-data'];
}
// Check if exists locale language
if( Sanitize::pathFile($langLocaleFile) ) {
$database = new dbJSON($langLocaleFile, false);
}
// Check if exists default language
elseif( Sanitize::pathFile($langDefaultFile) ) {
$database = new dbJSON($langDefaultFile, false);
}
if($database!==false)
{
$databaseArray = $database->db;
// Theme data
$theme = $databaseArray['theme-data'];
$theme = $themeMetaData;
// Remove theme data
// Remove theme meta data
unset($databaseArray['theme-data']);
// Add new words from language theme
// Add new words/phrase from language theme
$Language->add($databaseArray);
}

View File

@ -150,6 +150,30 @@ class dbSite extends dbJSON
return $this->getField('url');
}
public function domain()
{
// If the URL field is not set, try detect the domain.
if(Text::isEmpty( $this->url() ))
{
if(!empty($_SERVER['HTTPS'])) {
$protocol = 'https://';
}
else {
$protocol = 'http://';
}
$domain = $_SERVER['HTTP_HOST'];
return $protocol.$domain.HTML_PATH_ROOT;
}
// Parse the domain from the field URL.
$parse = parse_url($this->url());
$domain = $parse['scheme']."://".$parse['host'];
return $domain;
}
// Returns TRUE if the cli mode is enabled, otherwise FALSE.
public function cliMode()
{

View File

@ -25,11 +25,16 @@ class Date {
// Format a local time/date according to locale settings.
public static function format($date, $currentFormat, $outputFormat)
{
// Returns a new DateTime instance or FALSE on failure.
$Date = DateTime::createFromFormat($currentFormat, $date);
if($Date!==false) {
return $Date->format($outputFormat);
}
return false;
}
public static function timeago($time)
{
$time = time() - $time;

View File

@ -165,11 +165,13 @@ class Text {
return ucfirst($string);
}
// Find position of first occurrence of substring in a string.
public static function strpos($string, $substring)
// Find position of first occurrence of substring in a string otherwise returns FALSE.
public static function stringPosition($string, $substring)
{
if(MB_STRING)
if(MB_STRING) {
return mb_strpos($string, $substring, 0, 'UTF-8');
}
return strpos($string, $substring);
}

View File

@ -79,13 +79,18 @@ class Page extends fileContent
}
// Returns the post date according to locale settings and format settings.
public function date($format=false)
public function date()
{
$date = $this->getField('date');
return $this->getField('date');
}
// Returns the post date according to locale settings and format as database stored.
public function dateRaw($format=false)
{
$date = $this->getField('dateRaw');
if($format) {
// En %d %b deberia ir el formato definido por el usuario
return Date::format($date, DB_DATE_FORMAT, '%d %B');
return Date::format($date, DB_DATE_FORMAT, $format);
}
return $date;
@ -147,6 +152,7 @@ class Page extends fileContent
return '/'.$htmlPath.'/'.$tmp;
}
// Returns the parent key, if the page doesn't have a parent returns FALSE.
public function parentKey()
{
$explode = explode('/', $this->getField('key'));
@ -157,6 +163,18 @@ class Page extends fileContent
return false;
}
// Returns the parent method output, if the page doesn't have a parent returns FALSE.
public function parentMethod($method)
{
global $pages;
if( isset($pages[$this->parentKey()]) ) {
return $pages[$this->parentKey()]->{$method}();
}
return false;
}
public function children()
{
$tmp = array();

View File

@ -19,16 +19,18 @@ class Security extends dbJSON
// ====================================================
// Generate and save the token in Session.
public function generateToken()
public function generateTokenCSRF()
{
$token = Text::randomText(8);
$token = sha1($token);
Log::set(__METHOD__.LOG_SEP.'New tokenCSRF was generated '.$token);
Session::set('tokenCSRF', $token);
}
// Validate the token.
public function validateToken($token)
public function validateTokenCSRF($token)
{
$sessionToken = Session::get('tokenCSRF');
@ -36,12 +38,12 @@ class Security extends dbJSON
}
// Returns the token.
public function getToken()
public function getTokenCSRF()
{
return Session::get('tokenCSRF');
}
public function printToken()
public function printTokenCSRF()
{
echo Session::get('tokenCSRF');
}

View File

@ -32,7 +32,7 @@ class Url
$this->filters = array();
}
// Filters may be changed for different languages
// Filters change for different languages
// Ex (Spanish): Array('post'=>'/publicacion/', 'tag'=>'/etiqueta/', ....)
// Ex (English): Array('post'=>'/post/', 'tag'=>'/tag/', ....)
public function checkFilters($filters)
@ -41,35 +41,33 @@ class Url
$adminFilter['admin'] = $filters['admin'];
unset($filters['admin']);
// Sort by filter length
// Sort filters by length
uasort($filters, array($this, 'sortByLength'));
// Push the admin filter first
$filters = $adminFilter + $filters;
$this->filters = $filters;
foreach($filters as $filterKey=>$filter)
foreach($filters as $filterName=>$filterURI)
{
// getSlugAfterFilter() set the variable $this->slug
$slug = $this->getSlugAfterFilter($filter);
// $slug will be FALSE if the filter is not included in the URI.
$slug = $this->getSlugAfterFilter($filterURI);
// If the filter is included in the URI.
if($slug!==false)
{
// Where Am I is the filter now, because is in the URI.
$this->whereAmI = $filterKey;
$this->slug = $slug;
$this->whereAmI = $filterName;
// If the slug empty
if(empty($slug))
// If the slug is empty
if(Text::isEmpty($slug))
{
if($filter==='/')
if($filterURI==='/')
{
$this->whereAmI = 'home';
break;
}
if($filter===$adminFilter['admin'])
if($filterURI===$adminFilter['admin'])
{
$this->whereAmI = 'admin';
$this->slug = 'dashboard';
@ -140,45 +138,52 @@ class Url
$this->notFound = $error;
}
public function getDomain()
{
if(!empty($_SERVER['HTTPS'])) {
$protocol = 'https://';
}
else {
$protocol = 'http://';
}
$domain = $_SERVER['HTTP_HOST'];
return $protocol.$domain.HTML_PATH_ROOT;
}
// Return the slug after the $filter
// Returns the slug after the $filter, the slug could be an empty string
// If the filter is not included in the uri, returns FALSE
// If the filter is included in the uri and the slug is not empty, returns the slug
// ex: http://domain.com/cms/$filter/slug123 => slug123
// ex: http://domain.com/cms/$filter/name/lastname => name/lastname
// ex: http://domain.com/cms/$filter/ => empty string
// ex: http://domain.com/cms/$filter => empty string
private function getSlugAfterFilter($filter)
{
if($filter=='/') {
$filter = HTML_PATH_ROOT;
}
// Remove both slash from the filter
$filter = trim($filter, '/');
// Add to the filter the root directory
$filter = HTML_PATH_ROOT.$filter;
// Check if the filter is in the uri.
$position = Text::strpos($this->uri, $filter);
$position = Text::stringPosition($this->uri, $filter);
// If the position is FALSE, the filter isn't in the URI.
if($position===false) {
return false;
}
// Start position to cut
$start = $position + Text::length($filter);
// End position to cut
$end = $this->uriStrlen;
// Get the slug from the URI
$slug = Text::cut($this->uri, $start, $end);
$this->slug = trim($slug, '/');
if(Text::isEmpty($slug)) {
return '';
}
if($slug[0]=='/') {
return ltrim($slug, '/');
}
if($filter==HTML_PATH_ROOT) {
return $slug;
}
return false;
}
private function sortByLength($a, $b)
{
return strlen($b)-strlen($a);

View File

@ -15,7 +15,7 @@
"confirm-password": "Повтори паролата",
"editor": "Редактор",
"dashboard": "Администраторски панел",
"role": "Потребител",
"role": "Вид потребител",
"post": "Публикация",
"posts": "Публикаций",
"users": "Потребители",
@ -164,7 +164,7 @@
"scheduled": "Планирано",
"publish": "Публикувай",
"please-check-your-theme-configuration": "Моля, проверете конфигурацията на вашата тема.",
"plugin-label": "Plugin етикет",
"plugin-label": "Заглавие плъгин",
"enabled": "Разреши",
"disabled": "Забрани",
"cli-mode": "Режим CLI",
@ -205,7 +205,7 @@
"drag-and-drop-or-click-here": "Влачите и пускате или натиснете тук",
"insert-image": "Вмъкни снимка",
"supported-image-file-types": "Поддържани файлови формати за снимки",
"date-format": "Формат за дата",
"date-format": "Формат дата ",
"time-format": "Формат за време",
"chat-with-developers-and-users-on-gitter":"Чат с разработчици и потребители на [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Това е кратко описание на вашия сайт, за да се промени този текст отидете в админ панела, настройки плъгини, конфигуриране на плъгин About.",
@ -213,6 +213,11 @@
"the-about-page-is-very-important": "The about page is an important and powerful tool for potential clients and partners. For those who wonder who is behind the website, your About page is the first source of information.",
"change-this-pages-content-on-the-admin-panel": "Промяна на съдържанието на страницата се извършва от админ панела, управление, страници и кликнете върху страницата.",
"about-your-site-or-yourself": "За твоя сайт или за теб",
"welcome-to-bludit": "Добре дошли в Bludit"
"welcome-to-bludit": "Добре дошли в Bludit",
"site-information": "Информация за сайта",
"date-and-time-formats": "Формат дата и час",
"activate": "Активиране",
"deactivate": "Деактивиране"
}

View File

@ -213,5 +213,10 @@
"the-about-page-is-very-important": "The about page is an important and powerful tool for potential clients and partners. For those who wonder who is behind the website, your About page is the first source of information.",
"change-this-pages-content-on-the-admin-panel": "Change this page's content on the admin panel, manage, pages and click on the about page.",
"about-your-site-or-yourself": "About your site or yourself",
"welcome-to-bludit": "Welcome to Bludit"
"welcome-to-bludit": "Welcome to Bludit",
"site-information": "Site information",
"date-and-time-formats": "Date and time formats",
"activate": "Activate",
"deactivate": "Deactivate"
}

View File

@ -13,7 +13,7 @@
"password": "Contraseña",
"confirm-password": "Confirmar contraseña",
"editor": "Editor",
"dashboard": "Panel",
"dashboard": "Panel de administración",
"role": "Rol",
"post": "Entrada",
"posts": "Entradas",

217
languages/it_IT.json Normal file
View File

@ -0,0 +1,217 @@
{
"language-data":
{
"native": "Italiano (Italy)",
"english-name": "Italian",
"last-update": "2015-11-27",
"author": "Daniele La Pira",
"email": "daniele.lapira@gmail.com",
"website": "https://github.com/danielelapira"
},
"username": "Nome Utente",
"password": "Password",
"confirm-password": "Conferma Password",
"editor": "Editor",
"dashboard": "Pannello",
"role": "Ruolo",
"post": "Articolo",
"posts": "Articoli",
"users": "Utenti",
"administrator": "Amministratore",
"add": "Aggiungi",
"cancel": "Annulla",
"content": "Contenuto",
"title": "Titolo",
"no-parent": "Nessuna pagina genitore",
"edit-page": "Modifica Pagina",
"edit-post": "Modifica Articolo",
"add-a-new-user": "Aggiungi un nuovo utente",
"parent": "Genitore",
"friendly-url": "URL amichevole",
"description": "Descrizione",
"posted-by": "Pubblicato da",
"tags": "Tags",
"position": "Posizione",
"save": "Salva",
"draft": "Bozza",
"delete": "Elimina",
"registered": "Registrato",
"Notifications": "Notifiche",
"profile": "Profilo",
"email": "Email",
"settings": "Impostazioni",
"general": "Generale",
"advanced": "Avanzato",
"regional": "Regionale",
"about": "About",
"login": "Inizia sessione",
"logout": "Termina sessione",
"manage": "Amministra",
"themes": "Temi",
"prev-page": "Pagina precedente",
"next-page": "Pagina seguente",
"configure-plugin": "Configura plugin",
"confirm-delete-this-action-cannot-be-undone": "Conferma l'eliminazione. Questa azione non può essere annullata.",
"site-title": "Titolo del sito",
"site-slogan": "Slogan del sito",
"site-description": "Descrizione del sito",
"footer-text": "Testo pie' di pagina",
"posts-per-page": "Articoli per pagina",
"site-url": "URL del sito",
"writting-settings": "Impostazioni di scrittura",
"url-filters": "Filtri URL",
"page": "Pagina",
"pages": "Pagine",
"home": "Inizio",
"welcome-back": "Bentornato",
"language": "Lingua",
"website": "Sito web",
"timezone": "Fuso orario",
"locale": "Locale",
"new-post": "Nuovo articolo",
"new-page": "Nuova pagina",
"html-and-markdown-code-supported": "Codici HTML e Markdown supportati",
"manage-posts": "Gestisci articoli",
"published-date": "Data di pubblicazione",
"modified-date": "Data di modifica",
"empty-title": "Titolo assente",
"plugins": "Plugins",
"install-plugin": "Installa plugin",
"uninstall-plugin": "Disinstalla plugin",
"new-password": "Nuova password",
"edit-user": "Modifica utente",
"publish-now": "Pubblica adesso",
"first-name": "Nome",
"last-name": "Cognome",
"bludit-version": "Versione di Bludit",
"powered-by": "Powered by",
"recent-posts": "Articoli recenti",
"manage-pages": "Gestisci pagine",
"advanced-options": "Opzioni avanzate",
"user-deleted": "Utente eliminato",
"page-added-successfully": "Pagina aggiunta con successo",
"post-added-successfully": "Articolo aggiunto con successo",
"the-post-has-been-deleted-successfully": "L'articolo è stato eliminato con successo",
"the-page-has-been-deleted-successfully": "La pagina è stata eliminata con successo",
"username-or-password-incorrect": "Nome utente o password non corretti",
"database-regenerated": "Database rigenerato",
"the-changes-have-been-saved": "Le modifiche sono state salvate",
"enable-more-features-at": "Abilita altre funzioni a",
"username-already-exists": "Il nome utente esiste già",
"username-field-is-empty": "Campo nome utente vuoto",
"the-password-and-confirmation-password-do-not-match":"Le password non corrispondono",
"user-has-been-added-successfully": "Utente aggiunto con successo",
"you-do-not-have-sufficient-permissions": "Non hai i permessi sufficienti per accedere a questa pagina, contatta l'amministratore.",
"settings-advanced-writting-settings": "Impostazioni->Avanzate->Impostazioni di scrittura",
"new-posts-and-pages-synchronized": "Nuovi articoli e pagine sincronizzate.",
"you-can-choose-the-users-privilege": "Puoi selezionare i privilegi dell'utente. Il ruolo di editore può solo scrivere e modificare pagine e articoli.",
"email-will-not-be-publicly-displayed": "L'indirizzo Email non sarà visibile. Raccomandato per il recupero della password e per ricevere notifiche.",
"use-this-field-to-name-your-site": "Usa questo campo per dare un nome al tuo sito, apparirà nella parte superiore in ogni pagina del tuo sito.",
"use-this-field-to-add-a-catchy-phrase": "Usa questo campo per aggiungere uno slogan al tuo sito.",
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del sito per fornire una breve biografia o descrizione del sito.",
"you-can-add-a-small-text-on-the-bottom": "Puoi aggiungere un breve testo in fondo ad ogni pagina. Ad es. copyright, autore, date, ecc.",
"number-of-posts-to-show-per-page": "Numero di articoli da mostrare per pagina.",
"the-url-of-your-site": "Indirizzo URL del tuo sito.",
"add-or-edit-description-tags-or": "Aggiungi o modifica descrizione, tags oppure modifica l'URL amichevole.",
"select-your-sites-language": "Seleziona la lingua del tuo sito.",
"select-a-timezone-for-a-correct": "Seleziona un fuso orario per la corretta visualizzazione di data e ora sul sito.",
"you-can-use-this-field-to-define-a-set-of": "Puoi utilizzare questo campo per definire set di parametri riferiti alla lingua, alla nazione e preferenze speciali.",
"you-can-modify-the-url-which-identifies":"Puoi modificare l'indirizzo URL che identifica una pagina o un articolo utilizzando delle parole chiavi leggibili. Non più di 150 caratteri.",
"this-field-can-help-describe-the-content": "Quì puoi descrivere il contenuto in poche parole. Non più di 150 caratteri.",
"delete-the-user-and-all-its-posts":"Elimina l'utente e tutti i suoi articoli",
"delete-the-user-and-associate-its-posts-to-admin-user": "Elimina l'utente e assegna i suoi articoli all'utente admin",
"read-more": "Leggi tutto",
"show-blog": "Visualizza blog",
"default-home-page": "Home page predefinita",
"version": "Versione",
"there-are-no-drafts": "Non ci sono bozze.",
"create-a-new-article-for-your-blog":"Crea un nuovo articolo per il tuo blog.",
"create-a-new-page-for-your-website":"Crea una nuova pagina per il tuo sito.",
"invite-a-friend-to-collaborate-on-your-website":"Invita un amico per collaborare sul tuo sito.",
"change-your-language-and-region-settings":"Modifica le impostazioni di lingua e regione.",
"language-and-timezone":"Lingua e fuso orario",
"author": "Autore",
"start-here": "Inizia quì",
"install-theme": "Installa tema",
"first-post": "Primo articolo",
"congratulations-you-have-successfully-installed-your-bludit": "Congratulazioni, hai installato con successo **Bludit**",
"whats-next": "Passi seguenti",
"manage-your-bludit-from-the-admin-panel": "Gestisci Bludit dal [pannello di amministrazione](./admin/)",
"follow-bludit-on": "Segui Bludit su",
"visit-the-support-forum": "Visita il [forum](http://forum.bludit.com) for support",
"read-the-documentation-for-more-information": "Leggi la [documentazione](http://docs.bludit.com) per ulteriori informazioni",
"share-with-your-friends-and-enjoy": "Condividi con i tuoi amici",
"the-page-has-not-been-found": "La pagina non è stata trovata.",
"error": "Errore",
"bludit-installer": "Installa Bludit",
"welcome-to-the-bludit-installer": "Benvenuto nel programma di installazione di Bludit",
"complete-the-form-choose-a-password-for-the-username-admin": "Compila il modulo e scegli una password per l'utente « admin »",
"password-visible-field": "Password, campo visibile!",
"install": "Installa",
"choose-your-language": "Scegli la tua lingua",
"next": "Avanti",
"the-password-field-is-empty": "Il campo password è vuoto",
"your-email-address-is-invalid":"Il tuo indirizzo email non è valido.",
"proceed-anyway": "Procedi comunque!",
"drafts":"Bozze",
"ip-address-has-been-blocked": "L'indirizzo IP è stato bloccato.",
"try-again-in-a-few-minutes": "Prova di nuovo fra qualche minuto.",
"date": "Data",
"scheduled": "Programmato",
"publish": "Pubblica",
"please-check-your-theme-configuration": "Per favore verifica la configurazione del tuo tema.",
"plugin-label": "Etichetta del Plugin",
"enabled": "Abilitato",
"disabled": "Disabilitato",
"cli-mode": "Modo Cli",
"command-line-mode": "Modo linia di comando",
"enable-the-command-line-mode-if-you-add-edit": "Abilita il modo della linea di comando se vuoi aggiungere, modificare o eliminare articoli e pagine dal filesystem",
"configure": "Configura",
"uninstall": "Disinstalla",
"change-password": "Cambia password",
"to-schedule-the-post-just-select-the-date-and-time": "Per programmare l'articolo, seleziona data e ora.",
"write-the-tags-separated-by-commas": "Scrivi i tags separati da virgole.",
"status": "Status",
"published": "Pubblicato",
"scheduled-posts": "Articoli programmati",
"statistics": "Statistiche",
"name": "Nome",
"email-account-settings":"Impostazioni dell'account email",
"sender-email": "Mittente email",
"emails-will-be-sent-from-this-address":"Le emails saranno inviate da questo indirizzo.",
"bludit-login-access-code": "BLUDIT - Login access code",
"check-your-inbox-for-your-login-access-code":"Controlla la tua posta in ingresso per il codice di accesso",
"there-was-a-problem-sending-the-email":"C'è stato un problema nell'invio dell' email",
"back-to-login-form": "Torna indietro alla pagina di accesso",
"send-me-a-login-access-code": "Inviami un codice accesso",
"get-login-access-code": "Richiedi un codice accesso",
"email-notification-login-access-code": "<p>Questa è una notifica dal tuo sito {{WEBSITE_NAME}}</p><p>Hai richiesto un codice per accedere, segui il link seguente:</p><p>{{LINK}}</p>",
"there-are-no-scheduled-posts": "Non ci sono articoli programmati.",
"show-password": "Mostra password",
"edit-or-remove-your=pages": "Modifica o elimina pagine.",
"edit-or-remove-your-blogs-posts": "Modifica o elimina gli articoli del tuo blog.",
"general-settings": "Impostazioni generali",
"advanced-settings": "Impostazioni avanzate",
"manage-users": "Gestisci utenti",
"view-and-edit-your-profile": "Visualizza e modifica il tuo profilo.",
"password-must-be-at-least-6-characters-long": "La Password deve contenere almeno 6 caratteri",
"images": "Immagini",
"upload-image": "Invia un'immagine",
"drag-and-drop-or-click-here": "Trascina e rilascia oppure clicca quì",
"insert-image": "Inserisci immagine",
"supported-image-file-types": "Formati file immagine supportati",
"date-format": "Formato data",
"time-format": "Formato ora",
"chat-with-developers-and-users-on-gitter":"Chatta con gli sviluppatori e gli utenti su [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Questa è una breve descrizione tua o del tuo sito, Per cambiare il testo vai nel pannello di amministrazione, impostazioni, plugins, e configura il plugin about.",
"profile-picture": "Foto del profilo",
"the-about-page-is-very-important": "La pagina << about >> è molto utile. Fornisce ai tuoi visitatori importanti informazioni sul sito. Uno strumento efficace per potenziali clienti e partners.",
"change-this-pages-content-on-the-admin-panel": "Cambia il contenuto di questa pagina sul pannello di amministrazione, Amministra -> Pagine e Clicca sulla pagina << about >> per modificare.",
"about-your-site-or-yourself": "A proposito del tuo sito o di te stesso",
"welcome-to-bludit": "Benvenuti a Bludit"
}

View File

@ -0,0 +1,12 @@
{
"plugin-data":
{
"name": "За мен",
"description": "Кратко описание за вашия сайт или за себе си.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Acerca de",
"description": "Pequeña descripcion sobre tu mismo o sobre tu sitio."
}
}

View File

@ -1,7 +1,7 @@
{
"plugin-data":
{
"name": "Обо мне",
"name": "О блоге",
"description": "Небольшое описание о вашем сайте или о себя."
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Про блог",
"description": "Невеликий опис вашого сайту або про Вас."
}
}

View File

@ -0,0 +1,16 @@
{
"plugin-data":
{
"name": "Disqus коментари",
"description": "Disqus коментари е услуги за уеб сайтове и блогове. Трябва да сте регистрирани в Disqus.com, преди да използвате този плъгин.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
},
"disqus-shortname": "Disqus shortname",
"enable-disqus-on-pages": "Активиране Disqus на страници",
"enable-disqus-on-posts": "Активиране Disqus на публикации",
"enable-disqus-on-default-home-page": "Активиране Disqus на начална страница"
}

View File

@ -6,8 +6,8 @@
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
"version": "0.7",
"releaseDate": "2015-11-28"
},
"disqus-shortname": "Disqus shortname",
"enable-disqus-on-pages": "Enable Disqus on pages",

View File

@ -0,0 +1,15 @@
{
"plugin-data":
{
"name": "Режим на поддръжка",
"description": "Поставете вашия сайт на режим на поддръжка.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
},
"enable-maintence-mode": "Активиране режим на поддръжка ",
"message": "Съобщение"
}

View File

@ -0,0 +1,12 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Open Graph ви позволява да свържете вашето съдържание със социални мрежи.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
}
}

View File

@ -6,7 +6,7 @@
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
"version": "0.7",
"releaseDate": "2015-11-28"
}
}

View File

@ -2,6 +2,6 @@
"plugin-data":
{
"name": "Open Graph",
"description": "El protocolo Open Graph sirve para publicar contenido en las redes sociales."
"description": "Utiliza este plugin para mejorar las publicaciones en las redes sociales."
}
}

View File

@ -2,10 +2,35 @@
class pluginOpenGraph extends Plugin {
private function getImage($content)
{
$dom = new DOMDocument();
$dom->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$content);
$finder = new DomXPath($dom);
$images = $finder->query("//img[contains(@class, 'bludit-img-opengraph')]");
if($images->length==0) {
$images = $finder->query("//img");
}
if($images->length>0)
{
// First image from the list
$image = $images->item(0);
// Get value from attribute src
$imgSrc = $image->getAttribute('src');
// Returns the image src
return $imgSrc;
}
return false;
}
public function siteHead()
{
global $Url, $Site;
global $Post, $Page;
global $Post, $Page, $posts;
$og = array(
'locale' =>$Site->locale(),
@ -24,12 +49,21 @@ class pluginOpenGraph extends Plugin {
$og['title'] = $Post->title().' | '.$og['title'];
$og['description'] = $Post->description();
$og['url'] = $Post->permalink(true);
$content = $Post->content();
break;
case 'page':
$og['type'] = 'article';
$og['title'] = $Page->title().' | '.$og['title'];
$og['description'] = $Page->description();
$og['url'] = $Page->permalink(true);
$content = $Page->content();
break;
default:
$content = isset($posts[0])?$posts[0]->content():'';
break;
}
@ -38,10 +72,16 @@ class pluginOpenGraph extends Plugin {
$html .= '<meta property="og:type" content="'.$og['type'].'">'.PHP_EOL;
$html .= '<meta property="og:title" content="'.$og['title'].'">'.PHP_EOL;
$html .= '<meta property="og:description" content="'.$og['description'].'">'.PHP_EOL;
$html .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL;
$html .= '<meta property="og:url" content="'.$og['url'].'">'.PHP_EOL;
$html .= '<meta property="og:siteName" content="'.$og['siteName'].'">'.PHP_EOL;
// Get the image from the content
$src = $this->getImage( $content );
if($src!==false) {
$og['image'] = $Site->domain().$src;
$html .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL;
}
return $html;
}
}

View File

@ -0,0 +1,15 @@
{
"plugin-data":
{
"name": "Страници списък",
"description": "Показва списък на страниците.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
},
"home": "Начало",
"show-home-link": "Покажи връзката към начало"
}

View File

@ -0,0 +1,10 @@
{
"plugin-data":
{
"name": "Список сторінок",
"description": "Показує список сторінок по порядку."
},
"home": "Головна",
"show-home-link": "Показувати лінк на головну сторінку"
}

View File

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "SimpleMDE",
"description": "Един прост и красив редактор с поддръжка на JavaScript и Мarkdown от WesCossick. Адаптиран от Diego Najar за Bludit. ",
"author": "NextStepWebs",
"email": "",
"website": "https://github.com/NextStepWebs/simplemde-markdown-editor",
"version": "1.8.1",
"releaseDate": "2015-11-13"
},
"toolbar": "Панел с инструменти",
"tab-size": "Размер на панела"
}

View File

@ -2,7 +2,7 @@
"plugin-data":
{
"name": "SimpleMDE",
"description": "Simple y facil editor Markdown desarrollado por @WesCossick. Adaptado por Diego Najar para Bludit."
"description": "Simple y sensillo editor Markdown desarrollado por @WesCossick. Adaptado por Diego Najar para Bludit."
},
"toolbar": "Barra de herramientas",
"tab-size": "Tamaño de la tabulación"

View File

@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "SimpleMDE",
"description": "Простий, красивий, і вбудовуваний JavaScript markdown редактор від @WesCossick. Адаптований Diego Najar для Bludit."
},
"toolbar": "Панель інструментів",
"tab-size": "Розмір відступу"
}

View File

@ -0,0 +1,12 @@
{
"plugin-data":
{
"name": "Етикети",
"description": "Покажи всички етикети.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "0.6",
"releaseDate": "2015-11-13"
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Listado de tags",
"description": "Muestra los tags de forma ordenada y muestra la cantidad de posts asociados a un tag."
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Список тегів",
"description": "Показує всі теги."
}
}

View File

@ -0,0 +1,12 @@
body {
font-size: 0.9em;
}
*:first-child {
margin-top: 0;
}
img {
display: block;
max-width: 100%;
}

View File

@ -0,0 +1,12 @@
{
"plugin-data":
{
"name": "TinyMCE",
"description": "Tinymce is an easy HTML editor, with many plugins and very customizable.",
"author": "TinyMCE",
"email": "",
"website": "http://www.tinymce.com",
"version": "4.3",
"releaseDate": "2015-11-29"
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Tinymce",
"description": "Tinymce es un editor HTML muy facil de usar."
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Tinymce",
"description": "Tinymce是一個簡單易使用的HTML編輯器有著非常多的延伸模組與高自訂性"
}
}

105
plugins/tinymce/plugin.php Normal file
View File

@ -0,0 +1,105 @@
<?php
class pluginTinymce extends Plugin {
private $loadWhenController = array(
'new-post',
'new-page',
'edit-post',
'edit-page'
);
public function init()
{
$this->dbFields = array(
'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code, image',
'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat image | pagebreak code fullscreen'
);
}
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>Tinymce plugins</label>';
$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getDbField('plugins').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Tinymce toolbar</label>';
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
$html .= '</div>';
return $html;
}
public function adminHead()
{
global $Language;
global $Site;
global $layout;
$html = '';
// Load CSS and JS only on Controllers in array.
if(in_array($layout['controller'], $this->loadWhenController))
{
$language = $Site->shortLanguage();
$pluginPath = $this->htmlPath();
$html = '<script src="'.$pluginPath.'tinymce/tinymce.min.js"></script>';
}
return $html;
}
public function adminBodyEnd()
{
global $Language;
global $Site;
global $layout;
$html = '';
// 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() { ';
$html .= 'tinymce.init({
selector: "#jscontent",
plugins: "'.$this->getDbField('plugins').'",
toolbar: "'.$this->getDbField('toolbar').'",
content_css: "'.$pluginPath.'css/editor.css?version='.$this->version().'",
theme: "modern",
height:"400px",
width:"100%",
statusbar: false,
menubar:false,
browser_spellcheck: true,
autoresize_bottom_margin: "50",
pagebreak_separator: "'.PAGE_BREAK.'",
paste_as_text: true,
document_base_url: "'.HTML_PATH_UPLOADS.'"
});';
$html .= '$("#jsaddImage").on("click", function() {
var filename = $("#jsimageList option:selected" ).text();
if(!filename.trim()) {
return false;
}
tinymce.activeEditor.insertContent("<img src=\""+filename+"\" alt=\"\">" + "\n");
});';
$html .= '}); </script>';
}
return $html;
}
}

View File

@ -0,0 +1,3 @@
This is where language files should be placed.
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/

View File

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})});

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="",d="A"==b.tagName&&""===a.dom.getAttrib(b,"href");d&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(c){var e=c.data.name;d?b.id=e:(a.selection.collapse(!0),a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:e})))}})}a.addCommand("mceAnchor",b),a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:b,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:b})});

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?g.setStart(a,d(a,b)):g.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?g.setEnd(a,d(a,b)):g.setEndAfter(a)}var g,h,i,j,k,l,m,n,o,p;if("A"!=a.selection.getNode().tagName){if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))});

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0>=l)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&0>g&&c(d))}}function d(b,e,f){tinymce.util.Delay.setEditorTimeout(a,function(){c({}),b--?d(b,e,f):f&&f()},e)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))});

View File

@ -0,0 +1 @@
tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention?(d(!1),!1):!0}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0|&nbsp;|[ ]|<br[^>]*>)+?|)</"+c+">|<br>$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j});

View File

@ -0,0 +1 @@
!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a){var b=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.on("beforeSetContent",function(a){a.content=b["_"+c+"_bbcode2html"](a.content)}),a.on("postProcess",function(a){a.set&&(a.content=b["_"+c+"_bbcode2html"](a.content)),a.get&&(a.content=b["_"+c+"_html2bbcode"](a.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Ephox Corp",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),b(/<font>(.*?)<\/font>/gi,"$1"),b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),b(/<\/(strong|b)>/gi,"[/b]"),b(/<(strong|b)>/gi,"[b]"),b(/<\/(em|i)>/gi,"[/i]"),b(/<(em|i)>/gi,"[i]"),b(/<\/u>/gi,"[/u]"),b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),b(/<u>/gi,"[u]"),b(/<blockquote[^>]*>/gi,"[quote]"),b(/<\/blockquote>/gi,"[/quote]"),b(/<br \/>/gi,"\n"),b(/<br\/>/gi,"\n"),b(/<br>/gi,"\n"),b(/<p>/gi,""),b(/<\/p>/gi,"\n"),b(/&nbsp;|\u00a0/gi," "),b(/&quot;/gi,'"'),b(/&lt;/gi,"<"),b(/&gt;/gi,">"),b(/&amp;/gi,"&"),a},_punbb_bbcode2html:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/\n/gi,"<br />"),b(/\[b\]/gi,"<strong>"),b(/\[\/b\]/gi,"</strong>"),b(/\[i\]/gi,"<em>"),b(/\[\/i\]/gi,"</em>"),b(/\[u\]/gi,"<u>"),b(/\[\/u\]/gi,"</u>"),b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),a}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})});

View File

@ -0,0 +1,138 @@
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)});

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu",classes:"contextmenu"}).renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});

View File

@ -0,0 +1 @@
tinymce.PluginManager.add("directionality",function(a){function b(b){var c,d=a.dom,e=a.selection.getSelectedBlocks();e.length&&(c=d.getAttrib(e[0],"dir"),tinymce.each(e,function(a){d.getParent(a.parentNode,"*[dir='"+b+"']",d.getRoot())||(c!=b?d.setAttrib(a,"dir",b):d.setAttrib(a,"dir",null))}),a.nodeChanged())}function c(a){var b=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(c){b.push(c+"[dir="+a+"]")}),b.join(",")}a.addCommand("mceDirectionLTR",function(){b("ltr")}),a.addCommand("mceDirectionRTL",function(){b("rtl")}),a.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:c("ltr")}),a.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:c("rtl")})});

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Some files were not shown because too many files have changed in this diff Show More