Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 467987
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorer-table.js (-3 / +16 lines)
Lines 435-441 Link Here
435
				var dragEnter = function (evt) {
435
				var dragEnter = function (evt) {
436
					if (dragStartTarget) {
436
					if (dragStartTarget) {
437
						var copy = util.isMac ? evt.altKey : evt.ctrlKey;
437
						var copy = util.isMac ? evt.altKey : evt.ctrlKey;
438
						dropEffect = evt.dataTransfer.dropEffect = copy ? "copy" : "move"; //$NON-NLS-1$ //$NON-NLS-0$
438
						dropEffect = evt.dataTransfer.dropEffect = (copy ? "copy" : "move"); //$NON-NLS-1$ //$NON-NLS-0$
439
					} else {
439
					} else {
440
						/* accessing dataTransfer.effectAllowed here throws an error on IE */
440
						/* accessing dataTransfer.effectAllowed here throws an error on IE */
441
						if (!util.isIE && (evt.dataTransfer.effectAllowed === "all" ||   //$NON-NLS-0$
441
						if (!util.isIE && (evt.dataTransfer.effectAllowed === "all" ||   //$NON-NLS-0$
Lines 459-465 Link Here
459
				var dragOver = function (evt) {
459
				var dragOver = function (evt) {
460
					if (dragStartTarget) {
460
					if (dragStartTarget) {
461
						var copy = util.isMac ? evt.altKey : evt.ctrlKey;
461
						var copy = util.isMac ? evt.altKey : evt.ctrlKey;
462
						dropEffect = evt.dataTransfer.dropEffect = copy ? "copy" : "move"; //$NON-NLS-1$ //$NON-NLS-0$
462
						dropEffect = evt.dataTransfer.dropEffect = (copy ? "copy" : "move"); //$NON-NLS-1$ //$NON-NLS-0$
463
					} else {
463
					} else {
464
						// default behavior is to not trigger a drop, so we override the default
464
						// default behavior is to not trigger a drop, so we override the default
465
						// behavior in order to enable drop.  
465
						// behavior in order to enable drop.  
Lines 641-647 Link Here
641
						deferred.then(function(result) {
641
						deferred.then(function(result) {
642
							var dispatcher = explorer.modelEventDispatcher;
642
							var dispatcher = explorer.modelEventDispatcher;
643
							dispatcher.dispatchEvent({type: isCopy ? "copy" : "move", oldValue: source, newValue: result, parent: item}); //$NON-NLS-1$ //$NON-NLS-0$
643
							dispatcher.dispatchEvent({type: isCopy ? "copy" : "move", oldValue: source, newValue: result, parent: item}); //$NON-NLS-1$ //$NON-NLS-0$
644
						}, errorHandler);
644
						}, function(error) {
645
							if (error.status === 400 || error.status === 412) {
646
								var resp = error.responseText;
647
								if (typeof resp === "string") {
648
									try {
649
										resp = JSON.parse(resp);
650
										resp.Message = messages[isCopy ? "CopyFailed" : "MoveFailed"];
651
										error = resp;
652
									} catch(error) {}
653
								}
654
							}
655
							errorHandler(error);
656
						}
657
					);
645
						
658
						
646
					// webkit supports testing for and traversing directories
659
					// webkit supports testing for and traversing directories
647
					// http://wiki.whatwg.org/wiki/DragAndDropEntries
660
					// http://wiki.whatwg.org/wiki/DragAndDropEntries
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/fileCommands.js (-2 / +27 lines)
Lines 300-306 Link Here
300
						dispatchModelEventOn({type: "create", parent: loadedWorkspace, newValue: folder }); //$NON-NLS-0$
300
						dispatchModelEventOn({type: "create", parent: loadedWorkspace, newValue: folder }); //$NON-NLS-0$
301
					}, errorHandler);
301
					}, errorHandler);
302
				}, 
302
				}, 
303
				errorHandler);
303
				function(error) {
304
					if (error.status === 400 || error.status === 412) {
305
						var resp = error.responseText;
306
						if (typeof resp === "string") {
307
							try {
308
								resp = JSON.parse(resp);
309
								resp.Message = i18nUtil.formatMessage(messages["FailedToCreateProject"], name);
310
								error = resp;
311
							} catch(error) {}
312
						}
313
					}
314
					errorHandler(error);
315
				});
304
			}, errorHandler);
316
			}, errorHandler);
305
		}
317
		}
306
	}
318
	}
Lines 918-924 Link Here
918
						function(newArtifact) {
930
						function(newArtifact) {
919
							dispatchModelEvent({ type: "create", parent: parentItem, newValue: newArtifact }); //$NON-NLS-0$
931
							dispatchModelEvent({ type: "create", parent: parentItem, newValue: newArtifact }); //$NON-NLS-0$
920
						},
932
						},
921
						errorHandler);
933
						function(error) {
934
							if (error.status === 400 || error.status === 412) {
935
								var resp = error.responseText;
936
								if (typeof resp === "string") {
937
									try {
938
										resp = JSON.parse(resp);
939
										resp.Message = i18nUtil.formatMessage(messages["FailedToCreateFile"], name);
940
										error = resp;
941
									} catch(error) {}
942
								}
943
							}
944
							errorHandler(error);
945
						}
946
					);
922
				}
947
				}
923
			};
948
			};
924
			
949
			
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/navigate/nls/root/messages.js (+4 lines)
Lines 34-39 Link Here
34
	"ZipDL": "Create a zip file of the folder contents and download it",
34
	"ZipDL": "Create a zip file of the folder contents and download it",
35
	"New File": "File",
35
	"New File": "File",
36
	"Create a new file": "Create a new file",
36
	"Create a new file": "Create a new file",
37
	"FailedToCreateProject":"Failed to create project: ${0}",
38
	"FailedToCreateFile": "Failed to create file: ${0}",
39
	"CopyFailed": "Copy operation failed",
40
	"MoveFailed": "Move operation failed",
37
	"Name:": "Name:",
41
	"Name:": "Name:",
38
	"New Folder": "Folder",
42
	"New Folder": "Folder",
39
	"Folder name:": "Folder name:",
43
	"Folder name:": "Folder name:",

Return to bug 467987