-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle newline semantically, use special chars to denote text nodes a…
…nd unprintable chars in editor HTML * move cursor to new section after hitting enter * Select the first marker el in a new section rather than the section el * Append blank marker to empty section, only create markup from valid tag * Do not modify/wrap element in section element in Section parser
- Loading branch information
Showing
26 changed files
with
1,107 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
abc|def|ghi | ||
|
||
i=0, length=0, offset=3 | ||
i=1, length=3, offset=3 | ||
|
||
length === offset | ||
|
||
|
||
abc <b>bold <i>italic+bold</li> bold2</b> def | ||
|
||
const PickColorCard = { | ||
name: 'pick-color', | ||
edit: { | ||
setup(element, options, {save, cancel}, payload) { | ||
// ^ env - an object of runtime options and hooks | ||
let component = EditPickColorComponent.create(payload); | ||
component.save = function(newPayload) { | ||
save(newPayload); | ||
}; | ||
component.cancel = cancel; | ||
component.appendTo(element); | ||
return {component}; | ||
}, | ||
teardown({component}) { | ||
Ember.run(component,component.destroy); | ||
} | ||
}, | ||
render: { | ||
setup(element, options, {edit}, payload) { | ||
let component = PickColorComponent.create(payload); | ||
component.appendTo(element); | ||
if (options.mode === 'edit') { | ||
$(element).click(function(){ | ||
window.popup(payload.editUrl); | ||
}); | ||
} | ||
return {component}; | ||
}, | ||
teardown({component}) { | ||
Ember.run(component, component.destroy); | ||
}; | ||
} | ||
}; | ||
|
||
new ContentKit.Edtior(editorElement, cards: [ | ||
PickColorCard | ||
]}); | ||
|
||
var domRenderer = new MobiledocDOMRenderer(); | ||
var rendered = renderer.render(mobiledoc, { | ||
cardOptions: { mode: 'highQuality' }, | ||
unknownCard(element, options, {name}, payload) { | ||
// manage unknown name | ||
// can only be rendered, has no teardown | ||
}, | ||
cards: [ | ||
PickColorCard | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.