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

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js (-2 / +7 lines)
Lines 83-89 Link Here
83
	"Author Name:": "Author Name:",
83
	"Author Name:": "Author Name:",
84
	"Licence:": "Licence:",
84
	"Licence:": "Licence:",
85
	"Description:": "Description:",
85
	"Description:": "Description:",
86
	"A plugin for Eclipse Orion": "A plugin for Eclipse Orion",
86
	"A plugin for Orion": "A plugin for Orion",
87
	"Plugin Link": "Plugin Link",
87
	"Plugin Link": "Plugin Link",
88
	"Install": "Install",
88
	"Install": "Install",
89
	"Install a plugin by specifying its URL": "Install a plugin by specifying its URL",
89
	"Install a plugin by specifying its URL": "Install a plugin by specifying its URL",
Lines 225-229 Link Here
225
	"splitEditors": "Split Editors",
225
	"splitEditors": "Split Editors",
226
	"splitOrientation": "Split Orientation",
226
	"splitOrientation": "Split Orientation",
227
	"horizontal": "Horizontal",
227
	"horizontal": "Horizontal",
228
	"vertical": "Vertical"
228
	"vertical": "Vertical",
229
	"pluginStatusNotLoaded": "This plug-in is not loaded.",
230
	"pluginStatusNotRunning": "This plug-in is not running.",
231
	"Website": "Website",
232
	"License": "License",
233
	"Login": "Login"
229
});
234
});
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginEntry.js (-15 / +42 lines)
Lines 52-59 Link Here
52
		var serviceDescriptions = [];
52
		var serviceDescriptions = [];
