https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113424

Revision: 113424
Author:   catrope
Date:     2012-03-08 23:21:24 +0000 (Thu, 08 Mar 2012)
Log Message:
-----------
Add documentation for to-be-written prepareWrap function

Modified Paths:
--------------
    trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js

Modified: 
trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js     
2012-03-08 23:21:23 UTC (rev 113423)
+++ trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js     
2012-03-08 23:21:24 UTC (rev 113424)
@@ -1122,6 +1122,33 @@
 };
 
 /**
+ * Generates a transaction which wraps, unwraps or replaces structure.
+ * 
+ * @param {ve.Range} range Range to wrap/unwrap/replace around
+ * @param {Array} unwrapOuter Array of opening elements to unwrap. These must 
be immediately *outside* the range
+ * @param {Array} wrapOuter Array of opening elements to wrap around the range.
+ * @param {Array} unwrapEach Array of opening elements to unwrap from each 
top-level element in the range.
+ * @param {Array} wrapEach Array of opening elements to wrap around each 
top-level element in the range.
+ * @returns {ve.dm.Transaction}
+ * 
+ * @example Changing a paragraph to a header:
+ *     Before: [ {'type': 'paragraph'}, 'a', 'b', 'c', {'type': '/paragraph'} ]
+ *     prepareWrap( new ve.Range( 1, 4 ), [ {'type': 'paragraph'} ], [ 
{'type': 'heading', 'level': 1 } ] );
+ *     After: [ {'type': 'heading', 'level': 1 }, 'a', 'b', 'c', {'type': 
'/heading'} ]
+ * 
+ * @example Changing a set of paragraphs to a list:
+ *     Before: [ {'type': 'paragraph'}, 'a', {'type': '/paragraph'}, 
{'type':'paragraph'}, 'b', {'type':'/paragraph'} ]
+ *     prepareWrap( new ve.Range( 0, 6 ), [], [ {'type': 'list' } ], [], [ 
{'type': 'listItem', 'attributes': {'styles': ['bullet']}} ] );
+ *     After: [ {'type': 'list'}, {'type': 'listItem', 'attributes': 
{'styles': ['bullet']}}, {'type':'paragraph'} 'a',
+ *              {'type': '/paragraph'}, {'type': '/listItem'}, {'type': 
'listItem', 'attributes': {'styles': ['bullet']}},
+ *              {'type': 'paragraph'}, 'b', {'type': '/paragraph'}, {'type': 
'/listItem'}, {'type': '/list'} ]
+ * 
+ */
+ve.dm.DocumentNode.prototype.prepareWrap = function( range, unwrapOuter, 
wrapOuter, unwrapEach, wrapEach ) {
+};
+
+
+/**
  * Generates a transaction which annotates content within a given range.
  * 
  * @method


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to