1
0
mirror of https://github.com/typemill/typemill.git synced 2025-10-17 23:56:09 +02:00

Version 1.3.7. Fix image attributes

This commit is contained in:
trendschau
2020-06-12 21:21:49 +02:00
parent 8d052e785f
commit 2b6a1552ff
19 changed files with 239 additions and 109 deletions

View File

@@ -1832,19 +1832,11 @@ button.hdown{
font-weight: 700;
border: 0px solid #fff;
border-right: 1px solid #fff;
// 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;

View File

@@ -735,6 +735,7 @@ const quoteComponent = Vue.component('quote-component', {
'</div>',
data: function(){
return {
prefix: '> ',
quote: ''
}
},
@@ -742,24 +743,100 @@ const quoteComponent = Vue.component('quote-component', {
this.$refs.markdown.focus();
if(this.compmarkdown)
{
var quote = this.compmarkdown.replace("> ", "");
quote = this.compmarkdown.replace(">", "").trim();
this.quote = quote;
var lines = this.compmarkdown.match(/^.*([\n\r]+|$)/gm);
for (var i = 0; i < lines.length; i++) {
lines[i] = lines[i].replace(/(^[\> ]+)/mg, '');
}
this.quote = lines.join('');
}
this.$nextTick(function () {
autosize(document.querySelectorAll('textarea'));
});
});
},
methods: {
updatemarkdown: function(value)
{
this.quote = value;
var quote = '> ' + value;
var lines = value.match(/^.*([\n\r]|$)/gm);
var quote = this.prefix + lines.join(this.prefix);
this.$emit('updatedMarkdown', quote);
},
},
})
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 ulistComponent = Vue.component('ulist-component', {
props: ['compmarkdown', 'disabled'],
template: '<div>' +
@@ -834,77 +911,6 @@ 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>' +
@@ -1345,6 +1351,7 @@ const imageComponent = Vue.component('image-component', {
imglink: '',
imgclass: 'center',
imgid: '',
imgattr: '',
imgfile: '',
}
},
@@ -1404,6 +1411,10 @@ const imageComponent = Vue.component('image-component', {
{
this.imgid = imgattr[i].slice(1);
}
else
{
this.imgattr += ' ' + imgattr[i];
}
}
}
@@ -1484,7 +1495,11 @@ const imageComponent = Vue.component('image-component', {
errors = 'Maximum size of image class is 100 characters';
}
}
if(this.imgid != '' || this.imgclass != '')
if(this.imgattr != '')
{
imgattr += this.imgattr;
}
if(imgattr != '')
{
imgmarkdown = imgmarkdown + '{' + imgattr + '}';
}
@@ -2144,7 +2159,8 @@ const medialib = Vue.component('medialib', {
this.$parent.showmedialib = false;
this.$parent.updatemarkdown(imgmarkdown, image.src_live);
this.$parent.createmarkdown();
/* this.$parent.updatemarkdown(imgmarkdown, image.src_live); */
}
if(this.parentcomponent == 'files')
{
@@ -2177,7 +2193,8 @@ const medialib = Vue.component('medialib', {
this.$parent.showmedialib = false;
this.$parent.updatemarkdown(imgmarkdown, file.url);
this.$parent.createmarkdown();
/* this.$parent.updatemarkdown(imgmarkdown, file.url);*/
}
if(this.parentcomponent == 'files')
{

View File

@@ -200,12 +200,12 @@ VISIT_THE_AUTHOR_PANEL_AND_SETUP_YOUR_NEW_WEBSITE__YOU_CAN_CONFIGURE_THE_SYSTEM_
GET_HELP: Hilfe erhalten
IF_YOU_HAVE_ANY_QUESTIONS__PLEASE_READ_THE: Wenn du Fragen hast, lies bitte die
DOCS: Dokumentation
OR_OPEN_A_NEW_ISSUE_ON: oder öffne ein neues Issue
OR_OPEN_A_NEW_ISSUE_ON: oder erstelle ein neues Issue auf
CODED_WITH: Entwickelt mit
BY_THE: von der
COMMUNITY: Community
TRENDSCHAU_DIGITAL: Trendschau Digital
CONFIGURE_YOUR_WEBSITE: Richte deine Seite ein.
GIVE_YOUR_NEW_WEBSITE_A_NAME__ADD_THE_AUTHOR_AND_CHOOSE_A_COPYRIGHT_: Gib deiner neuen Seite einen Namen, füge Autoren hinzu und wähle ein Copyright.
CONFIGURE_YOUR_WEBSITE: Zur Autorenoberfläche
GIVE_YOUR_NEW_WEBSITE_A_NAME__ADD_THE_AUTHOR_AND_CHOOSE_A_COPYRIGHT_: Konfiguriere das System.
CHOOSE_A_THEME_FOR_YOUR_WEBSITE_AND_CONFIGURE_THE_THEME_DETAILS_: Richte ein Theme für deine Webseite ein.
ADD_NEW_FEATURES_TO_YOUR_WEBSITE_WITH_PLUGINS_AND_CONFIGURE_THEM_: Füge mit Plugins neue Funktionen hinzu.