Changeset 21962
- Timestamp:
- 09/24/2012 02:18:15 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/mce-view.js
r21961 r21962 21 21 // Accepts a unique `id` and an `options` object. 22 22 // 23 // `options` 24 // If `view` is an object, it will automatically be passed to 25 // `wp.mce.View.extend( view, properties )` to create a new view class. 23 // `options` accepts the following properties: 26 24 // 27 // If the `view` provided is already a constructor, the `properties` 28 // variable is ignored. 25 // `pattern` is the regular expression used to scan the content and 26 // detect matching views. 27 // 28 // `view` is a `Backbone.View` constructor. If a plain object is 29 // provided, it will automatically extend the parent constructor 30 // (usually `Backbone.View`). Views are instantiated when the `pattern` 31 // is successfully matched. The instance's `options` object is provided 32 // with the `original` matched value, the match `results` including 33 // capture groups, and the `viewType`, which is the constructor's `id`. 34 // 35 // `extend` an existing view by passing in its `id`. The current 36 // view will inherit all properties from the parent view, and if 37 // `view` is set to a plain object, it will extend the parent `view` 38 // constructor. 39 // 40 // `text` is a method that accepts an instance of the `view` 41 // constructor and transforms it into a text representation. 29 42 add: function( id, options ) { 30 43 var parent; … … 35 48 // Extend the `options` object with the parent's properties. 36 49 _.defaults( options, parent ); 50 options.id = id; 37 51 38 52 // If the `view` provided was an object, automatically create
Note: See TracChangeset
for help on using the changeset viewer.