-
Notifications
You must be signed in to change notification settings - Fork 166
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
Create numbered and bulleted lists #674
base: master
Are you sure you want to change the base?
Conversation
programs/editor/Tools.js
Outdated
@@ -167,6 +169,9 @@ define("webodf/editor/Tools", [ | |||
// Paragraph direct alignment buttons | |||
paragraphAlignment = createTool(ParagraphAlignment, args.directParagraphStylingEnabled); | |||
|
|||
// Paragraph direct alignment buttons | |||
toggleLists = createTool(ToggleLists, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need it's own feature flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -177,6 +177,7 @@ var Wodo = Wodo || (function () { | |||
paragraphStyleEditingEnabled = isEnabled(editorOptions.paragraphStyleEditingEnabled), | |||
imageEditingEnabled = isEnabled(editorOptions.imageEditingEnabled, true), | |||
hyperlinkEditingEnabled = isEnabled(editorOptions.hyperlinkEditingEnabled, true), | |||
listEditingEnabled = isEnabled(editorOptions.listEditingEnabled), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a 2nd parameter set to true to indicate the feature is still collab-unstable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
*/ | ||
|
||
/** | ||
* This is the default style for numbered lists created by WebODF. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need built-in defaults for those settings? What is currently happening for lists which styles which do not have all those settings set? What are the built-in defaults used there, and should those not be the same used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From memory a list with no style has no default fallback in webodf. The standard requires an implementation defined default http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415150_253892949
I agree the same defaults should be used, maybe we could do what LO does and assign the bulleted style to any list without a style assigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically assigning (as in: setting) might be too much for existing lists (that might break the intention of the original creator of the list). Just using it when rendering would be good, yes (but perhaps you meant this).
But I was also thinking about properties which are not set, so some built-in default values would be used. That needs to be defined somewhere as well. At least by how I understand the schema currently that can happen. Hm. Need to think more about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I did mean to use them only for rendering.
webodf/lib/odf/OdfUtils.js
Outdated
|
||
this.isListElement = isListElement; | ||
|
||
/** | ||
* Determine if the node is a text:list-item element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add or a <text:list-header>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment
d18608f
to
ccb1f2b
Compare
These operations work on the level of top level lists only Added tests for the new operations and changed the op test code to parse any op parameter containing "length" or "position" in the name as an integer
This handles transforms between Add/Remove list and other operations that modify the number of steps in the document. There are some unresolved conflicts with merging paragraphs and adding lists that return null as the transform result which required merge and split operations on lists to be resolved correctly. Added tests for the new parts of the op transform matrix and changed the op transform test code to parse any op parameter containing "length" or "position" in the name as an integer.
ccb1f2b
to
33566eb
Compare
Build succeeded. |
@@ -393,6 +393,34 @@ odf.OdfUtilsTests = function OdfUtilsTests(runner) { | |||
testFontFamilyNameNormalizing("'serif'", "'serif'"); | |||
testFontFamilyNameNormalizing("\"serif\"", "\"serif\""); | |||
} | |||
|
|||
function isListItemElement_ListItemOrListHeaderElements() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the naming pattern $methodname_$testcase
this should be isListItemOrListHeaderElement_ListItemAndListHeaderElements
As you can see I have been hesitating so far to look at the code of the actual operations. Something in my mind told me I am not happy about them, but I could not say exactly what it was. But now I know what made me unhappy: the lack of reasoning for the proposed operations and their spec. IMHO we should sit down this time and try to think about what operations there should be around lists, instead of going the painful try&error approach done in the initial prototyping of the WebODF editing (cough...removetext...cough). So before continueing this PR I really would like to see a broader approach to the problem, before we spent our time on the actual implementation. If you agree please go here and add to the collection of ideas/plans around list operations: |
Have gone through quite a bit of design around this with @peitschie and thought about what UI actions we want to support so it's definitely not a trial and error approach. I will fill out this wiki page with the design for this PR and the future work that I mentioned on the mailing list. |
Forgot about the email, pardon (too much info at too many places 👀 ). Here for reference: https://open.nlnet.nl/pipermail/webodf/2014-August/000149.html (was there another one as well?) Thanks for adding the notes also to the wiki page. With the "trial and error" approach I was meaning that this time I would like to have a wider view of what the total number of operations around lists should be like. So far the proposed operations only cover a few use-cases, and they might fail with their specs and scopes once more use-cases are approached. |
Hrm...I'm completely on board with improving process, but I am a little disappointed that this desire couldn't have been expressed several months ago when we made it clear that this was a feature we were planning to deliver. Fulfilling this change in expectations will likely cost us a day or two of dev time in order to document the design decisions in the now-desired format. I have two major concerns here:
If we are going to undertake this, I really need some idea from you @kossebau about how high a priority (and therefore, how timely) the design & code reviews for this feature would be... |
A quick discussion with @satsuper, we think it will be best to put the design info into a standalone md file and raise a PR. The wiki interface doesn't allow any type of review interaction as will be necessary for this. On the PR, people can comment on specific lines and points, and see older revisions with comments. Once the PR is signed off and everyone is happy, we can then transfer the markdown back to the wiki for permanent storage. Does that sound like a decent plan @kossebau @adityab ? |
Sounds like that should work best, yes. Please do. |
I can understand your disappointment very much. But then we/I have also learned quite a lot in all those months, and at least I draw the conclusion that ops need much more planning ahead and doing them on a case-by-case base is much more trouble in the end.
I will forward this to the person which rules me regarding that.... @th? |
That said, If we are to move forward with this PR to at least land partial support for list editing (with a design discussion ongoing on the side of course), there's one thing that's very important - which is the ability to break out of a list and create a new paragraph after it. |
There could perhaps be something like an ops playground, where ops are living that are just around for experiments and have not yet seen any proper review. |
Such a playground and the plugin infrastructure for that would also match what WebODF should ideally offer, being extensible by others with custom stuff. So would be a good testing for that. |
Yes. I agree completely on this. But, please don't overlook the fact that I have been involved in all aspects of this for the last 1.5 years however. After all, I have authored the majority of the documentation WebODF has on many of these subjects...
By the time we add the ops + transforms required to do that, this PR would be far to large to review. We already have this planned in our roadmap, and we have operations designed to allow this. For this PR however, I would consider it unnecessary as it isn't a regression over current master.
A plugin system would help alleviate the current symptoms if this was a stability or technical problem, or a question about the long term desirability of the feature. Currently however, this PR is facing a clear review time shortage, so a plugin system would provide no gain to anyone. |
This PR aims to add the creation of lists in a document. This only aims to support numbered and bulleted lists and not image bullet lists for now.
TODO