ember-auth-source 9.0.2 → 9.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/ember-auth.js +249 -257
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f161ec559b487de30fb8744854947ab7f071190a
|
4
|
+
data.tar.gz: 94c8b1ec040b45172b20cee8f86cf39c253234ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddf151053d500fc1bfd3148818c157756ac870d013784d46fba55e28b31bc8bbb5eaa1ae4a4e376053985436cf22d80db62a20921c7a1113103f5090a5d3d4c3
|
7
|
+
data.tar.gz: ad548eedc677ba12387b55d4891fef04c6ae5888563892d01dbfdcc93c98d635fd1e85ca4922915296eae9c73858de9a8162331b10a8ec87975b93bc55de9be5
|
data/dist/ember-auth.js
CHANGED
@@ -18,165 +18,228 @@ Em.onLoad('Ember.Application', function (application) {
|
|
18
18
|
}
|
19
19
|
});
|
20
20
|
});// Generated by EmberScript 0.0.7
|
21
|
-
|
22
|
-
var
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
21
|
+
void function () {
|
22
|
+
var $;
|
23
|
+
var get$ = Ember.get;
|
24
|
+
var set$ = Ember.set;
|
25
|
+
$ = jQuery;
|
26
|
+
set$(Em, 'Auth', Ember.Object.extend({
|
27
|
+
_defaults: {},
|
28
|
+
_config: function (namespace, defaults) {
|
29
|
+
if (null != defaults) {
|
30
|
+
return function (accum$) {
|
31
|
+
var k, v;
|
32
|
+
for (k in defaults) {
|
33
|
+
v = defaults[k];
|
34
|
+
get$(this, '_defaults')[namespace] || (get$(this, '_defaults')[namespace] = {});
|
35
|
+
accum$.push(get$(this, '_defaults')[namespace][k] = v);
|
34
36
|
}
|
35
|
-
return accum
|
36
|
-
}.call(this, [])
|
37
|
+
return accum$;
|
38
|
+
}.call(this, []);
|
39
|
+
} else {
|
40
|
+
return $.extend(true, {}, get$(this, '_defaults')[namespace], this.get(namespace));
|
37
41
|
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
},
|
43
|
+
_handlers: {
|
44
|
+
signInSuccess: [],
|
45
|
+
signInError: [],
|
46
|
+
signOutSuccess: [],
|
47
|
+
signOutError: [],
|
48
|
+
sendSuccess: [],
|
49
|
+
sendError: []
|
50
|
+
},
|
51
|
+
module: Ember.computed(function () {
|
52
|
+
var moduleName, modules;
|
53
|
+
modules = {};
|
54
|
+
for (var i$ = 0, length$ = get$(this, 'modules').length; i$ < length$; ++i$) {
|
55
|
+
moduleName = get$(this, 'modules')[i$];
|
56
|
+
modules[moduleName] = get$(this, 'container').lookup('authModule:' + moduleName);
|
48
57
|
}
|
49
|
-
return
|
50
|
-
}.
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
})
|
141
|
-
return reject(data);
|
142
|
-
});
|
143
|
-
})).fail((this$2 = this$, function (response) {
|
144
|
-
var data, handler, promises;
|
145
|
-
data = get$(this$2, '_response').canonicalize(response);
|
146
|
-
promises = [];
|
147
|
-
promises.push(get$(this$2, '_strategy').deserialize(data));
|
148
|
-
promises.push(get$(this$2, '_session').end(data));
|
149
|
-
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'signInError').length; i$ < length$; ++i$) {
|
150
|
-
handler = get$(get$(this$2, '_handlers'), 'signInError')[i$];
|
151
|
-
promises.push(handler(data));
|
152
|
-
}
|
153
|
-
return get$(Em, 'RSVP').all(promises).then(function () {
|
154
|
-
return reject(data);
|
155
|
-
}).fail(function () {
|
156
|
-
return reject(data);
|
157
|
-
});
|
58
|
+
return modules;
|
59
|
+
}).property('modules.@each'),
|
60
|
+
_request: Ember.computed(function () {
|
61
|
+
return get$(this, 'container').lookup('authRequest:' + get$(this, 'request'));
|
62
|
+
}).property('request'),
|
63
|
+
_response: Ember.computed(function () {
|
64
|
+
return get$(this, 'container').lookup('authResponse:' + get$(this, 'response'));
|
65
|
+
}).property('response'),
|
66
|
+
_strategy: Ember.computed(function () {
|
67
|
+
return get$(this, 'container').lookup('authStrategy:' + get$(this, 'strategy'));
|
68
|
+
}).property('strategy'),
|
69
|
+
_session: Ember.computed(function () {
|
70
|
+
return get$(this, 'container').lookup('authSession:' + get$(this, 'session'));
|
71
|
+
}).property('session'),
|
72
|
+
_initializeAdapters: function () {
|
73
|
+
var adapter, baseKlass, config, containerKey, containerType, klass, msg, type;
|
74
|
+
for (var cache$ = [
|
75
|
+
'request',
|
76
|
+
'response',
|
77
|
+
'strategy',
|
78
|
+
'session'
|
79
|
+
], i$ = 0, length$ = cache$.length; i$ < length$; ++i$) {
|
80
|
+
type = cache$[i$];
|
81
|
+
msg = 'The `' + type + '` config should be a string';
|
82
|
+
config = this.get(type);
|
83
|
+
Em.assert(msg, typeof config === 'string');
|
84
|
+
containerType = 'auth' + get$(Em, 'String').classify(type);
|
85
|
+
containerKey = '' + containerType + ':' + config;
|
86
|
+
adapter = get$(this, 'container').lookupFactory(containerKey);
|
87
|
+
baseKlass = get$(Em, 'String').classify(containerType);
|
88
|
+
klass = '' + get$(Em, 'String').classify(config) + baseKlass;
|
89
|
+
msg = 'The requested `' + config + '` ' + type + 'Adapter cannot be found. Either name it (YourApp).' + klass + ', or register it in the container under `' + containerKey + '`.';
|
90
|
+
Em.assert(msg, adapter);
|
91
|
+
msg = 'The requested `' + config + '` ' + type + 'Adapter must extend from Ember.Auth.' + baseKlass;
|
92
|
+
Em.assert(msg, get$(Em, 'Auth')[baseKlass].detect(adapter));
|
93
|
+
}
|
94
|
+
return null;
|
95
|
+
},
|
96
|
+
_initializeModules: function () {
|
97
|
+
var containerKey, klass, module, moduleName, msg;
|
98
|
+
for (var i$ = 0, length$ = get$(this, 'modules').length; i$ < length$; ++i$) {
|
99
|
+
moduleName = get$(this, 'modules')[i$];
|
100
|
+
containerKey = 'authModule:' + moduleName;
|
101
|
+
klass = '' + get$(Em, 'String').classify(moduleName) + 'AuthModule';
|
102
|
+
module = get$(this, 'container').lookupFactory(containerKey);
|
103
|
+
msg = 'The requested `' + moduleName + '` module cannot be found. Either name it (YourApp).' + klass + ', or register it in the container under `' + containerKey + '`.';
|
104
|
+
Em.assert(msg, module);
|
105
|
+
}
|
106
|
+
return null;
|
107
|
+
},
|
108
|
+
signIn: function (url, opts) {
|
109
|
+
var this$;
|
110
|
+
if (typeof opts === 'undefined') {
|
111
|
+
opts = url;
|
112
|
+
url = get$(this, '_request').resolveUrl(get$(this, 'signInEndPoint'));
|
113
|
+
} else {
|
114
|
+
url = get$(this, '_request').resolveUrl(url);
|
115
|
+
}
|
116
|
+
opts || (opts = {});
|
117
|
+
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
118
|
+
var this$1, this$2;
|
119
|
+
return get$(this$, '_request').signIn(url, get$(this$, '_strategy').serialize(opts)).then((this$1 = this$, function (response) {
|
120
|
+
var data, handler, promises;
|
121
|
+
data = get$(this$1, '_response').canonicalize(response);
|
122
|
+
promises = [];
|
123
|
+
promises.push(get$(this$1, '_strategy').deserialize(data));
|
124
|
+
promises.push(get$(this$1, '_session').start(data));
|
125
|
+
for (var i$ = 0, length$ = get$(get$(this$1, '_handlers'), 'signInSuccess').length; i$ < length$; ++i$) {
|
126
|
+
handler = get$(get$(this$1, '_handlers'), 'signInSuccess')[i$];
|
127
|
+
promises.push(handler(data));
|
128
|
+
}
|
129
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
130
|
+
return resolve(data);
|
131
|
+
}).fail(function () {
|
132
|
+
return reject(data);
|
133
|
+
});
|
134
|
+
})).fail((this$2 = this$, function (response) {
|
135
|
+
var data, handler, promises;
|
136
|
+
data = get$(this$2, '_response').canonicalize(response);
|
137
|
+
promises = [];
|
138
|
+
promises.push(get$(this$2, '_strategy').deserialize(data));
|
139
|
+
promises.push(get$(this$2, '_session').end(data));
|
140
|
+
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'signInError').length; i$ < length$; ++i$) {
|
141
|
+
handler = get$(get$(this$2, '_handlers'), 'signInError')[i$];
|
142
|
+
promises.push(handler(data));
|
143
|
+
}
|
144
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
145
|
+
return reject(data);
|
146
|
+
}).fail(function () {
|
147
|
+
return reject(data);
|
148
|
+
});
|
149
|
+
}));
|
158
150
|
}));
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
151
|
+
},
|
152
|
+
signOut: function (url, opts) {
|
153
|
+
var this$;
|
154
|
+
if (typeof opts === 'undefined') {
|
155
|
+
opts = url;
|
156
|
+
url = get$(this, '_request').resolveUrl(get$(this, 'signOutEndPoint'));
|
157
|
+
} else {
|
158
|
+
url = get$(this, '_request').resolveUrl(url);
|
159
|
+
}
|
160
|
+
opts || (opts = {});
|
161
|
+
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
162
|
+
var this$1, this$2;
|
163
|
+
return get$(this$, '_request').signOut(url, get$(this$, '_strategy').serialize(opts)).then((this$1 = this$, function (response) {
|
164
|
+
var data, handler, promises;
|
165
|
+
data = get$(this$1, '_response').canonicalize(response);
|
166
|
+
promises = [];
|
167
|
+
promises.push(get$(this$1, '_strategy').deserialize(data));
|
168
|
+
promises.push(get$(this$1, '_session').end(data));
|
169
|
+
for (var i$ = 0, length$ = get$(get$(this$1, '_handlers'), 'signOutSuccess').length; i$ < length$; ++i$) {
|
170
|
+
handler = get$(get$(this$1, '_handlers'), 'signOutSuccess')[i$];
|
171
|
+
promises.push(handler(data));
|
172
|
+
}
|
173
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
174
|
+
return resolve(data);
|
175
|
+
}).fail(function () {
|
176
|
+
return reject(data);
|
177
|
+
});
|
178
|
+
})).fail((this$2 = this$, function (response) {
|
179
|
+
var data, handler, promises;
|
180
|
+
data = get$(this$2, '_response').canonicalize(response);
|
181
|
+
promises = [];
|
182
|
+
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'signOutError').length; i$ < length$; ++i$) {
|
183
|
+
handler = get$(get$(this$2, '_handlers'), 'signOutError')[i$];
|
184
|
+
promises.push(handler(data));
|
185
|
+
}
|
186
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
187
|
+
return reject(data);
|
188
|
+
}).fail(function () {
|
189
|
+
return reject(data);
|
190
|
+
});
|
191
|
+
}));
|
192
|
+
}));
|
193
|
+
},
|
194
|
+
send: function (url, opts) {
|
195
|
+
var this$;
|
196
|
+
if (typeof opts === 'undefined') {
|
197
|
+
opts = url;
|
198
|
+
url = get$(this, '_request').resolveUrl('');
|
199
|
+
} else {
|
200
|
+
url = get$(this, '_request').resolveUrl(url);
|
201
|
+
}
|
202
|
+
opts || (opts = {});
|
203
|
+
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
204
|
+
var this$1, this$2;
|
205
|
+
return get$(this$, '_request').send(url, get$(this$, '_strategy').serialize(opts)).then((this$1 = this$, function (response) {
|
206
|
+
var handler, promises;
|
207
|
+
promises = [];
|
208
|
+
for (var i$ = 0, length$ = get$(get$(this$1, '_handlers'), 'sendSuccess').length; i$ < length$; ++i$) {
|
209
|
+
handler = get$(get$(this$1, '_handlers'), 'sendSuccess')[i$];
|
210
|
+
promises.push(handler(response));
|
211
|
+
}
|
212
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
213
|
+
return resolve(data);
|
214
|
+
}).fail(function () {
|
215
|
+
return reject(data);
|
216
|
+
});
|
217
|
+
})).fail((this$2 = this$, function (response) {
|
218
|
+
var handler, promises;
|
219
|
+
promises = [];
|
220
|
+
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'sendError').length; i$ < length$; ++i$) {
|
221
|
+
handler = get$(get$(this$2, '_handlers'), 'sendError')[i$];
|
222
|
+
promises.push(handler(response));
|
223
|
+
}
|
224
|
+
return get$(Em, 'RSVP').all(promises).then(function () {
|
225
|
+
return reject(data);
|
226
|
+
}).fail(function () {
|
227
|
+
return reject(data);
|
228
|
+
});
|
229
|
+
}));
|
230
|
+
}));
|
231
|
+
},
|
232
|
+
createSession: function (data) {
|
233
|
+
var this$;
|
234
|
+
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
235
|
+
var handler, promises;
|
236
|
+
if (typeof data === 'string')
|
237
|
+
data = get$(this$, '_response').canonicalize(data);
|
175
238
|
promises = [];
|
176
|
-
promises.push(get$(this
|
177
|
-
promises.push(get$(this
|
178
|
-
for (var i$ = 0, length$ = get$(get$(this
|
179
|
-
handler = get$(get$(this
|
239
|
+
promises.push(get$(this$, '_strategy').deserialize(data));
|
240
|
+
promises.push(get$(this$, '_session').start(data));
|
241
|
+
for (var i$ = 0, length$ = get$(get$(this$, '_handlers'), 'signInSuccess').length; i$ < length$; ++i$) {
|
242
|
+
handler = get$(get$(this$, '_handlers'), 'signInSuccess')[i$];
|
180
243
|
promises.push(handler(data));
|
181
244
|
}
|
182
245
|
return get$(Em, 'RSVP').all(promises).then(function () {
|
@@ -184,121 +247,50 @@ set$(Em, 'Auth', Ember.Object.extend({
|
|
184
247
|
}).fail(function () {
|
185
248
|
return reject(data);
|
186
249
|
});
|
187
|
-
})).fail((this$2 = this$, function (response) {
|
188
|
-
var data, handler, promises;
|
189
|
-
data = get$(this$2, '_response').canonicalize(response);
|
190
|
-
promises = [];
|
191
|
-
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'signOutError').length; i$ < length$; ++i$) {
|
192
|
-
handler = get$(get$(this$2, '_handlers'), 'signOutError')[i$];
|
193
|
-
promises.push(handler(data));
|
194
|
-
}
|
195
|
-
return get$(Em, 'RSVP').all(promises).then(function () {
|
196
|
-
return reject(data);
|
197
|
-
}).fail(function () {
|
198
|
-
return reject(data);
|
199
|
-
});
|
200
250
|
}));
|
201
|
-
}
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
if (typeof opts === 'undefined') {
|
206
|
-
opts = url;
|
207
|
-
url = get$(this, '_request').resolveUrl('');
|
208
|
-
} else {
|
209
|
-
url = get$(this, '_request').resolveUrl(url);
|
210
|
-
}
|
211
|
-
opts || (opts = {});
|
212
|
-
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
213
|
-
var this$1, this$2;
|
214
|
-
return get$(this$, '_request').send(url, get$(this$, '_strategy').serialize(opts)).then((this$1 = this$, function (response) {
|
251
|
+
},
|
252
|
+
destroySession: function (data) {
|
253
|
+
var this$;
|
254
|
+
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
215
255
|
var handler, promises;
|
256
|
+
if (typeof data === 'string')
|
257
|
+
data = get$(this$, '_response').canonicalize(data);
|
216
258
|
promises = [];
|
217
|
-
|
218
|
-
|
219
|
-
|
259
|
+
promises.push(get$(this$, '_strategy').deserialize(data));
|
260
|
+
promises.push(get$(this$, '_session').end(data));
|
261
|
+
for (var i$ = 0, length$ = get$(get$(this$, '_handlers'), 'signOutSuccess').length; i$ < length$; ++i$) {
|
262
|
+
handler = get$(get$(this$, '_handlers'), 'signOutSuccess')[i$];
|
263
|
+
promises.push(handler(data));
|
220
264
|
}
|
221
265
|
return get$(Em, 'RSVP').all(promises).then(function () {
|
222
266
|
return resolve(data);
|
223
267
|
}).fail(function () {
|
224
268
|
return reject(data);
|
225
269
|
});
|
226
|
-
})).fail((this$2 = this$, function (response) {
|
227
|
-
var handler, promises;
|
228
|
-
promises = [];
|
229
|
-
for (var i$ = 0, length$ = get$(get$(this$2, '_handlers'), 'sendError').length; i$ < length$; ++i$) {
|
230
|
-
handler = get$(get$(this$2, '_handlers'), 'sendError')[i$];
|
231
|
-
promises.push(handler(response));
|
232
|
-
}
|
233
|
-
return get$(Em, 'RSVP').all(promises).then(function () {
|
234
|
-
return reject(data);
|
235
|
-
}).fail(function () {
|
236
|
-
return reject(data);
|
237
|
-
});
|
238
270
|
}));
|
239
|
-
}
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
return
|
256
|
-
}
|
257
|
-
return
|
258
|
-
});
|
259
|
-
}));
|
260
|
-
},
|
261
|
-
destroySession: function (data) {
|
262
|
-
var this$;
|
263
|
-
return new (get$(get$(Em, 'RSVP'), 'Promise'))((this$ = this, function (resolve, reject) {
|
264
|
-
var handler, promises;
|
265
|
-
if (typeof data === 'string')
|
266
|
-
data = get$(this$, '_response').canonicalize(data);
|
267
|
-
promises = [];
|
268
|
-
promises.push(get$(this$, '_strategy').deserialize(data));
|
269
|
-
promises.push(get$(this$, '_session').end(data));
|
270
|
-
for (var i$ = 0, length$ = get$(get$(this$, '_handlers'), 'signOutSuccess').length; i$ < length$; ++i$) {
|
271
|
-
handler = get$(get$(this$, '_handlers'), 'signOutSuccess')[i$];
|
272
|
-
promises.push(handler(data));
|
271
|
+
},
|
272
|
+
addHandler: function (type, handler) {
|
273
|
+
var msg;
|
274
|
+
msg = 'Handler type unrecognized; you passed in `' + type + '`';
|
275
|
+
Em.assert(msg, null != get$(this, '_handlers')[type]);
|
276
|
+
msg = 'Handler must be a function';
|
277
|
+
Em.assert(msg, typeof handler === 'function');
|
278
|
+
return get$(this, '_handlers')[type].pushObject(handler);
|
279
|
+
},
|
280
|
+
removeHandler: function (type, handler) {
|
281
|
+
var msg;
|
282
|
+
msg = 'Handler type unrecognized; you passed in `' + type + '`';
|
283
|
+
Em.assert(msg, null != get$(this, '_handlers')[type]);
|
284
|
+
msg = 'Handler must be a function or omitted for removing all handlers';
|
285
|
+
Em.assert(msg, typeof handler === 'function' || typeof handler === 'undefined');
|
286
|
+
if (null != handler) {
|
287
|
+
return get$(this, '_handlers')[type].removeObject(handler);
|
288
|
+
} else {
|
289
|
+
return get$(this, '_handlers')[type] = [];
|
273
290
|
}
|
274
|
-
return get$(Em, 'RSVP').all(promises).then(function () {
|
275
|
-
return resolve(data);
|
276
|
-
}).fail(function () {
|
277
|
-
return reject(data);
|
278
|
-
});
|
279
|
-
}));
|
280
|
-
},
|
281
|
-
addHandler: function (type, handler) {
|
282
|
-
var msg;
|
283
|
-
msg = 'Handler type unrecognized; you passed in `' + type + '`';
|
284
|
-
Em.assert(msg, null != get$(this, '_handlers')[type]);
|
285
|
-
msg = 'Handler must be a function';
|
286
|
-
Em.assert(msg, typeof handler === 'function');
|
287
|
-
return get$(this, '_handlers')[type].pushObject(handler);
|
288
|
-
},
|
289
|
-
removeHandler: function (type, handler) {
|
290
|
-
var msg;
|
291
|
-
msg = 'Handler type unrecognized; you passed in `' + type + '`';
|
292
|
-
Em.assert(msg, null != get$(this, '_handlers')[type]);
|
293
|
-
msg = 'Handler must be a function or omitted for removing all handlers';
|
294
|
-
Em.assert(msg, typeof handler === 'function' || typeof handler === 'undefined');
|
295
|
-
if (null != handler) {
|
296
|
-
return get$(this, '_handlers')[type].removeObject(handler);
|
297
|
-
} else {
|
298
|
-
return get$(this, '_handlers')[type] = [];
|
299
291
|
}
|
300
|
-
}
|
301
|
-
})
|
292
|
+
}));
|
293
|
+
}.call(this);// Generated by EmberScript 0.0.7
|
302
294
|
void function () {
|
303
295
|
var mustImplement;
|
304
296
|
var get$ = Ember.get;
|