Markdown editor on publisher, conversations and mobile comments
This commit is contained in:
parent
280a9e2023
commit
008b899422
7 changed files with 34 additions and 2 deletions
|
|
@ -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
|
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||||
* licensed under the Affero General Public License version 3 or later. See
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
* the COPYRIGHT file.
|
* the COPYRIGHT file.
|
||||||
*/
|
*/
|
||||||
|
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
|
||||||
|
|
||||||
//= require jquery-textchange
|
//= require jquery-textchange
|
||||||
//= require charcount
|
//= require charcount
|
||||||
//= require js-routes
|
//= require js-routes
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
//= require helpers/i18n
|
//= require helpers/i18n
|
||||||
//= require helpers/profile_photo_uploader
|
//= require helpers/profile_photo_uploader
|
||||||
//= require helpers/tags_autocomplete
|
//= require helpers/tags_autocomplete
|
||||||
|
//= require bootstrap-markdown/bootstrap-markdown
|
||||||
|
//= require helpers/markdown_editor
|
||||||
//= require widgets/timeago
|
//= require widgets/timeago
|
||||||
//= require mobile/mobile_application
|
//= require mobile/mobile_application
|
||||||
//= require mobile/mobile_file_uploader
|
//= require mobile/mobile_file_uploader
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
new Diaspora.MarkdownEditor(".comment_box");
|
||||||
|
|
||||||
this.stream().on("tap click", "a.show-comments", function(evt){
|
this.stream().on("tap click", "a.show-comments", function(evt){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
self.toggleComments($(this));
|
self.toggleComments($(this));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
Diaspora.Mobile.Conversations = {
|
Diaspora.Mobile.Conversations = {
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
new Diaspora.MarkdownEditor(".conversation-message-text");
|
||||||
if (Diaspora.Page !== "ConversationsNew") { return; }
|
if (Diaspora.Page !== "ConversationsNew") { return; }
|
||||||
$(document).on("ajax:success", "form#new-conversation", this.conversationCreateSuccess);
|
$(document).on("ajax:success", "form#new-conversation", this.conversationCreateSuccess);
|
||||||
$(document).on("ajax:error", "form#new-conversation", this.conversationCreateError);
|
$(document).on("ajax:error", "form#new-conversation", this.conversationCreateError);
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,6 @@ $(document).ready(function(){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
$("#new_status_message").submit();
|
$("#new_status_message").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new Diaspora.MarkdownEditor("#status_message_text");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
.btn-group {
|
.btn-group {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
|
&:first-child { margin-left: 0; }
|
||||||
|
|
||||||
[class^="entypo-"],
|
[class^="entypo-"],
|
||||||
[class*="entypo-"] {
|
[class*="entypo-"] {
|
||||||
|
|
|
||||||
22
app/assets/stylesheets/mobile/markdown_editor.scss
Normal file
22
app/assets/stylesheets/mobile/markdown_editor.scss
Normal 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%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,8 @@
|
||||||
@import "mobile/stream_element";
|
@import "mobile/stream_element";
|
||||||
@import "mobile/comments";
|
@import "mobile/comments";
|
||||||
@import 'mobile/openid_connect_error_page';
|
@import 'mobile/openid_connect_error_page';
|
||||||
|
@import 'markdown-editor';
|
||||||
|
@import 'mobile/markdown_editor';
|
||||||
|
|
||||||
@import 'typography';
|
@import 'typography';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue