Posted by Wim Leers on November 20, 2012 at 12:10pm
| Download | Size | md5 hash |
|---|---|---|
| edit-8.x-1.0-alpha2.tar.gz | 83.78 KB | 5b9580e9048a802aa9736b5d78558c92 |
| edit-8.x-1.0-alpha2.zip | 99.01 KB | 76a1ea945d32b436890a5c75ccc293f4 |
Last updated: November 20, 2012 - 12:12
Release notes
The second alpha of Edit for Drupal 8 brings a completely refactored JS codebase, it is now built upon http://createjs.org.
The massive number of commits below is probably telling. This corresponds to the core patch posted at http://drupal.org/node/1824500#comment-6741906.
Changes since 8.x-1.0-alpha1 (155 commits):
- drupal.aloha.edit.js is no longer necessary.
- Merge branch 'node/1824100-createjs-d8' into 8.x-1.x
- Ensure the entity object is reloaded after saving.
- Delete drupal.aloha.edit.js, which was no longer being used anyway.
- Fixed visual glitch when using the modal and the active editor is the 'form' editor.
- And last but not least: load rerendered processed text when it uses transformation filters.
- Ensure only one modal is active, fixed only bind click events
- Backbone.syncDirect was also setting the value for the 'text format selector' . I solved this differently in Drupal 7, but this is slightly less hacky.
- Fix the last remaining drupalAlohaWidget problem: the fact that it won't work a second time. This is due to an Aloha Editor bug that unbinds our event handlers.
- Make drupalAlohaWidget fully work; it now uses Drupal.aloha.*, so that the format settings are set correctly and we're in full control when Aloha Editor shows up.
- Make drupalAlohaWidget 'kinda work': you have to click twice, and the format class is not yet being set, but it does show up and work.
- Document drupalContentEditableWidget and drupalFormWidget more consistently. Don't use jQuery UI Widget Factory's _init(), only use Create.js' _initialize().
- Simplify EditAppView.decorateEditor()'s parameters significantly.
- Make FieldDecorationView need less parameters, similarly to ToolbarView.
- Rewrite Drupal.edit.util.modal as a Backbone View.
- Prevent the user from clicking on the contents (especiallylinks) of fields/properties.
- Namespace jQuery events in toolbar-view.js.
- Handle validation errors better for the 'direct' editor; improve hiding of active editor in EditAppView._confirmStopEditing().
- Edit's original Modal is now in use again.
- Refactor EditAppView.saveProperty() into ToolbarView.save(). The ToolbarView now contains *all* interactivity setState() calls.
- While editing, don't show any other editors. Implemented in a hacky way until https://github.com/bergie/create/issues/133 is solved.
- Get rid of legacy edge cases in SparkEditService.
- Very minor code cleanup.
- Use Backbone Views' idiomatic events hash instead of doing event binding ourselves.
- Follow-up commit for 2b11988b303b02e069270dfc209cedb8b15ef4ad; the state change handling was cleaned up significantly in that commit, but broke switching from edit mode back to view mode. This makes that work again, and still keeps it easy to get rid of obsolete code once https://github.com/bergie/create/issues/133 is solved.
- No more console.log() statements!
- Minor doc improvements; use Backbone Views' idiomatic .on() instead of .bind().
- Refactor and document EditAppView.saveProperty(); now callbacks are passed to ToolbarView instead of DOM-based events to trigger saving and closing.
- Clean up edit-router.js; don't pass in appView, only pass in appModel. Less is better. Also add newlines between methods.
- Simplify/clean up/refactor/document all of EditAppView's methods, with the sole exception of save handling. Ensuring that app.js really only contains "the beating heart" of Edit.
- Clean up the 'escapeEditor' handling; thanks to an upstream patch (https://github.com/bergie/create/pull/146); got rid of the EditAppView being passed into the OverlayView.
- Move EditAppView.activeEditor and EditAppView.highlightedEditor into AppStateModel.
- Make all views more consistent; document each stateChange() method properly, minor coding standards refactoring for the MenuView and OverlayView.
- Move the initialize() and stateChange() methods to the top of toolbar-view.js, to be consistent with the other views.
- Rename StateModel to EditAppModel; rename state-model.js to edit-app-model.js.
- Prefix 'private' variables of Backbone Views with an underscore.
- Make the propagating of editor state changes significantly cleaner; once https://github.com/bergie/create/issues/133 is solved, we'll simply be able to delete about a dozen lines of code :)
- Upstream contribution to Create has ensured that each editor also contains its name and widget, which allows for considerable code clean-up.
- Assign different 'editor names' in Create's editor mapping, so that they map exactly to the 'edit type' we have always used on the Drupal (server) side.
- Minor clean-up in toolbar-view.js.
- Do the generation of DOM id attributes more consistently.
- ui-editables.js was deleted in the one but last commit (431dde5a467e378e7138830bf5c5f6b57f2bb929), but I forgot to remove it in hook_library_info().
- Removed a bunch of obsolete @todo statements.
- Delete ui-editables.js: move Drupal.edit.form to util.js, rename it to Drupal.edit.util.form.
- Clean up edit.js: move Drupal.edit.log() to util.js, rename it to Drupal.edit.util.log().
- Clean up edit.js: move Drupal.edit.constants from edit.js to util.js, rename it to Drupal.edit.util.constants.
- Minor code comment improvements.
- Rename EditAppView state-property to model in EditAppView (consistency and backbone idiom); instantiate StateModel in edit.js
- Simplify the StateModel; we no longer need to track boatloads of state anymore :)
- Drupal.edit.toggle has never materialized and is now irrelevant. Delete its stub.
- Clean up edit.js: get rid of Drupal.edit.confirm, Drupal.edit.vie and Drupal.edit.state.
- Move the backstage area creation into backbone.drupalform.js; the app shouldn't have to know/care about this.
- Remove the following Drupal.edit.util functions: getID(), getElementPredicate(), getElementValue(), getElementEntity(), findEditablesForFields(), findFieldForID(), findFieldForEditable(), findEntityForField().
- Backbone.sync & drupalFormWidget are "done". Massive technical debt clean-up, added docs.
- Get rid of the edit_field_form, edit_field_form_saved, edit_field_form_validation_errors AJAX commands; they're now all implemented on a scoped/closure basis.
- Perfected the implementation of Backbone.sync on top of Form API/AJAX commands framework for type=direct. Also not yet clean code, but working perfectly, including perfect clean-up of Drupal.ajax instances.
- Also clean up Drupal.ajax when canceling out of a type=form editor.
- Get rid of 'formLoadedFor' in the global state. Possible thanks to the previous commit.
- Perfected the implementation of Backbone.sync on top of Form API/AJAX commands framework for type=form. Not yet clean code, but working perfectly, including perfect clean-up of Drupal.ajax instances.
- Disable browser's HTML5 validation for type=direct.
- drupalContentEditableWidget is intended to edit only plain text, not HTML.
- Updated the controller's acceptStateChange() method to allow invalid -> saving state change.
- Make multiple subsequent type=form saves work again.
- Fix JSHint errors.
- =Reworked guards for escapeEditor and route-change events to prompt for user confirmation if active editor has changes
- Fix type=direct decoration; I had introduced a bug in the previous commit (ae4790b82557c22c7438e073b85a3638e3422d05).
- Make the background-color work for the "Loading…" indicator for type=form. Fixed a race condition by simplifying the way FieldDecorationView handles the background color.
- Allow the user to go from changed/invalid back to candidate state. However, ask for confirmation first (using a hacky/ugly/temporary modal).
- Saving a type=form field now works. Validation also works. All state changes also work. The toolbar has been updated to show a 'loading' indicator when saving, and stops displaying it when it is either saved or invalid.
- =Cleanup OverlayView and MenuView, document and more idiomatic Backbone styles
- Fix ToolbarView.onMouseLeave(); was broken in 411ef55.
- Fixed bug in FieldDecorationView that would prevent a correct transition from the 'active' state back to the 'candidate' stage.
- Minor refactoring in FieldDecorationView; already in the 'activating' stage, the .edit-candidate and .edit-editable classes should be added.
- drupalFormWidget was setting the background color incorrectly, in light of recent changes to FieldDecorationView.
- drupalFormWidget was doing certain things that it shouldn't be doing; that are FieldDecorationView's responsibility
- Never use .data() to access data- attributes, use .attr('data-something') instead.
- Comply with JSHint, remove dead code, fix a few typos, etc. Minor refactoring; shouldn't make any actually noticeable difference.
- We no longer need FieldViewModel, FieldView, EditableFieldView and FormEditableFieldView… :)
- Push PropertyEditor state changes actually down to the PropertyEditors themselves, so that they can properly react to them.
- The FieldDecoratorView has been revamped.
- Refactor EditAppView.acceptStateChange(); now supports the main use cases (highlighting and editing and stopping to do both).
- Refactored Drupal.edit.views.ToolbarView to accord with Backbone-conventions (using this.$el and events property properly)
- DrupalContentEditableWidget (added in the previous commit) is now working together with the state system, but it's still not really leveraging it yet.
- Subclass Create's editWidget (which uses plain contenteditable) to get the exact behavior we need for Edit. Still needs to leverage the state system though.
- Add support to ToolbarView for the 'inactive', 'saving', 'saved' and 'invalid' states.
- Minor bugfixes for ToolbarView.
- The ToolbarView has been perfected as much as possible. It now works better than the original :)
- I've contributed an upstream patch that consolidates Create's naming scheme. I've adopted the same consistent naming scheme in app.js. The new build is included. - I've *almost* gotten rid of the DOM event listening in the decorator and toolbar views. - Replaced bindEditableStateChanges() with a global stateChange() handler without relying on DOM events (only possible thanks to the aforementioned upstream patch). - Cleaned up bindAppStateChanges(). - The limitation of acceptStateChanges() has been fixed: it now has a context parameter.
- Implement acceptStateChanges(), get rid of all edge case checks in event handlers; rely on acceptStateChanges() instead. Unfortunately, we're currently running into a limitation of acceptStateChanges().
- Split out decorateEditor() into a separate function, setting the state is much cleaner now, and everything is documented more explicitly.
- AppView listens to (app-wide) state changes (isViewing), initial work on passing on events
- Pass the predicate when setting the state on an Editable widget.
- The Aloha widget shouldn't be self-activating; this triggers an unwanted state change.
- More rewiring, not completed yet, but saving should work again
- Pass the editable element instead of the editor element to FieldDecorationView and ToolbarView. State changes now work again.
- Intermediate state, basic rewiring done
- Pass entity to decorators
- =Refactor edit.js, introduce app view/controller
- The 'changed' state now works for all widgets, and it is indicated correctly in the toolbar.
- Create.js now uses changed instead of modified everywhere internally
- Decorators support and predicate in state changes
- Add drupalalohawidget.js, part of the Aloha changes I accidentally included in the commit I did for frega (3b3ccd2649fe974106a4fc4a659a0f769872f8e5).
- Fix toolbars not appearing for direct/wysiwyg editables
- =Update grunt.js to reflect the revised directory/file structure
- #1831232 by frega: Backbone Conversion - refactoring from FieldView+FieldViewModel-states to createEditable's new states.
- In 4ffa11821264c4f1f838fb33c9b30a3fb356b707, we implemented saving of fields through Backbone.syncDrupalFormWidget(). Now validation handling (edit_field_form_validation_errors) is also implemented.
- Minor Aloha widget syntax fix
- New Create.js build with fixed Aloha initialization, renamed modified to changed state
- Get rid of Drupal.edit.form.get() in Drupal.edit.views.EditableFieldView by storing it in *and* edit_id, , in Backbone.syncDrupalFormWidget by passing in the from Drupal.edit.views.EditableFieldView.
- Ensure we add HTTP status handling to the Backbone.sync implementations.
- Drupal.edit.form.remove() is not actually used anywhere.
- Ensure we fully replace the original field with the rerendered field; we may not use inner HTML stuff. VIE doesn't seem to like it though.
- Make Backbone.syncDrupalFormWidget no longer apply any state or DOM changes. Also update VIE's models correctly.
- Add getter for state
- Activated, deactivated events for direct editable
- Set state earlier
- Create.js rebuild: expose Editable state handling and transitions to controller
- Create.js rebuild: pass success and error data on to Edit
- Refactor to use createjs storage and Backbone.sync
- Ignore generated JS files
- New Create.js build to allow Edit to use the Storage widget
- #1824100 by Wim Leers: Initial clean-up of formwidget.js + better docs.
- =Adjust grunt file to account for bergie moving widgets and service around; add a build (js/build/edit-complete.js) that includes the create.js and vie.js libraries
- =Refactor to use a distinct FieldDecoratorView, this commit introduces more UI glitches (e.g. unpadding is broken), but should improve separation of concerns considerably
- New Create.js build
- Reorganize services and widgets to dirs
- =Rework the FieldView model from being a VIE entity to FieldViewModel instance
- =Added fieldview-model.js and refactored StateModel into Drupal.edit.models-namespace
- =Move to models-namespace and check for existence of namespace first
- Merge branch 'node/1824100-createjs-d8' of git.drupal.org:project/edit into node/1824100-createjs-d8
- Smaller builds of Create and VIE
- #1824100 by Wim Leers: Fix Drupal.edit being undefined — this was introduced in 7f0742138671b3640fe457d99dc231ca021b464c.
- =Refactoring views, models and router to separate files, replace $ with jQuery in the views, adjusted grunt.js, adjusted edit.module's hook_library_info
- #1741122 by Wim Leers: Validation support: validation errors currently result in JS alert()s with JSON barf.
- =Fixes fragment/url on menu bar
- =Add unminified create.js for development purposes
- #1824100 by frega: Add grunt.js file; satisfy jshint to make grunt succeed.
- #1824100 by frega: Refactoring/clean-up.
- #1824100 by Wim Leers: Add @todo statements to ensure we (@frega, @bergie and I) address code clarity of views.js during the code sprint in Ghent.
- #1824100 by Wim Leers: Add @todo statements to ensure we (@frega, @bergie and I) address code clarity during the code sprint in Ghent.
- #1824100 by Wim Leers: Add VIE to edit.js' closure; add minor clarifications.
- #1824100 by Wim Leers: type=direct fields now also work.
- #1824100 by Wim Leers: Form insertion should use Drupal.ajax's 'insert' command, otherwise Drupal behaviors don't get attached. Saving through Create.js now works completely :).
- #1824100 by Wim Leers: 'edit ID's have changed, they now also include language code and view mode. The Create.js branch wasn't updated to use this yet.
- Removed a stray testing variable.
- #1824100 by jessbeach: Editable for views are rendering correctly after fixing the Drupal.theme API change in D8: http://drupal.org/node/1630782
- #1824100 by jessebeach: Straight-porting JS files from the 7.x branch that don't exist in the 8.x branch.
- #1824100 by jessbeach: Resolved inclusion of VIE, create.js and their dependencies.
- Improve shell script to mark the Aloha Editor+Edit integration patch to not be tested by the d.o testbot.
- Improve docs + use path_is_admin(). Based on http://drupal.org/node/1824500#comment-6659116.
- Add shell script to generate Edit core patch, inspired by the one I did for Aloha.
- Get rid of includes/text.inc, include a core patch instead.
- #1824454 by Wim Leers: Clean up CSS.