New template that removes Bootstrap and jQuery from code snippet
This commit is contained in:
81
config/examples/strapless.html
Normal file
81
config/examples/strapless.html
Normal file
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
{{{ extraHead.local }}}
|
||||
{{{ css.tag }}}
|
||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="navbar" role="navigation">
|
||||
<div class="container" id="navbar-inner-container">
|
||||
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{{ contents }}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<h4 id="title">{{ title }}</h4>
|
||||
<p id="shortdesc">{{ shortdesc }}</p>
|
||||
<div id="docs">{{ md docs }}</div>
|
||||
<div id="api-links">Related API documentation: {{{ js.apiHtml }}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div id="source-controls">
|
||||
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
|
||||
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
||||
</div>
|
||||
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/library/pure/">
|
||||
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
||||
<input type="hidden" name="wrap" value="l">
|
||||
<input type="hidden" name="resources" value="http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||
</form>
|
||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>
|
||||
{{ extraHead.remote }}
|
||||
{{#if css.source}}
|
||||
<style>
|
||||
{{ css.source }}
|
||||
</style>
|
||||
{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
{{ contents }}
|
||||
<script>
|
||||
{{ js.source }}
|
||||
</script>
|
||||
</body>
|
||||
</html></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="./resources/common.js"></script>
|
||||
<script src="./resources/prism/prism.min.js"></script>
|
||||
{{{ js.tag }}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -36,8 +36,19 @@
|
||||
var urlMode = window.location.href.match(/mode=([a-z0-9\-]+)\&?/i);
|
||||
var curMode = urlMode ? urlMode[1] : 'advanced';
|
||||
|
||||
var modeChangedMethod = function() {
|
||||
var newMode = this.value;
|
||||
for (var mode in possibleModes) {
|
||||
if (possibleModes.hasOwnProperty(mode)) {
|
||||
var option = document.createElement('option');
|
||||
var modeTxt = possibleModes[mode];
|
||||
option.value = mode;
|
||||
option.innerHTML = modeTxt;
|
||||
option.selected = curMode === mode;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
select.onchange = function(event) {
|
||||
var newMode = event.target.value;
|
||||
var search = window.location.search.substring(1);
|
||||
var baseUrl = window.location.href.split('?')[0];
|
||||
var chunks = search ? search.split('&') : [];
|
||||
@@ -61,18 +72,6 @@
|
||||
location.href = baseUrl + '?' + pairs.join('&');
|
||||
};
|
||||
|
||||
for (var mode in possibleModes) {
|
||||
if (possibleModes.hasOwnProperty(mode)) {
|
||||
var option = document.createElement('option');
|
||||
var modeTxt = possibleModes[mode];
|
||||
option.value = mode;
|
||||
option.innerHTML = modeTxt;
|
||||
option.selected = curMode === mode;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
$(select).change(modeChangedMethod);
|
||||
select.className = 'input-medium';
|
||||
|
||||
form.className = 'navbar-form pull-right';
|
||||
|
||||
Reference in New Issue
Block a user