PATH:
usr
/
local
/
jetapps
/
frontend
/
jetbackup
/
libraries
/
angularjs-i18next
/*! ng-i18next - 1.0.4 - 2017-05-26 - Copyright (c) 2017 Andre Meyering; Licensed MIT*/!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("angular")):"function"==typeof define&&define.amd?define(["angular"],factory):global.ngI18next=factory(global.angular)}(this,function(angular){"use strict";var I18nDirective=function(){function I18nDirective($interpolate){var _this=this;this.$interpolate=$interpolate,this.restrict="A",this.scope=!1,this.controller="NgI18nextController",this.link=function($scope,$element,$attrs,ctrl){function observe(value){if(angular.isDefined(value)){if(""===(translationValue=value.replace(/^\s+|\s+$/g,"")))return setupWatcher();ctrl.localize(translationValue)}}function setupWatcher(){if(!isTransformed){var interpolation=self.$interpolate($element.html());$scope.$watch(interpolation,observe),isTransformed=!0}}var self=_this,translationValue="",isTransformed=!1;translationValue=$attrs.ngI18next.replace(/^\s+|\s+$/g,""),translationValue.indexOf("__once__")<0?$attrs.$observe("ngI18next",observe):(translationValue=translationValue.split("__once__").join(""),ctrl.localize(translationValue,!0)),$scope.$on("i18nextLanguageChange",function(){ctrl.localize(translationValue)})}}return I18nDirective.factory=function(){var directive=function($interpolate){return new I18nDirective($interpolate)};return directive.$inject=["$interpolate"],directive},I18nDirective}(),I18nBindOnceDirective=function(){function I18nBindOnceDirective($compile){var _this=this;this.$compile=$compile,this.restrict="A",this.scope=!1,this.link=function(scope,element,attrs){var newElement=element.clone();newElement.attr("ng-i18next","__once__"+attrs.boI18next),newElement.removeAttr("bo-i18next"),element.replaceWith(_this.$compile(newElement)(scope))}}return I18nBindOnceDirective.factory=function(){var directive=function($compile){return new I18nBindOnceDirective($compile)};return directive.$inject=["$compile"],directive},I18nBindOnceDirective}(),I18nDirectiveController=function(){function I18nDirectiveController($scope,$element,$compile,$parse,$interpolate,$sanitize,$i18next){this.$scope=$scope,this.$element=$element,this.$compile=$compile,this.$parse=$parse,this.$interpolate=$interpolate,this.$sanitize=$sanitize,this.$i18next=$i18next}return I18nDirectiveController.prototype.localize=function(key,noWatch){for(var keys=key.split(";"),i=0;i<keys.length;++i)""!==(key=keys[i].trim())&&this.parse(key,noWatch)},I18nDirectiveController.prototype.parse=function(key,noWatch){var _this=this,parsedKey=this.parseKey(key);this.argsUnregister&&this.argsUnregister(),this.stringUnregister&&this.stringUnregister(),noWatch||(this.argsUnregister=this.$scope.$watch(function(){return parsedKey.i18nOptions(_this.$scope)},function(){return _this.render(parsedKey,noWatch)},!0)),this.render(parsedKey,noWatch)},I18nDirectiveController.prototype.parseKey=function(key){var tmp,options={attr:"text"},i18nOptions="{}";return key=key.trim(),0===key.indexOf("[")&&(tmp=key.split("]"),options=this.parseOptions(tmp.shift().substr(1).trim()),key=tmp.join("]")),0===key.indexOf("(")&&key.indexOf(")")>=0&&(tmp=key.split(")"),key=tmp.pop().trim(),i18nOptions=tmp.join(")").substr(1).trim()),{i18nOptions:this.$parse(i18nOptions),key:key,options:options}},I18nDirectiveController.prototype.parseOptions=function(options){for(var res={attr:"text"},optionsSplit=options.split(":"),i=0;i<optionsSplit.length;++i)"i18next"===optionsSplit[i]?res[optionsSplit[i]]=!0:res.attr=optionsSplit[i];return res},I18nDirectiveController.prototype.render=function(parsedKey,noWatch){if(angular.isDefined(this)&&angular.isDefined(this.$scope)){var i18nOptions_1=parsedKey.i18nOptions(this.$scope);i18nOptions_1.sprintf&&(i18nOptions_1.postProcess="sprintf"),"html"===parsedKey.options.attr&&angular.forEach(i18nOptions_1,function(value,key){var newValue=void 0,sanitized=this.$sanitize(value),numeric=Number(value);newValue="number"!=typeof numeric||isNaN(numeric)?sanitized:numeric,i18nOptions_1[key]=newValue},this);var localizedString=this.$i18next.t(parsedKey.key,i18nOptions_1);if(angular.isDefined(localizedString)){if("html"===parsedKey.options.attr)return this.$element.empty().append(localizedString),void this.$compile(this.$element.contents())(this.$scope);this.stringUnregister&&this.stringUnregister();var insertText=this.$element.text.bind(this.$element);"text"!==parsedKey.options.attr&&(insertText=this.$element.attr.bind(this.$element,parsedKey.options.attr));var localizedStringInterpolation=this.$interpolate(localizedString);noWatch||(this.stringUnregister=this.$scope.$watch(localizedStringInterpolation,insertText)),insertText(localizedStringInterpolation(this.$scope))}}},I18nDirectiveController.$inject=["$scope","$element","$compile","$parse","$interpolate","$sanitize","$i18next"],I18nDirectiveController}(),I18nFilter=function(){function I18nFilter(){}return I18nFilter.factory=function(){var filter=function($i18next){function i18nextFilter(key,options){var localOptions=angular.isDefined(options)?options:{};return $i18next.t(key,localOptions)}return i18nextFilter.$stateful=!0,i18nextFilter};return filter.$inject=["$i18next"],filter},I18nFilter}(),I18nTranslateService=function(){function I18nTranslateService($rootScope,translationOptions){this.$rootScope=$rootScope,this.options={},this.tOptions={},this.modules=[],this.translations={},this.i18n=i18next,this.tOptions=translationOptions,this.initializeI18next()}return I18nTranslateService.prototype.t=function(key,ownOptions){var mergedOptions,lng,hasOwnOptions=angular.isDefined(ownOptions),hasOwnNsOption=hasOwnOptions&&angular.isDefined(ownOptions.ns),hasInitNsObj=angular.isDefined(this.options)&&angular.isDefined(this.options.ns),defaultOptions=this.options;return angular.isUndefined(hasOwnNsOption)&&hasInitNsObj&&(defaultOptions=angular.extend({},this.options),defaultOptions.ns=defaultOptions.defaultNS),mergedOptions=hasOwnOptions?ownOptions:this.tOptions,lng=mergedOptions.lng,this.translate(key,mergedOptions,hasOwnOptions),angular.isDefined(lng)?this.translations[lng][key]:this.translations.auto[key]},I18nTranslateService.prototype.changeLanguage=function(lng){var _this=this;this.options.lng!==lng&&this.i18n.language!==lng&&(this.options.lng=lng,this.i18n.changeLanguage(lng,function(err,t){_this.$rootScope.$broadcast("i18nextLanguageChange",_this.i18n.language)}))},I18nTranslateService.prototype.changeOptions=function(options){angular.isDefined(options)&&(this.options=options)},I18nTranslateService.prototype.initializeI18next=function(){var self=this;if(i18next)this.i18n=i18next,this.options=i18next.options;else{var error=new Error("[ng-i18next] Can't find i18next and/or i18next options! Please refer to i18next.");this.handleError(error)}i18next.on("initialized",function(options){self.options=options,self.$rootScope.$broadcast("i18nextLanguageChange",self.options.lng)})},I18nTranslateService.prototype.translate=function(key,tOptions,hasOwnOptions){var localOptions=angular.isDefined(tOptions)&&hasOwnOptions?tOptions:this.tOptions,lng=localOptions.lng||"auto";angular.isUndefined(this.translations[lng])&&(this.translations[lng]={}),angular.isUndefined(this.i18n)?this.translations[lng][key]=angular.isDefined(localOptions.defaultValue)?localOptions.defaultValue:key:(angular.isUndefined(this.translations[lng][key])||hasOwnOptions)&&(this.translations[lng][key]=this.i18n.t(key,localOptions))},I18nTranslateService.prototype.handleError=function(error){var message=angular.isDefined(error.message)?error.message:error[0];console.log(message)},I18nTranslateService}(),I18nProvider=function(){function I18nProvider(){var _this=this;this.translationOptions={},this.$get=function($rootScope){if(i18next)return new I18nTranslateService($rootScope,_this.translationOptions);throw"i18next is not loaded"},this.$get.$inject=["$rootScope"]}return I18nProvider}();angular.module("jm.i18next",["ng","ngSanitize"]).provider("$i18next",I18nProvider).directive("ngI18next",I18nDirective.factory()).directive("boI18next",I18nBindOnceDirective.factory()).controller("NgI18nextController",I18nDirectiveController).filter("i18next",I18nFilter.factory());return"jm.i18next"});
[-] i18nextSprintfPostProcessor.js
[edit]
[-] i18nextSprintfPostProcessor.min.js
[edit]
[-] i18next.min.js
[edit]
[+]
..
[-] ng-i18next.js
[edit]
[-] i18nextXHRBackend.js
[edit]
[-] ng-i18next.min.js
[edit]
[-] i18next.js
[edit]
[-] i18nextXHRBackend.min.js
[edit]