from gitlab
This commit is contained in:
73
common/resources/node_modules/angular-translate-loader-url/angular-translate-loader-url.js
generated
vendored
Normal file
73
common/resources/node_modules/angular-translate-loader-url/angular-translate-loader-url.js
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/*!
|
||||
* angular-translate - v2.18.2 - 2020-01-04
|
||||
*
|
||||
* Copyright (c) 2020 The angular-translate team, Pascal Precht; Licensed MIT
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define([], function () {
|
||||
return (factory());
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
factory();
|
||||
}
|
||||
}(this, function () {
|
||||
|
||||
$translateUrlLoader.$inject = ['$q', '$http'];
|
||||
angular.module('pascalprecht.translate')
|
||||
/**
|
||||
* @ngdoc object
|
||||
* @name pascalprecht.translate.$translateUrlLoader
|
||||
* @requires $q
|
||||
* @requires $http
|
||||
*
|
||||
* @description
|
||||
* Creates a loading function for a typical dynamic url pattern:
|
||||
* "locale.php?lang=en_US", "locale.php?lang=de_DE", "locale.php?language=nl_NL" etc.
|
||||
* Prefixing the specified url, the current requested, language id will be applied
|
||||
* with "?{queryParameter}={key}".
|
||||
* Using this service, the response of these urls must be an object of
|
||||
* key-value pairs.
|
||||
*
|
||||
* @param {object} options Options object, which gets the url, key and
|
||||
* optional queryParameter ('lang' is used by default).
|
||||
*/
|
||||
.factory('$translateUrlLoader', $translateUrlLoader);
|
||||
|
||||
function $translateUrlLoader($q, $http) {
|
||||
|
||||
'use strict';
|
||||
|
||||
return function (options) {
|
||||
|
||||
if (!options || !options.url) {
|
||||
throw new Error('Couldn\'t use urlLoader since no url is given!');
|
||||
}
|
||||
|
||||
var requestParams = {};
|
||||
|
||||
requestParams[options.queryParameter || 'lang'] = options.key;
|
||||
|
||||
return $http(angular.extend({
|
||||
url: options.url,
|
||||
params: requestParams,
|
||||
method: 'GET'
|
||||
}, options.$http))
|
||||
.then(function(result) {
|
||||
return result.data;
|
||||
}, function () {
|
||||
return $q.reject(options.key);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
$translateUrlLoader.displayName = '$translateUrlLoader';
|
||||
return 'pascalprecht.translate';
|
||||
|
||||
}));
|
6
common/resources/node_modules/angular-translate-loader-url/angular-translate-loader-url.min.js
generated
vendored
Normal file
6
common/resources/node_modules/angular-translate-loader-url/angular-translate-loader-url.min.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* angular-translate - v2.18.2 - 2020-01-04
|
||||
*
|
||||
* Copyright (c) 2020 The angular-translate team, Pascal Precht; Licensed MIT
|
||||
*/
|
||||
!function(e,t){"function"==typeof define&&define.amd?define([],function(){return t()}):"object"==typeof module&&module.exports?module.exports=t():t()}(0,function(){function e(r,n){"use strict";return function(e){if(!e||!e.url)throw new Error("Couldn't use urlLoader since no url is given!");var t={};return t[e.queryParameter||"lang"]=e.key,n(angular.extend({url:e.url,params:t,method:"GET"},e.$http)).then(function(e){return e.data},function(){return r.reject(e.key)})}}return e.$inject=["$q","$http"],angular.module("pascalprecht.translate").factory("$translateUrlLoader",e),e.displayName="$translateUrlLoader","pascalprecht.translate"});
|
12
common/resources/node_modules/angular-translate-loader-url/bower.json
generated
vendored
Normal file
12
common/resources/node_modules/angular-translate-loader-url/bower.json
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "angular-translate-loader-url",
|
||||
"description": "A plugin for Angular Translate",
|
||||
"version": "2.18.2",
|
||||
"main": "./angular-translate-loader-url.js",
|
||||
"ignore": [],
|
||||
"author": "Pascal Precht",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"angular-translate": "~2.18.2"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user