浏览代码

Version 1.2.2 Draft Management and fixed autosize

Sebastian 7 年之前
父节点
当前提交
1d71f80bea

+ 1 - 1
cache/lastCache.txt

@@ -1 +1 @@
-1532455604
+1532595582

+ 1 - 0
content/0_typemill/01-use-cases.txt

@@ -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."]

+ 1 - 3
system/author/content/content.twig

@@ -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 />

文件差异内容过多而无法显示
+ 5 - 0
system/author/js/autosize.min.js


+ 4 - 22
system/author/js/vue-editor.js

@@ -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){

+ 2 - 1
system/author/layouts/layoutContent.twig

@@ -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>

部分文件因为文件数量过多而无法显示