Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdding bootstrap-markdown editor #6551
Conversation
options.onPreview = previewCallback; | ||
} | ||
else{ | ||
options.disabledButtons = ["cmdPreview"] |
This comment has been minimized.
This comment has been minimized.
@@ -6,3 +6,4 @@ | |||
// Plugins | |||
|
|||
@import "bootstrap3-switch"; | |||
@import "bootstrap-markdown/bootstrap-markdown.min"; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@jhass: I'm having a problem with the asset pipeline on this: Do you know where it comes from? |
This comment has been minimized.
This comment has been minimized.
This would be pretty awesome if you can pull it off! The markdown variant seems like the correct one, though I the preview should probably be disabled since it probably wont be able to render all the codes diaspora supports? And we already have a preview. This would especially help new users to settle in who have never heard about markdown. |
This comment has been minimized.
This comment has been minimized.
I plan to use our rendering engine. One can sepcify a rendering function.
Yep, and it would clearly easier markdown formatting on mobile. |
This comment has been minimized.
This comment has been minimized.
I think my problem could be related to this. Since there seems to be no way to prevent bundler to perform dependency resolution, I'll try the solution in the last answer tonight. |
@@ -2,6 +2,10 @@ | |||
# licensed under the Affero General Public License version 3 or later. See | |||
# the COPYRIGHT file. | |||
|
|||
Rails.configuration.assets.paths.reject! do |path| | |||
path.include?('rails-assets-bootstrap') && !path.include?('rails-assets-bootstrap-markdown') |
This comment has been minimized.
This comment has been minimized.
diaspora-code-review
Nov 18, 2015
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
This comment has been minimized.
This comment has been minimized.
So this looks like an attempt to solve #5801. Is this conform to what we said there, == a publisher close to what github does (a write tab, not wisiwig, and a preview tab)? |
This comment has been minimized.
This comment has been minimized.
Yup! :) |
This comment has been minimized.
This comment has been minimized.
Nothing against a preview tab, but these buttons always look so clunky and messy :/ |
@@ -2,6 +2,10 @@ | |||
# licensed under the Affero General Public License version 3 or later. See | |||
# the COPYRIGHT file. | |||
|
|||
Rails.configuration.assets.paths.reject! do |path| |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Also make sure to render the preview with our existing markdown-it pipeline, if it uses a different renderer it's useless. |
This comment has been minimized.
This comment has been minimized.
Nothing to worry, preview will be rendered with our engine. |
This comment has been minimized.
This comment has been minimized.
goobertron
commented
Nov 18, 2015
Will be great if you can get this working! Just a thought, to save visual clutter and space, could you have the format icons spaced along a single bar rather than each being in a button? Something like this: It might even be best to merge this bar with the notification about using Markdown, to save space. I'd also suggest streamlining the new preview function with the existing one. There was discussion before about changing the preview button to a tab, which seems a good idea to me - but whether or not you decide to tackle that in this PR, I don't think there's a need for a second preview button. Thanks for your work! |
This comment has been minimized.
This comment has been minimized.
That looks great, goob! I agree that a simple formatting bar might do the On Wed, Nov 18, 2015 at 1:03 PM, goob notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
I thought about doing this. But I fear it could be controversial.
Yep, that's planned ;)
Current existing one will be annihilated! >:D #6537 will have to get merged before I can continue working on the preview function. |
This comment has been minimized.
This comment has been minimized.
Here is a design proposition based on what @goobertron proposed: I don't really like it. I find it messy and I fear about the risks of misclick. Particularly on a mobile phone. |
This comment has been minimized.
This comment has been minimized.
I would prefer to see the buttons at the bottom to not distract the user, but we then need a way to clearly differentiate what is markdown insert and what is post addition (polls, picture, location). |
This comment has been minimized.
This comment has been minimized.
I can't choose that, unhopefully. Besides, Having the formatting buttons at the top pretty a standard. |
This comment has been minimized.
This comment has been minimized.
I have to agree with Jonne at
Idea: One could use the "Markdown" link that's already there to trigger the editor to load. |
This comment has been minimized.
This comment has been minimized.
My opinion is that it has to be easy for inexperimented users first. So buttons have to be displayed by default. |
This comment has been minimized.
This comment has been minimized.
I agree our default should be "common" users. Or have a setting to switch the default. But default for new users should be to show the buttons. |
This comment has been minimized.
This comment has been minimized.
Let's first see if we can make the buttons as subtle and integrated as possible. If that's still too much for used users, then we'll see what we can do :) |
This comment has been minimized.
This comment has been minimized.
"Common users", at least on Geraspora, do not use any formatting but only publish plain text posts. ;) |
This comment has been minimized.
This comment has been minimized.
Maybe they don't know how to format posts. |
This comment has been minimized.
This comment has been minimized.
Here is how I see the publisher (note that the images have a width of 650px so the mockups work on all screens): First proposition:Second proposition:About the second proposition:
|
This comment has been minimized.
This comment has been minimized.
Nope, @Flaburgan, your proposition won't be possible. I can't just place the buttons where I want because they are created by the plugin. So, the way it goes, I'd have to... rewrite the plugin. Plus, I explained that small buttons like on your mocks causes huge risks on misclick. |
This comment has been minimized.
This comment has been minimized.
@AugierLe42e my mockups describe how the publisher can look like, they don't include any technical constraint. And I think we should first imagine and design what would be the best, and then see what are the technical limitations. |
This comment has been minimized.
This comment has been minimized.
So, maybe that's not the right place ;) |
This comment has been minimized.
This comment has been minimized.
Yeah I should have created them when I opened #5801 but now it looks like this PR is an attempt to close this issue (thanks for that!) so I post them here. We already have a preview button and we use our own render engine. So to not use the plugin to do that seems fine for me. I don't think my proposed design adds a lot more work ;) |
This comment has been minimized.
This comment has been minimized.
@@ -63,10 +63,19 @@ | |||
#main_stream .stream_element { | |||
padding: 10px; |
This comment has been minimized.
This comment has been minimized.
svbergerem
Aug 11, 2016
Member
You also added padding: 10px;
to the .stream_element
rule so I guess you can remove this here.
#poll_creator_container | ||
-# handlebars template | ||
.poll-creator-container#poll_creator_container | ||
-# handlebars template |
This comment has been minimized.
This comment has been minimized.
list: "list text here" | ||
quote: "quotation text here" | ||
code: "code here" | ||
|
This comment has been minimized.
This comment has been minimized.
end | ||
|
||
Then /^I should see "([^"]*)" in the preview$/ do |text| | ||
with_scope(".publisher-textarea-wrapper .md-preview") do | ||
current_scope.should have_content(text) |
This comment has been minimized.
This comment has been minimized.
|
||
Then /^I should not see "([^"]*)" in the preview$/ do |text| | ||
with_scope(".publisher-textarea-wrapper .md-preview") do | ||
current_scope.should_not have_content(text) |
This comment has been minimized.
This comment has been minimized.
|
||
Then /^I should not be in preview mode$/ do | ||
with_scope(".publisher-textarea-wrapper") do | ||
current_scope.should_not have_css(".md-preview") |
This comment has been minimized.
This comment has been minimized.
Then the preview should not be collapsed | ||
|
||
And I preview the post | ||
# Then the previewed should be collapsed |
This comment has been minimized.
This comment has been minimized.
svbergerem
Aug 12, 2016
Member
I think it would be great to keep the test.
Then the preview should not be collapsed
with_scope("publisher-textarea-wrapper .md-preview") do | ||
expect(find(".stream_element .collapsible", match: :first)).to have_css(".expander") | ||
end | ||
end |
This comment has been minimized.
This comment has been minimized.
end | ||
|
||
Then /^the preview should not be collapsed$/ do | ||
find(".post_preview").should_not have_selector('.collapsed') | ||
find(".post_preview").should have_selector('.opened') |
This comment has been minimized.
This comment has been minimized.
"author": app.currentUser ? app.currentUser.attributes : {}, | ||
"mentioned_people": mentionedPeople, | ||
"photos": photos, | ||
"frame_name": "status", |
This comment has been minimized.
This comment has been minimized.
svbergerem
Aug 12, 2016
Member
I'm unable to find this anywhere else so maybe we can just drop this?
"author": {}, | ||
"mentioned_people": [], | ||
"photos": [], | ||
"frame_name": "status", |
This comment has been minimized.
This comment has been minimized.
"location": ["", ""], | ||
"interactions": {"likes": [], "reshares": [], "comments_count": 0, "likes_count": 0, "reshares_count": 0}, | ||
"poll": undefined | ||
}); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
svbergerem
Aug 12, 2016
Member
https://github.com/diaspora/diaspora/blob/develop/spec/javascripts/jasmine_helpers/factory.js#L184
spec/javascripts/app/views/poll_view_spec.js:4: this.view = new app.views.Poll({ model: factory.postWithPoll()});
This comment has been minimized.
This comment has been minimized.
@@ -100,10 +112,10 @@ describe("app.views.Publisher", function() { | |||
}); | |||
|
|||
it("calls removePostPreview", function(){ |
This comment has been minimized.
This comment has been minimized.
this.$el = $("#fake-textarea"); | ||
Diaspora.I18n.language = "en"; | ||
var locale = { | ||
// Localisation |
This comment has been minimized.
This comment has been minimized.
} | ||
/* eslint-enable camelcase */ | ||
}; | ||
Diaspora.I18n.load(locale, "en", locale); |
This comment has been minimized.
This comment has been minimized.
svbergerem
Aug 12, 2016
Member
Regenerate fixtures, then you shouldn't need to set the locales manually: https://github.com/diaspora/diaspora/blob/develop/spec/javascripts/jasmine_helpers/SpecHelper.js#L161
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm able to reproduce it with Firefox 48 and Firefox Developer (50.0a2 (2016-08-05)):
|
This comment has been minimized.
This comment has been minimized.
Adding bootstrap-markdown editor
This comment has been minimized.
This comment has been minimized.
Thank you! |
This comment has been minimized.
This comment has been minimized.
goobertron
commented
Aug 13, 2016
Wow, thank you @AugierLe42e! A major UI improvement. |
This comment has been minimized.
This comment has been minimized.
Thank you @goobertron |
ghost commentedNov 17, 2015
•
edited by ghost
Adding Bootstrap Markdown editor to publisher.