mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Update cloudinary-1.26.0
This commit is contained in:
parent
ebffd124f6
commit
4b28040d59
17 changed files with 1169 additions and 307 deletions
|
@ -164,7 +164,7 @@ var slice = [].slice,
|
|||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||||
* @example
|
||||
*
|
||||
* function Foo(){};
|
||||
* function Foo(){};
|
||||
* isFunction(Foo);
|
||||
* // => true
|
||||
*
|
||||
|
@ -1403,7 +1403,8 @@ var slice = [].slice,
|
|||
"*": "mul",
|
||||
"/": "div",
|
||||
"+": "add",
|
||||
"-": "sub"
|
||||
"-": "sub",
|
||||
"^": "pow",
|
||||
};
|
||||
|
||||
|
||||
|
@ -1472,30 +1473,37 @@ var slice = [].slice,
|
|||
return new this(expressionStr);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Normalize a string expression
|
||||
* @function Cloudinary#normalize
|
||||
* @param {string} expression a expression, e.g. "w gt 100", "width_gt_100", "width > 100"
|
||||
* @return {string} the normalized form of the value expression, e.g. "w_gt_100"
|
||||
*/
|
||||
|
||||
Expression.normalize = function(expression) {
|
||||
var operators, pattern, replaceRE;
|
||||
var operators, operatorsPattern, operatorsReplaceRE, predefinedVarsPattern, predefinedVarsReplaceRE;
|
||||
if (expression == null) {
|
||||
return expression;
|
||||
}
|
||||
expression = String(expression);
|
||||
operators = "\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*";
|
||||
pattern = "((" + operators + ")(?=[ _])|" + Object.keys(Expression.PREDEFINED_VARS).join("|") + ")";
|
||||
replaceRE = new RegExp(pattern, "g");
|
||||
expression = expression.replace(replaceRE, function(match) {
|
||||
return Expression.OPERATORS[match] || Expression.PREDEFINED_VARS[match];
|
||||
operators = "\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^";
|
||||
|
||||
// operators
|
||||
operatorsPattern = "((" + operators + ")(?=[ _]))";
|
||||
operatorsReplaceRE = new RegExp(operatorsPattern, "g");
|
||||
expression = expression.replace(operatorsReplaceRE, function (match) {
|
||||
return Expression.OPERATORS[match];
|
||||
});
|
||||
|
||||
// predefined variables
|
||||
predefinedVarsPattern = "(" + Object.keys(Expression.PREDEFINED_VARS).join("|") + ")";
|
||||
predefinedVarsReplaceRE = new RegExp(predefinedVarsPattern, "g");
|
||||
expression = expression.replace(predefinedVarsReplaceRE, function(match, p1, offset){
|
||||
return (expression[offset - 1] === '$' ? match : Expression.PREDEFINED_VARS[match]);
|
||||
});
|
||||
|
||||
return expression.replace(/[ _]+/g, '_');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serialize the expression
|
||||
* @return {string} the expression as a string
|
||||
|
@ -3070,7 +3078,7 @@ var slice = [].slice,
|
|||
* @protected
|
||||
* @param {string} key - attribute name
|
||||
* @param {*|boolean} value - the value of the attribute. If the value is boolean `true`, return the key only.
|
||||
* @returns {string} the attribute
|
||||
* @returns {string} the attribute
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -4294,12 +4302,20 @@ var slice = [].slice,
|
|||
switch (false) {
|
||||
case !/w_auto:breakpoints/.test(dataSrc):
|
||||
requiredWidth = maxWidth(containerWidth, tag);
|
||||
dataSrc = dataSrc.replace(/w_auto:breakpoints([_0-9]*)(:[0-9]+)?/, "w_auto:breakpoints$1:" + requiredWidth);
|
||||
if (requiredWidth) {
|
||||
dataSrc = dataSrc.replace(/w_auto:breakpoints([_0-9]*)(:[0-9]+)?/, "w_auto:breakpoints$1:" + requiredWidth);
|
||||
} else {
|
||||
setUrl = false;
|
||||
}
|
||||
break;
|
||||
case !(match = /w_auto(:(\d+))?/.exec(dataSrc)):
|
||||
requiredWidth = applyBreakpoints.call(this, tag, containerWidth, match[2], options);
|
||||
requiredWidth = maxWidth(requiredWidth, tag);
|
||||
dataSrc = dataSrc.replace(/w_auto[^,\/]*/g, "w_" + requiredWidth);
|
||||
if (requiredWidth) {
|
||||
dataSrc = dataSrc.replace(/w_auto[^,\/]*/g, "w_" + requiredWidth);
|
||||
} else {
|
||||
setUrl = false;
|
||||
}
|
||||
}
|
||||
Util.removeAttribute(tag, 'width');
|
||||
if (!options.responsive_preserve_height) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue