mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-11 23:47:42 +00:00
GUAC-919: Copy Angular changes from old GUAC-546 branch.
This commit is contained in:
committed by
Michael Jumper
parent
ac2617b92a
commit
5c43ae4ff9
31
guacamole/src/main/webapp/lib/plugins/angular-translate-loader-static-files.js
vendored
Normal file
31
guacamole/src/main/webapp/lib/plugins/angular-translate-loader-static-files.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*!
|
||||
* angular-translate - v2.2.0 - 2014-06-03
|
||||
* http://github.com/PascalPrecht/angular-translate
|
||||
* Copyright (c) 2014 ; Licensed MIT
|
||||
*/
|
||||
angular.module('pascalprecht.translate').factory('$translateStaticFilesLoader', [
|
||||
'$q',
|
||||
'$http',
|
||||
function ($q, $http) {
|
||||
return function (options) {
|
||||
if (!options || (!angular.isString(options.prefix) || !angular.isString(options.suffix))) {
|
||||
throw new Error('Couldn\'t load static files, no prefix or suffix specified!');
|
||||
}
|
||||
var deferred = $q.defer();
|
||||
$http({
|
||||
url: [
|
||||
options.prefix,
|
||||
options.key,
|
||||
options.suffix
|
||||
].join(''),
|
||||
method: 'GET',
|
||||
params: ''
|
||||
}).success(function (data) {
|
||||
deferred.resolve(data);
|
||||
}).error(function (data) {
|
||||
deferred.reject(options.key);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
}
|
||||
]);
|
Reference in New Issue
Block a user