Cleanup experimental notice
With bootstrap js always included there is no need to add own js to dismiss it. Only generate the notice for experimental pages, no need to have js for that.
This commit is contained in:
@@ -117,11 +117,13 @@
|
|||||||
This example uses OpenLayers v<span>{{ olVersion }}</span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
|
This example uses OpenLayers v<span>{{ olVersion }}</span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="experimental-notice" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
|
{{#if ./experimental}}
|
||||||
|
<div id="experimental-notice" class="alert alert-warning alert-dismissible" role="alert">
|
||||||
<button id="experimental-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button id="experimental-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
This example uses features that are not part of the stable API and subject to change between releases. Consult the <a href="https://openlayers.org/en/latest/apidoc/">API documentation</a>
|
This example uses features that are not part of the stable API and subject to change between releases. Consult the <a href="https://openlayers.org/en/latest/apidoc/">API documentation</a>
|
||||||
to see what is supported in the latest release.
|
to see what is supported in the latest release.
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<a href="" class="codepen-button float-right"><i class="fa fa-codepen fa-lg"></i> Edit</a>
|
<a href="" class="codepen-button float-right"><i class="fa fa-codepen fa-lg"></i> Edit</a>
|
||||||
@@ -264,14 +266,6 @@
|
|||||||
document.cookie = cookieText;
|
document.cookie = cookieText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var experimentalNotice = document.getElementById('experimental-notice');
|
|
||||||
if (window.experimental) {
|
|
||||||
experimentalNotice.style.display = 'block';
|
|
||||||
document.getElementById('experimental-dismiss').onclick = function() {
|
|
||||||
experimentalNotice.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -291,15 +291,11 @@ class ExampleBuilder {
|
|||||||
jsSource = jsSource.replace('new Worker()', "new Worker('./worker.js')");
|
jsSource = jsSource.replace('new Worker()', "new Worker('./worker.js')");
|
||||||
|
|
||||||
data.js = {
|
data.js = {
|
||||||
tag: `<script src="${this.common}.js"></script><script src="${jsName}"></script>`,
|
tag: `<script src="${this.common}.js"></script>
|
||||||
|
<script src="${jsName}"></script>`,
|
||||||
source: jsSource,
|
source: jsSource,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.experimental) {
|
|
||||||
const prelude = '<script>window.experimental = true;</script>';
|
|
||||||
data.js.tag = prelude + data.js.tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for worker js
|
// check for worker js
|
||||||
const workerName = `${name}.worker.js`;
|
const workerName = `${name}.worker.js`;
|
||||||
const workerPath = path.join(data.dir, workerName);
|
const workerPath = path.join(data.dir, workerName);
|
||||||
|
|||||||
Reference in New Issue
Block a user