Add some docs to Customizer JS.

Props ericlewis.
See #29157.


git-svn-id: https://develop.svn.wordpress.org/trunk@29451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-08-08 23:30:30 +00:00
parent 0a6221058f
commit af851b9bda
3 changed files with 64 additions and 9 deletions
+49 -4
View File
@@ -3,6 +3,10 @@
var api = wp.customize;
/**
* @constructor
* @augments wp.customize.Value
* @augments wp.customize.Class
*
* @param options
* - previewer - The Previewer instance to sync with.
* - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
@@ -26,6 +30,10 @@
}
});
/**
* @constructor
* @augments wp.customize.Class
*/
api.Control = api.Class.extend({
initialize: function( id, options ) {
var control = this,
@@ -87,6 +95,9 @@
control.toggle( control.active() );
},
/**
* @abstract
*/
ready: function() {},
/**
@@ -141,6 +152,11 @@
}
});
/**
* @constructor
* @augments wp.customize.Control
* @augments wp.customize.Class
*/
api.ColorControl = api.Control.extend({
ready: function() {
var control = this,
@@ -157,6 +173,11 @@
}
});
/**
* @constructor
* @augments wp.customize.Control
* @augments wp.customize.Class
*/
api.UploadControl = api.Control.extend({
ready: function() {
var control = this;
@@ -210,6 +231,12 @@
}
});
/**
* @constructor
* @augments wp.customize.UploadControl
* @augments wp.customize.Control
* @augments wp.customize.Class
*/
api.ImageControl = api.UploadControl.extend({
ready: function() {
var control = this,
@@ -328,6 +355,11 @@
}
});
/**
* @constructor
* @augments wp.customize.Control
* @augments wp.customize.Class
*/
api.HeaderControl = api.Control.extend({
ready: function() {
this.btnRemove = $('#customize-control-header_image .actions .remove');
@@ -544,6 +576,12 @@
// Create the collection of Control objects.
api.control = new api.Values({ defaultConstructor: api.Control });
/**
* @constructor
* @augments wp.customize.Messenger
* @augments wp.customize.Class
* @mixes wp.customize.Events
*/
api.PreviewFrame = api.Messenger.extend({
sensitivity: 2000,
@@ -714,11 +752,22 @@
(function(){
var uuid = 0;
/**
* Create a universally unique identifier.
*
* @return {int}
*/
api.PreviewFrame.uuid = function() {
return 'preview-' + uuid++;
};
}());
/**
* @constructor
* @augments wp.customize.Messenger
* @augments wp.customize.Class
* @mixes wp.customize.Events
*/
api.Previewer = api.Messenger.extend({
refreshBuffer: 250,
@@ -924,10 +973,6 @@
}
});
/* =====================================================================
* Ready.
* ===================================================================== */
api.controlConstructor = {
color: api.ColorControl,
upload: api.UploadControl,