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

@@ -1,13 +1,13 @@
<modal id="about" status="info" icon="far fa-heart" heading="{{'About' | translate}}" large="yes" closeable="yes">
<div class="modal-body">
<h1 class="text-center">
<img alt="Syncthing" src="assets/img/logo-horizontal.svg" style="vertical-align: -16px" height="100" width="366"/>
<br/>
<img alt="Syncthing" src="assets/img/logo-horizontal.svg" style="vertical-align: -16px" height="100" width="366" />
<br />
<small>{{versionString()}}</small>
<br/>
<br />
<small><i>"{{version.codename}}"</i></small>
</h1>
<hr/>
<hr />
<p translate>Copyright &copy; 2014-2017 the following Contributors:</p>
<div class="row">
@@ -15,7 +15,7 @@
Jakob Borg, Audrius Butkevicius, Simon Frei, Alexander Graf, Alexandre Viau, Anderson Mesquita, Antony Male, Ben Schulz, Caleb Callaway, Daniel Harte, Lars K.W. Gohlke, Lode Hoste, Michael Ploujnikov, Nate Morrison, Philippe Schommers, Ryan Sullivan, Sergey Mishin, Stefan Tatschner, Wulf Weich, Aaron Bieber, Adam Piggott, Adel Qalieh, Alessandro G., Andrew Dunham, Andrew Rabert, Andrey D, Antoine Lamielle, Aranjedeath, Arthur Axel fREW Schmidt, BAHADIR YILMAZ, Bart De Vries, Ben Curthoys, Ben Shepherd, Ben Sidhom, Benedikt Heine, Benedikt Morbach, Benno Fünfstück, Benny Ng, Boris Rybalkin, Brandon Philips, Brendan Long, Brian R. Becker, Carsten Hagemann, Cathryne Linenweaver, Cedric Staniewski, Chris Howie, Chris Joel, Chris Tonkinson, Colin Kennedy, Cromefire_, Dale Visser, Daniel Bergmann, Daniel Martí, Darshil Chanpura, David Rimmer, Denis A., Dennis Wilson, Dmitry Saveliev, Dominik Heidler, Elias Jarlebring, Elliot Huffman, Emil Hessman, Erik Meitner, Federico Castagnini, Felix Ableitner, Felix Unterpaintner, Francois-Xavier Gsell, Frank Isemann, Gilli Sigurdsson, Graham Miln, Han Boetes, Harrison Jones, Heiko Zuerker, Iain Barnett, Ian Johnson, Jaakko Hannikainen, Jacek Szafarkiewicz, Jake Peterson, James Patterson, Jaroslav Malec, Jaya Chithra, Jens Diemer, Jerry Jacobs, Jochen Voss, Johan Andersson, Johan Vromans, John Rinehart, Jonathan Cross, Jose Manuel Delicado, Jörg Thalheim, Karol Różycki, Keith Turner, Kelong Cong, Ken'ichi Kamada, Kevin Allen, Kevin White, Jr., Kurt Fitzner, Laurent Arnoud, Laurent Etiemble, Leo Arias, Liu Siyuan, Lord Landon Agahnim, Majed Abdulaziz, Marc Laporte, Marc Pujol, Marcin Dziadus, Mark Pulford, Mateusz Naściszewski, Matic Potočnik, Matt Burke, Matteo Ruina, Max Schulze, MaximAL, Maxime Thirouin, Michael Jephcote, Michael Tilli, Mike Boone, MikeLund, Nicholas Rishel, Nico Stapelbroek, Nicolas Braud-Santoni, Niels Peter Roest, Nils Jakobi, NoLooseEnds, Oyebanji Jacob Mayowa, Pascal Jungblut, Pawel Palenica, Paweł Rozlach, Peter Badida, Peter Dave Hello, Peter Hoeg, Peter Marquardt, Phil Davis, Phill Luby, Pier Paolo Ramon, Piotr Bejda, Pramodh KP, Richard Hartmann, Robert Carosi, Roman Zaynetdinov, Ross Smith II, Sacheendra Talluri, Scott Klupfel, Sly_tom_cat, Stefan Kuntz, Suhas Gundimeda, Taylor Khan, Thomas Hipp, Tim Abell, Tim Howes, Tobias Nygren, Tobias Tom, Tomas Cerveny, Tommy Thorn, Tully Robinson, Tyler Brazier, Unrud, Veeti Paananen, Victor Buinsky, Vil Brekin, Vladimir Rusinov, William A. Kennington III, Xavier O., Yannic A., andresvia, andyleap, chucic, derekriemer, desbma, janost, jaseg, klemens, marco-m, perewa, rubenbe, wangguoliang, xjtdy888, 佛跳墙
</div>
</div>
<hr/>
<hr />
<p translate>Syncthing includes the following software or portions thereof:</p>
<ul class="list-unstyled two-columns" id="copyright-notices">

