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 350019 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.core/web/edit/setup.js (-2 / +2 lines)
Lines 182-193 exports.setUpEditor = function(serviceRegistry, preferences, isReadOnly){ Link Here
182
	var inputManager = {
182
	var inputManager = {
183
		lastFilePath: "",
183
		lastFilePath: "",
184
		
184
		
185
		setInput: function(location, editor) {
185
		setInput: function(location, editor, refresh) {
186
			var input = mUtil.getPositionInfo(location);
186
			var input = mUtil.getPositionInfo(location);
187
			var fileURI = input.filePath;
187
			var fileURI = input.filePath;
188
			// populate editor
188
			// populate editor
189
			if (fileURI) {
189
			if (fileURI) {
190
				if (fileURI === this.lastFilePath) {
190
				if (fileURI === this.lastFilePath && !refresh) {
191
					editor.showSelection(input.start, input.end, input.line, input.offset, input.length);
191
					editor.showSelection(input.start, input.end, input.line, input.offset, input.length);
192
				} else {
192
				} else {
193
					if (!editor.getTextView()) {
193
					if (!editor.getTextView()) {
(-)a/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js (-1 / +17 lines)
Lines 83-88 exports.EditorCommandFactory = (function() { Link Here
83
					);
83
					);
84
					return true;
84
					return true;
85
				}));
85
				}));
86
				editor.getTextView().setAction("Refresh", dojo.hitch(this, function () {
87
					if (this.inputManager.lastFilePath) {
88
						this.inputManager.setInput(this.inputManager.lastFilePath, editor, true);
89
					}
90
					return true;
91
				}));
92
				
86
				var saveCommand = new mCommands.Command({
93
				var saveCommand = new mCommands.Command({
87
					name: "Save",
94
					name: "Save",
88
					tooltip: "Save this file",
95
					tooltip: "Save this file",
Lines 90-98 exports.EditorCommandFactory = (function() { Link Here
90
					callback: function(editor) {
97
					callback: function(editor) {
91
						editor.getTextView().invokeAction("Save");
98
						editor.getTextView().invokeAction("Save");
92
					}});
99
					}});
100
				var refreshCommand = new mCommands.Command({
101
					name: "Refresh",
102
					toolTip: "Refresh this file",
103
					id: "orion.refresh",
104
					callback: function(editor) {
105
						editor.getTextView().invokeAction("Refresh");
106
					}
107
				});
93
				this.commandService.addCommand(saveCommand, "dom");
108
				this.commandService.addCommand(saveCommand, "dom");
109
				this.commandService.addCommand(refreshCommand, "dom");
94
				this.commandService.addCommandGroup("orion.editorActions.unlabeled", 200, null, null, this.toolbarId);
110
				this.commandService.addCommandGroup("orion.editorActions.unlabeled", 200, null, null, this.toolbarId);
95
				this.commandService.registerCommandContribution("orion.save", 1, this.toolbarId, "orion.editorActions.unlabeled", new mCommands.CommandKeyBinding('s', true));
111
				this.commandService.registerCommandContribution("orion.save", 1, this.toolbarId, "orion.editorActions.unlabeled", new mCommands.CommandKeyBinding('s', true));
112
				this.commandService.registerCommandContribution("orion.refresh", 2, this.toolbarId, "orion.editorActions.unlabeled");
96
	
113
	
97
				// add the commands generated by plug-ins who implement the "orion.edit.command" extension.
114
				// add the commands generated by plug-ins who implement the "orion.edit.command" extension.
98
				// we currently position these first so that the regular commands always appear in the same place (on the right) regardless of installed plug-ins
115
				// we currently position these first so that the regular commands always appear in the same place (on the right) regardless of installed plug-ins
99
- 

Return to bug 350019