From fa08b58ee1ab9738f5e0edb5cb1ba7a88ef4888d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Thu, 19 Mar 2015 17:06:16 +0100 Subject: [PATCH 01/16] All: Document classes option Fixes #256 --- entries/accordion.xml | 3 +++ entries/draggable.xml | 3 +++ entries/jQuery.widget.xml | 41 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/entries/accordion.xml b/entries/accordion.xml index 1e593106..6b2034c8 100644 --- a/entries/accordion.xml +++ b/entries/accordion.xml @@ -86,6 +86,9 @@ + diff --git a/entries/draggable.xml b/entries/draggable.xml index 445e6a12..cde7641e 100644 --- a/entries/draggable.xml +++ b/entries/draggable.xml @@ -41,6 +41,9 @@ + diff --git a/entries/jQuery.widget.xml b/entries/jQuery.widget.xml index 402fc048..9ef69723 100644 --- a/entries/jQuery.widget.xml +++ b/entries/jQuery.widget.xml @@ -192,6 +192,11 @@ + + @@ -200,6 +205,42 @@ + + + Add classes to an element of the widget. +

This provides a hook for the user to add additional classes or replace default styling classes, through the classes option.

+
+ + The element to add the classes to. Defaults to this.element. + + + + The classes to add. If a property of the classes option matches a key, the value will be added as well. +

Like the element argument, this argument is also optional. To skip it, specify null.

