mirror of https://github.com/CGAL/cgal
If the current version of the doc is not in the array, display it
anyway. To be etested.
This commit is contained in:
parent
b289509fce
commit
726a7fccc1
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
||||||
var url_local = /.*\/doc_output\//;
|
var url_local = /.*\/doc_output\//;
|
||||||
|
var current_version_local = '4.13-beta1'
|
||||||
var all_versions = [
|
var all_versions = [
|
||||||
'master',
|
'master',
|
||||||
'latest',
|
'latest',
|
||||||
|
|
@ -21,7 +22,6 @@
|
||||||
|
|
||||||
function build_select(current_version) {
|
function build_select(current_version) {
|
||||||
var buf = ['<select>'];
|
var buf = ['<select>'];
|
||||||
|
|
||||||
$.each(all_versions, function(id) {
|
$.each(all_versions, function(id) {
|
||||||
var version = all_versions[id];
|
var version = all_versions[id];
|
||||||
buf.push('<option value="' + version + '"');
|
buf.push('<option value="' + version + '"');
|
||||||
|
|
@ -32,7 +32,11 @@
|
||||||
}
|
}
|
||||||
buf.push('</option>');
|
buf.push('</option>');
|
||||||
});
|
});
|
||||||
|
if ( !all_versions.includes(current_version)) {
|
||||||
|
buf.push('<option value="' + current_version + '"');
|
||||||
|
buf.push(' selected="selected">' + current_version);
|
||||||
|
buf.push('</option>');
|
||||||
|
}
|
||||||
buf.push('</select>');
|
buf.push('</select>');
|
||||||
return buf.join('');
|
return buf.join('');
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +81,7 @@
|
||||||
else {
|
else {
|
||||||
match = url_local.exec(window.location.href);
|
match = url_local.exec(window.location.href);
|
||||||
if (match) {
|
if (match) {
|
||||||
var version = '4.11';
|
var version = current_version_local;
|
||||||
var select = build_select(version);
|
var select = build_select(version);
|
||||||
spanNode.innerHTML=select;
|
spanNode.innerHTML=select;
|
||||||
$('.version_menu select').bind('change', on_switch);
|
$('.version_menu select').bind('change', on_switch);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
||||||
var url_local = /.*\/doc_output\//;
|
var url_local = /.*\/doc_output\//;
|
||||||
|
var current_version_local = '4.13-beta1'
|
||||||
var all_versions = [
|
var all_versions = [
|
||||||
'master',
|
'master',
|
||||||
'latest',
|
'latest',
|
||||||
|
|
@ -21,7 +22,6 @@
|
||||||
|
|
||||||
function build_select(current_version) {
|
function build_select(current_version) {
|
||||||
var buf = ['<select>'];
|
var buf = ['<select>'];
|
||||||
|
|
||||||
$.each(all_versions, function(id) {
|
$.each(all_versions, function(id) {
|
||||||
var version = all_versions[id];
|
var version = all_versions[id];
|
||||||
buf.push('<option value="' + version + '"');
|
buf.push('<option value="' + version + '"');
|
||||||
|
|
@ -32,7 +32,11 @@
|
||||||
}
|
}
|
||||||
buf.push('</option>');
|
buf.push('</option>');
|
||||||
});
|
});
|
||||||
|
if ( !all_versions.includes(current_version)) {
|
||||||
|
buf.push('<option value="' + current_version + '"');
|
||||||
|
buf.push(' selected="selected">' + current_version);
|
||||||
|
buf.push('</option>');
|
||||||
|
}
|
||||||
buf.push('</select>');
|
buf.push('</select>');
|
||||||
return buf.join('');
|
return buf.join('');
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +81,7 @@
|
||||||
else {
|
else {
|
||||||
match = url_local.exec(window.location.href);
|
match = url_local.exec(window.location.href);
|
||||||
if (match) {
|
if (match) {
|
||||||
var version = '4.11';
|
var version = current_version_local;
|
||||||
var select = build_select(version);
|
var select = build_select(version);
|
||||||
spanNode.innerHTML=select;
|
spanNode.innerHTML=select;
|
||||||
$('.version_menu select').bind('change', on_switch);
|
$('.version_menu select').bind('change', on_switch);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+))\//;
|
||||||
var url_local = /.*\/doc_output\//;
|
var url_local = /.*\/doc_output\//;
|
||||||
|
var current_version_local = '4.13-beta1'
|
||||||
var all_versions = [
|
var all_versions = [
|
||||||
'master',
|
'master',
|
||||||
'latest',
|
'latest',
|
||||||
|
|
@ -21,7 +22,6 @@
|
||||||
|
|
||||||
function build_select(current_version) {
|
function build_select(current_version) {
|
||||||
var buf = ['<select>'];
|
var buf = ['<select>'];
|
||||||
|
|
||||||
$.each(all_versions, function(id) {
|
$.each(all_versions, function(id) {
|
||||||
var version = all_versions[id];
|
var version = all_versions[id];
|
||||||
buf.push('<option value="' + version + '"');
|
buf.push('<option value="' + version + '"');
|
||||||
|
|
@ -32,7 +32,11 @@
|
||||||
}
|
}
|
||||||
buf.push('</option>');
|
buf.push('</option>');
|
||||||
});
|
});
|
||||||
|
if ( !all_versions.includes(current_version)) {
|
||||||
|
buf.push('<option value="' + current_version + '"');
|
||||||
|
buf.push(' selected="selected">' + current_version);
|
||||||
|
buf.push('</option>');
|
||||||
|
}
|
||||||
buf.push('</select>');
|
buf.push('</select>');
|
||||||
return buf.join('');
|
return buf.join('');
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +81,7 @@
|
||||||
else {
|
else {
|
||||||
match = url_local.exec(window.location.href);
|
match = url_local.exec(window.location.href);
|
||||||
if (match) {
|
if (match) {
|
||||||
var version = '4.11';
|
var version = current_version_local;
|
||||||
var select = build_select(version);
|
var select = build_select(version);
|
||||||
spanNode.innerHTML=select;
|
spanNode.innerHTML=select;
|
||||||
$('.version_menu select').bind('change', on_switch);
|
$('.version_menu select').bind('change', on_switch);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue