ember-auth-source 7.1.0 → 7.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/dist/ember-auth.js +264 -266
- metadata +3 -3
data/dist/ember-auth.js
CHANGED
@@ -163,7 +163,7 @@ set$(get$(get$(Em, 'Auth'), 'Request'), 'Dummy', Ember.Object.extend({
|
|
163
163
|
this.send(opts);
|
164
164
|
switch (get$(opts, 'status')) {
|
165
165
|
case 'success':
|
166
|
-
get$(this, 'auth').trigger('
|
166
|
+
get$(this, 'auth').trigger('signInSuccess');
|
167
167
|
break;
|
168
168
|
case 'error':
|
169
169
|
get$(this, 'auth').trigger('signInError');
|
@@ -176,7 +176,7 @@ set$(get$(get$(Em, 'Auth'), 'Request'), 'Dummy', Ember.Object.extend({
|
|
176
176
|
this.send(opts);
|
177
177
|
switch (get$(opts, 'status')) {
|
178
178
|
case 'success':
|
179
|
-
get$(this, 'auth').trigger('
|
179
|
+
get$(this, 'auth').trigger('signOutSuccess');
|
180
180
|
break;
|
181
181
|
case 'error':
|
182
182
|
get$(this, 'auth').trigger('signOutError');
|
@@ -839,13 +839,15 @@ set$(get$(get$(Em, 'Auth'), 'Module'), 'EmberModel', Ember.Object.extend({
|
|
839
839
|
return Ember.RESTAdapter.reopen({
|
840
840
|
_ajax: function (url, params, method) {
|
841
841
|
var settings;
|
842
|
-
settings =
|
843
|
-
url: url,
|
844
|
-
type: method,
|
845
|
-
dataType: 'json',
|
846
|
-
data: params
|
847
|
-
};
|
842
|
+
settings = this.ajaxSettings(url, method);
|
848
843
|
return new (get$(Ember.RSVP, 'Promise'))(function (resolve, reject) {
|
844
|
+
if (params)
|
845
|
+
if (method === 'GET') {
|
846
|
+
set$(settings, 'data', params);
|
847
|
+
} else {
|
848
|
+
set$(settings, 'contentType', 'application/json; charset=utf-8');
|
849
|
+
set$(settings, 'data', JSON.stringify(params));
|
850
|
+
}
|
849
851
|
set$(settings, 'success', function (json) {
|
850
852
|
return Ember.run(null, resolve, json);
|
851
853
|
});
|
@@ -978,277 +980,273 @@ set$(get$(get$(Em, 'Auth'), 'Module'), 'Timeoutable', Ember.Object.extend({
|
|
978
980
|
return set$(this, 'startTime', null);
|
979
981
|
}
|
980
982
|
}));/*
|
981
|
-
*
|
983
|
+
* Purl (A JavaScript URL parser) v2.3.1
|
982
984
|
* Developed and maintanined by Mark Perkins, mark@allmarkedup.com
|
983
985
|
* Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
|
984
986
|
* Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
|
985
987
|
*/
|
986
|
-
|
988
|
+
|
987
989
|
|
988
990
|
;(function(factory) {
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
}
|
996
|
-
} else {
|
997
|
-
// No AMD available; mutate global vars
|
998
|
-
if ( typeof jQuery !== 'undefined' ) {
|
999
|
-
factory(jQuery);
|
1000
|
-
} else {
|
1001
|
-
factory();
|
1002
|
-
}
|
1003
|
-
}
|
1004
|
-
})(function($, undefined) {
|
1005
|
-
|
1006
|
-
var tag2attr = {
|
1007
|
-
a : 'href',
|
1008
|
-
img : 'src',
|
1009
|
-
form : 'action',
|
1010
|
-
base : 'href',
|
1011
|
-
script : 'src',
|
1012
|
-
iframe : 'src',
|
1013
|
-
link : 'href'
|
1014
|
-
},
|
1015
|
-
|
1016
|
-
key = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'], // keys available to query
|
1017
|
-
|
1018
|
-
aliases = { 'anchor' : 'fragment' }, // aliases for backwards compatability
|
1019
|
-
|
1020
|
-
parser = {
|
1021
|
-
strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, //less intuitive, more accurate to the specs
|
1022
|
-
loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
|
1023
|
-
},
|
1024
|
-
|
1025
|
-
toString = Object.prototype.toString,
|
1026
|
-
|
1027
|
-
isint = /^[0-9]+$/;
|
1028
|
-
|
1029
|
-
function parseUri( url, strictMode ) {
|
1030
|
-
var str = decodeURI( url ),
|
1031
|
-
res = parser[ strictMode || false ? 'strict' : 'loose' ].exec( str ),
|
1032
|
-
uri = { attr : {}, param : {}, seg : {} },
|
1033
|
-
i = 14;
|
1034
|
-
|
1035
|
-
while ( i-- ) {
|
1036
|
-
uri.attr[ key[i] ] = res[i] || '';
|
1037
|
-
}
|
1038
|
-
|
1039
|
-
// build query and fragment parameters
|
1040
|
-
uri.param['query'] = parseString(uri.attr['query']);
|
1041
|
-
uri.param['fragment'] = parseString(uri.attr['fragment']);
|
1042
|
-
|
1043
|
-
// split path and fragement into segments
|
1044
|
-
uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
|
1045
|
-
uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
|
1046
|
-
|
1047
|
-
// compile a 'base' domain attribute
|
1048
|
-
uri.attr['base'] = uri.attr.host ? (uri.attr.protocol ? uri.attr.protocol+'://'+uri.attr.host : uri.attr.host) + (uri.attr.port ? ':'+uri.attr.port : '') : '';
|
1049
|
-
|
1050
|
-
return uri;
|
1051
|
-
};
|
1052
|
-
|
1053
|
-
function getAttrName( elm ) {
|
1054
|
-
var tn = elm.tagName;
|
1055
|
-
if ( typeof tn !== 'undefined' ) return tag2attr[tn.toLowerCase()];
|
1056
|
-
return tn;
|
1057
|
-
}
|
1058
|
-
|
1059
|
-
function promote(parent, key) {
|
1060
|
-
if (parent[key].length == 0) return parent[key] = {};
|
1061
|
-
var t = {};
|
1062
|
-
for (var i in parent[key]) t[i] = parent[key][i];
|
1063
|
-
parent[key] = t;
|
1064
|
-
return t;
|
1065
|
-
}
|
991
|
+
if (typeof define === 'function' && define.amd) {
|
992
|
+
define(factory);
|
993
|
+
} else {
|
994
|
+
window.purl = factory();
|
995
|
+
}
|
996
|
+
})(function() {
|
1066
997
|
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
}
|
1079
|
-
} else {
|
1080
|
-
var obj = parent[key] = parent[key] || [];
|
1081
|
-
if (']' == part) {
|
1082
|
-
if (isArray(obj)) {
|
1083
|
-
if ('' != val) obj.push(val);
|
1084
|
-
} else if ('object' == typeof obj) {
|
1085
|
-
obj[keys(obj).length] = val;
|
1086
|
-
} else {
|
1087
|
-
obj = parent[key] = [parent[key], val];
|
1088
|
-
}
|
1089
|
-
} else if (~part.indexOf(']')) {
|
1090
|
-
part = part.substr(0, part.length - 1);
|
1091
|
-
if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
|
1092
|
-
parse(parts, obj, part, val);
|
1093
|
-
// key
|
1094
|
-
} else {
|
1095
|
-
if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
|
1096
|
-
parse(parts, obj, part, val);
|
1097
|
-
}
|
1098
|
-
}
|
1099
|
-
}
|
998
|
+
var tag2attr = {
|
999
|
+
a : 'href',
|
1000
|
+
img : 'src',
|
1001
|
+
form : 'action',
|
1002
|
+
base : 'href',
|
1003
|
+
script : 'src',
|
1004
|
+
iframe : 'src',
|
1005
|
+
link : 'href',
|
1006
|
+
embed : 'src',
|
1007
|
+
object : 'data'
|
1008
|
+
},
|
1100
1009
|
|
1101
|
-
|
1102
|
-
if (~key.indexOf(']')) {
|
1103
|
-
var parts = key.split('['),
|
1104
|
-
len = parts.length,
|
1105
|
-
last = len - 1;
|
1106
|
-
parse(parts, parent, 'base', val);
|
1107
|
-
} else {
|
1108
|
-
if (!isint.test(key) && isArray(parent.base)) {
|
1109
|
-
var t = {};
|
1110
|
-
for (var k in parent.base) t[k] = parent.base[k];
|
1111
|
-
parent.base = t;
|
1112
|
-
}
|
1113
|
-
set(parent.base, key, val);
|
1114
|
-
}
|
1115
|
-
return parent;
|
1116
|
-
}
|
1010
|
+
key = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'], // keys available to query
|
1117
1011
|
|
1118
|
-
|
1119
|
-
return reduce(String(str).split(/&|;/), function(ret, pair) {
|
1120
|
-
try {
|
1121
|
-
pair = decodeURIComponent(pair.replace(/\+/g, ' '));
|
1122
|
-
} catch(e) {
|
1123
|
-
// ignore
|
1124
|
-
}
|
1125
|
-
var eql = pair.indexOf('='),
|
1126
|
-
brace = lastBraceInKey(pair),
|
1127
|
-
key = pair.substr(0, brace || eql),
|
1128
|
-
val = pair.substr(brace || eql, pair.length),
|
1129
|
-
val = val.substr(val.indexOf('=') + 1, val.length);
|
1012
|
+
aliases = { 'anchor' : 'fragment' }, // aliases for backwards compatability
|
1130
1013
|
|
1131
|
-
|
1014
|
+
parser = {
|
1015
|
+
strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, //less intuitive, more accurate to the specs
|
1016
|
+
loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
|
1017
|
+
},
|
1132
1018
|
|
1133
|
-
|
1134
|
-
}, { base: {} }).base;
|
1135
|
-
}
|
1136
|
-
|
1137
|
-
function set(obj, key, val) {
|
1138
|
-
var v = obj[key];
|
1139
|
-
if (undefined === v) {
|
1140
|
-
obj[key] = val;
|
1141
|
-
} else if (isArray(v)) {
|
1142
|
-
v.push(val);
|
1143
|
-
} else {
|
1144
|
-
obj[key] = [v, val];
|
1145
|
-
}
|
1146
|
-
}
|
1147
|
-
|
1148
|
-
function lastBraceInKey(str) {
|
1149
|
-
var len = str.length,
|
1150
|
-
brace, c;
|
1151
|
-
for (var i = 0; i < len; ++i) {
|
1152
|
-
c = str[i];
|
1153
|
-
if (']' == c) brace = false;
|
1154
|
-
if ('[' == c) brace = true;
|
1155
|
-
if ('=' == c && !brace) return i;
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
|
1159
|
-
function reduce(obj, accumulator){
|
1160
|
-
var i = 0,
|
1161
|
-
l = obj.length >> 0,
|
1162
|
-
curr = arguments[2];
|
1163
|
-
while (i < l) {
|
1164
|
-
if (i in obj) curr = accumulator.call(undefined, curr, obj[i], i, obj);
|
1165
|
-
++i;
|
1166
|
-
}
|
1167
|
-
return curr;
|
1168
|
-
}
|
1169
|
-
|
1170
|
-
function isArray(vArg) {
|
1171
|
-
return Object.prototype.toString.call(vArg) === "[object Array]";
|
1172
|
-
}
|
1173
|
-
|
1174
|
-
function keys(obj) {
|
1175
|
-
var keys = [];
|
1176
|
-
for ( prop in obj ) {
|
1177
|
-
if ( obj.hasOwnProperty(prop) ) keys.push(prop);
|
1178
|
-
}
|
1179
|
-
return keys;
|
1180
|
-
}
|
1181
|
-
|
1182
|
-
function purl( url, strictMode ) {
|
1183
|
-
if ( arguments.length === 1 && url === true ) {
|
1184
|
-
strictMode = true;
|
1185
|
-
url = undefined;
|
1186
|
-
}
|
1187
|
-
strictMode = strictMode || false;
|
1188
|
-
url = url || window.location.toString();
|
1189
|
-
|
1190
|
-
return {
|
1191
|
-
|
1192
|
-
data : parseUri(url, strictMode),
|
1193
|
-
|
1194
|
-
// get various attributes from the URI
|
1195
|
-
attr : function( attr ) {
|
1196
|
-
attr = aliases[attr] || attr;
|
1197
|
-
return typeof attr !== 'undefined' ? this.data.attr[attr] : this.data.attr;
|
1198
|
-
},
|
1199
|
-
|
1200
|
-
// return query string parameters
|
1201
|
-
param : function( param ) {
|
1202
|
-
return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
|
1203
|
-
},
|
1204
|
-
|
1205
|
-
// return fragment parameters
|
1206
|
-
fparam : function( param ) {
|
1207
|
-
return typeof param !== 'undefined' ? this.data.param.fragment[param] : this.data.param.fragment;
|
1208
|
-
},
|
1209
|
-
|
1210
|
-
// return path segments
|
1211
|
-
segment : function( seg ) {
|
1212
|
-
if ( typeof seg === 'undefined' ) {
|
1213
|
-
return this.data.seg.path;
|
1214
|
-
} else {
|
1215
|
-
seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
|
1216
|
-
return this.data.seg.path[seg];
|
1217
|
-
}
|
1218
|
-
},
|
1219
|
-
|
1220
|
-
// return fragment segments
|
1221
|
-
fsegment : function( seg ) {
|
1222
|
-
if ( typeof seg === 'undefined' ) {
|
1223
|
-
return this.data.seg.fragment;
|
1224
|
-
} else {
|
1225
|
-
seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
|
1226
|
-
return this.data.seg.fragment[seg];
|
1227
|
-
}
|
1228
|
-
}
|
1229
|
-
|
1230
|
-
};
|
1231
|
-
|
1232
|
-
};
|
1233
|
-
|
1234
|
-
if ( typeof $ !== 'undefined' ) {
|
1235
|
-
|
1236
|
-
$.fn.url = function( strictMode ) {
|
1237
|
-
var url = '';
|
1238
|
-
if ( this.length ) {
|
1239
|
-
url = $(this).attr( getAttrName(this[0]) ) || '';
|
1240
|
-
}
|
1241
|
-
return purl( url, strictMode );
|
1242
|
-
};
|
1243
|
-
|
1244
|
-
$.url = purl;
|
1245
|
-
|
1246
|
-
} else {
|
1247
|
-
window.purl = purl;
|
1248
|
-
}
|
1019
|
+
isint = /^[0-9]+$/;
|
1249
1020
|
|
1250
|
-
|
1021
|
+
function parseUri( url, strictMode ) {
|
1022
|
+
var str = decodeURI( url ),
|
1023
|
+
res = parser[ strictMode || false ? 'strict' : 'loose' ].exec( str ),
|
1024
|
+
uri = { attr : {}, param : {}, seg : {} },
|
1025
|
+
i = 14;
|
1026
|
+
|
1027
|
+
while ( i-- ) {
|
1028
|
+
uri.attr[ key[i] ] = res[i] || '';
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
// build query and fragment parameters
|
1032
|
+
uri.param['query'] = parseString(uri.attr['query']);
|
1033
|
+
uri.param['fragment'] = parseString(uri.attr['fragment']);
|
1034
|
+
|
1035
|
+
// split path and fragement into segments
|
1036
|
+
uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
|
1037
|
+
uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
|
1038
|
+
|
1039
|
+
// compile a 'base' domain attribute
|
1040
|
+
uri.attr['base'] = uri.attr.host ? (uri.attr.protocol ? uri.attr.protocol+'://'+uri.attr.host : uri.attr.host) + (uri.attr.port ? ':'+uri.attr.port : '') : '';
|
1041
|
+
|
1042
|
+
return uri;
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
function getAttrName( elm ) {
|
1046
|
+
var tn = elm.tagName;
|
1047
|
+
if ( typeof tn !== 'undefined' ) return tag2attr[tn.toLowerCase()];
|
1048
|
+
return tn;
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
function promote(parent, key) {
|
1052
|
+
if (parent[key].length === 0) return parent[key] = {};
|
1053
|
+
var t = {};
|
1054
|
+
for (var i in parent[key]) t[i] = parent[key][i];
|
1055
|
+
parent[key] = t;
|
1056
|
+
return t;
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
function parse(parts, parent, key, val) {
|
1060
|
+
var part = parts.shift();
|
1061
|
+
if (!part) {
|
1062
|
+
if (isArray(parent[key])) {
|
1063
|
+
parent[key].push(val);
|
1064
|
+
} else if ('object' == typeof parent[key]) {
|
1065
|
+
parent[key] = val;
|
1066
|
+
} else if ('undefined' == typeof parent[key]) {
|
1067
|
+
parent[key] = val;
|
1068
|
+
} else {
|
1069
|
+
parent[key] = [parent[key], val];
|
1070
|
+
}
|
1071
|
+
} else {
|
1072
|
+
var obj = parent[key] = parent[key] || [];
|
1073
|
+
if (']' == part) {
|
1074
|
+
if (isArray(obj)) {
|
1075
|
+
if ('' !== val) obj.push(val);
|
1076
|
+
} else if ('object' == typeof obj) {
|
1077
|
+
obj[keys(obj).length] = val;
|
1078
|
+
} else {
|
1079
|
+
obj = parent[key] = [parent[key], val];
|
1080
|
+
}
|
1081
|
+
} else if (~part.indexOf(']')) {
|
1082
|
+
part = part.substr(0, part.length - 1);
|
1083
|
+
if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
|
1084
|
+
parse(parts, obj, part, val);
|
1085
|
+
// key
|
1086
|
+
} else {
|
1087
|
+
if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
|
1088
|
+
parse(parts, obj, part, val);
|
1089
|
+
}
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
function merge(parent, key, val) {
|
1094
|
+
if (~key.indexOf(']')) {
|
1095
|
+
var parts = key.split('[');
|
1096
|
+
parse(parts, parent, 'base', val);
|
1097
|
+
} else {
|
1098
|
+
if (!isint.test(key) && isArray(parent.base)) {
|
1099
|
+
var t = {};
|
1100
|
+
for (var k in parent.base) t[k] = parent.base[k];
|
1101
|
+
parent.base = t;
|
1102
|
+
}
|
1103
|
+
if (key !== '') {
|
1104
|
+
set(parent.base, key, val);
|
1105
|
+
}
|
1106
|
+
}
|
1107
|
+
return parent;
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
function parseString(str) {
|
1111
|
+
return reduce(String(str).split(/&|;/), function(ret, pair) {
|
1112
|
+
try {
|
1113
|
+
pair = decodeURIComponent(pair.replace(/\+/g, ' '));
|
1114
|
+
} catch(e) {
|
1115
|
+
// ignore
|
1116
|
+
}
|
1117
|
+
var eql = pair.indexOf('='),
|
1118
|
+
brace = lastBraceInKey(pair),
|
1119
|
+
key = pair.substr(0, brace || eql),
|
1120
|
+
val = pair.substr(brace || eql, pair.length);
|
1121
|
+
|
1122
|
+
val = val.substr(val.indexOf('=') + 1, val.length);
|
1123
|
+
|
1124
|
+
if (key === '') {
|
1125
|
+
key = pair;
|
1126
|
+
val = '';
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
return merge(ret, key, val);
|
1130
|
+
}, { base: {} }).base;
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
function set(obj, key, val) {
|
1134
|
+
var v = obj[key];
|
1135
|
+
if (typeof v === 'undefined') {
|
1136
|
+
obj[key] = val;
|
1137
|
+
} else if (isArray(v)) {
|
1138
|
+
v.push(val);
|
1139
|
+
} else {
|
1140
|
+
obj[key] = [v, val];
|
1141
|
+
}
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
function lastBraceInKey(str) {
|
1145
|
+
var len = str.length,
|
1146
|
+
brace,
|
1147
|
+
c;
|
1148
|
+
for (var i = 0; i < len; ++i) {
|
1149
|
+
c = str[i];
|
1150
|
+
if (']' == c) brace = false;
|
1151
|
+
if ('[' == c) brace = true;
|
1152
|
+
if ('=' == c && !brace) return i;
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
|
1156
|
+
function reduce(obj, accumulator){
|
1157
|
+
var i = 0,
|
1158
|
+
l = obj.length >> 0,
|
1159
|
+
curr = arguments[2];
|
1160
|
+
while (i < l) {
|
1161
|
+
if (i in obj) curr = accumulator.call(undefined, curr, obj[i], i, obj);
|
1162
|
+
++i;
|
1163
|
+
}
|
1164
|
+
return curr;
|
1165
|
+
}
|
1251
1166
|
|
1167
|
+
function isArray(vArg) {
|
1168
|
+
return Object.prototype.toString.call(vArg) === "[object Array]";
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
function keys(obj) {
|
1172
|
+
var key_array = [];
|
1173
|
+
for ( var prop in obj ) {
|
1174
|
+
if ( obj.hasOwnProperty(prop) ) key_array.push(prop);
|
1175
|
+
}
|
1176
|
+
return key_array;
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
function purl( url, strictMode ) {
|
1180
|
+
if ( arguments.length === 1 && url === true ) {
|
1181
|
+
strictMode = true;
|
1182
|
+
url = undefined;
|
1183
|
+
}
|
1184
|
+
strictMode = strictMode || false;
|
1185
|
+
url = url || window.location.toString();
|
1186
|
+
|
1187
|
+
return {
|
1188
|
+
|
1189
|
+
data : parseUri(url, strictMode),
|
1190
|
+
|
1191
|
+
// get various attributes from the URI
|
1192
|
+
attr : function( attr ) {
|
1193
|
+
attr = aliases[attr] || attr;
|
1194
|
+
return typeof attr !== 'undefined' ? this.data.attr[attr] : this.data.attr;
|
1195
|
+
},
|
1196
|
+
|
1197
|
+
// return query string parameters
|
1198
|
+
param : function( param ) {
|
1199
|
+
return typeof param !== 'undefined' ? this.data.param.query[param] : this.data.param.query;
|
1200
|
+
},
|
1201
|
+
|
1202
|
+
// return fragment parameters
|
1203
|
+
fparam : function( param ) {
|
1204
|
+
return typeof param !== 'undefined' ? this.data.param.fragment[param] : this.data.param.fragment;
|
1205
|
+
},
|
1206
|
+
|
1207
|
+
// return path segments
|
1208
|
+
segment : function( seg ) {
|
1209
|
+
if ( typeof seg === 'undefined' ) {
|
1210
|
+
return this.data.seg.path;
|
1211
|
+
} else {
|
1212
|
+
seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
|
1213
|
+
return this.data.seg.path[seg];
|
1214
|
+
}
|
1215
|
+
},
|
1216
|
+
|
1217
|
+
// return fragment segments
|
1218
|
+
fsegment : function( seg ) {
|
1219
|
+
if ( typeof seg === 'undefined' ) {
|
1220
|
+
return this.data.seg.fragment;
|
1221
|
+
} else {
|
1222
|
+
seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
|
1223
|
+
return this.data.seg.fragment[seg];
|
1224
|
+
}
|
1225
|
+
}
|
1226
|
+
|
1227
|
+
};
|
1228
|
+
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
purl.jQuery = function($){
|
1232
|
+
if ($ != null) {
|
1233
|
+
$.fn.url = function( strictMode ) {
|
1234
|
+
var url = '';
|
1235
|
+
if ( this.length ) {
|
1236
|
+
url = $(this).attr( getAttrName(this[0]) ) || '';
|
1237
|
+
}
|
1238
|
+
return purl( url, strictMode );
|
1239
|
+
};
|
1240
|
+
|
1241
|
+
$.url = purl;
|
1242
|
+
}
|
1243
|
+
};
|
1244
|
+
|
1245
|
+
purl.jQuery(window.jQuery);
|
1246
|
+
|
1247
|
+
return purl;
|
1248
|
+
|
1249
|
+
});
|
1252
1250
|
// Generated by EmberScript 0.0.7
|
1253
1251
|
void function () {
|
1254
1252
|
var $;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-auth-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ember-source
|
@@ -51,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
segments:
|
53
53
|
- 0
|
54
|
-
hash:
|
54
|
+
hash: -846208323
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|