Markdown editor on publisher, conversations and mobile comments

This commit is contained in:
Augier 2016-12-01 12:04:42 +01:00 committed by Steffen van Bergerem
parent 280a9e2023
commit 008b899422
No known key found for this signature in database
GPG key ID: 315C9787D548DC6B
7 changed files with 34 additions and 2 deletions

View file

@ -1,9 +1,9 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
//= require jquery-textchange
//= require charcount
//= require js-routes
@ -18,6 +18,8 @@
//= require helpers/i18n
//= require helpers/profile_photo_uploader
//= require helpers/tags_autocomplete
//= require bootstrap-markdown/bootstrap-markdown
//= require helpers/markdown_editor
//= require widgets/timeago
//= require mobile/mobile_application
//= require mobile/mobile_file_uploader

View file

@ -11,6 +11,8 @@
initialize: function() {
var self = this;
new Diaspora.MarkdownEditor(".comment_box");
this.stream().on("tap click", "a.show-comments", function(evt){
evt.preventDefault();
self.toggleComments($(this));

View file

@ -1,6 +1,7 @@
(function() {
Diaspora.Mobile.Conversations = {
initialize: function() {
new Diaspora.MarkdownEditor(".conversation-message-text");
if (Diaspora.Page !== "ConversationsNew") { return; }
$(document).on("ajax:success", "form#new-conversation", this.conversationCreateSuccess);
$(document).on("ajax:error", "form#new-conversation", this.conversationCreateError);

View file

@ -46,4 +46,6 @@ $(document).ready(function(){
evt.preventDefault();
$("#new_status_message").submit();
});
new Diaspora.MarkdownEditor("#status_message_text");
});

View file

@ -42,6 +42,7 @@
.btn-group {
margin-bottom: 8px;
&:first-child { margin-left: 0; }
[class^="entypo-"],
[class*="entypo-"] {

View file

@ -0,0 +1,22 @@
.md-editor {
border: 1px solid $light-grey;
border-radius: $btn-border-radius-base;
overflow: hidden;
&.active { border-color: $text-grey; }
&::after,
&::before {
clear: both;
content: ' ';
display: table;
}
textarea {
border: 0;
border-radius: 0;
min-height: 6rem;
resize: none;
width: 100%;
}
}

View file

@ -16,6 +16,8 @@
@import "mobile/stream_element";
@import "mobile/comments";
@import 'mobile/openid_connect_error_page';
@import 'markdown-editor';
@import 'mobile/markdown_editor';
@import 'typography';