Orchard/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/console-shim.js
Benedek Farkas 530d2a9221
8773: Recompiling client-side assets on 1.10.x (#8779)
* Updating rebuilt client-side assets that only changed in terms of sourceMappingURL

* Updating rebuilt client-side assets that changed functionally

* Fixing/simplifying Layout editor toolbox stickyness and height restriction to viewport

* Compile workflow: Upgrading actions/checkout and microsoft/setup-msbuild actions to their latest versions

* Compile workflow: Adding steps to validate that the client-side assets are up-to-date

* Compile workflow: Temporarily disabling MSBuild steps

* Moving client-side assets build to a separate job in the compile workflow

* Updating client-side compilation job

* Temporarily disabling the .NET build

* Separating package install from asset rebuild

* Adding debug command

* Fixing working directory

* Debugging

* Attempting to get rid of false positives due to line ending changes

* Removing debug code

* Checking asset validation by modifying Orchard.Resources/Assets/Less/Bootstrap/variables.less, but not its derivatives

* Revert "Checking asset validation by modifying Orchard.Resources/Assets/Less/Bootstrap/variables.less, but not its derivatives"

This reverts commit 3fc9b8362b.

* Revert "Temporarily disabling the .NET build"

This reverts commit 2a8fef7793.

* Fixing error message when client-side assets are not up-to-date
2024-04-16 16:55:04 +02:00

221 lines
19 KiB
JavaScript

/*
** NOTE: This file is generated by Gulp and should not be edited directly!
** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.
*/
/**
* @preserve console-shim 1.0.2
* https://github.com/kayahr/console-shim
* Copyright (C) 2011 Klaus Reimer <k@ailis.de>
* Licensed under the MIT license
* (See http://www.opensource.org/licenses/mit-license)
*/
(function(){
"use strict";
/**
* Returns a function which calls the specified function in the specified
* scope.
*
* @param {Function} func
* The function to call.
* @param {Object} scope
* The scope to call the function in.
* @param {...*} args
* Additional arguments to pass to the bound function.
* @returns {function(...[*]): undefined}
* The bound function.
*/
var bind = function(func, scope, args)
{
var fixedArgs = Array.prototype.slice.call(arguments, 2);
return function()
{
var args = fixedArgs.concat(Array.prototype.slice.call(arguments, 0));
(/** @type {Function} */ func).apply(scope, args);
};
};
// Create console if not present
if (!window["console"]) window.console = /** @type {Console} */ ({});
var console = (/** @type {Object} */ window.console);
// Implement console log if needed
if (!console["log"])
{
// Use log4javascript if present
if (window["log4javascript"])
{
var log = log4javascript.getDefaultLogger();
console.log = bind(log.info, log);
console.debug = bind(log.debug, log);
console.info = bind(log.info, log);
console.warn = bind(log.warn, log);
console.error = bind(log.error, log);
}
// Use empty dummy implementation to ignore logging
else
{
console.log = (/** @param {...*} args */ function(args) {});
}
}
// Implement other log levels to console.log if missing
if (!console["debug"]) console.debug = console.log;
if (!console["info"]) console.info = console.log;
if (!console["warn"]) console.warn = console.log;
if (!console["error"]) console.error = console.log;
// Wrap the log methods in IE (<=9) because their argument handling is wrong
// This wrapping is also done if the __consoleShimTest__ symbol is set. This
// is needed for unit testing.
if (window["__consoleShimTest__"] != null ||
eval("/*@cc_on @_jscript_version <= 9@*/"))
{
/**
* Wraps the call to a real IE logging method. Modifies the arguments so
* parameters which are not represented by a placeholder are properly
* printed with a space character as separator.
*
* @param {...*} args
* The function arguments. First argument is the log function
* to call, the other arguments are the log arguments.
*/
var wrap = function(args)
{
var i, max, match, log;
// Convert argument list to real array
args = Array.prototype.slice.call(arguments, 0);
// First argument is the log method to call
log = args.shift();
max = args.length;
if (max > 1 && window["__consoleShimTest__"] !== false)
{
// When first parameter is not a string then add a format string to
// the argument list so we are able to modify it in the next stop
if (typeof(args[0]) != "string")
{
args.unshift("%o");
max += 1;
}
// For each additional parameter which has no placeholder in the
// format string we add another placeholder separated with a
// space character.
match = args[0].match(/%[a-z]/g);
for (i = match ? match.length + 1 : 1; i < max; i += 1)
{
args[0] += " %o";
}
}
Function.apply.call(log, console, args);
};
// Wrap the native log methods of IE to fix argument output problems
console.log = bind(wrap, window, console.log);
console.debug = bind(wrap, window, console.debug);
console.info = bind(wrap, window, console.info);
console.warn = bind(wrap, window, console.warn);
console.error = bind(wrap, window, console.error);
}
// Implement console.assert if missing
if (!console["assert"])
{
console["assert"] = function()
{
var args = Array.prototype.slice.call(arguments, 0);
var expr = args.shift();
if (!expr)
{
args[0] = "Assertion failed: " + args[0];
console.error.apply(console, args);
}
};
}
// Linking console.dir and console.dirxml to the console.log method if
// missing. Hopefully the browser already logs objects and DOM nodes as a
// tree.
if (!console["dir"]) console["dir"] = console.log;
if (!console["dirxml"]) console["dirxml"] = console.log;
// Linking console.exception to console.error. This is not the same but
// at least some error message is displayed.
if (!console["exception"]) console["exception"] = console.error;
// Implement console.time and console.timeEnd if one of them is missing
if (!console["time"] || !console["timeEnd"])
{
var timers = {};
console["time"] = function(id)
{
timers[id] = new Date().getTime();
};
console["timeEnd"] = function(id)
{
var start = timers[id];
if (start)
{
console.log(id + ": " + (new Date().getTime() - start) + "ms");
delete timers[id];
}
};
}
// Implement console.table if missing
if (!console["table"])
{
console["table"] = function(data, columns)
{
var i, iMax, row, j, jMax, k;
// Do nothing if data has wrong type or no data was specified
if (!data || !(data instanceof Array) || !data.length) return;
// Auto-calculate columns array if not set
if (!columns || !(columns instanceof Array))
{
columns = [];
for (k in data[0])
{
if (!data[0].hasOwnProperty(k)) continue;
columns.push(k);
}
}
for (i = 0, iMax = data.length; i < iMax; i += 1)
{
row = [];
for (j = 0, jMax = columns.length; j < jMax; j += 1)
{
row.push(data[i][columns[j]]);
}
Function.apply.call(console.log, console, row);
}
};
}
// Dummy implementations of other console features to prevent error messages
// in browsers not supporting it.
if (!console["clear"]) console["clear"] = function() {};
if (!console["trace"]) console["trace"] = function() {};
if (!console["group"]) console["group"] = function() {};
if (!console["groupCollapsed"]) console["groupCollapsed"] = function() {};
if (!console["groupEnd"]) console["groupEnd"] = function() {};
if (!console["timeStamp"]) console["timeStamp"] = function() {};
if (!console["profile"]) console["profile"] = function() {};
if (!console["profileEnd"]) console["profileEnd"] = function() {};
if (!console["count"]) console["count"] = function() {};
})();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnNvbGUtc2hpbS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQ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1bWVudHMuXHJcbiAgICAgKi9cclxuICAgIHZhciB3cmFwID0gZnVuY3Rpb24oYXJncylcclxuICAgIHtcclxuICAgICAgICB2YXIgaSwgbWF4LCBtYXRjaCwgbG9nO1xyXG4gICAgICAgIFxyXG4gICAgICAgIC8vIENvbnZlcnQgYXJndW1lbnQgbGlzdCB0byByZWFsIGFycmF5XHJcbiAgICAgICAgYXJncyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMCk7XHJcbiAgICAgICAgXHJcbiAgICAgICAgLy8gRmlyc3QgYXJndW1lbnQgaXMgdGhlIGxvZyBtZXRob2QgdG8gY2FsbFxyXG4gICAgICAgIGxvZyA9IGFyZ3Muc2hpZnQoKTtcclxuICAgICAgICBcclxuICAgICAgICBtYXggPSBhcmdzLmxlbmd0aDtcclxuICAgICAgICBpZiAobWF4ID4gMSAmJiB3aW5kb3dbXCJfX2NvbnNvbGVTaGltVGVzdF9fXCJdICE9PSBmYWxzZSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIC8vIFdoZW4gZmlyc3QgcGFyYW1ldGVyIGlzIG5vdCBhIHN0cmluZyB0aGVuIGFkZCBhIGZvcm1hdCBzdHJpbmcgdG9cclxuICAgICAgICAgICAgLy8gdGhlIGFyZ3VtZW50IGxpc3Qgc28gd2UgYXJlIGFibGUgdG8gbW9kaWZ5IGl0IGluIHRoZSBuZXh0IHN0b3BcclxuICAgICAgICAgICAgaWYgKHR5cGVvZihhcmdzWzBdKSAhPSBcInN0cmluZ1wiKVxyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBhcmdzLnVuc2hpZnQoXCIlb1wiKTtcclxuICAgICAgICAgICAgICAgIG1heCArPSAxO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIFxyXG4gICAgICAgICAgICAvLyBGb3IgZWFjaCBhZGRpdGlvbmFsIHBhcmFtZXRlciB3aGljaCBoYXMgbm8gcGxhY2Vob2xkZXI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KSByZXR1cm47XHJcbiAgICAgICAgXHJcbiAgICAgICAgLy8gQXV0by1jYWxjdWxhdGUgY29sdW1ucyBhcnJheSBpZiBub3Qgc2V0XHJcbiAgICAgICAgaWYgKCFjb2x1bW5zIHx8ICEoY29sdW1ucyBpbnN0YW5jZW9mIEFycmF5KSlcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGNvbHVtbnMgPSBbXTtcclxuICAgICAgICAgICAgZm9yIChrIGluIGRhdGFbMF0pXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIGlmICghZGF0YVswXS5oYXNPd25Qcm9wZXJ0eShrKSkgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICBjb2x1bW5zLnB1c2goayk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgXHJcbiAgICAgICAgZm9yIChpID0gMCwgaU1heCA9IGRhdGEubGVuZ3RoOyBpIDwgaU1heDsgaSArPSAxKVxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgcm93ID0gW107XHJcbiAgICAgICAgICAgIGZvciAoaiA9IDAsIGpNYXggPSBjb2x1bW5zLmxlbmd0aDsgaiA8IGpNYXg7IGogKz0gMSlcclxuICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgcm93LnB1c2goZGF0YVtpXVtjb2x1bW5zW2pdXSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgXHJcbiAgICAgICAgICAgIEZ1bmN0aW9uLmFwcGx5LmNhbGwoY29uc29sZS5sb2csIGNvbnNvbGUsIHJvdyk7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxufVxyXG5cclxuLy8gRHVtbXkgaW1wbGVtZW50YXRpb25zIG9mIG90aGVyIGNvbnNvbGUgZmVhdHVyZXMgdG8gcHJldmVudCBlcnJvciBtZXNzYWdlc1xyXG4vLyBpbiBicm93c2VycyBub3Qgc3VwcG9ydGluZyBpdC5cclxuaWYgKCFjb25zb2xlW1wiY2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