Skip to content

1.11 #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 26, 2014
Merged

1.11 #210

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions entries/accordion.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="refresh">
<desc>Process any headers and panels that were added or removed directly in the DOM and recompute the height of the accordion panels. Results depend on the content and the <a href="#option-heightStyle"><code>heightStyle</code></a> option.</desc>
Expand Down
1 change: 1 addition & 0 deletions entries/autocomplete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="search" example-params='""'>
<desc>Triggers a <a href="#event-search"><code>search</code></a> event and invokes the data source if the event is not canceled. Can be used by a selectbox-like button to open the suggestions when clicked. When invoked with no parameters, the current input's value is used. Can be called with an empty string and <code>minLength: 0</code> to display all items.</desc>
Expand Down
1 change: 1 addition & 0 deletions entries/button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<method name="refresh">
<desc>Refreshes the visual state of the button. Useful for updating button state after the native element's checked or disabled state is changed programmatically.</desc>
</method>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
Expand Down
15 changes: 4 additions & 11 deletions entries/dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,10 @@
</option>
<option name="position" default='{ my: "center", at: "center", of: window }' example-value='{ my: "left top", at: "left bottom", of: button }'>
<desc>
<p>Specifies where the dialog should be displayed. The dialog will handle collisions such that as much of the dialog is visible as possible.</p>
<p><em>Note: The <code>String</code> and <code>Array</code> forms are deprecated.</em></p>
<p>Specifies where the dialog should be displayed when opened. The dialog will handle collisions such that as much of the dialog is visible as possible.</p>
<p>The <code>of</code> property defaults to the window, but you can specify another element to position against. You can refer to the <a href="/position/">jQuery UI Position</a> utility for more details about the available properties.</p>
</desc>
<type name="Object">
<desc>Identifies the position of the dialog when opened. The <code>of</code> option defaults to the window, but you can specify another element to position against. You can refer to the <a href="/position/">jQuery UI Position</a> utility for more details about the various options.</desc>
</type>
<type name="String">
<desc>A string representing the position within the viewport. Possible values: <code>"center"</code>, <code>"left"</code>, <code>"right"</code>, <code>"top"</code>, <code>"bottom"</code>.</desc>
</type>
<type name="Array">
<desc>An array containing an <em>x, y</em> coordinate pair in pixel offset from the top left corner of the viewport or the name of a possible string value.</desc>
</type>
<type name="Object"/>
</option>
<option name="resizable" default="true" example-value="false">
<desc>If set to <code>true</code>, the dialog will be resizable. Requires the <a href="/resizable/">jQuery UI Resizable widget</a> to be included.</desc>
Expand Down Expand Up @@ -312,6 +304,7 @@
<method name="open">
<desc>Opens the dialog.</desc>
</method>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
Expand Down
1 change: 1 addition & 0 deletions entries/draggable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
Expand Down
1 change: 1 addition & 0 deletions entries/droppable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
Expand Down
145 changes: 22 additions & 123 deletions entries/jQuery.widget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,32 @@

<h3>Instance</h3>

<p>The widget's instance is stored using <a href="//api.jquery.com/jQuery.data/"><code>jQuery.data()</code></a> with the widget's full name as the key. Therefore, you can use the following to retrieve the progressbar widget's instance object from the element.</p>
<p>The widget's instance can be retrieved from a given element using the <a href="#method-instance"><code>instance()</code></a> method.</p>

<pre><code>
$( "#elem" ).data( "ui-progressbar" );
$( "#elem" ).progressbar( "instance" );
</code></pre>

<p>Whether an element has a given widget bound to it can be determined using the <a href="/data-selector/"><code>:data</code></a> selector.</p>
<p>If the <code>instance()</code> method is called on an element that is not associated with the widget, <code>undefined</code> is returned.</p>

<pre><code>
$( "#not-a-progressbar" ).progressbar( "instance" ); // undefined
</code></pre>

<p>The instance is stored using <a href="//api.jquery.com/jQuery.data/"><code>jQuery.data()</code></a> with the widget's full name as the key. Therefore, the <a href="/data-selector/"><code>:data</code></a> selector can also determine whether an element has a given widget bound to it.</p>

<pre><code>
$( "#elem" ).is( ":data( 'ui-progressbar' )" ); // true
$( "#elem" ).is( ":data( 'ui-draggable' )" ); // false
</code></pre>

<p>Unlike <code>instance()</code>, <code>:data</code> can be used even if the widget being tested for has not loaded.</p>

<pre><code>
$( "#elem" ).nonExistentWidget( "instance" ); // TypeError
$( "#elem" ).is( ":data( 'ui-nonExistentWidget' )" ); // false
</code></pre>

<p>You can also use <code>:data</code> to get a list of all elements that are instances of a given widget.</p>

<pre><code>
Expand Down Expand Up @@ -181,126 +194,12 @@
<xi:include href="../includes/widget-option-show.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</options>
<methods suppress-auto-examples="true">
<method name="destroy">
<desc>
Removes the <placeholder name="name"/> functionality completely. This will return the element back to its pre-init state.
</desc>
<example>
<desc>Destroy the widget when any of its anchors are clicked.</desc>
<code><![CDATA[
this._on( this.element, {
"click a": function( event ) {
event.preventDefault();
this.destroy();
}
});
]]></code>
</example>
</method>
<method name="disable">
<desc>
Disables the <placeholder name="name"/>.
</desc>
<example>
<desc>Disable the widget when any of its anchors are clicked.</desc>
<code><![CDATA[
this._on( this.element, {
"click a": function( event ) {
event.preventDefault();
this.disable();
}
});
]]></code>
</example>
</method>
<method name="enable">
<desc>
Enables the <placeholder name="name"/>.
</desc>
<example>
<desc>Enable the widget when any of its anchors are clicked.</desc>
<code><![CDATA[
this._on( this.element, {
"click a": function( event ) {
event.preventDefault();
this.enable();
}
});
]]></code>
</example>
</method>
<method name="option" return="jQuery">
<desc>
Sets one or more options for the <placeholder name="name"/>.
</desc>
<signature return="Object" example-return-var="isDisabled" example-params='"disabled"'>
<desc>Gets the value currently associated with the specified <code>optionName</code>.</desc>
<argument name="optionName" type="String">
<desc>The name of the option to get.</desc>
</argument>
<example>
<desc>Retrieve the value of the <code>width</code> option.</desc>
<code><![CDATA[
this.option( "width" );
]]></code>
</example>
</signature>
<signature return="PlainObject" example-return-var="options">
<desc>Gets an object containing key/value pairs representing the current <placeholder name="name"/> options hash.</desc>
<example>
<desc>Log the key and value of each of the widget's options for debugging.</desc>
<code><![CDATA[
var options = this.option();
for ( var key in options ) {
console.log( key, options[ key ] );
}
]]></code>
</example>
</signature>
<signature example-params='"disabled", true'>
<desc>Sets the value of the <placeholder name="name"/> option associated with the specified <code>optionName</code>.</desc>
<argument name="optionName" type="String">
<desc>The name of the option to set.</desc>
</argument>
<argument name="value" type="Object">
<desc>A value to set for the option.</desc>
</argument>
<example>
<desc>Set the <code>width</code> option to <code>500</code>.</desc>
<code><![CDATA[
this.option( "width", 500 );
]]></code>
</example>
</signature>
<signature example-params="{ disabled: true }">
<desc>Sets one or more options for the <placeholder name="name"/>.</desc>
<argument name="options" type="Object">
<desc>A map of option-value pairs to set.</desc>
</argument>
<example>
<desc>Set the <code>height</code> and <code>width</code> options to <code>500</code>.</desc>
<code><![CDATA[
this.option({
width: 500,
height: 500
});
]]></code>
</example>
</signature>
</method>
<method name="widget" return="jQuery" example-return-var="widget">
<desc>
Returns a <code>jQuery</code> object containing the <placeholder name="widget-element"/>.
</desc>
<example>
<desc>Place a red border around the widget's original element when it's created.</desc>
<code><![CDATA[
_create: function() {
this.widget().css( "border", "2px solid red" );
}
]]></code>
</example>
</method>
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="_create">
<desc>
The <code>_create()</code> method is the widget's constructor.
Expand Down
79 changes: 55 additions & 24 deletions entries/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
Themeable menu with mouse and keyboard interactions for navigation.
</desc>
<longdesc>
<p>A menu can be created from any valid markup as long as the elements have a strict parent/child relationship and each menu item has an anchor. The most commonly used element is the unordered list (<code>&lt;ul></code>):</p>
<p>A menu can be created from any valid markup as long as the elements have a strict parent/child relationship. The most commonly used element is the unordered list (<code>&lt;ul></code>):</p>

<pre><code><![CDATA[
<ul id="menu">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3
<ul>
<li><a href="#">Item 3-1</a></li>
<li><a href="#">Item 3-2</a></li>
<li><a href="#">Item 3-3</a></li>
<li><a href="#">Item 3-4</a></li>
<li><a href="#">Item 3-5</a></li>
<li>Item 3-1</li>
<li>Item 3-2</li>
<li>Item 3-3</li>
<li>Item 3-4</li>
<li>Item 3-5</li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
<li><a href="#">Item 5</a></li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
]]></code></pre>

Expand All @@ -35,7 +35,7 @@

<pre><code><![CDATA[
<ul id="menu">
<li><a href="#"><span class="ui-icon ui-icon-disk"></span>Save</a></li>
<li><span class="ui-icon ui-icon-disk"></span>Save</li>
</ul>
]]></code></pre>
<p>Menu automatically adds the necessary padding to items without icons.</p>
Expand All @@ -46,9 +46,9 @@

<pre><code><![CDATA[
<ul id="menu">
<li><a href="#">Item 1</a></li>
<li>Item 1</li>
<li>-</li>
<li><a href="#">Item 2</a></li>
<li>Item 2</li>
</ul>
]]></code></pre>

Expand Down Expand Up @@ -150,6 +150,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="expand">
<desc>
Opens the sub-menu below the currently active item, if one exists.
Expand Down Expand Up @@ -227,6 +228,36 @@
</method>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
<extension-points>
<method name="_closeOnDocumentClick" return="Boolean">
<desc>
Method that determines whether clicks on the document should close any open menus. By default, menus are closed unless the click occurred on the menu.
</desc>
<argument name="event" type="Event"/>
<example>
<desc>Never close menus on document click.</desc>
<code><![CDATA[
_closeOnDocumentClick: function( event ) {
return false;
}
]]></code>
</example>
</method>
<method name="_isDivider" return="Boolean">
<desc>
Determines whether an item should acually be represented as a divider instead of a menu item. By default any item that contains just spaces and/or dashes is considered a divider.
</desc>
<argument name="item" type="jQuery"/>
<example>
<desc>Treat all items as menu items with no dividers.</desc>
<code><![CDATA[
_isDivider: function( item ) {
return false;
}
]]></code>
</example>
</method>
</extension-points>
<events>
<event name="blur">
<desc>
Expand Down Expand Up @@ -281,19 +312,19 @@ $( "#menu" ).menu();
]]></css>
<html><![CDATA[
<ul id="menu">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3
<ul>
<li><a href="#">Item 3-1</a></li>
<li><a href="#">Item 3-2</a></li>
<li><a href="#">Item 3-3</a></li>
<li><a href="#">Item 3-4</a></li>
<li><a href="#">Item 3-5</a></li>
<li>Item 3-1</li>
<li>Item 3-2</li>
<li>Item 3-3</li>
<li>Item 3-4</li>
<li>Item 3-5</li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
<li><a href="#">Item 5</a></li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
]]></html>
</example>
Expand Down
1 change: 1 addition & 0 deletions entries/progressbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="value">
<desc>Gets or sets the current value of the progressbar.</desc>
Expand Down
1 change: 1 addition & 0 deletions entries/resizable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
Expand Down
1 change: 1 addition & 0 deletions entries/selectable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-instance.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="refresh">
<desc>Refresh the position and size of each selectee element. This method can be used to manually recalculate the position and size of each selectee when the <a href="#option-autoRefresh"><code>autoRefresh</code></a> option is set to <code>false</code>.</desc>
</method>
Expand Down
Loading