View File

@@ -8,7 +8,7 @@
<div class="col-md-offset-2 col-md-8">
<div class="panel panel-default">
<div translate class="panel-body">
Failure to connect to IPv6 servers is expected if there is no IPv6 connectivity.
Failure to connect to IPv6 servers is expected if there is no IPv6 connectivity.
</div>
</div>
</div>

View File

@@ -10,7 +10,7 @@ angular.module('syncthing.core')
.filter('duration', function () {
'use strict';
var SECONDS_IN = {"d": 86400, "h": 3600, "m": 60, "s": 1};
var SECONDS_IN = { "d": 86400, "h": 3600, "m": 60, "s": 1 };
return function (input, precision) {
var result = "";
if (!precision) {
@@ -18,7 +18,7 @@ angular.module('syncthing.core')
}
input = parseInt(input, 10);
for (var k in SECONDS_IN) {
var t = (input/SECONDS_IN[k] | 0); // Math.floor
var t = (input / SECONDS_IN[k] | 0); // Math.floor
if (t > 0) {
result += " " + t + k;

View File

@@ -7,7 +7,7 @@ angular.module('syncthing.core')
var lastID = 0;
var self = this;
function successFn (data) {
function successFn(data) {
// When Syncthing restarts while the long polling connection is in
// progress the browser on some platforms returns a 200 (since the
// headers has been flushed with the return code 200), with no data.
@@ -38,7 +38,7 @@ angular.module('syncthing.core')
.error(errorFn);
}
function errorFn (dummy) {
function errorFn(dummy) {
$rootScope.$broadcast(self.OFFLINE);
$timeout(function () {
@@ -51,35 +51,35 @@ angular.module('syncthing.core')
angular.extend(self, {
// emitted by this
ONLINE: 'UIOnline',
ONLINE: 'UIOnline',
OFFLINE: 'UIOffline',
// emitted by syncthing process
CONFIG_SAVED: 'ConfigSaved', // Emitted after the config has been saved by the user or by Syncthing itself
DEVICE_CONNECTED: 'DeviceConnected', // Generated each time a connection to a device has been established
DEVICE_DISCONNECTED: 'DeviceDisconnected', // Generated each time a connection to a device has been terminated
DEVICE_DISCOVERED: 'DeviceDiscovered', // Emitted when a new device is discovered using local discovery
DEVICE_REJECTED: 'DeviceRejected', // Emitted when there is a connection from a device we are not configured to talk to
DEVICE_PAUSED: 'DevicePaused', // Emitted when a device has been paused
DEVICE_RESUMED: 'DeviceResumed', // Emitted when a device has been resumed
DOWNLOAD_PROGRESS: 'DownloadProgress', // Emitted during file downloads for each folder for each file
FOLDER_COMPLETION: 'FolderCompletion', //Emitted when the local or remote contents for a folder changes
FOLDER_REJECTED: 'FolderRejected', // Emitted when a device sends index information for a folder we do not have, or have but do not share with the device in question
FOLDER_SUMMARY: 'FolderSummary', // Emitted when folder contents have changed locally
ITEM_FINISHED: 'ItemFinished', // Generated when Syncthing ends synchronizing a file to a newer version
ITEM_STARTED: 'ItemStarted', // Generated when Syncthing begins synchronizing a file to a newer version
LOCAL_INDEX_UPDATED: 'LocalIndexUpdated', // Generated when the local index information has changed, due to synchronizing one or more items from the cluster or discovering local changes during a scan
CONFIG_SAVED: 'ConfigSaved', // Emitted after the config has been saved by the user or by Syncthing itself
DEVICE_CONNECTED: 'DeviceConnected', // Generated each time a connection to a device has been established
DEVICE_DISCONNECTED: 'DeviceDisconnected', // Generated each time a connection to a device has been terminated
DEVICE_DISCOVERED: 'DeviceDiscovered', // Emitted when a new device is discovered using local discovery
DEVICE_REJECTED: 'DeviceRejected', // Emitted when there is a connection from a device we are not configured to talk to
DEVICE_PAUSED: 'DevicePaused', // Emitted when a device has been paused
DEVICE_RESUMED: 'DeviceResumed', // Emitted when a device has been resumed
DOWNLOAD_PROGRESS: 'DownloadProgress', // Emitted during file downloads for each folder for each file
FOLDER_COMPLETION: 'FolderCompletion', //Emitted when the local or remote contents for a folder changes
FOLDER_REJECTED: 'FolderRejected', // Emitted when a device sends index information for a folder we do not have, or have but do not share with the device in question
FOLDER_SUMMARY: 'FolderSummary', // Emitted when folder contents have changed locally
ITEM_FINISHED: 'ItemFinished', // Generated when Syncthing ends synchronizing a file to a newer version
ITEM_STARTED: 'ItemStarted', // Generated when Syncthing begins synchronizing a file to a newer version
LOCAL_INDEX_UPDATED: 'LocalIndexUpdated', // Generated when the local index information has changed, due to synchronizing one or more items from the cluster or discovering local changes during a scan
REMOTE_INDEX_UPDATED: 'RemoteIndexUpdated', // Generated each time new index information is received from a device
STARTING: 'Starting', // Emitted exactly once, when Syncthing starts, before parsing configuration etc
STARTUP_COMPLETED: 'StartupCompleted', // Emitted exactly once, when initialization is complete and Syncthing is ready to start exchanging data with other devices
STATE_CHANGED: 'StateChanged', // Emitted when a folder changes state
FOLDER_ERRORS: 'FolderErrors', // Emitted when a folder has errors preventing a full sync
STARTING: 'Starting', // Emitted exactly once, when Syncthing starts, before parsing configuration etc
STARTUP_COMPLETED: 'StartupCompleted', // Emitted exactly once, when initialization is complete and Syncthing is ready to start exchanging data with other devices
STATE_CHANGED: 'StateChanged', // Emitted when a folder changes state
FOLDER_ERRORS: 'FolderErrors', // Emitted when a folder has errors preventing a full sync
FOLDER_SCAN_PROGRESS: 'FolderScanProgress', // Emitted every ScanProgressIntervalS seconds, indicating how far into the scan it is at.
FOLDER_PAUSED: 'FolderPaused', // Emitted when a folder is paused
FOLDER_RESUMED: 'FolderResumed', // Emitted when a folder is resumed
FOLDER_PAUSED: 'FolderPaused', // Emitted when a folder is paused
FOLDER_RESUMED: 'FolderResumed', // Emitted when a folder is resumed
start: function() {
start: function () {
$http.get(urlbase + '/events?limit=1')
.success(successFn)
.error(errorFn);

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

View File

@@ -51,7 +51,7 @@ angular.module('syncthing.core')
savedLang = _localStorage[_SYNLANG];
}
if(params.lang) {
if (params.lang) {
useLocale(params.lang, true);
} else if (savedLang) {
useLocale(savedLang);
@@ -99,8 +99,8 @@ angular.module('syncthing.core')
function useLocale(language, save2Storage) {
if (language) {
$translate.use(language).then(function () {
if (save2Storage && _localStorage)
$translate.use(language).then(function () {
if (save2Storage && _localStorage)
_localStorage[_SYNLANG] = language;
});
}
@@ -109,10 +109,10 @@ angular.module('syncthing.core')
return {
autoConfigLocale: autoConfigLocale,
useLocale: useLocale,
getCurrentLocale: function() { return $translate.use() },
getAvailableLocales: function() { return _availableLocales },
getCurrentLocale: function () { return $translate.use() },
getAvailableLocales: function () { return _availableLocales },
// langPrettyprint comes from an included global
getLocalesDisplayNames: function() { return langPrettyprint }
getLocalesDisplayNames: function () { return langPrettyprint }
}
}];

View File

@@ -11,4 +11,4 @@ angular.module('syncthing.core')
};
}
};
});
});

View File

@@ -23,9 +23,9 @@
<div class="panel-body">
<p translate>Automatic upgrade now offers the choice between stable releases and release candidates.</p>
<p>
<span translate>Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases.</span>
<span translate>Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.</span>
<span translate>You can read more about the two release channels at the link below.</span>
<span translate>Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases.</span>
<span translate>Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.</span>
<span translate>You can read more about the two release channels at the link below.</span>
</p>
<p translate>You can change your choice at any time in the Settings dialog.</p>
<p><a href="https://docs.syncthing.net/users/releases.html"><span class="fas fa-info-circle"></span>&nbsp;<span translate>Learn more</span></a></p>
@@ -51,7 +51,7 @@
<p translate>Continuously watching for changes is now available within Syncthing. This will detect changes on disk and issue a scan on only the modified paths. The benefits are that changes are propagated quicker and that less full scans are required.</p>
<p><a href="https://docs.syncthing.net/users/syncing.html#scanning"><span class="fas fa-info-circle"></span>&nbsp;<span translate>Learn more</span></a></p>
<p>
<span translate>Do you want to enable watching for changes for all your folders?</span><br/>
<span translate>Do you want to enable watching for changes for all your folders?</span><br />
<span translate>Additionally the full rescan interval will be increased (times 60, i.e. new default of 1h). You can also configure it manually for every folder later after choosing No.</span>
</p>
<p translate translate-value-syncthing-inotify="syncthing-inotify">Warning: If you are using an external watcher like {%syncthingInotify%}, you should make sure it is deactivated.</p>

View File

@@ -15,9 +15,9 @@ angular.module('syncthing.core')
if (xdirArr.length > ydirArr.length) {
return false;
}
return xdirArr.map(function(e, i) {
return xdirArr.map(function (e, i) {
return xdirArr[i] === ydirArr[i];
}).every(function(e) { return e });
}).every(function (e) { return e });
}
scope.folderPathErrors.isSub = false;
@@ -43,4 +43,4 @@ angular.module('syncthing.core')
});
}
};
});
});

