@atlassian/aui 9.11.4 → 9.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aui/aui-css-deprecations.js +1 -1
- package/dist/aui/aui-css-deprecations.js.map +1 -1
- package/dist/aui/aui-prototyping-browserfocus.css +2 -651
- package/dist/aui/aui-prototyping-browserfocus.css.map +1 -0
- package/dist/aui/aui-prototyping-darkmode.css +2 -285
- package/dist/aui/aui-prototyping-darkmode.css.map +1 -0
- package/dist/aui/aui-prototyping-design-tokens-api-full.js +2 -2
- package/dist/aui/aui-prototyping-design-tokens-api-full.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api.js +2 -2
- package/dist/aui/aui-prototyping-design-tokens-api.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.css +2 -2
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.css.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js +2 -2
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css +2 -115
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css.map +1 -0
- package/dist/aui/aui-prototyping.css +11 -11
- package/dist/aui/aui-prototyping.css.map +1 -1
- package/dist/aui/aui-prototyping.js +47 -47
- package/dist/aui/aui-prototyping.js.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.css +11 -11
- package/dist/aui/aui-prototyping.nodeps.css.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.js +47 -47
- package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
- package/dist/aui/themes/dark-future.js +1 -1
- package/dist/aui/themes/dark-future.js.map +1 -1
- package/dist/aui/themes/dark.js +1 -1
- package/dist/aui/themes/dark.js.map +1 -1
- package/dist/aui/themes/legacy-dark.js +1 -1
- package/dist/aui/themes/legacy-dark.js.map +1 -1
- package/dist/aui/themes/legacy-light.js +1 -1
- package/dist/aui/themes/legacy-light.js.map +1 -1
- package/dist/aui/themes/light-future.js +1 -1
- package/dist/aui/themes/light-future.js.map +1 -1
- package/dist/aui/themes/light.js +1 -1
- package/dist/aui/themes/light.js.map +1 -1
- package/dist/aui/themes/shape.js +1 -1
- package/dist/aui/themes/shape.js.map +1 -1
- package/dist/aui/themes/spacing.js +1 -1
- package/dist/aui/themes/spacing.js.map +1 -1
- package/dist/aui/themes/typography-adg3.js +1 -1
- package/dist/aui/themes/typography-adg3.js.map +1 -1
- package/dist/aui/themes/typography-modernized.js +2 -0
- package/dist/aui/themes/typography-modernized.js.map +1 -0
- package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.css +2 -2
- package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-theme-import-map.js +3 -11
- package/entry/token-themes-generated/npm/themes/dark.js +1 -1
- package/entry/token-themes-generated/npm/themes/light.js +1 -1
- package/entry/token-themes-generated/npm/themes/typography-adg3.js +11 -13
- package/entry/token-themes-generated/npm/themes/{typography-minor3.js → typography-modernized.js} +13 -21
- package/entry/token-themes-generated/p2/aui-prototyping-design-tokens-theme-import-map.js +3 -11
- package/entry/token-themes-generated/p2/aui-prototyping-design-tokens-theme.css +2 -2
- package/entry/token-themes-generated/p2/themes/dark.js +1 -1
- package/entry/token-themes-generated/p2/themes/light.js +1 -1
- package/entry/token-themes-generated/p2/themes/typography-adg3.js +11 -13
- package/entry/token-themes-generated/p2/themes/{typography-minor3.js → typography-modernized.js} +13 -21
- package/package.json +78 -79
- package/src/js/aui/avatar-group.js +4 -4
- package/src/js/aui/banner.js +2 -2
- package/src/js/aui/date-picker.js +10 -8
- package/src/js/aui/design-tokens/design-tokens-init.js +2 -2
- package/src/js/aui/design-tokens/design-tokens-testing-theme.js +6 -6
- package/src/js/aui/dialog2.js +3 -0
- package/src/js/aui/focus-manager.js +51 -1
- package/src/js/aui/form-notification.js +1 -0
- package/src/js/aui/internal/browser.js +1 -0
- package/src/js/aui/internal/deprecation.js +1 -0
- package/src/js/aui/polyfills/custom-event.js +2 -0
- package/src/js/aui/sidebar.js +1 -0
- package/src/js/aui/trigger.js +1 -0
- package/src/js/aui/when-i-type.js +1 -0
- package/src/less/aui-page-typography.less +7 -0
- package/src/less/imports/aui-theme/components/form-notification.less +1 -1
- package/src/less/imports/aui-theme/core/spaces.less +16 -14
- package/dist/aui/themes/dark-new-input-border.js +0 -2
- package/dist/aui/themes/dark-new-input-border.js.map +0 -1
- package/dist/aui/themes/light-new-input-border.js +0 -2
- package/dist/aui/themes/light-new-input-border.js.map +0 -1
- package/dist/aui/themes/typography-minor3.js +0 -2
- package/dist/aui/themes/typography-minor3.js.map +0 -1
- package/entry/token-themes-generated/npm/themes/dark-new-input-border.js +0 -7
- package/entry/token-themes-generated/npm/themes/light-new-input-border.js +0 -7
- package/entry/token-themes-generated/p2/themes/dark-new-input-border.js +0 -7
- package/entry/token-themes-generated/p2/themes/light-new-input-border.js +0 -7
- package/src/.eslintrc +0 -17
- package/src/js/aui/internal/i18n/.eslintrc +0 -6
- package/src/js-vendor/jquery-aop/LICENSE +0 -21
- package/src/js-vendor/jquery-aop/README.md +0 -54
- package/src/js-vendor/jquery-aop/aop.js +0 -404
- package/src/js-vendor/jquery-aop/jquery-aop.txt +0 -5
- package/src/js-vendor/jquery-aop/package.json +0 -16
- package/src/js-vendor/jquery-form/jquery.form.js +0 -813
- package/src/js-vendor/jquery-form/package.json +0 -15
- package/src/js-vendor/jquery.hotkeys/jquery.hotkeys.js +0 -99
- package/src/js-vendor/jquery.hotkeys/package.json +0 -14
- package/src/js-vendor/select2/CONTRIBUTING.md +0 -107
- package/src/js-vendor/select2/LICENSE +0 -18
- package/src/js-vendor/select2/README.md +0 -115
- package/src/js-vendor/select2/bower.json +0 -8
- package/src/js-vendor/select2/component.json +0 -66
- package/src/js-vendor/select2/composer.json +0 -29
- package/src/js-vendor/select2/package.json +0 -20
- package/src/js-vendor/select2/release.sh +0 -79
- package/src/js-vendor/select2/select2-bootstrap.css +0 -87
- package/src/js-vendor/select2/select2-spinner.gif +0 -0
- package/src/js-vendor/select2/select2.css +0 -692
- package/src/js-vendor/select2/select2.jquery.json +0 -36
- package/src/js-vendor/select2/select2.js +0 -3729
- package/src/js-vendor/select2/select2.min.js +0 -23
- package/src/js-vendor/select2/select2.png +0 -0
- package/src/js-vendor/select2/select2_locale_ar.js +0 -19
- package/src/js-vendor/select2/select2_locale_az.js +0 -20
- package/src/js-vendor/select2/select2_locale_bg.js +0 -20
- package/src/js-vendor/select2/select2_locale_ca.js +0 -19
- package/src/js-vendor/select2/select2_locale_cs.js +0 -51
- package/src/js-vendor/select2/select2_locale_da.js +0 -19
- package/src/js-vendor/select2/select2_locale_de.js +0 -18
- package/src/js-vendor/select2/select2_locale_el.js +0 -19
- package/src/js-vendor/select2/select2_locale_en.js.template +0 -20
- package/src/js-vendor/select2/select2_locale_es.js +0 -19
- package/src/js-vendor/select2/select2_locale_et.js +0 -19
- package/src/js-vendor/select2/select2_locale_eu.js +0 -45
- package/src/js-vendor/select2/select2_locale_fa.js +0 -21
- package/src/js-vendor/select2/select2_locale_fi.js +0 -30
- package/src/js-vendor/select2/select2_locale_fr.js +0 -18
- package/src/js-vendor/select2/select2_locale_gl.js +0 -45
- package/src/js-vendor/select2/select2_locale_he.js +0 -19
- package/src/js-vendor/select2/select2_locale_hr.js +0 -24
- package/src/js-vendor/select2/select2_locale_hu.js +0 -17
- package/src/js-vendor/select2/select2_locale_id.js +0 -21
- package/src/js-vendor/select2/select2_locale_is.js +0 -17
- package/src/js-vendor/select2/select2_locale_it.js +0 -17
- package/src/js-vendor/select2/select2_locale_ja.js +0 -17
- package/src/js-vendor/select2/select2_locale_ka.js +0 -19
- package/src/js-vendor/select2/select2_locale_ko.js +0 -19
- package/src/js-vendor/select2/select2_locale_lt.js +0 -26
- package/src/js-vendor/select2/select2_locale_lv.js +0 -19
- package/src/js-vendor/select2/select2_locale_mk.js +0 -19
- package/src/js-vendor/select2/select2_locale_ms.js +0 -21
- package/src/js-vendor/select2/select2_locale_nb.js +0 -22
- package/src/js-vendor/select2/select2_locale_nl.js +0 -17
- package/src/js-vendor/select2/select2_locale_pl.js +0 -54
- package/src/js-vendor/select2/select2_locale_pt-BR.js +0 -18
- package/src/js-vendor/select2/select2_locale_pt-PT.js +0 -17
- package/src/js-vendor/select2/select2_locale_ro.js +0 -17
- package/src/js-vendor/select2/select2_locale_rs.js +0 -19
- package/src/js-vendor/select2/select2_locale_ru.js +0 -23
- package/src/js-vendor/select2/select2_locale_sk.js +0 -50
- package/src/js-vendor/select2/select2_locale_sv.js +0 -19
- package/src/js-vendor/select2/select2_locale_th.js +0 -19
- package/src/js-vendor/select2/select2_locale_tr.js +0 -20
- package/src/js-vendor/select2/select2_locale_ug-CN.js +0 -16
- package/src/js-vendor/select2/select2_locale_uk.js +0 -25
- package/src/js-vendor/select2/select2_locale_vi.js +0 -20
- package/src/js-vendor/select2/select2_locale_zh-CN.js +0 -16
- package/src/js-vendor/select2/select2_locale_zh-TW.js +0 -16
- package/src/js-vendor/select2/select2x2.png +0 -0
- package/src/js-vendor/tablesorter/README.md +0 -158
- package/src/js-vendor/tablesorter/jquery.tablesorter.js +0 -1901
- package/src/js-vendor/tablesorter/package.json +0 -43
package/src/.eslintrc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014 Gonzalo Casas
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# jquery-aop
|
|
2
|
-
|
|
3
|
-
Add features of aspect-oriented programming (AOP) to jQuery.
|
|
4
|
-
|
|
5
|
-
## Introduction
|
|
6
|
-
|
|
7
|
-
jQuery AOP is a very small plugin that adds [AOP](http://en.wikipedia.org/wiki/Aspect-oriented_programming) features to javascript. It allows to add [advices](http://en.wikipedia.org/wiki/Advice_in_aspect-oriented_programming) (_Before_, _After_, _After Throw_, _After Finally_, _Around_ and _Introduction_) to any global or instance object.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
* Allows to add _Before_, _After_, _After Throw_, _After Finally_, _Around_ and _Introduction_ advices.
|
|
12
|
-
* Allows to define point-cuts using regex to match multiple methods.
|
|
13
|
-
* Works with global function and object methods.
|
|
14
|
-
* Advices can be removed after being applied.
|
|
15
|
-
* **Just 1091 bytes!** (Packed and Gzipped)
|
|
16
|
-
* Integrated into jQuery.
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
Starting with jQuery AOP is really easy!
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
jQuery.aop.before( {target: String, method: 'replace'},
|
|
25
|
-
function(regex, newString) {
|
|
26
|
-
alert("About to replace string '" + this + "' with '" + newString + "' using regEx '" + regex + "'");
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
More samples on [Reference](Reference.md)...
|
|
33
|
-
|
|
34
|
-
### What is new on 1.3?
|
|
35
|
-
|
|
36
|
-
The latest release of jQuery AOP includes:
|
|
37
|
-
* Support **after throw** and **after finally** advices
|
|
38
|
-
* some bug fixes
|
|
39
|
-
|
|
40
|
-
No breaking changes from 1.2.
|
|
41
|
-
|
|
42
|
-
### What is new on 1.2?
|
|
43
|
-
|
|
44
|
-
This is a bug fix release, solving some minor issues reported. No breaking changes from 1.1.
|
|
45
|
-
|
|
46
|
-
### What is new on 1.1?
|
|
47
|
-
|
|
48
|
-
The latest release of jQuery AOP includes two new features:
|
|
49
|
-
* Support for **introductions**
|
|
50
|
-
* and support for **regex matching** of method names!
|
|
51
|
-
|
|
52
|
-
The new regex matching support breaks compatibility with the previous version because now the weaving methods return an array of functions instead of just one function.
|
|
53
|
-
|
|
54
|
-
But don't worry! You can revert to the old behavior if you need to: more details on [BackwardsCompatibility](BackwardsCompatibility.md)!
|
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* jQuery AOP - jQuery plugin to add features of aspect-oriented programming (AOP) to jQuery.
|
|
3
|
-
* https://github.com/gonzalocasas/jquery-aop
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the MIT license:
|
|
6
|
-
* http://www.opensource.org/licenses/mit-license.php
|
|
7
|
-
*
|
|
8
|
-
* Version: 1.3
|
|
9
|
-
*
|
|
10
|
-
* Cross-frame type detection based on Daniel Steigerwald's code (http://daniel.steigerwald.cz)
|
|
11
|
-
* http://gist.github.com/204554
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
(function() {
|
|
16
|
-
|
|
17
|
-
var _after = 1;
|
|
18
|
-
var _afterThrow = 2;
|
|
19
|
-
var _afterFinally = 3;
|
|
20
|
-
var _before = 4;
|
|
21
|
-
var _around = 5;
|
|
22
|
-
var _intro = 6;
|
|
23
|
-
var _regexEnabled = true;
|
|
24
|
-
var _arguments = 'arguments';
|
|
25
|
-
var _undef = 'undefined';
|
|
26
|
-
|
|
27
|
-
var getType = (function() {
|
|
28
|
-
|
|
29
|
-
var toString = Object.prototype.toString,
|
|
30
|
-
toStrings = {},
|
|
31
|
-
nodeTypes = { 1: 'element', 3: 'textnode', 9: 'document', 11: 'fragment' },
|
|
32
|
-
types = 'Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window'.split(' ');
|
|
33
|
-
|
|
34
|
-
for (var i = types.length; i--; ) {
|
|
35
|
-
var type = types[i], constructor = window[type];
|
|
36
|
-
if (constructor) {
|
|
37
|
-
try { toStrings[toString.call(new constructor)] = type.toLowerCase(); }
|
|
38
|
-
catch (e) { }
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return function(item) {
|
|
43
|
-
return item == null && (item === undefined ? _undef : 'null') ||
|
|
44
|
-
item.nodeType && nodeTypes[item.nodeType] ||
|
|
45
|
-
typeof item.length == 'number' && (
|
|
46
|
-
item.callee && _arguments ||
|
|
47
|
-
item.alert && 'window' ||
|
|
48
|
-
item.item && 'nodelist') ||
|
|
49
|
-
toStrings[toString.call(item)];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
})();
|
|
53
|
-
|
|
54
|
-
var isFunc = function(obj) { return getType(obj) == 'function'; };
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Private weaving function.
|
|
58
|
-
*/
|
|
59
|
-
var weaveOne = function(source, method, advice) {
|
|
60
|
-
|
|
61
|
-
var old = source[method];
|
|
62
|
-
|
|
63
|
-
// Work-around IE6/7 behavior on some native method that return object instances
|
|
64
|
-
if (advice.type != _intro && !isFunc(old)) {
|
|
65
|
-
var oldObject = old;
|
|
66
|
-
old = function() {
|
|
67
|
-
var code = arguments.length > 0 ? _arguments + '[0]' : '';
|
|
68
|
-
|
|
69
|
-
for (var i=1;i<arguments.length;i++) {
|
|
70
|
-
code += ',' + _arguments + '[' + i + ']';
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return eval('oldObject(' + code + ');');
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var aspect;
|
|
78
|
-
if (advice.type == _after || advice.type == _afterThrow || advice.type == _afterFinally)
|
|
79
|
-
aspect = function() {
|
|
80
|
-
var returnValue, exceptionThrown = null;
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
returnValue = old.apply(this, arguments);
|
|
84
|
-
} catch (e) {
|
|
85
|
-
exceptionThrown = e;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (advice.type == _after)
|
|
89
|
-
if (exceptionThrown == null)
|
|
90
|
-
returnValue = advice.value.apply(this, [returnValue, method]);
|
|
91
|
-
else
|
|
92
|
-
throw exceptionThrown;
|
|
93
|
-
else if (advice.type == _afterThrow && exceptionThrown != null)
|
|
94
|
-
returnValue = advice.value.apply(this, [exceptionThrown, method]);
|
|
95
|
-
else if (advice.type == _afterFinally)
|
|
96
|
-
returnValue = advice.value.apply(this, [returnValue, exceptionThrown, method]);
|
|
97
|
-
|
|
98
|
-
return returnValue;
|
|
99
|
-
};
|
|
100
|
-
else if (advice.type == _before)
|
|
101
|
-
aspect = function() {
|
|
102
|
-
advice.value.apply(this, [arguments, method]);
|
|
103
|
-
return old.apply(this, arguments);
|
|
104
|
-
};
|
|
105
|
-
else if (advice.type == _intro)
|
|
106
|
-
aspect = function() {
|
|
107
|
-
return advice.value.apply(this, arguments);
|
|
108
|
-
};
|
|
109
|
-
else if (advice.type == _around) {
|
|
110
|
-
aspect = function() {
|
|
111
|
-
var invocation = { object: this, args: Array.prototype.slice.call(arguments) };
|
|
112
|
-
return advice.value.apply(invocation.object, [{ arguments: invocation.args, method: method, proceed :
|
|
113
|
-
function() {
|
|
114
|
-
return old.apply(invocation.object, invocation.args);
|
|
115
|
-
}
|
|
116
|
-
}] );
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
aspect.unweave = function() {
|
|
121
|
-
source[method] = old;
|
|
122
|
-
pointcut = source = aspect = old = null;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
source[method] = aspect;
|
|
126
|
-
|
|
127
|
-
return aspect;
|
|
128
|
-
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Private method search
|
|
133
|
-
*/
|
|
134
|
-
var search = function(source, pointcut, advice) {
|
|
135
|
-
|
|
136
|
-
var methods = [];
|
|
137
|
-
|
|
138
|
-
for (var method in source) {
|
|
139
|
-
|
|
140
|
-
var item = null;
|
|
141
|
-
|
|
142
|
-
// Ignore exceptions during method retrival
|
|
143
|
-
try {
|
|
144
|
-
item = source[method];
|
|
145
|
-
}
|
|
146
|
-
catch (e) { }
|
|
147
|
-
|
|
148
|
-
if (item != null && method.match(pointcut.method) && isFunc(item))
|
|
149
|
-
methods[methods.length] = { source: source, method: method, advice: advice };
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return methods;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Private weaver and pointcut parser.
|
|
158
|
-
*/
|
|
159
|
-
var weave = function(pointcut, advice) {
|
|
160
|
-
|
|
161
|
-
var source = typeof(pointcut.target.prototype) != _undef ? pointcut.target.prototype : pointcut.target;
|
|
162
|
-
var advices = [];
|
|
163
|
-
|
|
164
|
-
// If it's not an introduction and no method was found, try with regex...
|
|
165
|
-
if (advice.type != _intro && typeof(source[pointcut.method]) == _undef) {
|
|
166
|
-
|
|
167
|
-
// First try directly on target
|
|
168
|
-
var methods = search(pointcut.target, pointcut, advice);
|
|
169
|
-
|
|
170
|
-
// No method found, re-try directly on prototype
|
|
171
|
-
if (methods.length == 0)
|
|
172
|
-
methods = search(source, pointcut, advice);
|
|
173
|
-
|
|
174
|
-
for (var i in methods)
|
|
175
|
-
advices[advices.length] = weaveOne(methods[i].source, methods[i].method, methods[i].advice);
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
else
|
|
179
|
-
{
|
|
180
|
-
// Return as an array of one element
|
|
181
|
-
advices[0] = weaveOne(source, pointcut.method, advice);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return _regexEnabled ? advices : advices[0];
|
|
185
|
-
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
jQuery.aop =
|
|
189
|
-
{
|
|
190
|
-
/**
|
|
191
|
-
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
|
|
192
|
-
* has completed execution successfully, and will receive one parameter with the result of the execution.
|
|
193
|
-
* This function returns an array of weaved aspects (Function).
|
|
194
|
-
*
|
|
195
|
-
* @example jQuery.aop.after( {target: window, method: 'MyGlobalMethod'}, function(result) {
|
|
196
|
-
* alert('Returned: ' + result);
|
|
197
|
-
* return result;
|
|
198
|
-
* } );
|
|
199
|
-
* @result Array<Function>
|
|
200
|
-
*
|
|
201
|
-
* @example jQuery.aop.after( {target: String, method: 'indexOf'}, function(index) {
|
|
202
|
-
* alert('Result found at: ' + index + ' on:' + this);
|
|
203
|
-
* return index;
|
|
204
|
-
* } );
|
|
205
|
-
* @result Array<Function>
|
|
206
|
-
*
|
|
207
|
-
* @name after
|
|
208
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
209
|
-
* @option Object target Target object to be weaved.
|
|
210
|
-
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
|
|
211
|
-
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
|
|
212
|
-
* with the result of the point-cut's execution. The function can choose to return this same value or a different one.
|
|
213
|
-
*
|
|
214
|
-
* @type Array<Function>
|
|
215
|
-
* @cat Plugins/General
|
|
216
|
-
*/
|
|
217
|
-
after : function(pointcut, advice)
|
|
218
|
-
{
|
|
219
|
-
return weave( pointcut, { type: _after, value: advice } );
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Creates an advice after the defined point-cut only for unhandled exceptions. The advice will be executed
|
|
224
|
-
* after the point-cut method only if the execution failed and an exception has been thrown. It will receive one
|
|
225
|
-
* parameter with the exception thrown by the point-cut method.
|
|
226
|
-
* This function returns an array of weaved aspects (Function).
|
|
227
|
-
*
|
|
228
|
-
* @example jQuery.aop.afterThrow( {target: String, method: 'indexOf'}, function(exception) {
|
|
229
|
-
* alert('Unhandled exception: ' + exception);
|
|
230
|
-
* return -1;
|
|
231
|
-
* } );
|
|
232
|
-
* @result Array<Function>
|
|
233
|
-
*
|
|
234
|
-
* @example jQuery.aop.afterThrow( {target: calculator, method: 'Calculate'}, function(exception) {
|
|
235
|
-
* console.log('Unhandled exception: ' + exception);
|
|
236
|
-
* throw exception;
|
|
237
|
-
* } );
|
|
238
|
-
* @result Array<Function>
|
|
239
|
-
*
|
|
240
|
-
* @name afterThrow
|
|
241
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
242
|
-
* @option Object target Target object to be weaved.
|
|
243
|
-
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
|
|
244
|
-
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
|
|
245
|
-
* with the exception thrown by the point-cut method.
|
|
246
|
-
*
|
|
247
|
-
* @type Array<Function>
|
|
248
|
-
* @cat Plugins/General
|
|
249
|
-
*/
|
|
250
|
-
afterThrow : function(pointcut, advice)
|
|
251
|
-
{
|
|
252
|
-
return weave( pointcut, { type: _afterThrow, value: advice } );
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
|
|
257
|
-
* regardless of its success or failure, and it will receive two parameters: one with the
|
|
258
|
-
* result of a successful execution or null, and another one with the exception thrown or null.
|
|
259
|
-
* This function returns an array of weaved aspects (Function).
|
|
260
|
-
*
|
|
261
|
-
* @example jQuery.aop.afterFinally( {target: window, method: 'MyGlobalMethod'}, function(result, exception) {
|
|
262
|
-
* if (exception == null)
|
|
263
|
-
* return 'Returned: ' + result;
|
|
264
|
-
* else
|
|
265
|
-
* return 'Unhandled exception: ' + exception;
|
|
266
|
-
* } );
|
|
267
|
-
* @result Array<Function>
|
|
268
|
-
*
|
|
269
|
-
* @name afterFinally
|
|
270
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
271
|
-
* @option Object target Target object to be weaved.
|
|
272
|
-
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
|
|
273
|
-
* @param Function advice Function containing the code that will get called after the execution of the point-cut regardless of its success or failure.
|
|
274
|
-
* It receives two parameters, the first one with the result of a successful execution or null, and the second one with the
|
|
275
|
-
* exception or null.
|
|
276
|
-
*
|
|
277
|
-
* @type Array<Function>
|
|
278
|
-
* @cat Plugins/General
|
|
279
|
-
*/
|
|
280
|
-
afterFinally : function(pointcut, advice)
|
|
281
|
-
{
|
|
282
|
-
return weave( pointcut, { type: _afterFinally, value: advice } );
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Creates an advice before the defined point-cut. The advice will be executed before the point-cut method
|
|
288
|
-
* but cannot modify the behavior of the method, or prevent its execution.
|
|
289
|
-
* This function returns an array of weaved aspects (Function).
|
|
290
|
-
*
|
|
291
|
-
* @example jQuery.aop.before( {target: window, method: 'MyGlobalMethod'}, function() {
|
|
292
|
-
* alert('About to execute MyGlobalMethod');
|
|
293
|
-
* } );
|
|
294
|
-
* @result Array<Function>
|
|
295
|
-
*
|
|
296
|
-
* @example jQuery.aop.before( {target: String, method: 'indexOf'}, function(index) {
|
|
297
|
-
* alert('About to execute String.indexOf on: ' + this);
|
|
298
|
-
* } );
|
|
299
|
-
* @result Array<Function>
|
|
300
|
-
*
|
|
301
|
-
* @name before
|
|
302
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
303
|
-
* @option Object target Target object to be weaved.
|
|
304
|
-
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
|
|
305
|
-
* @param Function advice Function containing the code that will get called before the execution of the point-cut.
|
|
306
|
-
*
|
|
307
|
-
* @type Array<Function>
|
|
308
|
-
* @cat Plugins/General
|
|
309
|
-
*/
|
|
310
|
-
before : function(pointcut, advice)
|
|
311
|
-
{
|
|
312
|
-
return weave( pointcut, { type: _before, value: advice } );
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Creates an advice 'around' the defined point-cut. This type of advice can control the point-cut method execution by calling
|
|
318
|
-
* the functions '.proceed()' on the 'invocation' object, and also, can modify the arguments collection before sending them to the function call.
|
|
319
|
-
* This function returns an array of weaved aspects (Function).
|
|
320
|
-
*
|
|
321
|
-
* @example jQuery.aop.around( {target: window, method: 'MyGlobalMethod'}, function(invocation) {
|
|
322
|
-
* alert('# of Arguments: ' + invocation.arguments.length);
|
|
323
|
-
* return invocation.proceed();
|
|
324
|
-
* } );
|
|
325
|
-
* @result Array<Function>
|
|
326
|
-
*
|
|
327
|
-
* @example jQuery.aop.around( {target: String, method: 'indexOf'}, function(invocation) {
|
|
328
|
-
* alert('Searching: ' + invocation.arguments[0] + ' on: ' + this);
|
|
329
|
-
* return invocation.proceed();
|
|
330
|
-
* } );
|
|
331
|
-
* @result Array<Function>
|
|
332
|
-
*
|
|
333
|
-
* @example jQuery.aop.around( {target: window, method: /Get(\d+)/}, function(invocation) {
|
|
334
|
-
* alert('Executing ' + invocation.method);
|
|
335
|
-
* return invocation.proceed();
|
|
336
|
-
* } );
|
|
337
|
-
* @desc Matches all global methods starting with 'Get' and followed by a number.
|
|
338
|
-
* @result Array<Function>
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* @name around
|
|
342
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
343
|
-
* @option Object target Target object to be weaved.
|
|
344
|
-
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
|
|
345
|
-
* @param Function advice Function containing the code that will get called around the execution of the point-cut. This advice will be called with one
|
|
346
|
-
* argument containing one function '.proceed()', the collection of arguments '.arguments', and the matched method name '.method'.
|
|
347
|
-
*
|
|
348
|
-
* @type Array<Function>
|
|
349
|
-
* @cat Plugins/General
|
|
350
|
-
*/
|
|
351
|
-
around : function(pointcut, advice)
|
|
352
|
-
{
|
|
353
|
-
return weave( pointcut, { type: _around, value: advice } );
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Creates an introduction on the defined point-cut. This type of advice replaces any existing methods with the same
|
|
358
|
-
* name. To restore them, just unweave it.
|
|
359
|
-
* This function returns an array with only one weaved aspect (Function).
|
|
360
|
-
*
|
|
361
|
-
* @example jQuery.aop.introduction( {target: window, method: 'MyGlobalMethod'}, function(result) {
|
|
362
|
-
* alert('Returned: ' + result);
|
|
363
|
-
* } );
|
|
364
|
-
* @result Array<Function>
|
|
365
|
-
*
|
|
366
|
-
* @example jQuery.aop.introduction( {target: String, method: 'log'}, function() {
|
|
367
|
-
* alert('Console: ' + this);
|
|
368
|
-
* } );
|
|
369
|
-
* @result Array<Function>
|
|
370
|
-
*
|
|
371
|
-
* @name introduction
|
|
372
|
-
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
|
|
373
|
-
* @option Object target Target object to be weaved.
|
|
374
|
-
* @option String method Name of the function to be weaved.
|
|
375
|
-
* @param Function advice Function containing the code that will be executed on the point-cut.
|
|
376
|
-
*
|
|
377
|
-
* @type Array<Function>
|
|
378
|
-
* @cat Plugins/General
|
|
379
|
-
*/
|
|
380
|
-
introduction : function(pointcut, advice)
|
|
381
|
-
{
|
|
382
|
-
return weave( pointcut, { type: _intro, value: advice } );
|
|
383
|
-
},
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Configures global options.
|
|
387
|
-
*
|
|
388
|
-
* @name setup
|
|
389
|
-
* @param Map settings Configuration options.
|
|
390
|
-
* @option Boolean regexMatch Enables/disables regex matching of method names.
|
|
391
|
-
*
|
|
392
|
-
* @example jQuery.aop.setup( { regexMatch: false } );
|
|
393
|
-
* @desc Disable regex matching.
|
|
394
|
-
*
|
|
395
|
-
* @type Void
|
|
396
|
-
* @cat Plugins/General
|
|
397
|
-
*/
|
|
398
|
-
setup: function(settings)
|
|
399
|
-
{
|
|
400
|
-
_regexEnabled = settings.regexMatch;
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
})();
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jquery-aop",
|
|
3
|
-
"version": "1.3.0",
|
|
4
|
-
"description": "Add features of aspect-oriented programming (AOP) to jQuery.",
|
|
5
|
-
"main": "aop.js",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/gonzalocasas/jquery-aop.git"
|
|
9
|
-
},
|
|
10
|
-
"author": "Gonzalo Casas <gonzalocasas@gmail.com>",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/gonzalocasas/jquery-aop/issues"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/gonzalocasas/jquery-aop"
|
|
16
|
-
}
|