Port example list to Bootstrap
This commit is contained in:
+204
-292
@@ -1,299 +1,211 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
<!-- This is the example list source: if you are trying to look at the
|
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
source of an example, YOU ARE IN THE WRONG PLACE. -->
|
<link rel="stylesheet" href="examples.css" type="text/css">
|
||||||
<title>OpenLayers Examples</title>
|
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<link rel="alternate" href="example-list.xml" type="application/atom+xml" />
|
<style>
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
.example {
|
||||||
<style type="text/css">
|
height: 140px;
|
||||||
html, body {
|
padding: 3px;
|
||||||
margin: 0;
|
background-color: #eee;
|
||||||
padding: 0;
|
border-radius: 3px;
|
||||||
line-height: 1.25em;
|
margin-bottom: 10px;
|
||||||
}
|
overflow: auto;
|
||||||
#logo {
|
}
|
||||||
text-shadow: 2px 2px 3px gray;
|
.example:hover {
|
||||||
color: white;
|
background-color: #ddd;
|
||||||
vertical-align: middle;
|
}
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
left: 5px;
|
|
||||||
font-size: 34px;
|
|
||||||
font-family: "Trebuchet MS",Helvetica,Arial,sans-serif;
|
|
||||||
}
|
|
||||||
#logo img {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.ex_container{
|
|
||||||
}
|
|
||||||
.ex_container a {
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 5px 1em;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.ex_container a:hover {
|
|
||||||
background-color: #eeeeee;
|
|
||||||
}
|
|
||||||
.ex_title{
|
|
||||||
display: inline;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.ex_tags{
|
|
||||||
display: inline;
|
|
||||||
font-size: smaller;
|
|
||||||
font-style: italic;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.ex_filename {
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: #ccc
|
|
||||||
}
|
|
||||||
.ex_description{
|
|
||||||
color: #222;
|
|
||||||
padding: 3px;
|
|
||||||
}
|
|
||||||
.ex_classes{
|
|
||||||
font-size: .7em;
|
|
||||||
color: gray;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#toc {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
#filter {
|
|
||||||
position: fixed;
|
|
||||||
text-align: center;
|
|
||||||
top: 0px;
|
|
||||||
background: #9D9FA1;
|
|
||||||
width: 100%;
|
|
||||||
padding: 1.3em 0;
|
|
||||||
}
|
|
||||||
#examples {
|
|
||||||
overflow: auto;
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#examples ul {
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin-top: 4em;
|
|
||||||
}
|
|
||||||
#examples ul li {
|
|
||||||
display: inline;
|
|
||||||
float: left;
|
|
||||||
width: 350px;
|
|
||||||
margin: 10px 0 0 10px;
|
|
||||||
padding: 0;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
#examples .mainlink {
|
|
||||||
height: 8em;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
#exwin {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 30%;
|
|
||||||
width: 70%;
|
|
||||||
height: 100%;
|
|
||||||
border: none;
|
|
||||||
border-left: 1px solid #cccccc;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
@media only screen and (max-width: 600px) {
|
|
||||||
#examples ul {
|
|
||||||
margin-top: 100px;
|
|
||||||
}
|
|
||||||
#filter {
|
|
||||||
padding-top: 50px;
|
|
||||||
}
|
|
||||||
#examples ul li {
|
|
||||||
margin-left: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
border-width: 1px 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#examples .mainlink {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
#examples .ex_tags, #examples .ex_filename {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript" src="Jugl.js"></script>
|
|
||||||
<script type="text/javascript" src="example-list.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var template, target;
|
|
||||||
|
|
||||||
function listExamples(examples) {
|
::-webkit-scrollbar {
|
||||||
target.innerHTML = "";
|
width: 8px;
|
||||||
var node = template.process({
|
}
|
||||||
context: {examples: examples},
|
|
||||||
clone: true,
|
::-webkit-scrollbar-button {
|
||||||
parent: target
|
width: 0;
|
||||||
});
|
height: 0;
|
||||||
document.getElementById("count").innerHTML = "(" + examples.length + ")";
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
var timerId;
|
::-webkit-scrollbar-thumb {
|
||||||
function inputChange() {
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
if(timerId) {
|
-webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.10),inset 0 -1px 0 rgba(0, 0, 0, 0.07);
|
||||||
window.clearTimeout(timerId);
|
}
|
||||||
}
|
|
||||||
var text = this.value;
|
::-webkit-scrollbar-thumb:hover {
|
||||||
timerId = window.setTimeout(function() {
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
filterList(text);
|
}
|
||||||
}, 500);
|
|
||||||
}
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: transparent;
|
||||||
function filterList(text) {
|
}
|
||||||
var examples;
|
</style>
|
||||||
if(text.length < 2) {
|
<script type="text/javascript" src="Jugl.js"></script>
|
||||||
examples = info.examples;
|
<script type="text/javascript" src="example-list.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var template, target;
|
||||||
|
|
||||||
|
function listExamples(examples) {
|
||||||
|
target.innerHTML = "";
|
||||||
|
var node = template.process({
|
||||||
|
context: {examples: examples},
|
||||||
|
clone: true,
|
||||||
|
parent: target
|
||||||
|
});
|
||||||
|
document.getElementById("count").innerHTML = "(" + examples.length + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
var timerId;
|
||||||
|
function inputChange() {
|
||||||
|
if (timerId) {
|
||||||
|
window.clearTimeout(timerId);
|
||||||
|
}
|
||||||
|
var text = this.value;
|
||||||
|
timerId = window.setTimeout(function() {
|
||||||
|
filterList(text);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterList(text) {
|
||||||
|
var examples;
|
||||||
|
if (text.length < 2) {
|
||||||
|
examples = info.examples;
|
||||||
|
} else {
|
||||||
|
var words = text.split(/\W+/);
|
||||||
|
var scores = {};
|
||||||
|
for(var i=0; i<words.length; ++i) {
|
||||||
|
var word = words[i].toLowerCase();
|
||||||
|
var dict = info.index[word];
|
||||||
|
var updateScores = function() {
|
||||||
|
for(exIndex in dict) {
|
||||||
|
var count = dict[exIndex];
|
||||||
|
if(scores[exIndex]) {
|
||||||
|
if(scores[exIndex][word]) {
|
||||||
|
scores[exIndex][word] += count;
|
||||||
|
} else {
|
||||||
|
scores[exIndex][word] = count;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var words = text.split(/\W+/);
|
scores[exIndex] = {};
|
||||||
var scores = {};
|
scores[exIndex][word] = count;
|
||||||
for(var i=0; i<words.length; ++i) {
|
|
||||||
var word = words[i].toLowerCase();
|
|
||||||
var dict = info.index[word];
|
|
||||||
var updateScores = function() {
|
|
||||||
for(exIndex in dict) {
|
|
||||||
var count = dict[exIndex];
|
|
||||||
if(scores[exIndex]) {
|
|
||||||
if(scores[exIndex][word]) {
|
|
||||||
scores[exIndex][word] += count;
|
|
||||||
} else {
|
|
||||||
scores[exIndex][word] = count;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
scores[exIndex] = {};
|
|
||||||
scores[exIndex][word] = count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if(dict) {
|
|
||||||
updateScores();
|
|
||||||
} else {
|
|
||||||
var r;
|
|
||||||
for (idx in info.index) {
|
|
||||||
r = new RegExp(word);
|
|
||||||
if (r.test(idx)) {
|
|
||||||
dict = info.index[idx];
|
|
||||||
updateScores();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
examples = [];
|
|
||||||
for(var j in scores) {
|
|
||||||
var ex = info.examples[j];
|
|
||||||
ex.score = scores[j];
|
|
||||||
examples.push(ex);
|
|
||||||
}
|
|
||||||
// sort examples by first by number of words matched, then
|
|
||||||
// by word frequency
|
|
||||||
examples.sort(function(a, b) {
|
|
||||||
var cmp;
|
|
||||||
var aWords = 0, bWords = 0;
|
|
||||||
var aScore = 0, bScore = 0;
|
|
||||||
for(var i in a.score) {
|
|
||||||
aScore += a.score[i];
|
|
||||||
aWords += 1;
|
|
||||||
}
|
|
||||||
for(var j in b.score) {
|
|
||||||
bScore += b.score[j];
|
|
||||||
bWords += 1;
|
|
||||||
}
|
|
||||||
if(aWords == bWords) {
|
|
||||||
cmp = bScore - aScore;
|
|
||||||
} else {
|
|
||||||
cmp = bWords - aWords;
|
|
||||||
}
|
|
||||||
return cmp;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
listExamples(examples);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function showAll() {
|
|
||||||
document.getElementById("keywords").value = "";
|
|
||||||
listExamples(info.examples);
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseQuery() {
|
|
||||||
var params = {};
|
|
||||||
var list = window.location.search.substring(1).split("&");
|
|
||||||
for(var i=0; i<list.length; ++i) {
|
|
||||||
var pair = list[i].split("=");
|
|
||||||
if(pair.length == 2) {
|
|
||||||
params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(params["q"]) {
|
|
||||||
var input = document.getElementById("keywords");
|
|
||||||
input.value = params["q"];
|
|
||||||
inputChange.call(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.onload = function() {
|
|
||||||
for(var i=0; i<info.examples.length; ++i) {
|
|
||||||
info.examples[i].link += window.location.search;
|
|
||||||
}
|
|
||||||
//document.getElementById('keywords').focus();
|
|
||||||
template = new jugl.Template("template");
|
|
||||||
target = document.getElementById("examples");
|
|
||||||
listExamples(info.examples);
|
|
||||||
document.getElementById("keywords").onkeyup = inputChange;
|
|
||||||
parseQuery();
|
|
||||||
};
|
};
|
||||||
</script>
|
if (dict) {
|
||||||
</head>
|
updateScores();
|
||||||
<body>
|
} else {
|
||||||
<div id="toc">
|
var r;
|
||||||
<div id="filter">
|
for (idx in info.index) {
|
||||||
<div id="logo">
|
r = new RegExp(word);
|
||||||
<img src="http://www.openlayers.org/images/OpenLayers.trac.png"
|
if (r.test(idx)) {
|
||||||
/>
|
dict = info.index[idx];
|
||||||
OpenLayers 3
|
updateScores();
|
||||||
</div>
|
}
|
||||||
<input autofocus placeholder="filter by keywords..." type="text" id="keywords" />
|
}
|
||||||
<span id="count"></span>
|
}
|
||||||
<a href="javascript:void showAll();">show all</a>
|
}
|
||||||
</div>
|
examples = [];
|
||||||
<div id="examples"></div>
|
for (var j in scores) {
|
||||||
|
var ex = info.examples[j];
|
||||||
|
ex.score = scores[j];
|
||||||
|
examples.push(ex);
|
||||||
|
}
|
||||||
|
// sort examples by first by number of words matched, then
|
||||||
|
// by word frequency
|
||||||
|
examples.sort(function(a, b) {
|
||||||
|
var cmp;
|
||||||
|
var aWords = 0, bWords = 0;
|
||||||
|
var aScore = 0, bScore = 0;
|
||||||
|
for (var i in a.score) {
|
||||||
|
aScore += a.score[i];
|
||||||
|
aWords += 1;
|
||||||
|
}
|
||||||
|
for (var j in b.score) {
|
||||||
|
bScore += b.score[j];
|
||||||
|
bWords += 1;
|
||||||
|
}
|
||||||
|
if (aWords == bWords) {
|
||||||
|
cmp = bScore - aScore;
|
||||||
|
} else {
|
||||||
|
cmp = bWords - aWords;
|
||||||
|
}
|
||||||
|
return cmp;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
listExamples(examples);
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseQuery() {
|
||||||
|
var params = {};
|
||||||
|
var list = window.location.search.substring(1).split("&");
|
||||||
|
for (var i = 0; i < list.length; ++i) {
|
||||||
|
var pair = list[i].split("=");
|
||||||
|
if (pair.length == 2) {
|
||||||
|
params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (params["q"]) {
|
||||||
|
var input = document.getElementById("keywords");
|
||||||
|
input.value = params["q"];
|
||||||
|
inputChange.call(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
for (var i = 0; i < info.examples.length; ++i) {
|
||||||
|
info.examples[i].link += window.location.search;
|
||||||
|
}
|
||||||
|
// document.getElementById('keywords').focus();
|
||||||
|
template = new jugl.Template("template");
|
||||||
|
target = document.getElementById("examples");
|
||||||
|
listExamples(info.examples);
|
||||||
|
document.getElementById("keywords").onkeyup = inputChange;
|
||||||
|
parseQuery();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>Simple example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="example-list.html">OpenLayers 3 Examples</a>
|
||||||
|
<form class="navbar-search pull-left">
|
||||||
|
<input type="text" id="keywords" class="search-query" placeholder="Search">
|
||||||
|
<span id="count"></span>
|
||||||
|
</form>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><a href="https://github.com/openlayers/ol3"><i class="icon-github"></i></a></li>
|
||||||
|
<li><a href="https://twitter.com/openlayers"><i class="icon-twitter"></i></a></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: none;">
|
</div>
|
||||||
<ul id="template">
|
</div>
|
||||||
<li class="ex_container" jugl:repeat="example examples">
|
|
||||||
<a jugl:attributes="href example.link" class="mainlink"
|
<div class="container-fluid">
|
||||||
target="_blank">
|
|
||||||
<h5 class="ex_title">
|
<div id="examples"></div>
|
||||||
<span jugl:replace="example.title">title</span><br>
|
|
||||||
<span class="ex_filename" jugl:content="'(' + example.example + ')'">filename</span>
|
<div style="display: none;">
|
||||||
</h5>
|
<div id="template">
|
||||||
<div class="ex_description" jugl:content="example.shortdesc">
|
<div class="span4 example" jugl:repeat="example examples">
|
||||||
Short Description goes here
|
<a jugl:attributes="href example.link" class="mainlink" target="_blank">
|
||||||
</div>
|
<strong><span jugl:replace="example.title">title</span></strong>
|
||||||
<p class="ex_classes" jugl:content="example.classes">
|
<small jugl:content="'(' + example.example + ')'"></small>
|
||||||
Related Classes go here
|
</a>
|
||||||
</p>
|
<p><div jugl:content="example.shortdesc"></div></p>
|
||||||
<div class="ex_tags" jugl:content="'...tagged with ' + example.tags">
|
<p><div jugl:content="example.classes"></div></p>
|
||||||
|
<p><small jugl:content="'tags: ' + example.tags"></small></p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 id="title">Stamen example</h4>
|
<h4 id="title">Stamen example</h4>
|
||||||
<p id="shortdesc">Example of a <a href="http://maps.stamen.com">Stamen</a> tile source.</p>
|
<p id="shortdesc">Example of a Stamen tile source.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="stamen.js" target="_blank">stamen.js source</a> to see how this is done.</p>
|
<p>See the <a href="stamen.js" target="_blank">stamen.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/**
|
|
||||||
* Basic Typography
|
|
||||||
*/
|
|
||||||
body {
|
|
||||||
font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 85%;
|
|
||||||
color: #222;
|
|
||||||
background: #fff;
|
|
||||||
margin: 1em 1.5em;
|
|
||||||
}
|
|
||||||
pre, code {
|
|
||||||
margin: 1.5em 0;
|
|
||||||
white-space: pre;
|
|
||||||
}
|
|
||||||
pre, code {
|
|
||||||
font: 1em 'andale mono', 'lucida console', monospace;
|
|
||||||
line-height:1.5;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #436976;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
|
||||||
color: #003a6b;
|
|
||||||
background-color: transparent;
|
|
||||||
font: 100% Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding-top: 0.5em;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 130%;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
border-bottom: 1px solid #fcb100;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
font-size: 120%;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
border-bottom: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
h3 {
|
|
||||||
font-size: 110%;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
h4 {
|
|
||||||
font-size: 100%;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
h5 {
|
|
||||||
font-size: 100%;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
h6 {
|
|
||||||
font-size: 80%;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
#tags {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#shortdesc {
|
|
||||||
margin-bottom: 2em;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user