View File

@@ -7,9 +7,9 @@ angular.module('syncthing.core')
}
// Hard limit at two decimals
if (input < 0.1) {
return input.toLocaleString(undefined, {maximumFractionDigits: 2}) + '%';
return input.toLocaleString(undefined, { maximumFractionDigits: 2 }) + '%';
}
// "Soft" limit at two significant digits (e.g. 1.2%, not 1.27%)
return input.toLocaleString(undefined, {maximumSignificantDigits: 2}) + '%';
return input.toLocaleString(undefined, { maximumSignificantDigits: 2 }) + '%';
};
});

View File

@@ -6,4 +6,4 @@ angular.module('syncthing.core')
$(element).popover();
}
};
});
});

View File

@@ -2,7 +2,7 @@ angular.module('syncthing.core')
.directive('selectOnClick', function ($window) {
return {
link: function (scope, element, attrs) {
element.on('click', function() {
element.on('click', function () {
var selection = $window.getSelection();
var range = document.createRange();
range.selectNodeContents(element[0]);
@@ -11,4 +11,4 @@ angular.module('syncthing.core')
});
}
};
});
});

View File

@@ -1,6 +1,6 @@
angular.module('syncthing.core')
.config(function($locationProvider) {
$locationProvider.html5Mode({enabled: true, requireBase: false}).hashPrefix('!');
.config(function ($locationProvider) {
$locationProvider.html5Mode({ enabled: true, requireBase: false }).hashPrefix('!');
})
.controller('SyncthingController', function ($scope, $http, $location, LocaleService, Events, $filter, $q, $compile, $timeout, $rootScope, $translate) {
'use strict';
@@ -65,7 +65,7 @@ angular.module('syncthing.core')
rescanIntervalS: 3600,
fsWatcherDelayS: 10,
fsWatcherEnabled: true,
minDiskFree: {value: 1, unit: "%"},
minDiskFree: { value: 1, unit: "%" },
maxConflicts: 10,
fsync: true,
order: "random",
@@ -131,7 +131,7 @@ angular.module('syncthing.core')
}
$scope.version = data;
$scope.version.isDevelopmentVersion = data.version.indexOf('-')>0;
$scope.version.isDevelopmentVersion = data.version.indexOf('-') > 0;
}).error($scope.emitHTTPError);
$http.get(urlbase + '/svc/report').success(function (data) {
@@ -205,7 +205,7 @@ angular.module('syncthing.core')
// If a folder finished scanning, then refresh folder stats
// to update last scan time.
if(data.from === 'scanning' && data.to === 'idle') {
if (data.from === 'scanning' && data.to === 'idle') {
refreshFolderStats();
}
}
@@ -342,7 +342,7 @@ angular.module('syncthing.core')
});
$scope.emitHTTPError = function (data, status, headers, config) {
$scope.$emit('HTTPError', {data: data, status: status, headers: headers, config: config});
$scope.$emit('HTTPError', { data: data, status: status, headers: headers, config: config });
};
var debouncedFuncs = {};
@@ -447,7 +447,7 @@ angular.module('syncthing.core')
}).error($scope.emitHTTPError);
}
function recalcLocalStateTotal () {
function recalcLocalStateTotal() {
$scope.localStateTotal = {
bytes: 0,
directories: 0,
@@ -455,9 +455,9 @@ angular.module('syncthing.core')
};
for (var f in $scope.model) {
$scope.localStateTotal.bytes += $scope.model[f].localBytes;
$scope.localStateTotal.files += $scope.model[f].localFiles;
$scope.localStateTotal.directories += $scope.model[f].localDirectories;
$scope.localStateTotal.bytes += $scope.model[f].localBytes;
$scope.localStateTotal.files += $scope.model[f].localFiles;
$scope.localStateTotal.directories += $scope.model[f].localDirectories;
}
}
@@ -962,7 +962,7 @@ angular.module('syncthing.core')
var pendingFolders = 0;
for (var i = 0; i < $scope.devices.length; i++) {
var status = $scope.deviceStatus({
deviceID:$scope.devices[i].deviceID
deviceID: $scope.devices[i].deviceID
});
switch (status) {
case 'unknown':
@@ -996,7 +996,7 @@ angular.module('syncthing.core')
}
// all used devices are paused except (this) one
if (pauseCount === deviceCount-1) {
if (pauseCount === deviceCount - 1) {
return 'pause';
}
@@ -1085,11 +1085,11 @@ angular.module('syncthing.core')
$scope.logging = {
facilities: {},
refreshFacilities: function() {
refreshFacilities: function () {
$http.get(urlbase + '/system/debug').success(function (data) {
var facilities = {};
data.enabled = data.enabled || [];
$.each(data.facilities, function(key, value) {
$.each(data.facilities, function (key, value) {
facilities[key] = {
description: value,
enabled: data.enabled.indexOf(key) > -1
@@ -1098,12 +1098,12 @@ angular.module('syncthing.core')
$scope.logging.facilities = facilities;
}).error($scope.emitHTTPError);
},
show: function() {
show: function () {
$scope.logging.refreshFacilities();
$scope.logging.timer = $timeout($scope.logging.fetch);
var textArea = $('#logViewerText');
textArea.on("scroll", $scope.logging.onScroll);
$('#logViewer').modal().one('shown.bs.modal', function() {
$('#logViewer').modal().one('shown.bs.modal', function () {
// Scroll to bottom.
textArea.scrollTop(textArea[0].scrollHeight);
}).one('hidden.bs.modal', function () {
@@ -1113,17 +1113,17 @@ angular.module('syncthing.core')
$scope.logging.entries = [];
});
},
onFacilityChange: function(facility) {
onFacilityChange: function (facility) {
var enabled = $scope.logging.facilities[facility].enabled;
// Disable checkboxes while we're in flight.
$.each($scope.logging.facilities, function(key) {
$.each($scope.logging.facilities, function (key) {
$scope.logging.facilities[key].enabled = null;
})
$http.post(urlbase + '/system/debug?' + (enabled ? 'enable=':'disable=') + facility)
$http.post(urlbase + '/system/debug?' + (enabled ? 'enable=' : 'disable=') + facility)
.success($scope.logging.refreshFacilities)
.error($scope.emitHTTPError);
},
onScroll: function() {
onScroll: function () {
var textArea = $('#logViewerText');
var scrollTop = textArea.prop('scrollTop');
var scrollHeight = textArea.prop('scrollHeight');
@@ -1134,14 +1134,14 @@ angular.module('syncthing.core')
timer: null,
entries: [],
paused: false,
content: function() {
content: function () {
var content = "";
$.each($scope.logging.entries, function (idx, entry) {
content += entry.when.split('.')[0].replace('T', ' ') + ' ' + entry.message + "\n";
});
return content;
},
fetch: function() {
fetch: function () {
var textArea = $('#logViewerText');
if ($scope.logging.paused) {
if (!$scope.logging.timer) return;
@@ -1151,7 +1151,7 @@ angular.module('syncthing.core')
var last = null;
if ($scope.logging.entries.length > 0) {
last = $scope.logging.entries[$scope.logging.entries.length-1].when;
last = $scope.logging.entries[$scope.logging.entries.length - 1].when;
}
$http.get(urlbase + '/system/log' + (last ? '?since=' + encodeURIComponent(last) : '')).success(function (data) {
@@ -1161,7 +1161,7 @@ angular.module('syncthing.core')
if (data.messages) {
$scope.logging.entries.push.apply($scope.logging.entries, data.messages);
// Wait for the text area to be redrawn, adding new lines, and then scroll to bottom.
$timeout(function() {
$timeout(function () {
textArea.scrollTop(textArea[0].scrollHeight);
});
}
@@ -1191,7 +1191,7 @@ angular.module('syncthing.core')
settingsModal.off('hide.bs.modal');
}).on('hide.bs.modal', function (e) {
if ($scope.settingsModified()) {
$("#discard-changes-confirmation").modal().one('hidden.bs.modal', function() {
$("#discard-changes-confirmation").modal().one('hidden.bs.modal', function () {
if (!$scope.settingsModified()) {
settingsModal.modal('hide');
}
@@ -1220,7 +1220,7 @@ angular.module('syncthing.core')
}).error($scope.emitHTTPError);
};
$scope.urVersions = function() {
$scope.urVersions = function () {
var result = [];
if ($scope.system) {
for (var i = $scope.system.urVersionMax; i >= 2; i--) {
@@ -1357,7 +1357,7 @@ angular.module('syncthing.core')
$scope.currentDevice = $.extend({}, deviceCfg);
$scope.editingExisting = true;
$scope.willBeReintroducedBy = undefined;
if (deviceCfg.introducedBy) {
if (deviceCfg.introducedBy) {
var introducerDevice = $scope.findDevice(deviceCfg.introducedBy);
if (introducerDevice && introducerDevice.introducer) {
$scope.willBeReintroducedBy = $scope.deviceName(introducerDevice);
@@ -1619,7 +1619,7 @@ angular.module('syncthing.core')
};
$scope.loadFormIntoScope = function (form) {
console.log('loadFormIntoScope',form.$name);
console.log('loadFormIntoScope', form.$name);
switch (form.$name) {
case 'deviceEditor':
$scope.deviceEditor = form;
@@ -1707,16 +1707,16 @@ angular.module('syncthing.core')
$scope.editFolderModal();
};
$scope.selectAllDevices = function() {
$scope.selectAllDevices = function () {
var devices = $scope.otherDevices();
for (var i = 0; i < devices.length; i++){
for (var i = 0; i < devices.length; i++) {
$scope.currentFolder.selectedDevices[devices[i].deviceID] = true;
}
};
$scope.deSelectAllDevices = function() {
$scope.deSelectAllDevices = function () {
var devices = $scope.otherDevices();
for (var i = 0; i < devices.length; i++){
for (var i = 0; i < devices.length; i++) {
$scope.currentFolder.selectedDevices[devices[i].deviceID] = false;
}
};
@@ -1908,7 +1908,7 @@ angular.module('syncthing.core')
errors: null,
filters: {},
massAction: function (name, action) {
$.each($scope.restoreVersions.versions, function(key) {
$.each($scope.restoreVersions.versions, function (key) {
if (key.startsWith(name + '/') && (!$scope.restoreVersions.filters.text || key.indexOf($scope.restoreVersions.filters.text) > -1)) {
if (action == 'unset') {
delete $scope.restoreVersions.selections[key];
@@ -1916,7 +1916,7 @@ angular.module('syncthing.core')
}
var availableVersions = [];
$.each($scope.restoreVersions.filterVersions($scope.restoreVersions.versions[key]), function(idx, version) {
$.each($scope.restoreVersions.filterVersions($scope.restoreVersions.versions[key]), function (idx, version) {
availableVersions.push(version.versionTime);
})
@@ -1931,8 +1931,8 @@ angular.module('syncthing.core')
}
});
},
filterVersions: function(versions) {
var filteredVersions = [];
filterVersions: function (versions) {
var filteredVersions = [];
$.each(versions, function (idx, version) {
if (moment(version.versionTime).isBetween($scope.restoreVersions.filters['start'], $scope.restoreVersions.filters['end'], null, '[]')) {
filteredVersions.push(version);
@@ -1940,9 +1940,9 @@ angular.module('syncthing.core')
});
return filteredVersions;
},
selectionCount: function() {
selectionCount: function () {
var count = 0;
$.each($scope.restoreVersions.selections, function(key, value) {
$.each($scope.restoreVersions.selections, function (key, value) {
if (value) {
count++;
}
@@ -1950,12 +1950,12 @@ angular.module('syncthing.core')
return count;
},
restore: function() {
restore: function () {
$scope.restoreVersions.tree.clear();
$scope.restoreVersions.tree = null;
$scope.restoreVersions.versions = null;
var selections = {};
$.each($scope.restoreVersions.selections, function(key, value) {
$.each($scope.restoreVersions.selections, function (key, value) {
if (value) {
selections[key] = value;
}
@@ -1970,7 +1970,7 @@ angular.module('syncthing.core')
}
});
},
show: function(folder) {
show: function (folder) {
$scope.restoreVersions.folder = folder;
var closed = false;
@@ -1978,14 +1978,14 @@ angular.module('syncthing.core')
$('#restoreVersions').modal().one('hidden.bs.modal', function () {
closed = true;
resetRestoreVersions();
}).one('shown.bs.modal', function() {
}).one('shown.bs.modal', function () {
modalShown.resolve();
});
var dataReceived = $http.get(urlbase + '/folder/versions?folder=' + encodeURIComponent($scope.restoreVersions.folder))
.success(function (data) {
$.each(data, function(key, values) {
$.each(values, function(idx, value) {
$.each(data, function (key, values) {
$.each(values, function (idx, value) {
value.modTime = new Date(value.modTime);
value.versionTime = new Date(value.versionTime);
});
@@ -1994,8 +1994,8 @@ angular.module('syncthing.core')
$scope.restoreVersions.versions = data;
});
$q.all([dataReceived, modalShown.promise]).then(function() {
$timeout(function(){
$q.all([dataReceived, modalShown.promise]).then(function () {
$timeout(function () {
if (closed) {
resetRestoreVersions();
return;
@@ -2020,7 +2020,7 @@ angular.module('syncthing.core')
},
debugLevel: 2,
source: buildTree($scope.restoreVersions.versions),
renderColumns: function(event, data) {
renderColumns: function (event, data) {
var node = data.node,
$tdList = $(node.tr).find(">td"),
template;
@@ -2039,7 +2039,7 @@ angular.module('syncthing.core')
);
// Force angular to redraw.
$timeout(function() {
$timeout(function () {
$scope.$apply();
});
}
@@ -2050,8 +2050,8 @@ angular.module('syncthing.core')
date;
// Find version window.
$.each($scope.restoreVersions.versions, function(key) {
$.each($scope.restoreVersions.versions[key], function(idx, version) {
$.each($scope.restoreVersions.versions, function (key) {
$.each($scope.restoreVersions.versions[key], function (idx, version) {
date = moment(version.versionTime);
if (date.isBefore(minDate)) {
minDate = date;
@@ -2066,17 +2066,17 @@ angular.module('syncthing.core')
$scope.restoreVersions.filters['end'] = maxDate;
var ranges = {
'All time': [minDate, maxDate],
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
'All time': [minDate, maxDate],
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
};
// Filter out invalid ranges.
$.each(ranges, function(key, range) {
$.each(ranges, function (key, range) {
if (!range[0].isBetween(minDate, maxDate, null, '[]') && !range[1].isBetween(minDate, maxDate, null, '[]')) {
delete ranges[key];
}
@@ -2097,12 +2097,12 @@ angular.module('syncthing.core')
locale: {
format: 'YYYY/MM/DD HH:mm:ss',
}
}).on('apply.daterangepicker', function(ev, picker) {
}).on('apply.daterangepicker', function (ev, picker) {
$scope.restoreVersions.filters['start'] = picker.startDate;
$scope.restoreVersions.filters['end'] = picker.endDate;
// Events for this UI element are not managed by angular.
// Force angular to wake up.
$timeout(function() {
$timeout(function () {
$scope.$apply();
});
});
@@ -2113,7 +2113,7 @@ angular.module('syncthing.core')
}
resetRestoreVersions();
$scope.$watchCollection('restoreVersions.filters', function() {
$scope.$watchCollection('restoreVersions.filters', function () {
if (!$scope.restoreVersions.tree) return;
$scope.restoreVersions.tree.filterNodes(function (node) {
@@ -2163,7 +2163,7 @@ angular.module('syncthing.core')
$scope.showRemoteNeed = function (device) {
resetRemoteNeed();
$scope.remoteNeedDevice = device;
$scope.deviceFolders(device).forEach(function(folder) {
$scope.deviceFolders(device).forEach(function (folder) {
var comp = $scope.completion[device.deviceID][folder];
if (comp !== undefined && comp.needItems + comp.needDeletes === 0) {
return;
@@ -2233,11 +2233,11 @@ angular.module('syncthing.core')
if ($scope.reportDataPreviewDiff && version > 2) {
$q.all([
$http.get(urlbase + '/svc/report?version=' + version),
$http.get(urlbase + '/svc/report?version=' + (version-1)),
$http.get(urlbase + '/svc/report?version=' + (version - 1)),
]).then(function (responses) {
var newReport = responses[0].data;
var oldReport = responses[1].data;
angular.forEach(oldReport, function(_, key) {
angular.forEach(oldReport, function (_, key) {
delete newReport[key];
});
$scope.reportDataPreview = newReport;
@@ -2257,7 +2257,7 @@ angular.module('syncthing.core')
$http.post(urlbase + "/db/scan?folder=" + encodeURIComponent(folder));
};
$scope.setAllFoldersPause = function(pause) {
$scope.setAllFoldersPause = function (pause) {
var folderListCache = $scope.folderList();
for (var i = 0; i < folderListCache.length; i++) {
@@ -2268,7 +2268,7 @@ angular.module('syncthing.core')
$scope.saveConfig();
};
$scope.isAtleastOneFolderPausedStateSetTo = function(pause) {
$scope.isAtleastOneFolderPausedStateSetTo = function (pause) {
var folderListCache = $scope.folderList();
for (var i = 0; i < folderListCache.length; i++) {
@@ -2280,10 +2280,10 @@ angular.module('syncthing.core')
return false;
};
$scope.activateAllFsWatchers = function() {
$scope.activateAllFsWatchers = function () {
var folders = $scope.folderList();
$.each(folders, function(i) {
$.each(folders, function (i) {
if (folders[i].fsWatcherEnabled) {
return;
}
@@ -2331,7 +2331,7 @@ angular.module('syncthing.core')
'solaris': 'Solaris'
}[$scope.version.os] || $scope.version.os;
var arch ={
var arch = {
'386': '32 bit',
'amd64': '64 bit',
'arm': 'ARM',

View File

@@ -8,4 +8,4 @@ angular.module('syncthing.core')
});
}
};
});
});

View File

@@ -18,4 +18,4 @@ angular.module('syncthing.core')
});
}
};
});
});

View File

@@ -29,4 +29,4 @@ angular.module('syncthing.core')
});
}
};
});
});