FELIX-1988 Modify license display to use the JQuery load() function thus not requiring an <iframe>. Load the details into a <pre> element with rounded corner and dynamic height.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@912186 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 c94e84a..98f7c7d 100644
--- a/webconsole/src/main/resources/res/ui/license.css
+++ b/webconsole/src/main/resources/res/ui/license.css
@@ -26,7 +26,6 @@
}
#licenseLeft a {
display: block;
- width: 100%;
margin: 0;
text-decoration: none;
}
@@ -36,5 +35,5 @@
}
#licenseDetails {
width: 100%;
- height: 50em;
+ padding: 1em;
}
diff --git a/webconsole/src/main/resources/res/ui/license.js b/webconsole/src/main/resources/res/ui/license.js
index 35018d4..f378161 100644
--- a/webconsole/src/main/resources/res/ui/license.js
+++ b/webconsole/src/main/resources/res/ui/license.js
@@ -35,11 +35,16 @@
{
var entry = theBundleData.files[name];
var buttons = "";
+ var firstPage = null;
for (var idx in entry)
{
var descr = entry[idx];
var jar = descr.jar ? '&jar=' + descr.jar : ''; // inner jar attribute
- buttons += '<a href="' + pluginRoot + '?bid=' + bundleId + '&url=' + descr.path + jar + '" target="licenseDetails">' + descr.url + '</a> ';
+ var link = pluginRoot + '?bid=' + bundleId + '&url=' + descr.path + jar;
+ buttons += '<a href="' + link + '">' + descr.url + '</a> ';
+ if (!firstPage) {
+ firstPage = link;
+ }
}
if (buttons)
{
@@ -52,9 +57,19 @@
licenseButtons.html("<h1>" + title + "</h1>" + innerHTML);
}
- licenseDetails.html("");
+ if (firstPage) {
+ licenseDetails.load(firstPage);
+ } else {
+ licenseDetails.html("");
+ }
+
$("#licenseLeft a").removeClass('ui-state-default ui-corner-all');
$("#licenseLeft #" +bundleId).addClass('ui-state-default ui-corner-all');
+
+ $('#licenseButtons a').click(function() {
+ licenseDetails.load(this.href);
+ return false;
+ });
}