gui: Reformat HTML & JS for consistent white space

(white space only change)
This commit is contained in:
Jakob Borg
2018-12-25 14:26:46 +01:00
parent 41469c5393
commit 0ac6ea6f1e
27 changed files with 252 additions and 246 deletions

View File

@@ -4,12 +4,12 @@ angular.module('syncthing.core')
return {
restrict: 'EA',
template:
'<a ng-if="visible" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="fas fa-globe"></span><span class="hidden-xs">&nbsp;{{localesNames[currentLocale] || "English"}}</span> <span class="caret"></span></a>'+
'<ul ng-if="visible" class="dropdown-menu">'+
'<li ng-repeat="name in localesNamesInvKeys" ng-class="{active: localesNamesInv[name]==currentLocale}">'+
'<a href="#" data-ng-click="changeLanguage(localesNamesInv[name])">{{name}}</a>'+
'</li>'+
'</ul>',
'<a ng-if="visible" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="fas fa-globe"></span><span class="hidden-xs">&nbsp;{{localesNames[currentLocale] || "English"}}</span> <span class="caret"></span></a>' +
'<ul ng-if="visible" class="dropdown-menu">' +
'<li ng-repeat="name in localesNamesInvKeys" ng-class="{active: localesNamesInv[name]==currentLocale}">' +
'<a href="#" data-ng-click="changeLanguage(localesNamesInv[name])">{{name}}</a>' +
'</li>' +
'</ul>',
link: function ($scope) {
var availableLocales = LocaleService.getAvailableLocales();
@@ -27,12 +27,12 @@ angular.module('syncthing.core')
}
}
$scope.localesNames = availableLocaleNames;
var invert = function (obj) {
var new_obj = {};
for (var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if (obj.hasOwnProperty(prop)) {
new_obj[obj[prop]] = prop;
}
}
@@ -40,7 +40,7 @@ angular.module('syncthing.core')
};
$scope.localesNamesInv = invert($scope.localesNames);
$scope.localesNamesInvKeys = Object.keys($scope.localesNamesInv).sort();
$scope.visible = $scope.localesNames && $scope.localesNames['en'];
// using $watch cause LocaleService.currentLocale will be change after receive async query accepted-languages