1
0
mirror of https://github.com/typemill/typemill.git synced 2025-10-16 15:16:14 +02:00

Version 1.3.7: Theme Cyanine and Notice Component

This commit is contained in:
trendschau
2020-06-11 09:45:32 +02:00
parent 021f487fe7
commit 53dd14fd8b
86 changed files with 1532 additions and 3067 deletions

View File

@@ -19,11 +19,13 @@ class Settings
# no individual image sizes are allowed sind 1.3.4
$settings['images'] = $defaultSettings['images'];
# if there is no theme set
if(!isset($settings['theme']))
# we have to check if the theme has been deleted
$themefolder = $settings['rootPath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR;
# if there is no theme in settings or theme has been deleted
if(!isset($settings['theme']) OR !file_exists($themefolder . $settings['theme']))
{
# scan theme folder and get the first theme
$themefolder = $settings['rootPath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR;
$themes = array_diff(scandir($themefolder), array('..', '.'));
$firsttheme = reset($themes);
@@ -72,7 +74,7 @@ class Settings
'userPath' => $rootPath . 'settings' . DIRECTORY_SEPARATOR . 'users',
'authorPath' => __DIR__ . DIRECTORY_SEPARATOR . 'author' . DIRECTORY_SEPARATOR,
'editor' => 'visual',
'formats' => ['markdown', 'headline', 'ulist', 'olist', 'table', 'quote', 'image', 'video', 'file', 'toc', 'hr', 'definition', 'code'],
'formats' => ['markdown', 'headline', 'ulist', 'olist', 'table', 'quote', 'notice', 'image', 'video', 'file', 'toc', 'hr', 'definition', 'code'],
'contentFolder' => 'content',
'cache' => true,
'cachePath' => $rootPath . 'cache',

View File

@@ -17,7 +17,7 @@ class Translations
$language = $settings['language'];
}
$theme = 'typemill';
$theme = 'cyanine';
if($settings !== NULL){
if(is_array($settings)){
if (array_key_exists('theme', $settings)) {

View File

@@ -238,6 +238,22 @@ figcaption{
caption-side: bottom;
}
button.note1{
background-color: #d00;
color: #fff;
}
button.note2{
background-color: #fb0;
color: #fff;
}
button.note3{
background-color: #08e;
color: #fff;
}
.blox-editor textarea.pl-notice{
padding-left: 40px;
}
.notice1 {
margin: 1em 0;
padding: 10px 1em;
@@ -1814,16 +1830,21 @@ button.hdown{
left: 0px;
font-size: 1em;
font-weight: 700;
background: #f9f8f6;
border: 0px solid #fff;
border-right: 1px solid #fff;
color: #66b0a3;
// background: #f9f8f6;
// color: #66b0a3;
}
button.hdown.headline{
color: #f9f8f6;
background: #66b0a3;
}
/*
button.hdown:hover,button.hdown:focus,button.hdown:active{
color: #f9f8f6;
background: #66b0a3;
}
*/
.blox-editor .contenttype {
position: absolute;
top: 15px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -63,6 +63,13 @@ let determiner = {
}
return false;
},
notice: function(block,lines,firstChar,secondChar,thirdChar){
if( firstChar == '!' && ( secondChar == '!' || secondChar == ' ') )
{
return "notice-component";
}
return false;
},
ulist: function(block,lines,firstChar,secondChar,thirdChar){
if( (firstChar == '*' || firstChar == '-' || firstChar == '+') && secondChar == ' ')
{
@@ -79,6 +86,7 @@ let bloxFormats = {
olist: { label: '<svg class="icon icon-list-numbered"><use xlink:href="#icon-list-numbered"></use></svg>', title: 'Numbered List', component: 'olist-component' },
table: { label: '<svg class="icon icon-table2"><use xlink:href="#icon-table2"></use></svg>', title: 'Table', component: 'table-component' },
quote: { label: '<svg class="icon icon-quotes-left"><use xlink:href="#icon-quotes-left"></use></svg>', title: 'Quote', component: 'quote-component' },
notice: { label: '<svg class="icon icon-exclamation-circle"><use xlink:href="#icon-exclamation-circle"></use></svg>', title: 'Notice', component: 'notice-component' },
image: { label: '<svg class="icon icon-image"><use xlink:href="#icon-image"></use></svg>', title: 'Image', component: 'image-component' },
video: { label: '<svg class="icon icon-play"><use xlink:href="#icon-play"></use></svg>', title: 'Video', component: 'video-component' },
file: { label: '<svg class="icon icon-paperclip"><use xlink:href="#icon-paperclip"></use></svg>', title: 'File', component: 'file-component' },

View File

@@ -165,7 +165,7 @@ const contentComponent = Vue.component('content-block', {
},
submitBlock: function(){
var emptyline = /^\s*$(?:\r\n?|\n)/gm;
if(this.componentType == "code-component" || this.componentType == "math-component"){ }
if(this.componentType == "code-component" || this.componentType == "math-component" || this.componentType == "notice-component"){ }
else if(this.componentType == "ulist-component" || this.componentType == "olist-component")
{
var listend = (this.componentType == "ulist-component") ? '* \n' : '1. \n';
@@ -834,11 +834,82 @@ const olistComponent = Vue.component('olist-component', {
},
})
const noticeComponent = Vue.component('notice-component', {
props: ['compmarkdown', 'disabled'],
template: '<div>' +
'<input type="hidden" ref="markdown" :value="compmarkdown" :disabled="disabled" @input="updatemarkdown" />' +
'<div class="contenttype"><svg class="icon icon-exclamation-circle"><use xlink:href="#icon-exclamation-circle"></use></svg></div>' +
'<button class="hdown" :class="noteclass" @click.prevent="noticedown" v-html="prefix"></button>' +
'<inline-formats>' +
'<textarea class="mdcontent pl-notice" ref="markdown" v-model="notice" :disabled="disabled" @input="updatemarkdown(event.target.value)"></textarea>' +
'</inline-formats>' +
'</div>',
data: function(){
return {
prefix: '! ',
notice: '',
noteclass: 'note1'
}
},
mounted: function(){
this.$refs.markdown.focus();
if(this.compmarkdown)
{
this.prefix = this.getNoticePrefix(this.compmarkdown);
var lines = this.compmarkdown.match(/^.*([\n\r]+|$)/gm);
for (var i = 0; i < lines.length; i++) {
lines[i] = lines[i].replace(/(^[\! ]+)/mg, '');
}
this.notice = lines.join('');
this.noteclass = 'note'+this.prefix.length;
}
this.$nextTick(function () {
autosize(document.querySelectorAll('textarea'));
});
},
methods: {
noticedown: function()
{
this.prefix = this.getNoticePrefix(this.compmarkdown);
this.prefix += "! ";
if(this.prefix.length > 4)
{
this.prefix = "! ";
}
this.noteclass = 'note' + (this.prefix.length-1);
this.updatemarkdown(this.notice);
},
getNoticePrefix: function(str)
{
var prefix = '';
for(var i = 0; i < str.length; i++){
if(str[i] != '!'){ return prefix }
prefix += '!';
}
return prefix+' ';
},
updatemarkdown: function(value)
{
this.notice = value;
var lines = value.match(/^.*([\n\r]|$)/gm);
var notice = this.prefix + lines.join(this.prefix);
this.$emit('updatedMarkdown', notice);
},
},
})
const headlineComponent = Vue.component('headline-component', {
props: ['compmarkdown', 'disabled'],
template: '<div>' +
'<div class="contenttype"><svg class="icon icon-header"><use xlink:href="#icon-header"></use></svg></div>' +
'<button class="hdown" @click.prevent="headlinedown" v-html="level"></button>' +
'<button class="hdown headline" @click.prevent="headlinedown" v-html="level"></button>' +
'<input class="mdcontent" :class="hlevel" type="text" ref="markdown" v-model="compmarkdown" :disabled="disabled" @input="updatemarkdown">' +
'</div>',
data: function(){

View File

@@ -115,6 +115,7 @@ NONE: Keine
NO_PREVIEW: Keine Vorschau
NO_SETTINGS: Keine Einstellungen
NOT_EDITABLE: Nicht editierbar
NOTICE: Hinweis
NUMBERED_LIST: Aufzählung
OLIST: olist
ONLINE: online

View File

@@ -120,6 +120,7 @@ NONE: None
NO_PREVIEW: No Preview
NO_SETTINGS: No Settings
NOT_EDITABLE: not editable
NOTICE: Notice
NUMBERED_LIST: Numbered List
OLIST: olist
ONLINE: online

View File

@@ -8,18 +8,19 @@
<meta name="description" content="Configure your TYPEMILL website"/>
<base href="{{ base_url }}/">
<meta name="msapplication-TileColor" content="#F9F8F6" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/mstile-144x144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32.png" sizes="32x32" />
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_url }}/system/author/img/favicon-72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ base_url }}/system/author/img/favicon-114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css?20200505" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200505" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

View File

@@ -11,11 +11,13 @@
<base href="{{ base_url }}/">
<meta name="msapplication-TileColor" content="#F9F8F6" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/mstile-144x144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32.png" sizes="32x32" />
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_url }}/system/author/img/favicon-72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ base_url }}/system/author/img/favicon-114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200505" />

View File

@@ -10,11 +10,13 @@
<base href="{{ base_url }}/">
<meta name="msapplication-TileColor" content="#F9F8F6" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/mstile-144x144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32.png" sizes="32x32" />
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_url }}/system/author/img/favicon-72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ base_url }}/system/author/img/favicon-114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200505" />

View File

@@ -10,11 +10,13 @@
<base href="{{ base_url }}/">
<meta name="msapplication-TileColor" content="#F9F8F6" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/mstile-144x144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32.png" sizes="32x32" />
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_url }}/system/author/img/favicon-72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ base_url }}/system/author/img/favicon-114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css" />
@@ -79,6 +81,10 @@
<path d="M26 9c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3z"></path>
<path d="M28 26h-24v-4l7-12 8 10h2l7-6z"></path>
</symbol>
<symbol id="icon-exclamation-circle" viewBox="0 0 24 28">
<title>{{ __('NOTICE') }}</title>
<path d="M12 2c6.625 0 12 5.375 12 12s-5.375 12-12 12-12-5.375-12-12 5.375-12 12-12zM14 21.484v-2.969c0-0.281-0.219-0.516-0.484-0.516h-3c-0.281 0-0.516 0.234-0.516 0.516v2.969c0 0.281 0.234 0.516 0.516 0.516h3c0.266 0 0.484-0.234 0.484-0.516zM13.969 16.109l0.281-9.703c0-0.109-0.047-0.219-0.156-0.281-0.094-0.078-0.234-0.125-0.375-0.125h-3.437c-0.141 0-0.281 0.047-0.375 0.125-0.109 0.063-0.156 0.172-0.156 0.281l0.266 9.703c0 0.219 0.234 0.391 0.531 0.391h2.891c0.281 0 0.516-0.172 0.531-0.391z"></path>
</symbol>
<symbol id="icon-paperclip" viewBox="0 0 22 28">
<title>{{ __('PAPERCLIP') }}</title>
<path d="M21.938 21.641c0 2.438-1.859 4.297-4.297 4.297-1.375 0-2.703-0.594-3.672-1.563l-12.141-12.125c-1.109-1.125-1.766-2.656-1.766-4.234 0-3.313 2.609-5.953 5.922-5.953 1.594 0 3.125 0.641 4.266 1.766l9.453 9.469c0.094 0.094 0.156 0.219 0.156 0.344 0 0.328-0.875 1.203-1.203 1.203-0.141 0-0.266-0.063-0.359-0.156l-9.469-9.484c-0.75-0.734-1.766-1.203-2.828-1.203-2.219 0-3.938 1.797-3.938 4 0 1.062 0.438 2.078 1.188 2.828l12.125 12.141c0.594 0.594 1.422 0.984 2.266 0.984 1.328 0 2.312-0.984 2.312-2.312 0-0.859-0.391-1.672-0.984-2.266l-9.078-9.078c-0.25-0.234-0.594-0.375-0.938-0.375-0.594 0-1.047 0.438-1.047 1.047 0 0.344 0.156 0.672 0.391 0.922l6.406 6.406c0.094 0.094 0.156 0.219 0.156 0.344 0 0.328-0.891 1.219-1.219 1.219-0.125 0-0.25-0.063-0.344-0.156l-6.406-6.406c-0.625-0.609-0.984-1.469-0.984-2.328 0-1.719 1.344-3.062 3.063-3.062 0.875 0 1.719 0.359 2.328 0.984l9.078 9.078c0.984 0.969 1.563 2.297 1.563 3.672z"></path>

