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

Implement Lists #94

Merged
merged 3 commits into from
Aug 27, 2015
Merged

Implement Lists #94

merged 3 commits into from
Aug 27, 2015

Conversation

bantic
Copy link
Collaborator

@bantic bantic commented Aug 26, 2015

ready to merge

fixes #86

This adds a:

  • ListSection — inherits from MarkupSection and lives alongside MarkupSections and cards in the post's sections list
  • ListItem — inherits from MarkupSection and lives in the nested items/sections list on a ListSection, has a list of markers
  • Some edge case code to postEditor#splitSection to deal with hitting enter on an empty final list item
  • Some largely duplicated code in ListItem#splitAtMarker that could be cleaned up
  • Simplifies editor#reparse by recognizing that there are fewer unexpected situations that could occur
  • Add a new type of section ("3") to mobiledoc format for lists
  • Update the Mobiledoc renderer to render ListSections and ListItems
  • Update the EditorDom renderer to render ListSections and ListItems
  • Update MOBILEDOC_VERSION to "0.2.0"

Stil to do:

  • update the mobiledoc html/dom renderers to recognize the change to the mobiledoc format (dom and html)
  • clean up duplicated code
  • there are still some slightly buggy behaviors around adding multiple list items, apply markup across list items, etc. Corral these

@bantic
Copy link
Collaborator Author

bantic commented Aug 27, 2015

@mixonic Could use review. This is ready to go now. After review I can update the standalone renderers to handle lists

@bantic bantic force-pushed the lists-2 branch 2 times, most recently from 61c9e08 to 9ce308c Compare August 27, 2015 16:59
QUnit.config.urlConfig.push({
id: 'debugTest',
label: 'Debug Test'
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a little odd, perhaps, but it greatly improves debugging speed for acceptance tests. This adds a checkbox 'DebugTest' in the QUnit toolbar. Clicking it causes the page to reload and drop into the debugger right before starting the test. The flow I've been using is:

  • run all tests (with dev tools open), click "rerun test" on any failing acceptance test
  • click the "Debug Test" checkbox -> page reloads and the debugger activates
  • step into the originalCallback test function and step through the lines in the test

I've found this to be a lot quicker than finding the test code in my text editor and reading through the steps to figure out what it is testing and what should be happening.

The caveat is that you need to import {test, module} from Helpers in the acceptance test (instead of import {test, module} from QUnit)

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 seems cool, eager to give it a try

@@ -104,6 +111,37 @@ function renderMarker(marker, element, previousRenderNode) {
return textNode;
}

function attachRenderNodeElementToDOM(renderNode, element, originalElement) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

bantic added 3 commits August 27, 2015 16:48
  * simplify editor reparse
  * update post parser to reparse list sections
  * hit enter to split a list item
  * can delete to exit a list
  * hitting enter in empty list item exits list section altogether
  * Use Helpers.dom.build rather than `makeDOM`
  * Test to ensure that hitting enter in a list exits the list appropriately
mixonic added a commit that referenced this pull request Aug 27, 2015
@mixonic mixonic merged commit b57465d into master Aug 27, 2015
@mixonic mixonic deleted the lists-2 branch August 27, 2015 21:29
@mixonic
Copy link
Contributor

mixonic commented Aug 27, 2015

sweeeeeeeeetttttt

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.

implement lists
2 participants