|
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; |