9 Commits f8ce5ea6f3 ... e28a18ab16

Author SHA1 Message Date
  Morris Jobke e28a18ab16 Merge pull request #13660 from nextcloud/fix/template_parameter 5 years ago
  Morris Jobke 743323ee48 Merge pull request #12381 from rummatee/master 5 years ago
  Roeland Jago Douma 66367797df Fix template paramter 5 years ago
  Morris Jobke 10ab678aa5 Merge pull request #13664 from nextcloud/bugfix/noid/proper-warning-in-settings 5 years ago
  Morris Jobke 9ee4433333 Use warning background color & primary text color for setting warnings 5 years ago
  Florian Schunk 332b4aee9d fix testing for undefined 5 years ago
  Florian Schunk ecb936495f also remember folder for multiselect actions 5 years ago
  Florian Schunk 37270fc525 remember last copied to directory 6 years ago
  Florian Schunk 528964e0b7 copy Dialog starts in current directory 6 years ago

+ 6 - 1
apps/files/js/fileactions.js

@@ -648,6 +648,10 @@
 					if (permissions & OC.PERMISSION_UPDATE) {
 						actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE;
 					}
+					var dialogDir = context.dir;
+					if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') {
+						dialogDir = context.fileList.dirInfo.dirLastCopiedTo;
+					}
 					OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
 						if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
 							context.fileList.copy(filename, targetPath, false, context.dir);
@@ -655,7 +659,8 @@
 						if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
 							context.fileList.move(filename, targetPath, false, context.dir);
 						}
-					}, false, "httpd/unix-directory", true, actions);
+						context.fileList.dirInfo.dirLastCopiedTo = targetPath; 
+					}, false, "httpd/unix-directory", true, actions, dialogDir);
 				}
 			});
 

+ 6 - 1
apps/files/js/filelist.js

@@ -918,6 +918,10 @@
 			};
 
 			var actions = this.isSelectedMovable() ? OC.dialogs.FILEPICKER_TYPE_COPY_MOVE : OC.dialogs.FILEPICKER_TYPE_COPY;
+			var dialogDir = self.getCurrentDirectory();
+			if (typeof self.dirInfo.dirLastCopiedTo !== 'undefined') {
+				dialogDir = self.dirInfo.dirLastCopiedTo;
+			}
 			OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {
 				self.fileMultiSelectMenu.toggleLoading('copyMove', true);
 				if (type === OC.dialogs.FILEPICKER_TYPE_COPY) {
@@ -926,7 +930,8 @@
 				if (type === OC.dialogs.FILEPICKER_TYPE_MOVE) {
 					self.move(files, targetPath, disableLoadingState);
 				}
-			}, false, "httpd/unix-directory", true, actions);
+				self.dirInfo.dirLastCopiedTo = targetPath; 
+			}, false, "httpd/unix-directory", true, actions, dialogDir);
 			event.preventDefault();
 		},
 

+ 1 - 1
core/Controller/ClientFlowLoginController.php

@@ -138,7 +138,7 @@ class ClientFlowLoginController extends Controller {
 			$this->appName,
 			'403',
 			[
-				'file' => $this->l10n->t('State token does not match'),
+				'message' => $this->l10n->t('State token does not match'),
 			],
 			'guest'
 		);

+ 2 - 0
core/css/styles.scss

@@ -322,6 +322,8 @@ label.infield {
 	margin-top: 8px;
 	padding: 5px;
 	border-radius: var(--border-radius);
+	color: var(--color-primary-text);
+	background-color: var(--color-warning);
 }
 
 .warning {

+ 5 - 3
core/js/oc-dialogs.js

@@ -189,8 +189,9 @@ var OCdialogs = {
 	 * @param mimetypeFilter mimetype to filter by - directories will always be included
 	 * @param modal make the dialog modal
 	 * @param type Type of file picker : Choose, copy, move, copy and move
+	 * @param path path to the folder that the the file can be picket from
 	*/
-	filepicker:function(title, callback, multiselect, mimetypeFilter, modal, type) {
+	filepicker:function(title, callback, multiselect, mimetypeFilter, modal, type, path) {
 		var self = this;
 
 		this.filepicker.sortField = 'name';
@@ -214,6 +215,7 @@ var OCdialogs = {
 		this.filepicker.filesClient = (OCA.Sharing && OCA.Sharing.PublicApp && OCA.Sharing.PublicApp.fileList)? OCA.Sharing.PublicApp.fileList.filesClient: OC.Files.getClient();
 
 		this.filelist = null;
+		path = path || '';
 
 		$.when(this._getFilePickerTemplate()).then(function($tmpl) {
 			self.filepicker.loading = false;
@@ -234,7 +236,7 @@ var OCdialogs = {
 				title: title,
 				emptytext: emptyText,
 				newtext: newText
-			}).data('path', '').data('multiselect', multiselect).data('mimetype', mimetypeFilter);
+			}).data('path', path).data('multiselect', multiselect).data('mimetype', mimetypeFilter);
 
 			if (modal === undefined) {
 				modal = false;
@@ -355,7 +357,7 @@ var OCdialogs = {
 					self.filepicker.sortOrder = self.filepicker.sortOrder === 'asc' ? 'desc' : 'asc';
 					self._fillFilePicker(dir);
 				});
-				self._fillFilePicker('');
+				self._fillFilePicker(path);
 			});
 
 			// build buttons

+ 1 - 1
tests/Core/Controller/ClientFlowLoginControllerTest.php

@@ -257,7 +257,7 @@ class ClientFlowLoginControllerTest extends TestCase {
 			'core',
 			'403',
 			[
-				'file' => 'State token does not match',
+				'message' => 'State token does not match',
 			],
 			'guest'
 		);