Skip to content

Commit

Permalink
chore(release): update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Sep 7, 2023
1 parent b29d84f commit d0a1c65
Show file tree
Hide file tree
Showing 136 changed files with 13,202 additions and 1,444 deletions.
37 changes: 22 additions & 15 deletions definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,25 @@
$allModules = isFunction(this)
? $(window)
: $(this),
moduleSelector = $allModules.selector || '',
time = Date.now(),
performance = [],

query = arguments[0],
methodInvoked = typeof query === 'string',
queryArguments = [].slice.call(arguments, 1),
contextCheck = function (context, win) {
var $context;
if ([window, document].indexOf(context) >= 0) {
$context = $(context);
} else {
$context = $(win.document).find(context);
if ($context.length === 0) {
$context = win.frameElement ? contextCheck(context, win.parent) : window;
}
}

return $context;
},
returnedValue
;

Expand All @@ -47,6 +58,7 @@
: $.extend({}, $.fn.api.settings),

// internal aliases
regExp = settings.regExp,
namespace = settings.namespace,
metadata = settings.metadata,
selector = settings.selector,
Expand All @@ -62,9 +74,7 @@
$form = $module.closest(selector.form),

// context used for state
$context = settings.stateContext
? ([window, document].indexOf(settings.stateContext) < 0 ? $(document).find(settings.stateContext) : $(settings.stateContext))
: $module,
$context = settings.stateContext ? contextCheck(settings.stateContext, window) : $module,

// request details
ajaxSettings,
Expand Down Expand Up @@ -351,8 +361,8 @@
optionalVariables
;
if (url) {
requiredVariables = url.match(settings.regExp.required);
optionalVariables = url.match(settings.regExp.optional);
requiredVariables = url.match(regExp.required);
optionalVariables = url.match(regExp.optional);
urlData = urlData || settings.urlData;
if (requiredVariables) {
module.debug('Looking for required URL variables', requiredVariables);
Expand Down Expand Up @@ -449,7 +459,7 @@
});
});
$.each(formArray, function (i, el) {
if (!settings.regExp.validate.test(el.name)) {
if (!regExp.validate.test(el.name)) {
return;
}
var
Expand All @@ -460,7 +470,7 @@
|| (String(floatValue) === el.value
? floatValue
: (el.value === 'false' ? false : el.value)),
nameKeys = el.name.match(settings.regExp.key) || [],
nameKeys = el.name.match(regExp.key) || [],
pushKey = el.name.replace(/\[]$/, '')
;
if (!(pushKey in pushes)) {
Expand All @@ -480,9 +490,9 @@

if (k === '' && !Array.isArray(value)) { // foo[]
value = build([], pushes[pushKey]++, value);
} else if (settings.regExp.fixed.test(k)) { // foo[n]
} else if (regExp.fixed.test(k)) { // foo[n]
value = build([], k, value);
} else if (settings.regExp.named.test(k)) { // foo; foo[bar]
} else if (regExp.named.test(k)) { // foo; foo[bar]
value = build({}, k, value);
}
}
Expand Down Expand Up @@ -637,7 +647,7 @@
module.debug('Adding error state');
module.set.error();
if (module.should.removeError()) {
setTimeout(module.remove.error, settings.errorDuration);
setTimeout(function () { module.remove.error(); }, settings.errorDuration);
}
}
module.debug('API Request failed', errorMessage, xhr);
Expand Down Expand Up @@ -961,7 +971,7 @@
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
},
display: function () {
var
Expand All @@ -974,9 +984,6 @@
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if (moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if (performance.length > 0) {
console.groupCollapsed(title);
if (console.table) {
Expand Down
Loading

0 comments on commit d0a1c65

Please sign in to comment.