Fixed FELIX-2207 /License plugin should support Bundle-License manifest header/
https://issues.apache.org/jira/browse/FELIX-2207
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@934400 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/license.css b/webconsole/src/main/resources/res/ui/license.css
index 98f7c7d..bf65987 100644
--- a/webconsole/src/main/resources/res/ui/license.css
+++ b/webconsole/src/main/resources/res/ui/license.css
@@ -37,3 +37,8 @@
width: 100%;
padding: 1em;
}
+#licenseDetails iframe {
+ width: 100%;
+ height: 35em;
+ border: none;
+}
diff --git a/webconsole/src/main/resources/res/ui/license.js b/webconsole/src/main/resources/res/ui/license.js
index ca3744f..8fc2891 100644
--- a/webconsole/src/main/resources/res/ui/license.js
+++ b/webconsole/src/main/resources/res/ui/license.js
@@ -59,6 +59,7 @@
link += descr.jar + "!/"; // inner jar attribute
}
link += descr.path;
+ if (descr.path.indexOf('http:') == 0 || descr.path.indexOf('ftp:') == 0) link = descr.path;
buttons += '<a href="' + link + '">' + descr.url + '</a> ';
@@ -79,7 +80,7 @@
}
if (firstPage) {
- $.get(firstPage, insertLicenseData);
+ openLicenseLink(firstPage);
} else {
licenseDetails.html("");
}
@@ -88,11 +89,19 @@
$("#licenseLeft #" +bundleIndex).addClass('ui-state-default ui-corner-all');
$('#licenseButtons a').click(function() {
- $.get(this.href, insertLicenseData);
- return false;
+ openLicenseLink(this.href);
+ return false;
});
}
+function openLicenseLink(uri) {
+ if (uri.indexOf(window.location.href) == 0 || uri.indexOf(pluginRoot) == 0) { // local URI
+ $.get(uri, insertLicenseData);
+ } else {
+ licenseDetails.html( '<iframe frameborder="0" src="' + uri+ '"></iframe>' );
+ }
+}
+
$(document).ready(function() {
// init elements cache