Skip to content

Commit b1d8616

Browse files
authored
Merge branch 'main' into plugin-author
2 parents 9b00934 + a2a01a4 commit b1d8616

File tree

4 files changed

+20
-315
lines changed

4 files changed

+20
-315
lines changed

order.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
"finding-evaluating-plugins",
7777
"basic-plugin-creation",
7878
"publishing-plugins",
79-
"advanced-plugin-concepts",
80-
"stateful-plugins-with-widget-factory"
79+
"advanced-plugin-concepts"
8180
]
8281
},
8382
{

page/events/introduction-to-custom-events.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Why should you care? An example is probably the best way to explain. Suppose you
1919

2020
```
2121
<div class="room" id="kitchen">
22-
<div class="lightbulb on"></div>
23-
<div class="switch"></div>
24-
<div class="switch"></div>
25-
<div class="clapper"></div>
22+
<div class="lightbulb on">Kitchen light</div>
23+
<div class="switch">Kitchen switch 1</div>
24+
<div class="switch">Kitchen switch 2</div>
25+
<div class="clapper">Kitchen clapper switch</div>
2626
</div>
2727
```
2828

@@ -65,18 +65,18 @@ Let's make our example a little more interesting. We'll add another room to our
6565

6666
```
6767
<div class="room" id="kitchen">
68-
<div class="lightbulb on"></div>
69-
<div class="switch"></div>
70-
<div class="switch"></div>
71-
<div class="clapper"></div>
68+
<div class="lightbulb on">Kitchen light</div>
69+
<div class="switch">Kitchen switch 1</div>
70+
<div class="switch">Kitchen switch 2</div>
71+
<div class="clapper">Kitchen clapper switch</div>
7272
</div>
7373
<div class="room" id="bedroom">
74-
<div class="lightbulb on"></div>
75-
<div class="switch"></div>
76-
<div class="switch"></div>
77-
<div class="clapper"></div>
74+
<div class="lightbulb on">Bedroom light</div>
75+
<div class="switch">Bedroom switch 1</div>
76+
<div class="switch">Bedroom switch 2</div>
77+
<div class="clapper">Bedroom clapper switch</div>
7878
</div>
79-
<div id="master_switch"></div>
79+
<div id="master_switch">Master switch</div>
8080
```
8181

8282
If there are any lights on in the house, we want the master switch to turn all the lights off; otherwise, we want it to turn all lights on. To accomplish this, we'll add two more custom events to the lightbulbs: `light:on` and `light:off`. We'll make use of them in the `light:toggle` custom event, and use some logic to decide which one the master switch should trigger:

page/plugins.md

+6
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ A jQuery plugin is simply a new method that we use to extend jQuery's prototype
1414
The idea of a plugin is to do something with a collection of elements. You could consider each method that comes with the jQuery core a plugin, like `.fadeOut()` or `.addClass()`.
1515

1616
You can make your own plugins and use them privately in your code or you can release them into the wild. There are thousands of jQuery plugins available online. The barrier to creating a plugin of your own is so low that you'll want to do it straight away!
17+
18+
While most existing jQuery plugins are stateless – that is, we call them on an element and that is the extent of our interaction with the plugin – there's a large set of functionality that doesn't fit into the basic plugin pattern.
19+
20+
In order to fill this gap, jQuery UI has implemented a more advanced plugin system. The new system manages state, allows multiple functions to be exposed via a single plugin, and provides various extension points. This system is called the Widget Factory and is exposed as `jQuery.widget` as part of jQuery UI 1.8; however, it can be used independently of jQuery UI.
21+
22+
For details on the capabilities of the Widget Factory, see this [How To Use the Widget Factory](/jquery-ui/widget-factory/how-to-use-the-widget-factory/).

page/plugins/stateful-plugins-with-widget-factory.md

-300
This file was deleted.

0 commit comments

Comments
 (0)