53
		plugin.getServiceReferences().forEach(function(reference) {
53
		plugin.getServiceReferences().forEach(function(reference) {
54
			var serviceName = "";
54
			var serviceName = "";
55
			if (reference.getProperty("objectClass")){
55
			if (reference.getProperty("objectClass")){   //$NON-NLS-0$ 
56
				serviceName = reference.getProperty("objectClass").join(" ");
56
				serviceName = reference.getProperty("objectClass").join(" ");   //$NON-NLS-0$   //$NON-NLS-1$ 
57
			}
57
			}
58
			
58
			
59
			var serviceDescription = {
59
			var serviceDescription = {
Lines 87-92 Link Here
87
									'<span class="plugin-commands"></span>' + //$NON-NLS-0$
87
									'<span class="plugin-commands"></span>' + //$NON-NLS-0$
88
									'<div class="stretch">' + //$NON-NLS-0$
88
									'<div class="stretch">' + //$NON-NLS-0$
89
										'<span class="plugin-title"></span>' + //$NON-NLS-0$
89
										'<span class="plugin-title"></span>' + //$NON-NLS-0$
90
										'<div class="plugin-status" style="font-size:11px;color:red"></div>' + //$NON-NLS-0$
90
										'<div></div>' + //$NON-NLS-0$
91
										'<div></div>' + //$NON-NLS-0$
91
										'<span class="plugin-description"></span>' + //$NON-NLS-0$
92
										'<span class="plugin-description"></span>' + //$NON-NLS-0$
92
										'<div class="plugin-links" style="font-size:11px"></div>' + //$NON-NLS-0$ 
93
										'<div class="plugin-links" style="font-size:11px"></div>' + //$NON-NLS-0$ 
Lines 99-109 Link Here
99
100
100
		createElements: function() {
101
		createElements: function() {
101
			this.node.innerHTML = this.templateString;
102
			this.node.innerHTML = this.templateString;
102
			this.pluginTitle = lib.$(".plugin-title", this.node);
103
			this.pluginTitle = lib.$(".plugin-title", this.node);  //$NON-NLS-0$ 
103
			this.pluginDescription = lib.$(".plugin-description", this.node);
104
			this.pluginStatus = lib.$(".plugin-status", this.node);  //$NON-NLS-0$ 
104
			this.pluginLinks = lib.$(".plugin-links", this.node);
105
			this.pluginDescription = lib.$(".plugin-description", this.node);  //$NON-NLS-0$ 
105
			this.commandSpan = lib.$(".plugin-commands", this.node);
106
			this.pluginLinks = lib.$(".plugin-links", this.node);  //$NON-NLS-0$ 
106
			this.serviceContainer = lib.$(".plugin-service-item", this.node);
107
			this.commandSpan = lib.$(".plugin-commands", this.node);  //$NON-NLS-0$ 
108
			this.serviceContainer = lib.$(".plugin-service-item", this.node);  //$NON-NLS-0$ 
107
			this.postCreate();
109
			this.postCreate();
108
		},
110
		},
109
		destroy: function() {
111
		destroy: function() {
Lines 116-122 Link Here
116
		},
118
		},
117
		addPluginLink: function(name, url)  {
119
		addPluginLink: function(name, url)  {
118
			if (!PageUtil.validateURLScheme(url)) {
120
			if (!PageUtil.validateURLScheme(url)) {
119
				console.log("Illegal "+ name +" URL: " + url);
121
				console.log("Illegal "+ name +" URL: " + url);  //$NON-NLS-0$  //$NON-NLS-1$
120
				return;
122
				return;
121
			}
123
			}
122
			var link = document.createElement("a"); //$NON-NLS-0$
124
			var link = document.createElement("a"); //$NON-NLS-0$
Lines 129-147 Link Here
129
		postCreate: function(){	
131
		postCreate: function(){	
130
			var headers = this.plugin.getHeaders();
132
			var headers = this.plugin.getHeaders();
131
			var location = this.plugin.getLocation();
133
			var location = this.plugin.getLocation();
132
			this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location);
134
			var loaded = this.plugin.getState();
133
			this.pluginDescription.textContent = headers.description || messages['A plugin for Eclipse Orion'];
135
			
136
			if (PageUtil.validateURLScheme(location)){
137
				var link = document.createElement("a"); //$NON-NLS-0$
138
				link.href = location;
139
				link.title = headers.name || formatLocationAsPluginName(location);
140
				link.textContent = headers.name || formatLocationAsPluginName(location);
141
				this.pluginTitle.appendChild(link);
142
			} else {
143
				this.pluginTitle.textContent = headers.name || formatLocationAsPluginName(location);
144
			}			
145
			
146
			if (loaded){
147
				switch (loaded){
148
					// Ignore active, starting and stopping states
149
					case "uninstalled":  //$NON-NLS-0$
150
						this.pluginStatus.textContent = messages['pluginStatusNotLoaded'];
151
						break;
152
					case "installed": //$NON-NLS-0$
153
						this.pluginStatus.textContent = messages['pluginStatusNotLoaded'];
154
						break;
155
					case "resolved": //$NON-NLS-0$
156
						this.pluginStatus.textContent = messages['pluginStatusNotRunning'];
157
						break;
158
				}
159
			}
160
			
161
			this.pluginDescription.textContent = headers.description || messages['A plugin for Orion'];
134
162
135
			// Plugin Links
163
			// Additional Links
136
			this.addPluginLink("Plugin", location);
137
			if (headers.website) {
164
			if (headers.website) {
138
				this.addPluginLink("Website", headers.website);
165
				this.addPluginLink(messages["Website"], headers.website);
139
			}
166
			}
140
			if (headers.license) {
167
			if (headers.license) {
141
				this.addPluginLink("License", headers.license);
168
				this.addPluginLink(messages["License"], headers.license);
142
			}
169
			}
143
			if (headers.login) {
170
			if (headers.login) {
144
				this.addPluginLink("Login", headers.login);
171
				this.addPluginLink(messages["Login"], headers.login);
145
			}
172
			}
146
			
173
			
147
			this.commandSpan.id = location;
174
			this.commandSpan.id = location;
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/plugin/PluginList.js (-2 / +39 lines)
Lines 282-288 Link Here
282
			});			
282
			});			
283
			this.commandService.addCommand(enablePluginCommand);
283
			this.commandService.addCommand(enablePluginCommand);
284
			this.commandService.registerCommandContribution("pluginCommand", "orion.enablePlugin", 4); //$NON-NLS-1$ //$NON-NLS-0$
284
			this.commandService.registerCommandContribution("pluginCommand", "orion.enablePlugin", 4); //$NON-NLS-1$ //$NON-NLS-0$
285
286
		
285
		
287
			var list = this.pluginList;
286
			var list = this.pluginList;
288
		
287
		
Lines 295-301 Link Here
295
			var plugins = this.settings.pluginRegistry.getPlugins();
294
			var plugins = this.settings.pluginRegistry.getPlugins();
296
			this.pluginTitle.textContent = messages['Plugins'];
295
			this.pluginTitle.textContent = messages['Plugins'];
297
			this.pluginCount.textContent = plugins.length;
296
			this.pluginCount.textContent = plugins.length;
298
297
			
298
			plugins.sort(this._sortPlugins); 
299
			
299
			// TODO maybe this should only be done once
300
			// TODO maybe this should only be done once
300
			this.explorer = new PluginListExplorer(this.commandService);
301
			this.explorer = new PluginListExplorer(this.commandService);
301
			this.pluginListTree = this.explorer.createTree(this.pluginList.id, new mExplorer.SimpleFlatModel(plugins, "plugin", function(item) { //$NON-NLS-1$ //$NON-NLS-0$
302
			this.pluginListTree = this.explorer.createTree(this.pluginList.id, new mExplorer.SimpleFlatModel(plugins, "plugin", function(item) { //$NON-NLS-1$ //$NON-NLS-0$
Lines 308-313 Link Here
308
//				pluginEntry.show();
309
//				pluginEntry.show();
309
//			}
310
//			}
310
		},
311
		},
312
		
313
		/**
314
		 * @name _sortPlugins
315
		 * @description sorts plugins by state then by name
316
		 * @function
317
		 * @private
318
		 * @param a first object to compare
319
		 * @param b second object to return
320
		 * @returns -1 for a first, 1 for b first, 0 if equals
321
		 */
322
		_sortPlugins: function(a, b) {
323
			var aState = a.getState();
324
			var bState = b.getState();
325
			if ((bState == "active" || bState == "starting") && (aState !== "active" && aState !== "starting")){ //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
326
				return -1;
327
			}			
328
			if ((aState == "active" || aState == "starting") && (bState !== "active" && bState !== "starting")){ //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
329
				return 1;
330
			}
331
			var aHeaders = a.getHeaders();
332
			var bHeaders = b.getHeaders();
333
			if (!aHeaders && !bHeaders){
334
				return 0;
335
			}
336
			if (!aHeaders){
337
				return -1;
338
			}
339
			if (!bHeaders){
340
				return 1;
341
			}
342
			var n1 = aHeaders.name && aHeaders.name.toLowerCase();
343
			var n2 = bHeaders.name && bHeaders.name.toLowerCase();
344
			if (n1 < n2) { return -1; }
345
			if (n1 > n2) { return 1; }
346
			return 0;
347
		},
311
				
348
				
312
		pluginURLFocus: function(){
349
		pluginURLFocus: function(){
313
			this.pluginUrlEntry.value = '';
350
			this.pluginUrlEntry.value = '';
(-)a/bundles/org.eclipse.orion.client.ui/web/settings/settings.css (-4 / +2 lines)
Lines 282-290 Link Here
282
282
283
.plugin-entry {
283
.plugin-entry {
284
	border-bottom: solid 1px #EEE;
284
	border-bottom: solid 1px #EEE;
285
	padding-bottom: 10px;
285
	padding: 10px 10px 10px 10px;
286
287
	padding: 15px 10px 15px 10px;
288
}
286
}
289
287
290
.plugin-icon {
288
.plugin-icon {
Lines 360-366 Link Here
360
	clear: left;
358
	clear: left;
361
	outline: none;
359
	outline: none;
362
	line-height:14px;
360
	line-height:14px;
363
	padding-top: 10px;
361
	padding-top: 5px;
364
}
362
}
365
363
366
.serviceCount {
364
.serviceCount {

Return to bug 438886