r103359 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103358‎ | r103359 | r103360 >
Date:19:28, 16 November 2011
Author:catrope
Status:deferred
Tags:
Comment:
Drop droppable (oh, how meta!) attribute introduced in r103211. Will convert prepareRemoval() later
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.HeadingModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.ListItemModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.ListModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.ParagraphModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.PreModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.TableCellModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.TableModel.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/models/es.TableRowModel.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js
@@ -40,32 +40,26 @@
4141 * parents and children properties may contain one of two possible values:
4242 * {Array} List symbolic names of allowed element types (if empty, none will be allowed)
4343 * {Null} Any element type is allowed (as long as the other element also allows it)
44 - * droppable:
45 - * {Boolean} Whether the node can be dropped from it's parent (false for table cells)
4644 *
4745 * @example Paragraph rules
4846 * {
4947 * 'parents': null,
50 - * 'children': [],
51 - * 'droppable': true
 48+ * 'children': []
5249 * }
5350 * @example List rules
5451 * {
5552 * 'parents': null,
56 - * 'children': ['listItem'],
57 - * 'droppable': true
 53+ * 'children': ['listItem']
5854 * }
5955 * @example ListItem rules
6056 * {
6157 * 'parents': ['list'],
62 - * 'children': null,
63 - * 'droppable': true
 58+ * 'children': null
6459 * }
6560 * @example TableCell rules
6661 * {
6762 * 'parents': ['tableRow'],
68 - * 'children': null,
69 - * 'droppable': false
 63+ * 'children': null
7064 * }
7165 */
7266 es.DocumentModel.nodeRules = {};
@@ -848,7 +842,7 @@
849843 // Handle selected nodes
850844 if ( !selectedNode.range ) {
851845 // Drop whole nodes
852 - if ( rules[selectedNode.node.getElementType()].droppable ) {
 846+ if ( /*rules[selectedNode.node.getElementType()].droppable*/ true ) {
853847 tx.pushRemove( doc.data.slice( left, right ) );
854848 } else {
855849 tx.pushRetain( 1 );
Index: trunk/extensions/VisualEditor/modules/es/models/es.HeadingModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.heading = {
3333 'parents': null,
34 - 'children': [],
35 - 'droppable': true
 34+ 'children': []
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.TableRowModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.tableRow = {
3333 'parents': ['table'],
34 - 'children': ['tableCell'],
35 - 'droppable': true
 34+ 'children': ['tableCell']
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.ParagraphModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.paragraph = {
3333 'parents': null,
34 - 'children': [],
35 - 'droppable': true
 34+ 'children': []
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.PreModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.pre = {
3333 'parents': null,
34 - 'children': [],
35 - 'droppable': true
 34+ 'children': []
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.TableCellModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.tableCell = {
3333 'parents': ['tableRow'],
34 - 'children': null,
35 - 'droppable': false
 34+ 'children': null
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.TableModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.table = {
3333 'parents': null,
34 - 'children': ['tableRow'],
35 - 'droppable': true
 34+ 'children': ['tableRow']
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.ListItemModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.listItem = {
3333 'parents': ['list'],
34 - 'children': null,
35 - 'droppable': true
 34+ 'children': null
3635 };
3736
3837 /* Inheritance */
Index: trunk/extensions/VisualEditor/modules/es/models/es.ListModel.js
@@ -30,8 +30,7 @@
3131
3232 es.DocumentModel.nodeRules.list = {
3333 'parents': null,
34 - 'children': ['listItem'],
35 - 'droppable': true
 34+ 'children': ['listItem']
3635 };
3736
3837 /* Inheritance */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103211Added a "droppable" bit to each model so that prepareRemoval can avoid droppi...tparscal19:01, 15 November 2011

Status & tagging log