+
+
+ + Additional classes to add. Unlike the keys argument, these aren't associated with any properties of the classes option. + + + Add the "loading-indicator" class to the widget's element (this.element. Will also add any additional classes specified through the classes option for the given class. + + + + Add the "popup-header" class to the specified element (here referencing this.popup). Will also add any additional classes specified through the classes option for the given class. In addition, it will always add the "ui-front" class. + + + + Adds the "ui-helper-hidden-accessible" class the to a specific element. Uses null for the keys argument to skip it. + + +
The _create() method is the widget's constructor. From c7a5974f05a8b01c0f537463000e11c92c736375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Thu, 19 Mar 2015 19:02:21 +0100 Subject: [PATCH 02/16] [tmp]: Extend jQuery.Widget, accordion and draggable classes docs --- entries/accordion.xml | 16 ++++++++++++++-- entries/draggable.xml | 12 ++++++++++-- entries/jQuery.widget.xml | 21 ++++++++++++++++----- includes/classes-option-desc.xml | 5 +++++ 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 includes/classes-option-desc.xml diff --git a/entries/accordion.xml b/entries/accordion.xml index 6b2034c8..ba5a4536 100644 --- a/entries/accordion.xml +++ b/entries/accordion.xml @@ -86,8 +86,20 @@ - - diff --git a/includes/classes-option-desc.xml b/includes/classes-option-desc.xml index 32e3e5e1..5e0a92ce 100644 --- a/includes/classes-option-desc.xml +++ b/includes/classes-option-desc.xml @@ -2,4 +2,4 @@

Specify additional classes to add to the widget's elements. Any of the default keys can be specified to override their value. To learn more about this option, check out the documentation for jQuery.Widget's classes option.

The default value for the widget:

-
\ No newline at end of file + From 23eba79568fc5054a5a6976cc62c3c4d2c55bb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Thu, 9 Apr 2015 18:29:24 +0200 Subject: [PATCH 04/16] [fix]: Many improvements --- entries/accordion.xml | 21 ++++++++++++++++++++- entries/jQuery.widget.xml | 26 ++++++++++---------------- includes/classes-option-desc.xml | 2 +- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/entries/accordion.xml b/entries/accordion.xml index ba5a4536..6b07f8e8 100644 --- a/entries/accordion.xml +++ b/entries/accordion.xml @@ -86,7 +86,7 @@ - - -
    diff --git a/entries/draggable.xml b/entries/draggable.xml index 4ab9a0cb..a566a23e 100644 --- a/entries/draggable.xml +++ b/entries/draggable.xml @@ -41,16 +41,15 @@ - - Adds the "ui-helper-hidden-accessible" class the to a specific element. Uses null for the keys argument to skip it. + Adds the "ui-helper-hidden-accessible" class to the specified element. Uses null for the keys argument to skip it. diff --git a/includes/classes-option-desc.xml b/includes/classes-option-desc.xml index 6ea19461..391ee671 100644 --- a/includes/classes-option-desc.xml +++ b/includes/classes-option-desc.xml @@ -1,5 +1,4 @@

    Specify additional classes to add to the widget's elements. Any of the default keys can be specified to override their value. To learn more about this option, check out the learn article about the classes option.

    -

    The default value for the widget:

    diff --git a/includes/classes-option-example.xml b/includes/classes-option-example.xml new file mode 100644 index 00000000..1d4c30a2 --- /dev/null +++ b/includes/classes-option-example.xml @@ -0,0 +1,23 @@ + + + + Initialize the with the classes option specified, changing the theming for the ui- class: + +$( ".selector" ).({ + classes: { + "ui-": "highlight" + } +}); + + + + Get or set a property of the classes option, after initialization, here reading and changing the theming for the ui- class: + +// Getter +var themeClass = $( ".selector" ).( "option", "classes.ui-" ); + +// Setter +$( ".selector" ).( "option", "classes.ui-", "highlight" ); + + + \ No newline at end of file From 2ed4ae44a684c78439437f3e653130255e43c1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Fri, 10 Apr 2015 14:04:41 +0200 Subject: [PATCH 07/16] [fix]: Missing EOL --- includes/classes-option-example.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes-option-example.xml b/includes/classes-option-example.xml index 1d4c30a2..1f4e392b 100644 --- a/includes/classes-option-example.xml +++ b/includes/classes-option-example.xml @@ -20,4 +20,4 @@ var themeClass = $( ".selector" ).( "option", "classes $( ".selector" ).( "option", "classes.ui-", "highlight" );
    - \ No newline at end of file + From 6793c7796012ae44143a6828e0b57d261983ab56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Fri, 10 Apr 2015 14:28:48 +0200 Subject: [PATCH 08/16] [fix]: Improve _addClass() docs, add _removeClass and _toggleClass --- entries/jQuery.widget.xml | 69 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.widget.xml b/entries/jQuery.widget.xml index 7fede43a..445a3a72 100644 --- a/entries/jQuery.widget.xml +++ b/entries/jQuery.widget.xml @@ -228,21 +228,84 @@ Additional classes to add, required for layout or other reasons. Unlike the keys argument, these aren't associated with any properties of the classes option. Just like keys, they will also be automatically removed when destroying the widget. - Add the "loading-indicator" class to the widget's element (this.element. Will also add any additional classes specified through the classes option for the given class. + Add the ui-progressbar class to the widget's element (this.element). Will also add any additional classes specified through the classes option for the given class. - Add the "demo-popup-header" class to the specified element (here referencing this.popup). Will also add any additional classes specified through the classes option for the given class. In addition, it will always add the "ui-front" class. + Add the demo-popup-header class to the specified element (here referencing this.popup). Will also add any additional classes specified through the classes option for the given class. In addition, it will always add the ui-front class. - Adds the "ui-helper-hidden-accessible" class to the specified element. Uses null for the keys argument to skip it. + Adds the ui-helper-hidden-accessible class to the specified element. Uses null for the keys argument to skip it. + + + + + Remove classes from an element of the widget. +

    The arguments are the same as for the _addClass() method, the same semantics apply, just in reverse.

    +
    + + The element to remove the classes from. Defaults to this.element. + + + + The classes to remove, as a space-delimited list. If a property of the classes option matches a key, the value will be removed as well. +

    When you only need the extra argument, you can skip this argument by specifying null.

    +
    +
    + + Additional classes to remove, required for layout or other reasons. Unlike the keys argument, these aren't associated with any properties of the classes option. + + + Remove the ui-progressbar class from the widget's element (this.element). Will also remove any additional classes specified through the classes option for the given class. + + + + Remove the demo-popup-header class from the specified element (here referencing this.popup). Will also remove any additional classes specified through the classes option for the given class. In addition, it will also remove the ui-front class. + + + + Remove the ui-helper-hidden-accessible class from the specified element. Uses null for the keys argument to skip it. + + +
    + + + Toggle classes of an element of the widget. +

    The arguments are the same as for the _addClass() and _removeClass() methods, except for the additional boolean argument that specifies to add or remove classes.

    +
    + + The element to toogle the classes on. Defaults to this.element. + + + + The classes to toogle, as a space-delimited list. If a property of the classes option matches a key, the value will be toggled as well. +

    When you only need the extra argument, you can skip this argument by specifying null.

    +
    +
    + + Additional classes to toggle, required for layout or other reasons. Unlike the keys argument, these aren't associated with any properties of the classes option. Just like keys, they will also be automatically removed when destroying the widget. + + + Indicates whether to add or remove the specified classes, where a boolean true indicates that classes should be added, a boolean false indicates that classes should be removed. + + + Toggle the ui-state-disabled class on the widget's element (this.element). +
    From 3ceccf7a866c2e4bafdf3dea4a28ef7b05966bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Fri, 10 Apr 2015 14:31:18 +0200 Subject: [PATCH 09/16] [fix]: Put the includes after the element --- entries/draggable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/draggable.xml b/entries/draggable.xml index a566a23e..11cd390d 100644 --- a/entries/draggable.xml +++ b/entries/draggable.xml @@ -42,13 +42,13 @@ Prevents dragging from starting on specified elements.
@@ -88,14 +93,9 @@