Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding bootstrap-markdown editor #6551

Merged
merged 1 commit into from Aug 12, 2016
Merged

Adding bootstrap-markdown editor #6551

merged 1 commit into from Aug 12, 2016

Conversation

ghost
Copy link

@ghost ghost commented Nov 17, 2015

Adding Bootstrap Markdown editor to publisher.

  • preview rendering with markdown-it
  • render location
  • render poll
  • render photos
  • jasmine test
  • fix cukes
  • localization
  • UT for MarkdownEditor

options.onPreview = previewCallback;
}
else{
options.disabledButtons = ["cmdPreview"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@ghost
Copy link
Author

ghost commented Nov 17, 2015

@jhass: I'm having a problem with the asset pipeline on this:

screen shot 2015-11-17 at 22 35 50

Do you know where it comes from?

@jaywink
Copy link
Contributor

jaywink commented Nov 18, 2015

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.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

I the preview should probably be disabled since it probably wont be able to render all the codes diaspora supports?

I plan to use our rendering engine. One can sepcify a rendering function.

This would especially help new users to settle in who have never heard about markdown.

Yep, and it would clearly easier markdown formatting on mobile.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

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.
Edit: Ok, nice, the fix works!

markdowneditor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@Flaburgan
Copy link
Member

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)?

@ghost
Copy link
Author

ghost commented Nov 18, 2015

Yup! :)

@jhass
Copy link
Member

jhass commented Nov 18, 2015

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|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining this hack.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Ninja commit from work ;)

@jhass
Copy link
Member

jhass commented Nov 18, 2015

Also make sure to render the preview with our existing markdown-it pipeline, if it uses a different renderer it's useless.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

Nothing to worry, preview will be rendered with our engine.

@goobertron
Copy link

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:

_format

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!

@DeadSuperHero
Copy link
Member

That looks great, goob! I agree that a simple formatting bar might do the
trick here.

On Wed, Nov 18, 2015 at 1:03 PM, goob notifications@github.com wrote:

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:

[image: _format]
https://cloud.githubusercontent.com/assets/2530168/11250958/e0fb08a2-8e26-11e5-8a83-b706ec7e8e8f.png

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!


Reply to this email directly or view it on GitHub
#6551 (comment).

@ghost
Copy link
Author

ghost commented Nov 18, 2015

It might even be best to merge this bar with the notification about using Markdown, to save space.

I thought about doing this. But I fear it could be controversial.

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

Yep, that's planned ;)

I don't think there's a need for a second preview button.

Current existing one will be annihilated! >:D
Second shot:

screen shot 2015-11-18 at 20 24 39
screen shot 2015-11-18 at 20 38 02

#6537 will have to get merged before I can continue working on the preview function.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

Here is a design proposition based on what @goobertron proposed:

screen shot 2015-11-18 at 21 03 45

I don't really like it. I find it messy and I fear about the risks of misclick. Particularly on a mobile phone.

@Flaburgan
Copy link
Member

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).

@ghost
Copy link
Author

ghost commented Nov 18, 2015

I would prefer to see the buttons at the bottom to not distract the user

I can't choose that, unhopefully. Besides, Having the formatting buttons at the top pretty a standard.

@denschub
Copy link
Member

I have to agree with Jonne at

Nothing against a preview tab, but these buttons always look so clunky and messy :/

Idea: One could use the "Markdown" link that's already there to trigger the editor to load.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

Idea: One could use the "Markdown" link that's already there to trigger the editor to load.

My opinion is that it has to be easy for inexperimented users first. So buttons have to be displayed by default.

@jaywink
Copy link
Contributor

jaywink commented Nov 18, 2015

My opinion is that it has to be easy for inexperimented users first. So buttons have to be displayed by default.

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.

@Flaburgan
Copy link
Member

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 :)

@denschub
Copy link
Member

"Common users", at least on Geraspora, do not use any formatting but only publish plain text posts. ;)

@jaywink
Copy link
Contributor

jaywink commented Nov 18, 2015

"Common users", at least on Geraspora, do not use any formatting but only publish plain text posts. ;)

Maybe they don't know how to format posts.

@Flaburgan
Copy link
Member

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:

Writing
publisher-write
Reading
publisher-read

Second proposition:

Writing
publisher-write2
Reading
publisher-read2

About the second proposition:
To move the poll, upload and location icon on the top right allow to:

  • Clearly separate them from the "insert markdown" button, so no confusion for the user (we could even add text like "Insert markdown" and "attach content" to legend what the buttons are doing)
  • Allow to completely hide the bottom bar when previewing, we have imo a better idea about how the post will look like.
    A down side is that it puts them away from the "publish" button, meaning the user is not encourage / remembered to use them.

@ghost
Copy link
Author

ghost commented Nov 18, 2015

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.

@Flaburgan
Copy link
Member

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

@ghost
Copy link
Author

ghost commented Nov 18, 2015

@AugierLe42e my mockups describe how the publisher can look like, they don't include any technical constraint.

So, maybe that's not the right place ;)

@Flaburgan
Copy link
Member

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 ;)

@svbergerem
Copy link
Member

After reloading the stream page when there is still some content in the publisher:

publisher after reload

@@ -63,10 +63,19 @@
#main_stream .stream_element {
padding: 10px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also added padding: 10px; to the .stream_element rule so I guess you can remove this here.

@ghost
Copy link
Author

ghost commented Aug 12, 2016

After reloading the stream page when there is still some content in the publisher:

I can't reproduce :/

@svbergerem
Copy link
Member

I'm able to reproduce it with Firefox 48 and Firefox Developer (50.0a2 (2016-08-05)):

  1. Go to the main stream.
  2. Enter some text into the publisher.
  3. Reload the page. (Hit F5)
  4. Confirm the alert.

@ghost
Copy link
Author

ghost commented Aug 12, 2016

indeed

@svbergerem svbergerem merged commit 5c2e241 into diaspora:develop Aug 12, 2016
svbergerem pushed a commit that referenced this pull request Aug 12, 2016
@ghost ghost deleted the bootstrap-markdown branch August 12, 2016 21:54
@svbergerem
Copy link
Member

Thank you! 👍

@svbergerem svbergerem added this to the 0.6.0.0 milestone Aug 12, 2016
@goobertron
Copy link

Wow, thank you @AugierLe42e! A major UI improvement.

@ghost
Copy link
Author

ghost commented Aug 13, 2016

Thank you @goobertron 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet