Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Nate Mielnik
@nmielnik
so they can make any final changes to any html that's going to be inserted, there would still be order issues there, but then it goes beyond paste handling and event handling
Peter E Higgins
@phiggins42
basically everything does getSelection() -> find closest "block parent"
to ensure the actions incoming are allowed/etc
also have a handy actionWhitelist / actionBlacklist pattern for dynamic buttons to control toolbar inside of different types of "block parents"
Nate Mielnik
@nmielnik
are you talking about overriding document.execCommand altogether?
Peter E Higgins
@phiggins42
no
overriding what is passed to execCommand
rather than do cleanup post-paste/insert
because the cleanup breaks undo
(unwrapping those nasty span[style] tags, etc)
Nate Mielnik
@nmielnik
ah, so document.execCommand('insertHTML') specifically
Peter E Higgins
@phiggins42
right
Nate Mielnik
@nmielnik
yeah, I could see making that something extensions can control
Peter E Higgins
@phiggins42
so just a smarter pastehandler than can say to the extensions "about to paste [this] into you, you cool with that? no, return me what you are cool with" somehow
Nate Mielnik
@nmielnik
what I was suggesting was all calls to document.execCommand('insertHTML') get routed through all the extensions first
nothing calls Util.insertHTMLCommand directly, only after the extensions have had a chance to muck with the html would the internal code actually call the command
so it would go beyond even pasting
Peter E Higgins
@phiggins42
ic
Dan Kaplun
@dbkaplun
ReferenceError: Can't find variable: _ in file:///Users/dan/stuff/medium-editor/spec/init.spec.js (line 138)
Anyone else getting that?
grunt
Nate Mielnik
@nmielnik
Make sure you do an npm install
Dan Kaplun
@dbkaplun
Ah OK
Looks like most tests on IE8 are broken right now
Wally
@wallylawless
I'm curious, I haven't seen examples of this on the Github pages, but is it possible to have a custom static toolbar for a medium-editor instance? As an example if I were to want to a tinyMCE style editor but with medium-editor as the text input?
Jérémy Benoist
@j0k3r
What could be the benefit?
Wally
@wallylawless
the benefit would be that I could use my own HTML and CSS to position the toolbar and control interactions with it, if there's a better way to do it I'm all ears, I'm new to this project
Nate Mielnik
@nmielnik
so you should be able to use your own css on the page to style the toolbar to appear however you want it
the 'staticToolbar' option should position the toolbar at the top of the input
and we have the ability to pass overrides to the built-in buttons via 'extensions'
so if you need to change the bold button to not be a 'button' but some other type of element in the toolbar, you can create an extension which derives from the existing built-in bold button
if it implements the 'getButton()` method, it can return its own type of html, and attach its own event handlers that may still call into the existing methods of the built-in buttons
Nate Mielnik
@nmielnik
@/all are any of you gents or ladies attending JSConf (US) next week?
Jérémy Benoist
@j0k3r
nope
Wally
@wallylawless
wish I could
Nate Mielnik
@nmielnik
well @nchase and myself will be there, so let us know if you're going so we can say Hey
Jérémy Benoist
@j0k3r
I have some problems using Firefox when pasting content from Word. If I activate cleanPastedHTML I only get the text/plain content, not the HTML. It doesn't seems to be available. When I check event.clipboardData.types on Firefox, there is only text/plain. Is there something to activate to have text/html enabled?
Without cleanPastedHTML I got all the horrible stuff from Word :cry:
Nate Mielnik
@nmielnik
So yeah, if it's not accessible from clipboardData, there's nothing that I know of we can do given our current paste strategy
others have gone with the strategy where you just allow the paste to come through, and then go through and try to fix things up
that's definitely something we may want to explore
Rok
@zenkkor
Hey guys! Any idea why medium editor is not accepting the default options?
see plunkr
Nate Mielnik
@nmielnik
@zenkkor buttons should be nested inside a toolbar option
Rok
@zenkkor
Ag thanks @nmielnik
I'll give it a shot
I am looking at wysiwyg inline editors and I love medium editor the most so far
Is this still activelly being maintained?