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.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;
+ });
}