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

Implements file-upload via dropzone #2508

Closed
wants to merge 8 commits into from
Closed

Implements file-upload via dropzone #2508

wants to merge 8 commits into from

Conversation

jacargentina
Copy link
Contributor

Fixes #2071

Now integrates with octicons!

Depends on elementalui/elemental#146

@jacargentina
Copy link
Contributor Author

I think the heading, and H1...H4 should look better, but i could'nt find a better option in the octicons 3.5.0 font

octicons-markdown

@mxstbr
Copy link
Collaborator

mxstbr commented Mar 24, 2016

We sadly cannot upgrade Elemental to [email protected] because they removed icons in 3.2.0 and 3.4.0 which breaks some of our sites. That means we need to stay on 3.1.0 for now.

I copied your changes locally and tried to drag-n-drop an image onto the Markdown field but that didn't work – what did I understand wrong, I thought that was the functionality this PR adds?

I think the heading, and H1...H4 should look better, but i could'nt find a better option in the octicons 3.5.0 font

Why not just take H character from your keyboard like we do now?

@JedWatson
Copy link
Member

Why not just take H character from your keyboard like we do now?

I agree, that's a clearer UI in my opinion

@jacargentina
Copy link
Contributor Author

My idea was not doing something already "built-in", which is yet possible. But first how it works right now: in every markdown field, you can, on the options, pass the option with key dropZoneOptions which is directly used by boostrap-markddown. The docs are here: http://www.codingdrama.com/bootstrap-markdown/ under Usage look at the last option.

Here you can configure an endpoint which would receive the uploads, example from my own keystone website code:

Doc.add({
  title: {
    type: Types.Text,
    required: true
  },
  content: {
    type: Types.Markdown,
    markedOptions: {
      renderer: docRenderer,
      gfm: true
    },
    dropZoneOptions: {
      disablePreview: true,
      url: '/services/upload/doc/'
    },
    height: 600
  }, ...

The /services/upload/doc is the customized endpoint that i've implemented on the very same website to receive the upload, and return the url which references it, which is later embedded on the markdown text itself.

Also you have the option to upload to external hosting services.

Anyway, if a "just works" (tm) implementation is wanted, i can with some direction (@JedWatson i'm looking at you) to write that code. I'm thinking about having a fixed location where put those uploads, and a global option to enable that on all markdown fields?

@jacargentina
Copy link
Contributor Author

In any case, if the elemental octicons 3.5.0 update is not accepted, do you want i replace the non existing on 3.1.0 icons with just text?

@mxstbr
Copy link
Collaborator

mxstbr commented Mar 24, 2016

Ah I see, thanks for the clarification - let me try again when I'm up and awake.

Yes, please replace the non-existing icons with suitable alternatives and/or characters. Thanks!

@jacargentina
Copy link
Contributor Author

A new PR on elemental: elementalui/elemental#147

@mxstbr I did use just text, as i dont see any alternative on octicons for bold, italic, and headings (or text-size)

Hope this is accepted (i choose not to make the changes on the boostrap-markdown editor, as somebody can use that project with current v3.5.0 just fine)

The current look is like this:

octicons-new

@mxstbr
Copy link
Collaborator

mxstbr commented Mar 25, 2016

Why don't we just leave the menu bar icons as they are? It looks perfectly fine imo:

screen shot 2016-03-25 at 18 49 48

@jacargentina
Copy link
Contributor Author

Yes, i know. But mi idea looking at the future, was at some point being able to use bootstrap-markdown as a dependency, and not a copy local to keystone as it is now, including the "customized buttons" its using right now.

So my take was to improve bootstrap-markdown in two ways: the dropzone integration, and lately, the octicons support.

If there is no intention on using upstream boostrap-markdown, u can leave the buttons like they are right now, they will work.

Anyway, the update is needed anyway for the dropzone thing.

Hope there is nothing else to discuss and let keystone go go go!!!

@mxstbr
Copy link
Collaborator

mxstbr commented Mar 26, 2016

Lets stick with the old buttons for now, and take a look at using upstream bootstrap-markdown in another PR! Can you update this to use the old buttons and then we can finally land this 👍

Thank so much for taking the time to implement this!

@jacargentina
Copy link
Contributor Author

I just looked how the icons are right now on master, and i really really think the new option is better: the current icons depend on a nasty hack on boostrap-markdown where gryph icons are changed to mce icons css styles. I know my solution is also a hacky one, but i think its not so "ugly"

Anyway now i'm looking into making them just look better, as much as possible as before my PR

@jacargentina
Copy link
Contributor Author

This is my take for a better look.

captura de pantalla de 2016-03-30 00-05-02

@jacargentina
Copy link
Contributor Author

@JedWatson @mxstbr Any chance to merge this ?

@jacargentina
Copy link
Contributor Author

I'm closing as i'm now using my fork for my own keystone "with features" :)

@tmaclean-LV
Copy link

@jacargentina would you mind if I pick up on this PR where you left off? I'd really love to see this happen, and I have the time to spend on it.

@jacargentina
Copy link
Contributor Author

@tmaclean-LV you' re welcome.

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.

4 participants