<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[30738] trunk/src/wp-admin/js: Add some inline JS docs for Customizer.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/30738">30738</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/30738","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-12-04 02:03:30 +0000 (Thu, 04 Dec 2014)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Add some inline JS docs for Customizer.
See <a href="https://core.trac.wordpress.org/ticket/30469">#30469</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjscommonjs">trunk/src/wp-admin/js/common.js</a></li>
<li><a href="#trunksrcwpadminjscustomizecontrolsjs">trunk/src/wp-admin/js/customize-controls.js</a></li>
<li><a href="#trunksrcwpadminjscustomizewidgetsjs">trunk/src/wp-admin/js/customize-widgets.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjscommonjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/common.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/common.js 2014-12-04 01:58:56 UTC (rev 30737)
+++ trunk/src/wp-admin/js/common.js 2014-12-04 02:03:30 UTC (rev 30738)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,6 +247,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $( document ).trigger( 'wp-collapse-menu', { state: state } );
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Ensure an admin submenu is within the visual viewport.
+ *
+ * @since 4.1.0
+ *
+ * @param {jQuery} $menuItem The parent menu item containing the submenu.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function adjustSubmenu( $menuItem ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var bottomOffset, pageHeight, adjustment, theFold, menutop, wintop, maxtop,
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu = $menuItem.find( '.wp-submenu' );
</span></span></pre></div>
<a id="trunksrcwpadminjscustomizecontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-controls.js 2014-12-04 01:58:56 UTC (rev 30737)
+++ trunk/src/wp-admin/js/customize-controls.js 2014-12-04 02:03:30 UTC (rev 30738)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,8 +38,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Watch all changes to Value properties, and bubble changes to parent Values instance
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {wp.customize.Class} instance
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Array} properties The names of the Value instances to watch.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Array} properties The names of the Value instances to watch.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> api.utils.bubbleChildValueChanges = function ( instance, properties ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $.each( properties, function ( i, key ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +56,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Expand a panel, section, or control and focus on the first focusable element.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Object} [params]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
+ * @param {Object} [params]
+ * @param {Callback} [params.completeCallback]
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> focus = function ( params ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var construct, completeCallback, focus;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,6 +90,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * If a.priority() === b.priority(), then sort by their respective params.instanceNumber.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Number}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,6 +107,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Return whether the supplied Event object is for a keydown event but not the Enter key.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {jQuery.Event} event
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {boolean}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,6 +119,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Return whether the two lists of elements are the same and are in the same order.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Array|jQuery} listA
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Array|jQuery} listB
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {boolean}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,8 +139,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Base class for Panel and Section
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Base class for Panel and Section.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @class
</span><span class="cx" style="display: block; padding: 0 10px"> * @augments wp.customize.Class
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,6 +150,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
</span><span class="cx" style="display: block; padding: 0 10px"> defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.1.0
+ *
+ * @param {String} id
+ * @param {Object} options
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> initialize: function ( id, options ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var container = this;
</span><span class="cx" style="display: block; padding: 0 10px"> container.id = id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,6 +194,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @abstract
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> ready: function() {},
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,6 +203,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the child models associated with this parent, sorting them by their priority Value.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {String} parentType
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {String} childType
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Array}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,6 +223,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * To override by subclass, to return whether the container has active children.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @abstract
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> isContextuallyActive: function () {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,13 +234,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Handle changes to the active state.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * This does not change the active state, it merely handles the behavior
</span><span class="cx" style="display: block; padding: 0 10px"> * for when it does change.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * To override by subclass, update the container's UI to reflect the provided active state.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Boolean} active
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Object} args merged on top of this.defaultActiveArguments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Object} args
+ * @param {Object} args.duration
+ * @param {Object} args.completeCallback
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onChangeActive: function ( active, args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,8 +261,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @params {Boolean} active
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Object} [params]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Object} [params]
</ins><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if state already applied
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> _toggleActive: function ( active, params ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,14 +350,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @class
</span><span class="cx" style="display: block; padding: 0 10px"> * @augments wp.customize.Class
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> api.Section = Container.extend({
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {String} id
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Array} options
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Array} options
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> initialize: function ( id, options ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,6 +383,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Embed the container in the DOM when any parent panel is ready.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> embed: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this, inject;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -379,7 +418,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add behaviors for the accordion section
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add behaviors for the accordion section.
+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> attachEvents: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -402,7 +443,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Return whether this section has any active controls.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @returns {boolean}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
+ * @returns {Boolean}
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> isContextuallyActive: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,6 +462,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the controls that are associated with this section, sorted by their priority Value.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @returns {Array}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> controls: function () {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,10 +471,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Update UI to reflect expanded state
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Update UI to reflect expanded state.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Boolean} expanded
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Object} args
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {Object} args
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onChangeExpanded: function ( expanded, args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -472,10 +519,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @class
</span><span class="cx" style="display: block; padding: 0 10px"> * @augments wp.customize.Class
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> api.Panel = Container.extend({
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.1.0
+ *
+ * @param {String} id
+ * @param {Object} options
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> initialize: function ( id, options ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var panel = this;
</span><span class="cx" style="display: block; padding: 0 10px"> Container.prototype.initialize.call( panel, id, options );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -487,6 +542,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Embed the container in the DOM when any parent panel is ready.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> embed: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var panel = this,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -499,7 +556,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> attachEvents: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var meta, panel = this;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,6 +600,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the sections that are associated with this panel, sorted by their priority Value.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @returns {Array}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> sections: function () {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -552,6 +611,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Return whether this panel has any active sections.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @returns {boolean}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> isContextuallyActive: function () {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -569,8 +630,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Update UI to reflect expanded state
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Boolean} expanded
- * @param {Object} args merged with this.defaultExpandedArguments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
+ * @param {Boolean} expanded
+ * @param {Object} args
+ * @param {Boolean} args.unchanged
+ * @param {Callback} args.completeCallback
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onChangeExpanded: function ( expanded, args ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -792,7 +857,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Bring the containing section and panel into view and then this control into view, focusing on the first input
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Bring the containing section and panel into view and then
+ * this control into view, focusing on the first input.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> focus: focus,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -801,8 +867,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * This does not change the active state, it merely handles the behavior
</span><span class="cx" style="display: block; padding: 0 10px"> * for when it does change.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Boolean} active
- * @param {Object} args merged on top of this.defaultActiveArguments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
+ * @param {Boolean} active
+ * @param {Object} args
+ * @param {Number} args.duration
+ * @param {Callback} args.completeCallback
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onChangeActive: function ( active, args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $.contains( document, this.container ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -817,7 +887,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @deprecated alias of onChangeActive
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.1.0 Use this.onChangeActive() instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> toggle: function ( active ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return this.onChangeActive( active, this.defaultActiveArguments );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -826,6 +896,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Shorthand way to enable the active state.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [params]
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if already active
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -834,6 +906,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Shorthand way to disable the active state.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [params]
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if already inactive
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -880,6 +954,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Render the control from its JS template, if it exists.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * The control's container must already exist in the DOM.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> renderContent: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var template,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1291,7 +1367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Change objects contained within the main customize object to Settings.
</span><span class="cx" style="display: block; padding: 0 10px"> api.defaultConstructor = api.Setting;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Create the collection of Control objects.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Create the collections for Controls, Sections and Panels.
</ins><span class="cx" style="display: block; padding: 0 10px"> api.control = new api.Values({ defaultConstructor: api.Control });
</span><span class="cx" style="display: block; padding: 0 10px"> api.section = new api.Values({ defaultConstructor: api.Section });
</span><span class="cx" style="display: block; padding: 0 10px"> api.panel = new api.Values({ defaultConstructor: api.Panel });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1495,8 +1571,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }());
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Set the document title of the customizer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Set the document title of the customizer.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {string} documentTitle
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> api.setDocumentTitle = function ( documentTitle ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1628,7 +1706,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the URL when the iframe sends a URL message.
</span><span class="cx" style="display: block; padding: 0 10px"> this.bind( 'url', this.previewUrl );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update the document title when the preview changes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the document title when the preview changes.
</ins><span class="cx" style="display: block; padding: 0 10px"> this.bind( 'documentTitle', function ( title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> api.setDocumentTitle( title );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1768,7 +1846,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Expand/Collapse the main customizer customize info
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Expand/Collapse the main customizer customize info.
</ins><span class="cx" style="display: block; padding: 0 10px"> $( '#customize-info' ).find( '> .accordion-section-title' ).on( 'click keydown', function( event ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1943,6 +2021,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Sort panels, sections, controls by priorities. Hide empty sections and panels.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> api.reflowPaneContents = _.bind( function () {
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminjscustomizewidgetsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/customize-widgets.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/customize-widgets.js 2014-12-04 01:58:56 UTC (rev 30737)
+++ trunk/src/wp-admin/js/customize-widgets.js 2014-12-04 02:03:30 UTC (rev 30738)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,6 +409,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> completeCallback: $.noop
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @since 4.1.0
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> initialize: function ( id, options ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var control = this;
</span><span class="cx" style="display: block; padding: 0 10px"> api.Control.prototype.initialize.call( control, id, options );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,8 +803,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Overrides api.Control.toggle()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Boolean} active
- * @param {Object} args
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
+ * @param {Boolean} active
+ * @param {Object} args
+ * @param {Callback} args.completeCallback
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> onChangeActive: function ( active, args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Note: there is a second 'args' parameter being passed, merged on top of this.defaultActiveArguments
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1134,6 +1140,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Boolean} expanded
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [params]
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if state already applied
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1141,6 +1149,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _toggleExpanded: api.Section.prototype._toggleExpanded,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [params]
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if already expanded
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1149,13 +1159,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Expand the widget form control
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @deprecated alias of expand()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.1.0 Use this.expand() instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> expandForm: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> this.expand();
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.1.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} [params]
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {Boolean} false if already collapsed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1164,7 +1176,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Collapse the widget form control
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @deprecated alias of expand()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 4.1.0 Use this.collapse() instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> collapseForm: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> this.collapse();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1378,6 +1390,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Sync the section's active state back to the Backbone model's is_rendered attribute
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @since 4.1.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> ready: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var section = this, registeredSidebar;
</span></span></pre>
</div>
</div>
</body>
</html>