Skip to content

Commit

Permalink
Docs: use proper XCP release names in API docs
Browse files Browse the repository at this point in the history
Consider XCP 0.5/midnight-ride to be the first release of XCP, and the one in
which all API elements were introduced.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
  • Loading branch information
robhoes committed Nov 21, 2011
1 parent db08f15 commit 419d9d5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 7 deletions.
1 change: 1 addition & 0 deletions ocaml/doc/apidoc.js
Expand Up @@ -328,6 +328,7 @@ function release_list()
{
html = '<h2>Release notes</h2>';

releases = releases.slice(releases.indexOf(first_release))
for (i in releases) {
r = releases[i];
html += '<a href="?r=' + r + '">' + get_release_name(r) + '</a><br>';
Expand Down
23 changes: 22 additions & 1 deletion ocaml/doc/branding.js
Expand Up @@ -31,8 +31,29 @@ function make_header(t) {
document.getElementById('header').innerHTML = html;
}

first_release = 'midnight-ride';

function get_release_name(s)
{
return s;
switch (s) {
case 'rio':
case 'miami':
case 'symc':
case 'orlando':
case 'orlando-update-1':
case 'george':
case 'midnight-ride':
return 'XCP 0.5';
break;
case 'cowley':
return 'XCP 1.0';
break;
case 'boston':
return 'XCP 1.5';
break;
default:
return 'Unreleased';
break;
}
}

7 changes: 3 additions & 4 deletions ocaml/doc/citrix/branding.js
Expand Up @@ -22,6 +22,8 @@ function make_header(t) {
document.getElementById('header').innerHTML = html;
}

first_release = 'rio';

function get_release_name(s)
{
switch (s) {
Expand Down Expand Up @@ -52,11 +54,8 @@ function get_release_name(s)
case 'boston':
return 'XenServer 6.0';
break;
case 'tampa':
return 'Unreleased';
break;
default:
return s;
return 'Unreleased';
break;
}
}
Expand Down
15 changes: 13 additions & 2 deletions ocaml/doc/index.html
Expand Up @@ -12,8 +12,19 @@
make_title();
if (cls != "")
document.write('<script src="api/', cls, '.json" type="text/JavaScript"><\/script>');
if (rel != "")
document.write('<script src="api/', rel, '.json" type="text/JavaScript"><\/script>');
if (rel != "") {
if (rel == first_release)
rels = releases.slice(0, releases.indexOf(first_release) + 1);
else
rels = [rel];
function ld(info) {
if (rels.length > 0)
load_script('api/' + rels.pop() + '.json', function(){return ld(info.concat(release_info));});
else
release_info = info;
}
ld([]);
}
</script>
<link rel="stylesheet" href="style.css" />
</head>
Expand Down
12 changes: 12 additions & 0 deletions ocaml/doc/main.js
Expand Up @@ -84,3 +84,15 @@ function compare(a, b)
return 0;
}

// include a JS script
function load_script(url, callback)
{
var head= document.getElementsByTagName('head')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= url;
script.onreadystatechange = callback;
script.onload = callback
head.appendChild(script);
}

0 comments on commit 419d9d5

Please sign in to comment.