diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go
index ca431e6b..b276fe79 100644
--- a/cmd/syncthing/gui.go
+++ b/cmd/syncthing/gui.go
@@ -969,9 +969,7 @@ func (s *apiService) getRandomString(w http.ResponseWriter, r *http.Request) {
func (s *apiService) getDBIgnores(w http.ResponseWriter, r *http.Request) {
qs := r.URL.Query()
- folder := qs.Get("folder")
-
- ignores, patterns, err := s.model.GetIgnores(folder)
+ ignores, patterns, err := s.model.GetIgnores(qs.Get("folder"))
if err != nil {
http.Error(w, err.Error(), 500)
return
diff --git a/gui/default/assets/lang/lang-en.json b/gui/default/assets/lang/lang-en.json
index 24d54112..26db4838 100644
--- a/gui/default/assets/lang/lang-en.json
+++ b/gui/default/assets/lang/lang-en.json
@@ -43,7 +43,6 @@
"Copied from original": "Copied from original",
"Copyright © 2014-2016 the following Contributors:": "Copyright © 2014-2016 the following Contributors:",
"Copyright © 2014-2017 the following Contributors:": "Copyright © 2014-2017 the following Contributors:",
- "Creating ignore patterns, overwriting an existing file at {%path%}.": "Creating ignore patterns, overwriting an existing file at {{path}}.",
"Danger!": "Danger!",
"Deleted": "Deleted",
"Device": "Device",
@@ -64,7 +63,6 @@
"Edit Device": "Edit Device",
"Edit Folder": "Edit Folder",
"Editing": "Editing",
- "Editing {%path%}.": "Editing {{path}}.",
"Enable NAT traversal": "Enable NAT traversal",
"Enable Relaying": "Enable Relaying",
"Enter comma separated (\"tcp://ip:port\", \"tcp://host:port\") addresses or \"dynamic\" to perform automatic discovery of the address.": "Enter comma separated (\"tcp://ip:port\", \"tcp://host:port\") addresses or \"dynamic\" to perform automatic discovery of the address.",
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index a418e2d0..f1717681 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -58,24 +58,6 @@ angular.module('syncthing.core')
$scope.metricRates = (window.localStorage["metricRates"] == "true");
} catch (exception) { }
- $scope.folderDefaults = {
- selectedDevices: {},
- type: "readwrite",
- rescanIntervalS: 60,
- minDiskFreePct: 1,
- maxConflicts: 10,
- fsync: true,
- order: "random",
- fileVersioningSelector: "none",
- trashcanClean: 0,
- simpleKeep: 5,
- staggeredMaxAge: 365,
- staggeredCleanInterval: 3600,
- staggeredVersionsPath: "",
- externalCommand: "",
- autoNormalize: true
- };
-
$scope.localStateTotal = {
bytes: 0,
files: 0
@@ -1411,9 +1393,24 @@ angular.module('syncthing.core')
};
$scope.addFolder = function () {
- $scope.currentFolder = angular.copy($scope.folderDefaults);
+ $scope.currentFolder = {
+ selectedDevices: {},
+ type: "readwrite",
+ rescanIntervalS: 60,
+ minDiskFreePct: 1,
+ maxConflicts: 10,
+ fsync: true,
+ order: "random",
+ fileVersioningSelector: "none",
+ trashcanClean: 0,
+ simpleKeep: 5,
+ staggeredMaxAge: 365,
+ staggeredCleanInterval: 3600,
+ staggeredVersionsPath: "",
+ externalCommand: "",
+ autoNormalize: true
+ };
$scope.editingExisting = false;
- $('#editIgnores textarea').val("");
$scope.folderEditor.$setPristine();
$http.get(urlbase + '/svc/random/string?length=10').success(function (data) {
$scope.currentFolder.id = (data.random.substr(0, 5) + '-' + data.random.substr(5, 5)).toLowerCase();
@@ -1423,11 +1420,26 @@ angular.module('syncthing.core')
$scope.addFolderAndShare = function (folder, folderLabel, device) {
$scope.dismissFolderRejection(folder, device);
- $scope.currentFolder = angular.copy($scope.folderDefaults);
- $scope.currentFolder.id = folder;
- $scope.currentFolder.label = folderLabel;
- $scope.currentFolder.viewFlags = {
- importFromOtherDevice: true
+ $scope.currentFolder = {
+ id: folder,
+ label: folderLabel,
+ selectedDevices: {},
+ rescanIntervalS: 60,
+ minDiskFreePct: 1,
+ maxConflicts: 10,
+ fsync: true,
+ order: "random",
+ fileVersioningSelector: "none",
+ trashcanClean: 0,
+ simpleKeep: 5,
+ staggeredMaxAge: 365,
+ staggeredCleanInterval: 3600,
+ staggeredVersionsPath: "",
+ externalCommand: "",
+ autoNormalize: true,
+ viewFlags: {
+ importFromOtherDevice: true
+ }
};
$scope.currentFolder.selectedDevices[device] = true;
@@ -1504,20 +1516,10 @@ angular.module('syncthing.core')
delete folderCfg.versioning;
}
- var ignores = $('#editIgnores textarea').val().trim();
- if (!$scope.editingExisting && ignores) {
- folderCfg.paused = true;
- };
-
$scope.folders[folderCfg.id] = folderCfg;
$scope.config.folders = folderList($scope.folders);
$scope.saveConfig();
-
- if (!$scope.editingExisting && ignores) {
- $scope.saveIgnores();
- $scope.setFolderPause(folderCfg.id, false);
- };
};
$scope.dismissFolderRejection = function (folder, device) {
@@ -1591,21 +1593,11 @@ angular.module('syncthing.core')
});
};
- $scope.editIgnoresOnAddingFolder = function () {
- if ($scope.editingExisting) {
+ $scope.saveIgnores = function () {
+ if (!$scope.editingExisting) {
return;
}
- if ($scope.currentFolder.path.endsWith($scope.system.pathSeparator)) {
- $scope.currentFolder.path = $scope.currentFolder.path.slice(0, -1);
- };
- $('#editIgnores').modal().one('shown.bs.modal', function () {
- textArea.focus();
- });
- };
-
-
- $scope.saveIgnores = function () {
$http.post(urlbase + '/db/ignores?folder=' + encodeURIComponent($scope.currentFolder.id), {
ignore: $('#editIgnores textarea').val().split('\n')
});
diff --git a/gui/default/syncthing/folder/editFolderModalView.html b/gui/default/syncthing/folder/editFolderModalView.html
index 359f90e1..2eb1faee 100644
--- a/gui/default/syncthing/folder/editFolderModalView.html
+++ b/gui/default/syncthing/folder/editFolderModalView.html
@@ -184,7 +184,7 @@
-