1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-03 12:47:34 +02:00

Version 1.2.2 Draft Management and fixed autosize

This commit is contained in:
Sebastian
2018-07-26 11:05:45 +02:00
parent d2a3dd9aa3
commit 1d71f80bea
6 changed files with 15 additions and 27 deletions

2
cache/lastCache.txt vendored
View File

@@ -1 +1 @@
1532455604
1532595582

View File

@@ -0,0 +1 @@
["# Use Cases","Whenever you want to publish a finished text work as a website and if you like writing with Markdown, then TYPEMILL is a smart and lightweight solution. Possible use cases are ...","- a documentation\n- a manual\n- a user guide\n- a whitepaper\n- a handbook\n- a tutorial\n- a study\n- a book\n- a drama\n- a lyric collection\n- a collection of articles","If you want to create a blog, a wiki or a classic corporate website, please use a specialized CMS for that instead of TYPEMILL.","TYPEMILL is under heavy developement and not finished right now. It has an admin panel for settings and a very basic editor for existing content. More options like delete or create new pages and manage your media-files will be added step by step in next weeks. Also different output formats like mobi and ePup are on the roadmap, so stay tuned.","You have to use a FTP-software like FileZilla until the basic editing features are ready. Check the roadmap for more informations."]

View File

@@ -18,9 +18,7 @@
</div>
<div class="large" :class="{'error' : errors.content}">
<label for="content">Content*</label>
<resizable-textarea>
<textarea @input="changeContent" id="content" v-model="form.content" @keyup.enter="submit" required>{{ content }}</textarea>
</resizable-textarea>
<textarea id="content" v-model="form.content" @input="changeContent" @keyup.enter="submit" required>{{ content }}</textarea>
<span class="error" v-if="errors.content">${ errors.content }</span>
</div>
<input id="path" type="hidden" value="{{ item.urlRel }}" required readonly />

6
system/author/js/autosize.min.js vendored Normal file
View File

@@ -0,0 +1,6 @@
/*!
autosize 4.0.2
license: MIT
http://www.jacklmoore.com/autosize
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);-1<t&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!p.has(r)){var e,n=null,o=null,i=null,d=function(){r.clientWidth!==o&&a()},l=function(t){window.removeEventListener("resize",d,!1),r.removeEventListener("input",a,!1),r.removeEventListener("keyup",a,!1),r.removeEventListener("autosize:destroy",l,!1),r.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),p.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",l,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),r.addEventListener("input",a,!1),r.addEventListener("autosize:update",a,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",p.set(r,{destroy:l,update:a}),"vertical"===(e=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===e.resize&&(r.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),a()}function s(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function u(){if(0!==r.scrollHeight){var e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop;r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t)}}function a(){u();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(s("scroll"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(s("hidden"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}}function i(e){var t=p.get(e);t&&t.destroy()}function d(e){var t=p.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default});

View File

@@ -1,24 +1,3 @@
Vue.component('resizable-textarea', {
methods: {
resizeTextarea (event) {
event.target.style.height = 'auto'
event.target.style.height = (event.target.scrollHeight) + 'px'
},
},
mounted () {
this.$nextTick(() => {
this.$el.setAttribute('style', 'height:' + (this.$el.scrollHeight) + 'px;overflow-y:hidden;')
})
this.$el.addEventListener('input', this.resizeTextarea)
},
beforeDestroy () {
this.$el.removeEventListener('input', this.resizeTextarea)
},
render () {
return this.$slots.default[0]
},
});
let app = new Vue({
delimiters: ['${', '}'],
el: '#editor',
@@ -46,8 +25,11 @@ let app = new Vue({
publishStatus: document.getElementById("publishController").dataset.published ? false : true,
publishLabel: document.getElementById("publishController").dataset.published ? "online" : "offline",
},
mounted(){
autosize(document.querySelector('textarea'));
},
methods: {
submit: function(e){
submit: function(e){
/* count submits and react to line before. */
},
changeContent: function(e){

View File

@@ -35,7 +35,8 @@
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/vue.min.js"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20180724"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js"></script>
<script src="{{ base_url }}/system/author/js/author.js?20180724"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20180724"></script>
</body>
</html>