View File

@@ -10,16 +10,16 @@
<base href="{{ base_url }}/">
<meta name="msapplication-TileColor" content="#F9F8F6" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/mstile-144x144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16x16.png" sizes="16x16" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<meta name="msapplication-TileImage" content="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ base_url }}/system/author/img/favicon-32.png" sizes="32x32" />
<link rel="apple-touch-icon" sizes="72x72" href="{{ base_url }}/system/author/img/favicon-72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ base_url }}/system/author/img/favicon-114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="{{ base_url }}/system/author/img/favicon-144.png" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200505" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
{{ assets.renderCSS() }}

View File

@@ -218,22 +218,22 @@ $container['view'] = function ($container)
$view->getEnvironment()->addGlobal('assets', $container->assets);
/******************************
* LOAD TRANSLATIONS *
******************************/
$uri = $_SERVER['REQUEST_URI'];
if(isset($uri) && (strpos($uri,'/tm/') !== false OR strpos($uri,'/setup') !== false))
{
// Admin environment labels
$labels = Typemill\Translations::loadTranslations('admin');
} else {
// User environment labels
// For now it is useless, but it will prove useful in the future
$labels = Typemill\Translations::loadTranslations('user');
}
$container['translations'] = $labels;
$view['translations'] = $labels;
$view->addExtension(new Typemill\Extensions\TwigLanguageExtension( $labels ));
/******************************
* LOAD TRANSLATIONS *
******************************/
$uri = $_SERVER['REQUEST_URI'];
if(isset($uri) && (strpos($uri,'/tm/') !== false OR strpos($uri,'/setup') !== false))
{
// Admin environment labels
$labels = Typemill\Translations::loadTranslations('admin');
} else {
// User environment labels
// For now it is useless, but it will prove useful in the future
$labels = Typemill\Translations::loadTranslations('user');
}
$container['translations'] = $labels;
$view['translations'] = $labels;
$view->addExtension(new Typemill\Extensions\TwigLanguageExtension( $labels ));
return $view;
};