Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c53a46d7d | |||
| 962473c3ab | |||
| 57ee7f52fd | |||
| 7985f030fa | |||
| fd8df2949b | |||
| 6fc6450630 | |||
| 1e25fc5585 | |||
| b3ac1afd00 | |||
| bd9092199b | |||
| 84cad42f6d | |||
| 516c1b39f7 | |||
| ef9db32dda | |||
| 9b734a3335 | |||
| f150259eee | |||
| 849774dceb | |||
| bac0f304de | |||
| c2bb8a27f0 | |||
| 10ee3b644c | |||
| 881373b178 | |||
| 13db9a5038 | |||
| 5d14b9e2d4 | |||
| 17c3936ab6 | |||
| 1ac4ed574f | |||
| 1d3c4bf4e7 | |||
| 5e603e0889 | |||
| 213d1ac0fe | |||
| 934e52d75a | |||
| 4dc48d748e | |||
| 535febbd07 | |||
| ea546e820e | |||
| 9cef8d2818 | |||
| acb618e473 | |||
| 80887d9deb | |||
| 10e299148e | |||
| 92cad64411 | |||
| dc9c5b3cfe | |||
| e9c319cb5e | |||
| 406ea86fb7 | |||
| 1f8c98db8c | |||
| 453f8499d6 | |||
| de8bd80c7d | |||
| 5a66d6e728 | |||
| 021fd236f9 | |||
| 447d9ec05b |
@@ -1,6 +0,0 @@
|
|||||||
*.pyc
|
|
||||||
/build
|
|
||||||
/examples/*.html.png
|
|
||||||
/examples/example-list.js
|
|
||||||
/examples/example-list.xml
|
|
||||||
/node_modules/
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
before_install:
|
|
||||||
- "sudo pip install -r requirements.txt"
|
|
||||||
- "npm install -g npm && npm install"
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- "rm src/ol/renderer/webgl/*shader.js"
|
|
||||||
|
|
||||||
script: "./build.py ci"
|
|
||||||
-58
@@ -1,58 +0,0 @@
|
|||||||
OpenLayers contributors:
|
|
||||||
|
|
||||||
* Antoine Abt
|
|
||||||
* Mike Adair
|
|
||||||
* Jeff Adams
|
|
||||||
* Seb Benthall
|
|
||||||
* Bruno Binet
|
|
||||||
* Stéphane Brunner
|
|
||||||
* Howard Butler
|
|
||||||
* Bertil Chaupis
|
|
||||||
* John Cole
|
|
||||||
* Tim Coulter
|
|
||||||
* Robert Coup
|
|
||||||
* Jeff Dege
|
|
||||||
* Roald de Wit
|
|
||||||
* Schuyler Erle
|
|
||||||
* Christian López Espínola
|
|
||||||
* John Frank
|
|
||||||
* Sean Gilles
|
|
||||||
* Pierre Giraud
|
|
||||||
* Ivan Grcic
|
|
||||||
* Andreas Hocevar
|
|
||||||
* Marc Jansen
|
|
||||||
* Ian Johnson
|
|
||||||
* Frédéric Junod
|
|
||||||
* Eric Lemoine
|
|
||||||
* Philip Lindsay
|
|
||||||
* Martijn van Oosterhout
|
|
||||||
* David Overstrom
|
|
||||||
* Tom Payne
|
|
||||||
* Corey Puffault
|
|
||||||
* Peter William Robins
|
|
||||||
* Gregers Rygg
|
|
||||||
* Tim Schaub
|
|
||||||
* Christopher Schmidt
|
|
||||||
* Tobias Schwinger
|
|
||||||
* Cameron Shorter
|
|
||||||
* Pedro Simonetti
|
|
||||||
* Paul Spencer
|
|
||||||
* Paul Smith
|
|
||||||
* Glen Stampoultzis
|
|
||||||
* James Stembridge
|
|
||||||
* Erik Uzureau
|
|
||||||
* Bart van den Eijnden
|
|
||||||
* Ivan Willig
|
|
||||||
* Thomas Wood
|
|
||||||
* Bill Woodall
|
|
||||||
* Steve Woodbridge
|
|
||||||
* David Zwarg
|
|
||||||
|
|
||||||
Some portions of OpenLayers are used under the Apache 2.0 license, available
|
|
||||||
in doc/licenses/APACHE-2.0.txt.
|
|
||||||
|
|
||||||
Some portions of OpenLayers are used under the MIT license, availabie in
|
|
||||||
doc/licenses/MIT-LICENSE.txt.
|
|
||||||
|
|
||||||
Some portions of OpenLayers are Copyright 2001 Robert Penner, and are used
|
|
||||||
under the BSD license, available in doc/licenses/BSD-LICENSE.txt
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Contributing to OpenLayers 3
|
|
||||||
|
|
||||||
Thanks for your interest in contributing to OpenLayers 3.
|
|
||||||
|
|
||||||
## Contributing Code
|
|
||||||
|
|
||||||
Our preferred means of receiving contributions is through [pull
|
|
||||||
requests](https://help.github.com/articles/using-pull-requests).
|
|
||||||
|
|
||||||
See the [Developer
|
|
||||||
Guide](https://github.com/openlayers/ol3/wiki/Developer-Guide) to get started
|
|
||||||
with OpenLayers 3 development. This guide provides information you should know
|
|
||||||
before creating pull requests.
|
|
||||||
|
|
||||||
Note that, before accepting a contribution, we ask that you provide us
|
|
||||||
a Contributor License Agreement. If you are making your contribution as part of
|
|
||||||
work for your employer, please follow the guidelines on submitting a [Corporate
|
|
||||||
Contributor License Agreement](http://www.openlayers.org/ccla.txt). If you are
|
|
||||||
making your contribution as an individual, you can submit a digital [Individual
|
|
||||||
Contributor License
|
|
||||||
Agreement](https://docs.google.com/spreadsheet/viewform?formkey=dGNNVUJEMXF2dERTU0FXM3JjNVBQblE6MQ).
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
Copyright 2005-2014 OpenLayers Contributors. All rights reserved. See
|
|
||||||
AUTHORS.md for full list.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation and/or
|
|
||||||
other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY OPENLAYERS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
|
|
||||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
||||||
SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
The views and conclusions contained in the software and documentation are those
|
|
||||||
of the authors and should not be interpreted as representing official policies,
|
|
||||||
either expressed or implied, of OpenLayers Contributors.
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# OpenLayers 3
|
|
||||||
|
|
||||||
[](http://travis-ci.org/#!/openlayers/ol3)
|
|
||||||
|
|
||||||
Welcome to [OpenLayers 3](http://ol3js.org/)!
|
|
||||||
|
|
||||||
Check out the [hosted examples](http://ol3js.org/en/master/examples/), the [workshop](http://ol3js.org/ol3-workshop/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
|
|
||||||
|
|
||||||
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.
|
|
||||||
|
|
||||||
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"opts": {
|
|
||||||
"recurse": true,
|
|
||||||
"template": "apidoc/template"
|
|
||||||
},
|
|
||||||
"tags": {
|
|
||||||
"allowUnknownTags": true
|
|
||||||
},
|
|
||||||
"source": {
|
|
||||||
"includePattern": ".+\\.js(doc)?$",
|
|
||||||
"excludePattern": "(^|\\/|\\\\)_",
|
|
||||||
"include": [
|
|
||||||
"src",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"node_modules/jsdoc/plugins/markdown",
|
|
||||||
"apidoc/plugins/inheritdoc",
|
|
||||||
"apidoc/plugins/interface",
|
|
||||||
"apidoc/plugins/typedefs",
|
|
||||||
"apidoc/plugins/events",
|
|
||||||
"apidoc/plugins/observable",
|
|
||||||
"apidoc/plugins/api"
|
|
||||||
],
|
|
||||||
"markdown": {
|
|
||||||
"parser": "gfm"
|
|
||||||
},
|
|
||||||
"stability": {
|
|
||||||
"levels": ["deprecated","experimental","unstable","stable","frozen","locked"]
|
|
||||||
},
|
|
||||||
"templates": {
|
|
||||||
"cleverLinks": true,
|
|
||||||
"monospaceLinks": true,
|
|
||||||
"default": {
|
|
||||||
"outputSourceFiles": true
|
|
||||||
},
|
|
||||||
"applicationName": "OpenLayers 3"
|
|
||||||
},
|
|
||||||
"jsVersion": 180
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
<table><tr>
|
|
||||||
<th width="33.3%">Map</th><th width="33.3%">View</th><th width="33.3%">Layers</th>
|
|
||||||
</tr><tr>
|
|
||||||
<td><p>A [map](ol.Map.html) is made of [layers](ol.layer.html), a [view](ol.View.html) to visualize them, [interactions](ol.interaction.html) to modify map content and [controls](ol.control.html) with UI components.</p>
|
|
||||||
[Overview](ol.Map.html)<br>
|
|
||||||
[Creation](ol.Map.html#Map)<br>
|
|
||||||
[Events](ol.MapBrowserEvent.html)</td>
|
|
||||||
<td><p>The view manages the visual parameters of the map view, like resolution or rotation.</p>
|
|
||||||
[ol.View](ol.View.html) with center, projection, resolution and rotation</td>
|
|
||||||
<td><p>Layers are lightweight containers that get their data from [sources](ol.source.html).</p>
|
|
||||||
[ol.layer.Tile](ol.layer.Tile.html)<br>
|
|
||||||
[ol.layer.Image](ol.layer.Image.html)<br>
|
|
||||||
[ol.layer.Vector](ol.layer.Vector.html)</td>
|
|
||||||
</tr><tr>
|
|
||||||
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
|
||||||
</tr><tr>
|
|
||||||
<td>[Map default controls](ol.control.html#defaults)<br>
|
|
||||||
[All controls](ol.control.html)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
[Map default interactions](ol.interaction.html#defaults)<br>
|
|
||||||
Interactions for [vector features](ol.Feature.html)
|
|
||||||
<ul><li>[ol.interaction.Select](ol.interaction.Select.html)</li>
|
|
||||||
<li>[ol.interaction.Draw](ol.interaction.Draw.html)</li>
|
|
||||||
<li>[ol.interaction.Modify](ol.interaction.Modify.html)</li></ul>
|
|
||||||
[All interactions](ol.interaction.html)</td>
|
|
||||||
<td>[Tile sources](ol.source.Tile.html) for [ol.layer.Tile](ol.layer.Tile.html)
|
|
||||||
<br>[Image sources](ol.source.Image.html) for [ol.layer.Image](ol.layer.Image.html)
|
|
||||||
<br>[Vector sources](ol.source.Vector.html) for [ol.layer.Vector](ol.layer.Vector.html)
|
|
||||||
<br>[Formats](ol.format.Feature.html) for reading/writing vector data
|
|
||||||
<br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr>
|
|
||||||
<tr><th>Projections</th><th>2-way bindings</th><th>Other components</th></tr>
|
|
||||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: [EPSG:3857](ol.proj.EPSG3857.html)). To transform, use [ol.proj.transform()](ol.proj.html#transform) and [ol.extent.applyTransform()](ol.extent.html#applyTransform).</p>
|
|
||||||
[ol.proj](ol.proj.html)</td>
|
|
||||||
<td><p>[Objects](ol.Object.html) can be kept in sync using the [bindTo()](ol.Object.html#bindTo) method.</p>
|
|
||||||
<p>A [DOM Input](ol.dom.Input.html) class is available to bind Object properties to HTML Input elements.</p></td>
|
|
||||||
<td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br>
|
|
||||||
[ol.Geolocation](ol.Geolocation.html)<br>
|
|
||||||
[ol.Overlay](ol.Overlay.html)<br>
|
|
||||||
[ol.FeatureOverlay](ol.FeatureOverlay.html)<br></td>
|
|
||||||
</tr></table>
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
/**
|
|
||||||
* Define an @api tag
|
|
||||||
*/
|
|
||||||
var conf = env.conf.stability;
|
|
||||||
var defaultLevels = ["deprecated","experimental","unstable","stable","frozen","locked"];
|
|
||||||
var levels = conf.levels || defaultLevels;
|
|
||||||
var util = require('util');
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
dictionary.defineTag('api', {
|
|
||||||
mustHaveValue: false,
|
|
||||||
canHaveType: false,
|
|
||||||
canHaveName: false,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
var level = tag.text || "experimental";
|
|
||||||
if (levels.indexOf(level) >= 0) {
|
|
||||||
doclet.stability = level;
|
|
||||||
} else {
|
|
||||||
var errorText = util.format('Invalid stability level (%s) in %s line %s', tag.text, doclet.meta.filename, doclet.meta.lineno);
|
|
||||||
require('jsdoc/util/error').handle( new Error(errorText) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Based on @stability annotations, and assuming that items with no @stability
|
|
||||||
* annotation should not be documented, this plugin removes undocumented symbols
|
|
||||||
* from the documentation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function hasApiMembers(doclet) {
|
|
||||||
return doclet.longname.split('#')[0] == this.longname;
|
|
||||||
}
|
|
||||||
|
|
||||||
function includeAugments(doclet) {
|
|
||||||
var augments = doclet.augments;
|
|
||||||
if (augments) {
|
|
||||||
var cls;
|
|
||||||
for (var i = augments.length - 1; i >= 0; --i) {
|
|
||||||
cls = classes[augments[i]];
|
|
||||||
if (cls) {
|
|
||||||
includeAugments(cls);
|
|
||||||
if (cls.fires) {
|
|
||||||
if (!doclet.fires) {
|
|
||||||
doclet.fires = [];
|
|
||||||
}
|
|
||||||
cls.fires.forEach(function(f) {
|
|
||||||
if (doclet.fires.indexOf(f) == -1) {
|
|
||||||
doclet.fires.push(f);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (cls.observables) {
|
|
||||||
if (!doclet.observables) {
|
|
||||||
doclet.observables = [];
|
|
||||||
}
|
|
||||||
cls.observables.forEach(function(f) {
|
|
||||||
if (doclet.observables.indexOf(f) == -1) {
|
|
||||||
doclet.observables.push(f);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (cls.longname.indexOf('oli.') !== 0) {
|
|
||||||
cls._hideConstructor = true;
|
|
||||||
delete cls.undocumented;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var api = [];
|
|
||||||
var augments = {};
|
|
||||||
var classes = {};
|
|
||||||
|
|
||||||
exports.handlers = {
|
|
||||||
|
|
||||||
newDoclet: function(e) {
|
|
||||||
var doclet = e.doclet;
|
|
||||||
// Keep track of api items - needed in parseComplete to determine classes
|
|
||||||
// with api members.
|
|
||||||
if (doclet.stability) {
|
|
||||||
api.push(doclet);
|
|
||||||
}
|
|
||||||
// Mark explicity defined namespaces - needed in parseComplete to keep
|
|
||||||
// namespaces that we need as containers for api items.
|
|
||||||
if (/.*\.jsdoc$/.test(doclet.meta.filename) && doclet.kind == 'namespace') {
|
|
||||||
doclet.namespace_ = true;
|
|
||||||
}
|
|
||||||
if (doclet.kind == 'class') {
|
|
||||||
classes[doclet.longname] = doclet;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
parseComplete: function(e) {
|
|
||||||
var doclets = e.doclets;
|
|
||||||
for (var i = doclets.length - 1; i >= 0; --i) {
|
|
||||||
var doclet = doclets[i];
|
|
||||||
if (doclet.stability || doclet.namespace_) {
|
|
||||||
if (doclet.kind == 'class') {
|
|
||||||
includeAugments(doclet);
|
|
||||||
}
|
|
||||||
if (doclet.fires) {
|
|
||||||
doclet.fires.sort(function(a, b) {
|
|
||||||
return a.split(/#?event:/)[1] < b.split(/#?event:/)[1] ? -1 : 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (doclet.observables) {
|
|
||||||
doclet.observables.sort(function(a, b) {
|
|
||||||
return a.name < b.name ? -1 : 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Always document namespaces and items with stability annotation
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (doclet.kind == 'class' && api.some(hasApiMembers, doclet)) {
|
|
||||||
// Mark undocumented classes with documented members as unexported.
|
|
||||||
// This is used in ../template/tmpl/container.tmpl to hide the
|
|
||||||
// constructor from the docs.
|
|
||||||
doclet._hideConstructor = true;
|
|
||||||
includeAugments(doclet);
|
|
||||||
} else if (!doclet._hideConstructor) {
|
|
||||||
// Remove all other undocumented symbols
|
|
||||||
doclet.undocumented = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
var events = {};
|
|
||||||
var classes = {};
|
|
||||||
|
|
||||||
exports.handlers = {
|
|
||||||
|
|
||||||
newDoclet: function(e) {
|
|
||||||
var doclet = e.doclet;
|
|
||||||
var cls;
|
|
||||||
if (doclet.kind == 'event') {
|
|
||||||
cls = doclet.longname.split('#')[0];
|
|
||||||
if (!(cls in events)) {
|
|
||||||
events[cls] = [];
|
|
||||||
}
|
|
||||||
events[cls].push(doclet.longname);
|
|
||||||
} else if (doclet.kind == 'class') {
|
|
||||||
classes[doclet.longname] = doclet;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
parseComplete: function(e) {
|
|
||||||
var doclets = e.doclets;
|
|
||||||
var eventClass, doclet, i, ii, j, jj, event, fires;
|
|
||||||
for (i = 0, ii = doclets.length - 1; i < ii; ++i) {
|
|
||||||
doclet = doclets[i];
|
|
||||||
if (doclet.fires) {
|
|
||||||
if (doclet.kind == 'class') {
|
|
||||||
fires = [];
|
|
||||||
for (j = 0, jj = doclet.fires.length; j < jj; ++j) {
|
|
||||||
event = doclet.fires[j].replace('event:', '');
|
|
||||||
if (events[event]) {
|
|
||||||
fires.push.apply(fires, events[event]);
|
|
||||||
} else {
|
|
||||||
fires.push(doclet.fires[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
doclet.fires = fires;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
* This is a hack to prevent inheritDoc tags from entirely removing
|
|
||||||
* documentation of the method that inherits the documentation.
|
|
||||||
*
|
|
||||||
* TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53
|
|
||||||
* is addressed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
dictionary.defineTag('inheritDoc', {
|
|
||||||
mustHaveValue: false,
|
|
||||||
canHaveType: false,
|
|
||||||
canHaveName: false,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
doclet.inheritdoc = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var lookup = {};
|
|
||||||
var incompleteByClass = {};
|
|
||||||
var keepKeys = ['comment', 'meta', 'name', 'memberof', 'longname', 'augment',
|
|
||||||
'stability'];
|
|
||||||
|
|
||||||
exports.handlers = {
|
|
||||||
|
|
||||||
newDoclet: function(e) {
|
|
||||||
var doclet = e.doclet;
|
|
||||||
var incompletes;
|
|
||||||
if (!(doclet.longname in lookup)) {
|
|
||||||
lookup[doclet.longname] = [];
|
|
||||||
}
|
|
||||||
lookup[doclet.longname].push(doclet);
|
|
||||||
if (doclet.inheritdoc) {
|
|
||||||
if (!(doclet.memberof in incompleteByClass)) {
|
|
||||||
incompleteByClass[doclet.memberof] = [];
|
|
||||||
}
|
|
||||||
incompletes = incompleteByClass[doclet.memberof];
|
|
||||||
if (incompletes.indexOf(doclet.name) == -1) {
|
|
||||||
incompletes.push(doclet.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
parseComplete: function(e) {
|
|
||||||
var ancestors, candidate, candidates, doclet, i, j, k, l, key;
|
|
||||||
var incompleteDoclet, stability, incomplete, incompletes;
|
|
||||||
var doclets = e.doclets;
|
|
||||||
for (i = doclets.length - 1; i >= 0; --i) {
|
|
||||||
doclet = doclets[i];
|
|
||||||
if (doclet.augments) {
|
|
||||||
ancestors = [].concat(doclet.augments);
|
|
||||||
}
|
|
||||||
incompletes = incompleteByClass[doclet.longname];
|
|
||||||
if (ancestors && incompletes) {
|
|
||||||
// collect ancestors from the whole hierarchy
|
|
||||||
for (j = 0; j < ancestors.length; ++j) {
|
|
||||||
candidates = lookup[ancestors[j]];
|
|
||||||
if (candidates) {
|
|
||||||
for (k = candidates.length - 1; k >= 0; --k) {
|
|
||||||
candidate = candidates[k];
|
|
||||||
if (candidate.augments) {
|
|
||||||
ancestors = ancestors.concat(candidate.augments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// walk through all inheritDoc members
|
|
||||||
for (j = incompletes.length - 1; j >= 0; --j) {
|
|
||||||
incomplete = incompletes[j];
|
|
||||||
candidates = lookup[doclet.longname + '#' + incomplete];
|
|
||||||
if (candidates) {
|
|
||||||
// get the incomplete doclet that needs to be augmented
|
|
||||||
for (k = candidates.length - 1; k >= 0; --k) {
|
|
||||||
incompleteDoclet = candidates[k];
|
|
||||||
if (incompleteDoclet.inheritdoc) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// find the documented ancestor
|
|
||||||
for (k = ancestors.length - 1; k >= 0; --k) {
|
|
||||||
candidates = lookup[ancestors[k] + '#' + incomplete];
|
|
||||||
if (candidates) {
|
|
||||||
for (l = candidates.length - 1; l >= 0; --l) {
|
|
||||||
candidate = candidates[l];
|
|
||||||
if (candidate && !candidate.inheritdoc) {
|
|
||||||
stability = candidate.stability || incompleteDoclet.stability
|
|
||||||
if (stability) {
|
|
||||||
incompleteDoclet.stability = stability;
|
|
||||||
for (key in candidate) {
|
|
||||||
if (candidate.hasOwnProperty(key) &&
|
|
||||||
keepKeys.indexOf(key) == -1) {
|
|
||||||
incompleteDoclet[key] = candidate[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
var util = require('util');
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
|
|
||||||
var classTag = dictionary.lookUp('class');
|
|
||||||
dictionary.defineTag('interface', {
|
|
||||||
mustHaveValue: false,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
classTag.onTagged.apply(this, arguments);
|
|
||||||
doclet.interface = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var augmentsTag = dictionary.lookUp('augments');
|
|
||||||
dictionary.defineTag('implements', {
|
|
||||||
mustHaveValue: true,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
tag.value = tag.value.match(/^\{?([^\}]*)\}?$/)[1];
|
|
||||||
augmentsTag.onTagged.apply(this, arguments);
|
|
||||||
if (!doclet.implements) {
|
|
||||||
doclet.implements = [];
|
|
||||||
}
|
|
||||||
doclet.implements.push(tag.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
var classes = {};
|
|
||||||
var observables = {};
|
|
||||||
|
|
||||||
exports.handlers = {
|
|
||||||
|
|
||||||
newDoclet: function(e) {
|
|
||||||
var doclet = e.doclet;
|
|
||||||
if (doclet.kind == 'class') {
|
|
||||||
classes[doclet.longname] = doclet;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
parseComplete: function(e) {
|
|
||||||
var doclets = e.doclets;
|
|
||||||
var cls, doclet, event, i, ii, observable;
|
|
||||||
for (i = 0, ii = doclets.length - 1; i < ii; ++i) {
|
|
||||||
doclet = doclets[i];
|
|
||||||
cls = classes[doclet.longname.split('#')[0]];
|
|
||||||
if (typeof doclet.observable == 'string' && cls) {
|
|
||||||
var name = doclet.name.replace(/^[sg]et/, '');
|
|
||||||
name = name.substr(0, 1).toLowerCase() + name.substr(1);
|
|
||||||
var key = doclet.longname.split('#')[0] + '#' + name;
|
|
||||||
doclet.observable = key;
|
|
||||||
if (!observables[key]) {
|
|
||||||
observables[key] = {};
|
|
||||||
}
|
|
||||||
observable = observables[key];
|
|
||||||
observable.name = name;
|
|
||||||
observable.readonly = typeof observable.readonly == 'boolean' ?
|
|
||||||
observable.readonly : true;
|
|
||||||
if (doclet.name.indexOf('get') === 0) {
|
|
||||||
observable.type = doclet.returns[0].type;
|
|
||||||
observable.description = doclet.returns[0].description;
|
|
||||||
} else if (doclet.name.indexOf('set') === 0) {
|
|
||||||
observable.readonly = false;
|
|
||||||
}
|
|
||||||
if (!cls.observables) {
|
|
||||||
cls.observables = [];
|
|
||||||
}
|
|
||||||
observable = observables[doclet.observable];
|
|
||||||
if (cls.observables.indexOf(observable) == -1) {
|
|
||||||
cls.observables.push(observable);
|
|
||||||
}
|
|
||||||
if (!cls.fires) {
|
|
||||||
cls.fires = [];
|
|
||||||
}
|
|
||||||
var event = 'ol.ObjectEvent#event:change:' + name.toLowerCase();
|
|
||||||
if (cls.fires.indexOf(event) == -1) {
|
|
||||||
cls.fires.push(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
dictionary.defineTag('observable', {
|
|
||||||
mustNotHaveValue: true,
|
|
||||||
canHaveType: false,
|
|
||||||
canHaveName: false,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
doclet.observable = '';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* Converts olx.js @type annotations into properties of the previous @typedef.
|
|
||||||
* Changes @enum annotations into @typedef.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var lastOlxTypedef = null;
|
|
||||||
var olxTypes = {};
|
|
||||||
|
|
||||||
function addSubparams(params) {
|
|
||||||
for (var j = 0, jj = params.length; j < jj; ++j) {
|
|
||||||
var param = params[j];
|
|
||||||
var types = param.type.names;
|
|
||||||
for (var k = 0, kk = types.length; k < kk; ++k) {
|
|
||||||
var name = types[k];
|
|
||||||
if (name in olxTypes) {
|
|
||||||
param.subparams = olxTypes[name];
|
|
||||||
// TODO addSubparams(param.subparams);
|
|
||||||
// TODO Do we need to support multiple object literal types per
|
|
||||||
// param?
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.handlers = {
|
|
||||||
|
|
||||||
newDoclet: function(e) {
|
|
||||||
var doclet = e.doclet;
|
|
||||||
if (doclet.meta.filename == 'olx.js') {
|
|
||||||
if (doclet.kind == 'typedef') {
|
|
||||||
lastOlxTypedef = doclet;
|
|
||||||
olxTypes[doclet.longname] = [];
|
|
||||||
doclet.properties = [];
|
|
||||||
} else if (lastOlxTypedef && doclet.memberof == lastOlxTypedef.longname) {
|
|
||||||
lastOlxTypedef.properties.push(doclet);
|
|
||||||
olxTypes[lastOlxTypedef.longname].push(doclet);
|
|
||||||
} else {
|
|
||||||
lastOlxTypedef = null;
|
|
||||||
}
|
|
||||||
} else if (doclet.isEnum) {
|
|
||||||
// We never export enums, so we document them like typedefs
|
|
||||||
doclet.kind = 'typedef';
|
|
||||||
delete doclet.isEnum;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
parseComplete: function(e) {
|
|
||||||
var doclets = e.doclets;
|
|
||||||
for (var i = doclets.length - 1; i >= 0; --i) {
|
|
||||||
var doclet = doclets[i];
|
|
||||||
var params = doclet.params;
|
|
||||||
if (params) {
|
|
||||||
addSubparams(params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# API Documentation
|
|
||||||
|
|
||||||
This directory contains configuration (`conf.json`), static content (`index.md`), template (`template/`) and plugins (`plugins/`) for the [JSDoc3](http://usejsdoc.org/) API generator.
|
|
||||||
|
|
||||||
## Documenting the source code
|
|
||||||
|
|
||||||
JSDoc annotations are used for metadata used by the compiler, for defining the user facing API, and for user documentation.
|
|
||||||
|
|
||||||
In the simplest case, a JSDoc block can look like this:
|
|
||||||
```js
|
|
||||||
/**
|
|
||||||
* Add the given control to the map.
|
|
||||||
* @param {ol.control.Control} control Control.
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
ol.Map.prototype.addControl = function(control) {
|
|
||||||
// ...
|
|
||||||
};
|
|
||||||
```
|
|
||||||
The first line is text for the user documentation. This can be long, and it can
|
|
||||||
contain Markdown.
|
|
||||||
|
|
||||||
The second line tells the Closure compiler the type of the argument.
|
|
||||||
|
|
||||||
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
|
|
||||||
|
|
||||||
### Events
|
|
||||||
|
|
||||||
Events are documented using `@fires` and `@event` annotations:
|
|
||||||
```js
|
|
||||||
/**
|
|
||||||
* Constants for event names.
|
|
||||||
* @enum {string}
|
|
||||||
*/
|
|
||||||
ol.MapBrowserEvent.EventType = {
|
|
||||||
/**
|
|
||||||
* A true single click with no dragging and no double click. Note that this
|
|
||||||
* event is delayed by 250 ms to ensure that it is not a double click.
|
|
||||||
* @event ol.MapBrowserEvent#singleclick
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
SINGLECLICK: 'singleclick',
|
|
||||||
// ...
|
|
||||||
};
|
|
||||||
```
|
|
||||||
Note the value of the `@event` annotation. The text before the hash refers to the event class that the event belongs to, and the text after the hash is the type of the event.
|
|
||||||
|
|
||||||
To export event properties, they need to be defined in `externs/oli.js` (also see `readme.md` in `externs/`) and marked with an @api annotation:
|
|
||||||
```js
|
|
||||||
/** @interface */
|
|
||||||
oli.MapBrowserEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {ol.Coordinate}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
oli.MapBrowserEvent.prototype.coordinate;
|
|
||||||
|
|
||||||
// ...
|
|
||||||
|
|
||||||
};
|
|
||||||
```
|
|
||||||
To document which events are fired by a class or method, the `@fires` annotation is used:
|
|
||||||
```js
|
|
||||||
/**
|
|
||||||
* @fires ol.MapBrowserEvent
|
|
||||||
* @fires ol.MapEvent
|
|
||||||
* @fires ol.render.Event
|
|
||||||
* ...
|
|
||||||
*/
|
|
||||||
ol.Map = function(options) {
|
|
||||||
// ...
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
### Observable Properties
|
|
||||||
|
|
||||||
Observable properties are documented using the `@observable` annotation. This annotation is added to the getter of an observable property. If an observable property is also settable, the setter is annotated with `@observable` as well.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
This template is based on the [Jaguar](https://github.com/davidshimjs/jaguarjs/tree/master/docs/templates/jaguar) template. [JaguarJS](https://github.com/davidshimjs/jaguarjs) is licensed under the [LGPL license](https://github.com/davidshimjs/jaguarjs/tree/master/LICENSE).
|
|
||||||
|
|
||||||
The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template).
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
@navWidth: 250px;
|
|
||||||
@colorSubtitle: rgb(119, 156, 52);
|
|
||||||
@colorRed: rgb(238, 125, 125);
|
|
||||||
@colorLink: #2a6496;
|
|
||||||
@colorBgNavi: #2a2a2a;
|
|
||||||
|
|
||||||
.font-description () {
|
|
||||||
font-family: "freight-text-pro",Georgia,Cambria,"Times New Roman",Times,serif
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
@import "common.less";
|
|
||||||
|
|
||||||
footer {
|
|
||||||
margin: 15px 0;
|
|
||||||
padding-top: 15px;
|
|
||||||
border-top: 1px solid #e1e1e1;
|
|
||||||
.font-description();
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
@import "common.less";
|
|
||||||
|
|
||||||
// normalize
|
|
||||||
html, body {
|
|
||||||
font: 1em "jaf-bernino-sans","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
ul, ol {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wrap {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
@import "navigation.less";
|
|
||||||
@import "main.less";
|
|
||||||
@import "footer.less";
|
|
||||||
@@ -1,288 +0,0 @@
|
|||||||
@import "common.less";
|
|
||||||
|
|
||||||
.main {
|
|
||||||
padding: 20px 20px;
|
|
||||||
margin-left: @navWidth;
|
|
||||||
.page-title {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.6em;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.5em;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 12px;
|
|
||||||
margin: 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h5 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4.name {
|
|
||||||
span.type-signature {
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: gray;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding: 2px 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.type {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.glyphicon {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
color: #e1e1e1;
|
|
||||||
margin-left: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.returnType {
|
|
||||||
margin-left: 3px;
|
|
||||||
background-color: transparent!important;
|
|
||||||
color: gray!important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
span.static {
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: @colorSubtitle!important;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding: 2px 4px;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.number {
|
|
||||||
background-color: #ccc!important;
|
|
||||||
color: #2fa2b1!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.string {
|
|
||||||
background-color: #ccc!important;
|
|
||||||
color: #2fa2b1!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.object {
|
|
||||||
background-color: #ccc!important;
|
|
||||||
color: #2fa2b1!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.array {
|
|
||||||
background-color: #ccc!important;
|
|
||||||
color: #2fa2b1!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.boolean {
|
|
||||||
background-color: #ccc!important;
|
|
||||||
color: #2fa2b1!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subsection-title {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-top: 30px;
|
|
||||||
color: @colorSubtitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description {
|
|
||||||
margin-top: 10px;
|
|
||||||
// .font-description();
|
|
||||||
font-size: 13px;
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-source {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
dt.tag-source {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt.tag-todo {
|
|
||||||
font-size: 10px;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: @colorLink;
|
|
||||||
color: #fff;
|
|
||||||
padding: 2px 4px;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.type-signature {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-deprecated {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.important {
|
|
||||||
background-color: @colorRed;
|
|
||||||
color: #fff;
|
|
||||||
padding: 2px 4px;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nameContainer {
|
|
||||||
position: relative;
|
|
||||||
margin-top: 20px;
|
|
||||||
padding-top: 5px;
|
|
||||||
border-top: 1px solid #e1e1e1;
|
|
||||||
|
|
||||||
.inherited {
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: #888!important;
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding: 2px 4px;
|
|
||||||
margin-right: 5px;
|
|
||||||
a {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-source {
|
|
||||||
position: absolute;
|
|
||||||
top: 17px;
|
|
||||||
right: 0;
|
|
||||||
font-size: 10px;
|
|
||||||
a {
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.inherited {
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
margin-right: 150px;
|
|
||||||
line-height: 1.3;
|
|
||||||
|
|
||||||
.signature {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
th {
|
|
||||||
padding: 3px 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
vertical-align: top;
|
|
||||||
padding: 5px 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.type {
|
|
||||||
width: 60px;
|
|
||||||
color: #aaa;
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attributes {
|
|
||||||
width: 80px;
|
|
||||||
color: #aaa;
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description {
|
|
||||||
font-size: 12px;
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.optional {
|
|
||||||
float: left;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: #ddd!important;
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding: 2px 4px;
|
|
||||||
margin-right: 5px;
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.readme {
|
|
||||||
p {
|
|
||||||
margin-top: 15px;
|
|
||||||
line-height: 1.2;
|
|
||||||
font-size: 0.85em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 1.7em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin-top: 30px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
border-bottom: 1px solid #e1e1e1;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
article {
|
|
||||||
ol, ul {
|
|
||||||
margin-left: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol > li {
|
|
||||||
list-style-type: decimal;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul > li {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
list-style-type: disc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
@import "common.less";
|
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 8px;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background-color: gray;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navigation {
|
|
||||||
position: fixed;
|
|
||||||
float: left;
|
|
||||||
width: @navWidth;
|
|
||||||
height: 100%;
|
|
||||||
background-color: @colorBgNavi;
|
|
||||||
|
|
||||||
.applicationName {
|
|
||||||
margin: 0;
|
|
||||||
margin-top: 15px;
|
|
||||||
padding: 10px 15px;
|
|
||||||
font: bold 1.25em Helvetica;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search {
|
|
||||||
padding: 10px 15px;
|
|
||||||
|
|
||||||
input {
|
|
||||||
background-color: #333;
|
|
||||||
color: #fff;
|
|
||||||
border-color: #555;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
padding: 10px 15px 0 15px;
|
|
||||||
position: relative;
|
|
||||||
overflow: auto;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
li.item {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
border-bottom: 1px solid #333;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #bbb;
|
|
||||||
&:hover {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
a {
|
|
||||||
color: #e1e1e1;
|
|
||||||
&:hover {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
display: block;
|
|
||||||
font-size: 0.8em;
|
|
||||||
|
|
||||||
.static {
|
|
||||||
display: block;
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: @colorSubtitle;
|
|
||||||
color: #000;
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding: 2px 4px;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtitle {
|
|
||||||
margin-top: 10px;
|
|
||||||
font: bold 0.65em Helvetica;
|
|
||||||
color: @colorSubtitle;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ul {
|
|
||||||
& > li {
|
|
||||||
font-size: 0.7em;
|
|
||||||
padding-left: 8px;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.itemMembers {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,523 +0,0 @@
|
|||||||
/*global env: true */
|
|
||||||
var template = require('jsdoc/template'),
|
|
||||||
fs = require('jsdoc/fs'),
|
|
||||||
path = require('jsdoc/path'),
|
|
||||||
taffy = require('taffydb').taffy,
|
|
||||||
handle = require('jsdoc/util/error').handle,
|
|
||||||
helper = require('jsdoc/util/templateHelper'),
|
|
||||||
_ = require('underscore'),
|
|
||||||
htmlsafe = helper.htmlsafe,
|
|
||||||
linkto = helper.linkto,
|
|
||||||
resolveAuthorLinks = helper.resolveAuthorLinks,
|
|
||||||
scopeToPunc = helper.scopeToPunc,
|
|
||||||
hasOwnProp = Object.prototype.hasOwnProperty,
|
|
||||||
data,
|
|
||||||
view,
|
|
||||||
outdir = env.opts.destination;
|
|
||||||
|
|
||||||
function find(spec) {
|
|
||||||
return helper.find(data, spec);
|
|
||||||
}
|
|
||||||
|
|
||||||
function tutoriallink(tutorial) {
|
|
||||||
return helper.toTutorial(tutorial, null, { tag: 'em', classname: 'disabled', prefix: 'Tutorial: ' });
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAncestorLinks(doclet) {
|
|
||||||
return helper.getAncestorLinks(data, doclet);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hashToLink(doclet, hash) {
|
|
||||||
if ( !/^(#.+)/.test(hash) ) { return hash; }
|
|
||||||
|
|
||||||
var url = helper.createLink(doclet);
|
|
||||||
|
|
||||||
url = url.replace(/(#.+|$)/, hash);
|
|
||||||
return '<a href="' + url + '">' + hash + '</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function needsSignature(doclet) {
|
|
||||||
var needsSig = false;
|
|
||||||
|
|
||||||
// function and class definitions always get a signature
|
|
||||||
if (doclet.kind === 'function' || doclet.kind === 'class') {
|
|
||||||
needsSig = true;
|
|
||||||
}
|
|
||||||
// typedefs that contain functions get a signature, too
|
|
||||||
else if (doclet.kind === 'typedef' && doclet.type && doclet.type.names &&
|
|
||||||
doclet.type.names.length) {
|
|
||||||
for (var i = 0, l = doclet.type.names.length; i < l; i++) {
|
|
||||||
if (doclet.type.names[i].toLowerCase() === 'function') {
|
|
||||||
needsSig = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return needsSig;
|
|
||||||
}
|
|
||||||
|
|
||||||
function addSignatureParams(f) {
|
|
||||||
var params = helper.getSignatureParams(f, 'optional');
|
|
||||||
|
|
||||||
f.signature = (f.signature || '') + '('+params.join(', ')+')';
|
|
||||||
}
|
|
||||||
|
|
||||||
function addSignatureReturns(f) {
|
|
||||||
var returnTypes = helper.getSignatureReturns(f);
|
|
||||||
|
|
||||||
f.signature = '<span class="signature">'+(f.signature || '') + '</span>';
|
|
||||||
|
|
||||||
if (returnTypes.length) {
|
|
||||||
f.signature += '<span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">'+(returnTypes.length ? '{'+returnTypes.join('|')+'}' : '')+'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addSignatureTypes(f) {
|
|
||||||
var types = helper.getSignatureTypes(f);
|
|
||||||
|
|
||||||
f.signature = (f.signature || '') + '<span class="type-signature">'+(types.length? ' :'+types.join('|') : '')+' </span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function addAttribs(f) {
|
|
||||||
var attribs = helper.getAttribs(f);
|
|
||||||
|
|
||||||
if (attribs.length) {
|
|
||||||
f.attribs = '<span class="type-signature ' + (attribs[0] === 'static' ? 'static' : '') + '">' + htmlsafe(attribs.length ? attribs.join(',') : '') + ' </span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function shortenPaths(files, commonPrefix) {
|
|
||||||
// always use forward slashes
|
|
||||||
var regexp = new RegExp('\\\\', 'g');
|
|
||||||
|
|
||||||
Object.keys(files).forEach(function(file) {
|
|
||||||
files[file].shortened = files[file].resolved.replace(commonPrefix, '')
|
|
||||||
.replace(regexp, '/');
|
|
||||||
});
|
|
||||||
|
|
||||||
return files;
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveSourcePath(filepath) {
|
|
||||||
return path.resolve(process.cwd(), filepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPathFromDoclet(doclet) {
|
|
||||||
if (!doclet.meta) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var filepath = doclet.meta.path && doclet.meta.path !== 'null' ?
|
|
||||||
doclet.meta.path + '/' + doclet.meta.filename.split(/[\/\\]/).pop() :
|
|
||||||
doclet.meta.filename;
|
|
||||||
|
|
||||||
return filepath;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generate(title, docs, filename, resolveLinks) {
|
|
||||||
resolveLinks = resolveLinks === false ? false : true;
|
|
||||||
|
|
||||||
var docData = {
|
|
||||||
filename: filename,
|
|
||||||
title: title,
|
|
||||||
docs: docs
|
|
||||||
};
|
|
||||||
|
|
||||||
var outpath = path.join(outdir, filename),
|
|
||||||
html = view.render('container.tmpl', docData);
|
|
||||||
|
|
||||||
if (resolveLinks) {
|
|
||||||
html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync(outpath, html, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateSourceFiles(sourceFiles) {
|
|
||||||
Object.keys(sourceFiles).forEach(function(file) {
|
|
||||||
var source;
|
|
||||||
// links are keyed to the shortened path in each doclet's `meta.filename` property
|
|
||||||
var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
|
|
||||||
helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
|
|
||||||
|
|
||||||
try {
|
|
||||||
source = {
|
|
||||||
kind: 'source',
|
|
||||||
code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, 'utf8') )
|
|
||||||
};
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
handle(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
|
|
||||||
false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Look for classes or functions with the same name as modules (which indicates that the module
|
|
||||||
* exports only that class or function), then attach the classes or functions to the `module`
|
|
||||||
* property of the appropriate module doclets. The name of each class or function is also updated
|
|
||||||
* for display purposes. This function mutates the original arrays.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Array.<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
|
|
||||||
* check.
|
|
||||||
* @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
|
|
||||||
*/
|
|
||||||
function attachModuleSymbols(doclets, modules) {
|
|
||||||
var symbols = {};
|
|
||||||
|
|
||||||
// build a lookup table
|
|
||||||
doclets.forEach(function(symbol) {
|
|
||||||
symbols[symbol.longname] = symbol;
|
|
||||||
});
|
|
||||||
|
|
||||||
return modules.map(function(module) {
|
|
||||||
if (symbols[module.longname]) {
|
|
||||||
module.module = symbols[module.longname];
|
|
||||||
module.module.name = module.module.name.replace('module:', 'require("') + '")';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the navigation sidebar.
|
|
||||||
* @param {object} members The members that will be used to create the sidebar.
|
|
||||||
* @param {array<object>} members.classes
|
|
||||||
* @param {array<object>} members.externals
|
|
||||||
* @param {array<object>} members.globals
|
|
||||||
* @param {array<object>} members.mixins
|
|
||||||
* @param {array<object>} members.modules
|
|
||||||
* @param {array<object>} members.namespaces
|
|
||||||
* @param {array<object>} members.tutorials
|
|
||||||
* @param {array<object>} members.events
|
|
||||||
* @return {string} The HTML for the navigation sidebar.
|
|
||||||
*/
|
|
||||||
function buildNav(members) {
|
|
||||||
var nav = [];
|
|
||||||
|
|
||||||
if (members.namespaces.length) {
|
|
||||||
_.each(members.namespaces, function (v) {
|
|
||||||
// exclude 'olx' from sidebar
|
|
||||||
if (v.longname.indexOf('olx') !== 0) {
|
|
||||||
nav.push({
|
|
||||||
type: 'namespace',
|
|
||||||
longname: v.longname,
|
|
||||||
name: v.name,
|
|
||||||
members: find({
|
|
||||||
kind: 'member',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
methods: find({
|
|
||||||
kind: 'function',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
typedefs: find({
|
|
||||||
kind: 'typedef',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
events: find({
|
|
||||||
kind: 'event',
|
|
||||||
memberof: v.longname
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (members.classes.length) {
|
|
||||||
_.each(members.classes, function (v) {
|
|
||||||
// ignore interfaces
|
|
||||||
if (v.interface !== true) {
|
|
||||||
nav.push({
|
|
||||||
type: 'class',
|
|
||||||
longname: v.longname,
|
|
||||||
name: v.name,
|
|
||||||
members: find({
|
|
||||||
kind: 'member',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
methods: find({
|
|
||||||
kind: 'function',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
typedefs: find({
|
|
||||||
kind: 'typedef',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
fires: v.fires,
|
|
||||||
events: find({
|
|
||||||
kind: 'event',
|
|
||||||
memberof: v.longname
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return nav;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param {TAFFY} taffyData See <http://taffydb.com/>.
|
|
||||||
@param {object} opts
|
|
||||||
@param {Tutorial} tutorials
|
|
||||||
*/
|
|
||||||
exports.publish = function(taffyData, opts, tutorials) {
|
|
||||||
data = taffyData;
|
|
||||||
|
|
||||||
var conf = env.conf.templates || {};
|
|
||||||
conf['default'] = conf['default'] || {};
|
|
||||||
|
|
||||||
var templatePath = opts.template;
|
|
||||||
view = new template.Template(templatePath + '/tmpl');
|
|
||||||
|
|
||||||
// claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness
|
|
||||||
// doesn't try to hand them out later
|
|
||||||
var indexUrl = helper.getUniqueFilename('index');
|
|
||||||
// don't call registerLink() on this one! 'index' is also a valid longname
|
|
||||||
|
|
||||||
var globalUrl = helper.getUniqueFilename('global');
|
|
||||||
helper.registerLink('global', globalUrl);
|
|
||||||
|
|
||||||
// set up templating
|
|
||||||
view.layout = 'layout.tmpl';
|
|
||||||
|
|
||||||
// set up tutorials for helper
|
|
||||||
helper.setTutorials(tutorials);
|
|
||||||
|
|
||||||
data = helper.prune(data);
|
|
||||||
data.sort('longname, version, since');
|
|
||||||
helper.addEventListeners(data);
|
|
||||||
|
|
||||||
var sourceFiles = {};
|
|
||||||
var sourceFilePaths = [];
|
|
||||||
data().each(function(doclet) {
|
|
||||||
doclet.attribs = '';
|
|
||||||
|
|
||||||
if (doclet.examples) {
|
|
||||||
doclet.examples = doclet.examples.map(function(example) {
|
|
||||||
var caption, code;
|
|
||||||
|
|
||||||
if (example.match(/^\s*<caption>([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) {
|
|
||||||
caption = RegExp.$1;
|
|
||||||
code = RegExp.$3;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
caption: caption || '',
|
|
||||||
code: code || example
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (doclet.see) {
|
|
||||||
doclet.see.forEach(function(seeItem, i) {
|
|
||||||
doclet.see[i] = hashToLink(doclet, seeItem);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// build a list of source files
|
|
||||||
var sourcePath;
|
|
||||||
var resolvedSourcePath;
|
|
||||||
if (doclet.meta) {
|
|
||||||
sourcePath = getPathFromDoclet(doclet);
|
|
||||||
resolvedSourcePath = resolveSourcePath(sourcePath);
|
|
||||||
sourceFiles[sourcePath] = {
|
|
||||||
resolved: resolvedSourcePath,
|
|
||||||
shortened: null
|
|
||||||
};
|
|
||||||
sourceFilePaths.push(resolvedSourcePath);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// update outdir if necessary, then create outdir
|
|
||||||
var packageInfo = ( find({kind: 'package'}) || [] ) [0];
|
|
||||||
if (packageInfo && packageInfo.name) {
|
|
||||||
outdir = path.join(outdir, packageInfo.name, packageInfo.version);
|
|
||||||
}
|
|
||||||
fs.mkPath(outdir);
|
|
||||||
|
|
||||||
// copy the template's static files to outdir
|
|
||||||
var fromDir = path.join(templatePath, 'static');
|
|
||||||
var staticFiles = fs.ls(fromDir, 3);
|
|
||||||
|
|
||||||
staticFiles.forEach(function(fileName) {
|
|
||||||
var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
|
|
||||||
fs.mkPath(toDir);
|
|
||||||
fs.copyFileSync(fileName, toDir);
|
|
||||||
});
|
|
||||||
|
|
||||||
// copy user-specified static files to outdir
|
|
||||||
var staticFilePaths;
|
|
||||||
var staticFileFilter;
|
|
||||||
var staticFileScanner;
|
|
||||||
if (conf['default'].staticFiles) {
|
|
||||||
staticFilePaths = conf['default'].staticFiles.paths || [];
|
|
||||||
staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf['default'].staticFiles);
|
|
||||||
staticFileScanner = new (require('jsdoc/src/scanner')).Scanner();
|
|
||||||
|
|
||||||
staticFilePaths.forEach(function(filePath) {
|
|
||||||
var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter);
|
|
||||||
|
|
||||||
extraStaticFiles.forEach(function(fileName) {
|
|
||||||
var sourcePath = fs.statSync(filePath).isDirectory() ? filePath :
|
|
||||||
path.dirname(filePath);
|
|
||||||
var toDir = fs.toDir( fileName.replace(sourcePath, outdir) );
|
|
||||||
fs.mkPath(toDir);
|
|
||||||
fs.copyFileSync(fileName, toDir);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sourceFilePaths.length) {
|
|
||||||
sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) );
|
|
||||||
}
|
|
||||||
data().each(function(doclet) {
|
|
||||||
var url = helper.createLink(doclet);
|
|
||||||
helper.registerLink(doclet.longname, url);
|
|
||||||
|
|
||||||
// replace the filename with a shortened version of the full path
|
|
||||||
var docletPath;
|
|
||||||
if (doclet.meta) {
|
|
||||||
docletPath = getPathFromDoclet(doclet);
|
|
||||||
docletPath = sourceFiles[docletPath].shortened;
|
|
||||||
if (docletPath) {
|
|
||||||
doclet.meta.filename = docletPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
data().each(function(doclet) {
|
|
||||||
var url = helper.longnameToUrl[doclet.longname];
|
|
||||||
|
|
||||||
if (url.indexOf('#') > -1) {
|
|
||||||
doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
doclet.id = doclet.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( needsSignature(doclet) ) {
|
|
||||||
addSignatureParams(doclet);
|
|
||||||
addSignatureReturns(doclet);
|
|
||||||
addAttribs(doclet);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// do this after the urls have all been generated
|
|
||||||
data().each(function(doclet) {
|
|
||||||
doclet.ancestors = getAncestorLinks(doclet);
|
|
||||||
|
|
||||||
if (doclet.kind === 'member') {
|
|
||||||
addSignatureTypes(doclet);
|
|
||||||
addAttribs(doclet);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doclet.kind === 'constant') {
|
|
||||||
addSignatureTypes(doclet);
|
|
||||||
addAttribs(doclet);
|
|
||||||
doclet.kind = 'member';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var members = helper.getMembers(data);
|
|
||||||
members.tutorials = tutorials.children;
|
|
||||||
|
|
||||||
// add template helpers
|
|
||||||
view.find = find;
|
|
||||||
view.linkto = linkto;
|
|
||||||
view.resolveAuthorLinks = resolveAuthorLinks;
|
|
||||||
view.tutoriallink = tutoriallink;
|
|
||||||
view.htmlsafe = htmlsafe;
|
|
||||||
view.members = members; //@davidshimjs: To make navigation for customizing
|
|
||||||
|
|
||||||
// once for all
|
|
||||||
view.nav = buildNav(members);
|
|
||||||
attachModuleSymbols( find({ kind: ['class', 'function'], longname: {left: 'module:'} }),
|
|
||||||
members.modules );
|
|
||||||
|
|
||||||
// only output pretty-printed source files if requested; do this before generating any other
|
|
||||||
// pages, so the other pages can link to the source files
|
|
||||||
if (conf['default'].outputSourceFiles) {
|
|
||||||
generateSourceFiles(sourceFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); }
|
|
||||||
|
|
||||||
// index page displays information from package.json and lists files
|
|
||||||
var files = find({kind: 'file'}),
|
|
||||||
packages = find({kind: 'package'});
|
|
||||||
|
|
||||||
generate('Index',
|
|
||||||
packages.concat(
|
|
||||||
[{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}]
|
|
||||||
).concat(files),
|
|
||||||
indexUrl);
|
|
||||||
|
|
||||||
// set up the lists that we'll use to generate pages
|
|
||||||
var classes = taffy(members.classes);
|
|
||||||
var modules = taffy(members.modules);
|
|
||||||
var namespaces = taffy(members.namespaces);
|
|
||||||
var mixins = taffy(members.mixins);
|
|
||||||
var externals = taffy(members.externals);
|
|
||||||
|
|
||||||
for (var longname in helper.longnameToUrl) {
|
|
||||||
if ( hasOwnProp.call(helper.longnameToUrl, longname) ) {
|
|
||||||
var myClasses = helper.find(classes, {longname: longname});
|
|
||||||
if (myClasses.length) {
|
|
||||||
generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var myModules = helper.find(modules, {longname: longname});
|
|
||||||
if (myModules.length) {
|
|
||||||
generate('Module: ' + myModules[0].name, myModules, helper.longnameToUrl[longname]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var myNamespaces = helper.find(namespaces, {longname: longname});
|
|
||||||
if (myNamespaces.length) {
|
|
||||||
generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var myMixins = helper.find(mixins, {longname: longname});
|
|
||||||
if (myMixins.length) {
|
|
||||||
generate('Mixin: ' + myMixins[0].name, myMixins, helper.longnameToUrl[longname]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var myExternals = helper.find(externals, {longname: longname});
|
|
||||||
if (myExternals.length) {
|
|
||||||
generate('External: ' + myExternals[0].name, myExternals, helper.longnameToUrl[longname]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: move the tutorial functions to templateHelper.js
|
|
||||||
function generateTutorial(title, tutorial, filename) {
|
|
||||||
var tutorialData = {
|
|
||||||
title: title,
|
|
||||||
header: tutorial.title,
|
|
||||||
content: tutorial.parse(),
|
|
||||||
children: tutorial.children
|
|
||||||
};
|
|
||||||
|
|
||||||
var tutorialPath = path.join(outdir, filename),
|
|
||||||
html = view.render('tutorial.tmpl', tutorialData);
|
|
||||||
|
|
||||||
// yes, you can use {@link} in tutorials too!
|
|
||||||
html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
|
|
||||||
|
|
||||||
fs.writeFileSync(tutorialPath, html, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
// tutorials can have only one parent so there is no risk for loops
|
|
||||||
function saveChildren(node) {
|
|
||||||
node.children.forEach(function(child) {
|
|
||||||
generateTutorial('Tutorial: ' + child.title, child, helper.tutorialToUrl(child.name));
|
|
||||||
saveChildren(child);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
saveChildren(tutorials);
|
|
||||||
};
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
docs.forEach(function(doc, i) {
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?js if (doc.kind === 'mainpage' || (doc.kind === 'package')) { ?>
|
|
||||||
<?js= self.partial('mainpage.tmpl', doc) ?>
|
|
||||||
<?js } else if (doc.kind === 'source') { ?>
|
|
||||||
<?js= self.partial('source.tmpl', doc) ?>
|
|
||||||
<?js } else { ?>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
<h2><?js if (doc.ancestors && doc.ancestors.length) { ?>
|
|
||||||
<span class="ancestors"><?js= doc.ancestors.join('') ?></span><?js } ?><?js= doc.name ?>
|
|
||||||
<?js if (doc.variation) { ?>
|
|
||||||
<sup class="variation"><?js= doc.variation ?></sup>
|
|
||||||
<?js } ?></h2>
|
|
||||||
<?js if (doc.classdesc) { ?>
|
|
||||||
<div class="class-description"><?js= doc.classdesc ?></div>
|
|
||||||
<?js } ?>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<div class="container-overview">
|
|
||||||
<?js if (doc.kind === 'module' && doc.module) { ?>
|
|
||||||
<?js= self.partial('method.tmpl', doc.module) ?>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (doc.kind === 'class') { ?>
|
|
||||||
<?js= self.partial('method.tmpl', doc) ?>
|
|
||||||
<?js } else { ?>
|
|
||||||
<?js if (doc.description) { ?>
|
|
||||||
<div class="description"><?js= doc.description ?></div>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js= self.partial('details.tmpl', doc) ?>
|
|
||||||
|
|
||||||
<?js if (doc.examples && doc.examples.length) { ?>
|
|
||||||
<h3>Example<?js= doc.examples.length > 1? 's':'' ?></h3>
|
|
||||||
<?js= self.partial('examples.tmpl', doc.examples) ?>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?js if (doc.kind == 'class') {
|
|
||||||
var subclasses = self.find(function() {
|
|
||||||
return this.augments && this.augments.indexOf(doc.longname) > -1;
|
|
||||||
})
|
|
||||||
if (subclasses.length) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Subclasses</h3>
|
|
||||||
<ul><?js subclasses.forEach(function(s) { ?>
|
|
||||||
<li><?js= self.linkto(s.longname, s.longname) ?>
|
|
||||||
<?js= (s.interface ? '(Interface)' : '') ?>
|
|
||||||
</li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } } ?>
|
|
||||||
|
|
||||||
<?js if (doc.augments && doc.augments.length) { ?>
|
|
||||||
<h3 class="subsection-title">Extends</h3>
|
|
||||||
|
|
||||||
<ul><?js doc.augments.forEach(function(a) { ?>
|
|
||||||
<li><?js= self.linkto(a, a) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (doc.mixes && doc.mixes.length) { ?>
|
|
||||||
<h3 class="subsection-title">Mixes In</h3>
|
|
||||||
|
|
||||||
<ul><?js doc.mixes.forEach(function(a) { ?>
|
|
||||||
<li><?js= self.linkto(a, a) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (doc.requires && doc.requires.length) { ?>
|
|
||||||
<h3 class="subsection-title">Requires</h3>
|
|
||||||
|
|
||||||
<ul><?js doc.requires.forEach(function(r) { ?>
|
|
||||||
<li><?js= self.linkto(r, r) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var classes = self.find({kind: 'class', memberof: doc.longname});
|
|
||||||
if (doc.kind !== 'globalobj' && classes && classes.length) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Classes</h3>
|
|
||||||
|
|
||||||
<dl><?js classes.forEach(function(c) { ?>
|
|
||||||
<dt><?js= self.linkto(c.longname, c.name) ?></dt>
|
|
||||||
<dd><?js if (c.summary) { ?><?js= c.summary ?><?js } ?></dd>
|
|
||||||
<?js }); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var namespaces = self.find({kind: 'namespace', memberof: doc.longname});
|
|
||||||
if (doc.kind !== 'globalobj' && namespaces && namespaces.length) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Namespaces</h3>
|
|
||||||
|
|
||||||
<dl><?js namespaces.forEach(function(n) { ?>
|
|
||||||
<dt><a href="namespaces.html#<?js= n.longname ?>"><?js= self.linkto(n.longname, n.name) ?></a></dt>
|
|
||||||
<dd><?js if (n.summary) { ?><?js= n.summary ?><?js } ?></dd>
|
|
||||||
<?js }); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
if (doc.observables && doc.observables.length) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Observable Properties</h3>
|
|
||||||
<dl><?js= self.partial('observables.tmpl', doc.observables) ?></dl>
|
|
||||||
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var members = self.find({kind: 'member', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
|
|
||||||
if (members && members.length && members.forEach) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Members</h3>
|
|
||||||
|
|
||||||
<dl><?js members.forEach(function(p) { ?>
|
|
||||||
<?js= self.partial('members.tmpl', p) ?>
|
|
||||||
<?js }); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
|
|
||||||
if (methods && methods.length && methods.forEach) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Methods</h3>
|
|
||||||
|
|
||||||
<dl><?js methods.forEach(function(m) { ?>
|
|
||||||
<?js= self.partial('method.tmpl', m) ?>
|
|
||||||
<?js }); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var typedefs = self.find({kind: 'typedef', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
|
|
||||||
if (typedefs && typedefs.length && typedefs.forEach) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Type Definitions</h3>
|
|
||||||
|
|
||||||
<dl><?js typedefs.forEach(function(e) {
|
|
||||||
if (e.signature) {
|
|
||||||
?>
|
|
||||||
<?js= self.partial('method.tmpl', e) ?>
|
|
||||||
<?js
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
?>
|
|
||||||
<?js= self.partial('members.tmpl', e) ?>
|
|
||||||
<?js
|
|
||||||
}
|
|
||||||
}); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
var events = self.find({kind: 'event', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
|
|
||||||
if (events && events.length && events.forEach) {
|
|
||||||
?>
|
|
||||||
<h3 class="subsection-title">Events</h3>
|
|
||||||
|
|
||||||
<dl><?js events.forEach(function(e) { ?>
|
|
||||||
<?js= self.partial('method.tmpl', e) ?>
|
|
||||||
<?js }); ?></dl>
|
|
||||||
<?js } ?>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js }); ?>
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
?>
|
|
||||||
<dl class="details">
|
|
||||||
<?js
|
|
||||||
var properties = data.properties;
|
|
||||||
if (properties && properties.length && properties.forEach) {
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h5 class="subsection-title">Properties:</h5>
|
|
||||||
|
|
||||||
<dl><?js= this.partial('properties.tmpl', properties) ?></dl>
|
|
||||||
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.version) {?>
|
|
||||||
<dt class="tag-version">Version:</dt>
|
|
||||||
<dd class="tag-version"><ul class="dummy"><li><?js= version ?></li></ul></dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.since) {?>
|
|
||||||
<dt class="tag-since">Since:</dt>
|
|
||||||
<dd class="tag-since"><ul class="dummy"><li><?js= since ?></dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.deprecated) { ?>
|
|
||||||
<dt class="important tag-deprecated">Deprecated</dt><?js
|
|
||||||
if (data.deprecated === true) { ?><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd><?js }
|
|
||||||
else { ?><dd><ul class="dummy"><li><?js= data.deprecated ?></li><ul></dd><?js }
|
|
||||||
?>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.author && author.length) {?>
|
|
||||||
<dt class="tag-author">Author:</dt>
|
|
||||||
<dd class="tag-author">
|
|
||||||
<ul><?js author.forEach(function(a) { ?>
|
|
||||||
<li><?js= self.resolveAuthorLinks(a) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
</dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.copyright) {?>
|
|
||||||
<dt class="tag-copyright">Copyright:</dt>
|
|
||||||
<dd class="tag-copyright"><ul class="dummy"><li><?js= copyright ?></li></ul></dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.license) {?>
|
|
||||||
<dt class="tag-license">License:</dt>
|
|
||||||
<dd class="tag-license"><ul class="dummy"><li><?js= license ?></li></ul></dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.defaultvalue) {?>
|
|
||||||
<dt class="tag-default">Default Value:</dt>
|
|
||||||
<dd class="tag-default"><ul class="dummy"><li><?js= data.defaultvalue ?></li></ul></dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.tutorials && tutorials.length) {?>
|
|
||||||
<dt class="tag-tutorial">Tutorials:</dt>
|
|
||||||
<dd class="tag-tutorial">
|
|
||||||
<ul><?js tutorials.forEach(function(t) { ?>
|
|
||||||
<li><?js= self.tutoriallink(t) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
</dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.see && see.length) {?>
|
|
||||||
<dt class="tag-see">See:</dt>
|
|
||||||
<dd class="tag-see">
|
|
||||||
<ul><?js see.forEach(function(s) { ?>
|
|
||||||
<li><?js= self.linkto(s) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
</dd>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.todo && todo.length) {?>
|
|
||||||
<dt class="tag-todo">TODO</dt>
|
|
||||||
<dd class="tag-todo">
|
|
||||||
<ul><?js todo.forEach(function(t) { ?>
|
|
||||||
<li><?js= t ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
</dd>
|
|
||||||
<?js } ?>
|
|
||||||
</dl>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<?js var data = obj; ?>
|
|
||||||
<pre class="prettyprint"><code><?js= data ?></code></pre>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
data.forEach(function(example) {
|
|
||||||
if (example.caption) {
|
|
||||||
?>
|
|
||||||
<p class="code-caption"><?js= example.caption ?></p>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (example.code.toString().indexOf('<pre>') === -1) { ?>
|
|
||||||
<pre class="prettyprint"><code><?js= example.code ?></code></pre>
|
|
||||||
<?js } else { ?>
|
|
||||||
<?js= example.code.replace(/<pre>/g, '<pre class="prettyprint">') ?>
|
|
||||||
<?js } ?>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
?>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
?>
|
|
||||||
<?js if (data.description && data.type && data.type.names) { ?>
|
|
||||||
<dl>
|
|
||||||
<dt>
|
|
||||||
<div class="param-desc">
|
|
||||||
<?js= data.description ?>
|
|
||||||
</div>
|
|
||||||
</dt>
|
|
||||||
<dt>
|
|
||||||
<dl>
|
|
||||||
<dt>
|
|
||||||
Type
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<?js= this.partial('type.tmpl', data.type.names) ?>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dt>
|
|
||||||
</dl>
|
|
||||||
<?js } else { ?>
|
|
||||||
<div class="param-desc">
|
|
||||||
<?js if (data.description) { ?>
|
|
||||||
<?js= data.description ?>
|
|
||||||
<?js } else if (data.type && data.type.names) { ?>
|
|
||||||
<?js= this.partial('type.tmpl', data.type.names) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</div>
|
|
||||||
<?js } ?>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>OpenLayers 3 API Documentation - <?js= title ?></title>
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<script src="scripts/jquery.min.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jaguar.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
|
||||||
<div class="navbar-inner">
|
|
||||||
<div class="container">
|
|
||||||
<a class="brand" href="/"><img src="../resources/logo.png"> OpenLayers 3</a>
|
|
||||||
<a class="brand" href="index.html">API Documentation</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wrap" class="clearfix">
|
|
||||||
<?js= this.partial('navigation.tmpl', this) ?>
|
|
||||||
<div class="main">
|
|
||||||
<h1 class="page-title" data-filename="<?js= filename ?>"><?js= title ?></h1>
|
|
||||||
<?js= content ?>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a> on <?js= (new Date()) ?>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>prettyPrint();</script>
|
|
||||||
<script src="scripts/linenumber.js"></script>
|
|
||||||
<script src="scripts/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?js if (data.kind === 'package') { ?>
|
|
||||||
<h3><?js= data.name ?> <?js= data.version ?></h3>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.readme) { ?>
|
|
||||||
<section>
|
|
||||||
<article class="readme"><?js= data.readme ?></article>
|
|
||||||
</section>
|
|
||||||
<?js } ?>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
var typeSignature = '';
|
|
||||||
|
|
||||||
if (data.type && data.type.names) {
|
|
||||||
data.type.names.forEach(function (name) {
|
|
||||||
typeSignature += '<span class="type-signature type ' + name.toLowerCase() + '">{' + self.linkto(name, self.htmlsafe(name)) + '}</span> ';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<dt>
|
|
||||||
<div class="nameContainer">
|
|
||||||
<h4 class="name" id="<?js= id ?>">
|
|
||||||
<?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?>
|
|
||||||
<?js= this.partial('stability.tmpl', data) ?>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<?js if (data.summary) { ?>
|
|
||||||
<p class="summary"><?js= summary ?></p>
|
|
||||||
<?js } ?>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<?js if (data.description) { ?>
|
|
||||||
<div class="description">
|
|
||||||
<?js= data.description ?>
|
|
||||||
</div>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js= this.partial('details.tmpl', data) ?>
|
|
||||||
|
|
||||||
<?js if (data.examples && examples.length) { ?>
|
|
||||||
<h5>Example<?js= examples.length > 1? 's':'' ?></h5>
|
|
||||||
<?js= this.partial('examples.tmpl', examples) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</dd>
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
?>
|
|
||||||
<dt>
|
|
||||||
<div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>">
|
|
||||||
<?js if (data.stability || kind !== 'class') { ?>
|
|
||||||
<h4 class="name" id="<?js= id ?>">
|
|
||||||
<?js= data.attribs + (kind === 'class' ? 'new ' : '') + (data.scope === 'static' ? longname : name) + (kind !== 'event' ? data.signature : '') ?>
|
|
||||||
<?js if (data.inherited || data.inherits) { ?>
|
|
||||||
<span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span>
|
|
||||||
<?js } ?>
|
|
||||||
<?js= this.partial('stability.tmpl', data) ?>
|
|
||||||
</h4>
|
|
||||||
<?js if (data.meta) {?>
|
|
||||||
<div class="tag-source">
|
|
||||||
<?js= self.linkto(meta.filename) ?>, <?js= self.linkto(meta.filename, 'line ' + meta.lineno, null, 'line' + meta.lineno) ?>
|
|
||||||
</div>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
</div>
|
|
||||||
<?js if (data.summary) { ?>
|
|
||||||
<p class="summary"><?js= summary ?></p>
|
|
||||||
<?js } ?>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
<?js if (data.description) { ?>
|
|
||||||
<div class="description">
|
|
||||||
<?js= data.description ?>
|
|
||||||
</div>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (kind === 'event' && data.type && data.type.names) {?>
|
|
||||||
<h5>Type:</h5>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<?js= self.partial('type.tmpl', data.type.names) ?>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data['this']) { ?>
|
|
||||||
<h5>This:</h5>
|
|
||||||
<ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.stability || kind !== 'class') { ?>
|
|
||||||
<?js if (data.params && params.length) { ?>
|
|
||||||
<?js= this.partial('params.tmpl', params) ?>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js= this.partial('details.tmpl', data) ?>
|
|
||||||
|
|
||||||
<?js if (data.fires && fires.length) { ?>
|
|
||||||
<h5>Fires:</h5>
|
|
||||||
<ul><?js fires.forEach(function(f) {
|
|
||||||
var parts = f.split(/#?event:/);
|
|
||||||
var type = parts.pop();
|
|
||||||
var eventClassName = parts[0];
|
|
||||||
parts = type.split(' ');
|
|
||||||
type = parts.shift();
|
|
||||||
var description = parts.length ? parts.join(' ') : '';
|
|
||||||
var eventDoclet = self.find({longname: f})[0];
|
|
||||||
if (eventDoclet && !description && eventDoclet.description) {
|
|
||||||
description = eventDoclet.description.replace(/<[^>]*>/g, '');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<li>
|
|
||||||
<code><?js= self.linkto(f, type) ?></code>
|
|
||||||
<?js if (eventClassName) {
|
|
||||||
var eventClass = self.find({longname: eventClassName})[0];
|
|
||||||
if (eventClass) { ?>
|
|
||||||
(<?js= self.linkto(eventClass.longname) ?>)
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
<?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {stability: 'experimental'})) ?>
|
|
||||||
<?js if (description) { ?> -
|
|
||||||
<?js= description ?>
|
|
||||||
<?js } ?>
|
|
||||||
</li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.listens && listens.length) { ?>
|
|
||||||
<h5>Listens to Events:</h5>
|
|
||||||
<ul><?js listens.forEach(function(f) { ?>
|
|
||||||
<li><?js= self.linkto(f) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.listeners && listeners.length) { ?>
|
|
||||||
<h5>Listeners of This Event:</h5>
|
|
||||||
<ul><?js listeners.forEach(function(f) { ?>
|
|
||||||
<li><?js= self.linkto(f) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.exceptions && exceptions.length) { ?>
|
|
||||||
<h5>Throws:</h5>
|
|
||||||
<?js if (exceptions.length > 1) { ?><ul><?js
|
|
||||||
exceptions.forEach(function(r) { ?>
|
|
||||||
<li><?js= self.partial('exceptions.tmpl', r) ?></li>
|
|
||||||
<?js });
|
|
||||||
?></ul><?js } else {
|
|
||||||
exceptions.forEach(function(r) { ?>
|
|
||||||
<?js= self.partial('exceptions.tmpl', r) ?>
|
|
||||||
<?js });
|
|
||||||
} } ?>
|
|
||||||
|
|
||||||
<?js if (data.returns && returns.length) { ?>
|
|
||||||
<?js if (returns.length > 1) { ?><h5>Returns:</h5><?js } ?>
|
|
||||||
<?js= self.partial('returns.tmpl', data.returns) ?>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (data.examples && examples.length) { ?>
|
|
||||||
<h5>Example<?js= examples.length > 1? 's':'' ?></h5>
|
|
||||||
<?js= this.partial('examples.tmpl', examples) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</dd>
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
?>
|
|
||||||
<div class="navigation">
|
|
||||||
<div class="search">
|
|
||||||
<input id="search" type="text" class="form-control input-sm" placeholder="Search Documentation">
|
|
||||||
</div>
|
|
||||||
<ul class="list">
|
|
||||||
<?js
|
|
||||||
this.nav.forEach(function (item) {
|
|
||||||
?>
|
|
||||||
<li class="item" data-name="<?js= item.longname ?>">
|
|
||||||
<span class="title">
|
|
||||||
<?js= self.linkto(item.longname, item.longname) ?>
|
|
||||||
<?js if (item.type === 'namespace' &&
|
|
||||||
(item.members.length + item.typedefs.length + item.methods.length +
|
|
||||||
item.events.length > 0)) { ?>
|
|
||||||
<span class="static">static</span>
|
|
||||||
<?js } ?>
|
|
||||||
</span>
|
|
||||||
<ul class="members itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.members.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Members</span>
|
|
||||||
<?js
|
|
||||||
item.members.forEach(function (v) {
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="typedefs itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.typedefs.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Typedefs</span>
|
|
||||||
<?js
|
|
||||||
item.typedefs.forEach(function (v) {
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="methods itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.methods.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Methods</span>
|
|
||||||
<?js
|
|
||||||
|
|
||||||
item.methods.forEach(function (v) {
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="fires itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.fires && item.fires.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Fires</span>
|
|
||||||
<?js
|
|
||||||
item.fires.forEach(function (v) {
|
|
||||||
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="events itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.events.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Events</span>
|
|
||||||
<?js
|
|
||||||
item.events.forEach(function (v) {
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<?js }); ?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?js
|
|
||||||
var props = obj;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table class="props">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>Settable</th>
|
|
||||||
<th><a href="ol.ObjectEvent.html">ol.ObjectEvent</a> type</th>
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
props.forEach(function(prop) {
|
|
||||||
if (!prop) { return; }
|
|
||||||
var setter = prop.readonly ? 'no' : 'yes';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="name"><code><?js= prop.name ?></code></td>
|
|
||||||
<td class="type">
|
|
||||||
<?js if (prop.type && prop.type.names) {?>
|
|
||||||
<?js= self.partial('type.tmpl', prop.type.names) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
<td class="setter"><?js= setter ?></td>
|
|
||||||
<td class="event"><code>change:<?js= prop.name.toLowerCase() ?></code></td>
|
|
||||||
<td class="description last"><?js= prop.description ?></td>
|
|
||||||
</tr>
|
|
||||||
<?js }); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
<?js
|
|
||||||
var params = obj;
|
|
||||||
|
|
||||||
/* sort subparams under their parent params (like opts.classname) */
|
|
||||||
var parentParam = null;
|
|
||||||
params.forEach(function(param, i) {
|
|
||||||
if (!param) { return; }
|
|
||||||
if ( parentParam && param.name && param.name.indexOf(parentParam.name + '.') === 0 ) {
|
|
||||||
param.name = param.name.substr(parentParam.name.length+1);
|
|
||||||
parentParam.subparams = parentParam.subparams || [];
|
|
||||||
parentParam.subparams.push(param);
|
|
||||||
params[i] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parentParam = param;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* determine if we need extra columns, "attributes" and "default" */
|
|
||||||
params.hasAttributes = false;
|
|
||||||
params.hasDefault = false;
|
|
||||||
params.hasName = false;
|
|
||||||
|
|
||||||
var colspan = 2;
|
|
||||||
params.forEach(function(param) {
|
|
||||||
if (!param) { return; }
|
|
||||||
if (param.type && param.type.names && param.type.names.indexOf('undefined') !== -1) {
|
|
||||||
param.optional = true;
|
|
||||||
}
|
|
||||||
if (param.name.indexOf('var_') == 0) {
|
|
||||||
params.hasAttributes = true;
|
|
||||||
param.variable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (param.optional || param.nullable) {
|
|
||||||
params.hasAttributes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (param.name) {
|
|
||||||
params.hasName = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof param.defaultvalue !== 'undefined') {
|
|
||||||
++colspan;
|
|
||||||
params.hasDefault = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<?js if (params.hasName) {?>
|
|
||||||
<th>Name</th>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<th>Type</th>
|
|
||||||
|
|
||||||
<?js if (params.hasDefault) {?>
|
|
||||||
<th>Default</th>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
params.forEach(function(param) {
|
|
||||||
if (!param) { return; }
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<?js if (params.hasName) {?>
|
|
||||||
<td class="name"><code><?js= param.name.replace(/^opt_/, "") ?></code></td>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (!param.subparams) {?>
|
|
||||||
<td class="type">
|
|
||||||
<?js if (param.type && param.type.names) {?>
|
|
||||||
<?js= self.partial('type.tmpl', param.type.names) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<?js if (params.hasDefault) {?>
|
|
||||||
<td class="default">
|
|
||||||
<?js if (typeof param.defaultvalue !== 'undefined') { ?>
|
|
||||||
<?js= self.htmlsafe(param.defaultvalue) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<td<?js= (param.subparams ? ' colspan=' + colspan : ' ') ?> class="description last">
|
|
||||||
<?js if (params.hasAttributes) {?>
|
|
||||||
<?js if (param.optional) { ?>
|
|
||||||
<span class="optional">optional</span>
|
|
||||||
<?js } ?>
|
|
||||||
<?js if (param.nullable) { ?>
|
|
||||||
<span class="nullable">nullable</span>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (param.variable) { ?>
|
|
||||||
<span class="repeatable">repeatable</span>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
|
||||||
<?js= param.description ?><?js if (param.subparams) { ?>
|
|
||||||
<?js= self.partial('params.tmpl', param.subparams) ?>
|
|
||||||
<?js } ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?js }); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
<?js
|
|
||||||
var props = obj;
|
|
||||||
|
|
||||||
/* sort subprops under their parent props (like opts.classname) */
|
|
||||||
var parentProp = null;
|
|
||||||
props.forEach(function(prop, i) {
|
|
||||||
if (!prop) { return; }
|
|
||||||
if ( parentProp && prop.name && prop.name.indexOf(parentProp.name + '.') === 0 ) {
|
|
||||||
prop.name = prop.name.substr(parentProp.name.length+1);
|
|
||||||
parentProp.subprops = parentProp.subprops || [];
|
|
||||||
parentProp.subprops.push(prop);
|
|
||||||
props[i] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parentProp = prop;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* determine if we need extra columns, "attributes" and "default" */
|
|
||||||
props.hasAttributes = false;
|
|
||||||
props.hasDefault = false;
|
|
||||||
props.hasName = false;
|
|
||||||
|
|
||||||
props.forEach(function(prop) {
|
|
||||||
if (!prop) { return; }
|
|
||||||
|
|
||||||
if (prop.optional || prop.nullable) {
|
|
||||||
props.hasAttributes = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prop.name) {
|
|
||||||
props.hasName = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof prop.defaultvalue !== 'undefined') {
|
|
||||||
props.hasDefault = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table class="props">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<?js if (props.hasName) {?>
|
|
||||||
<th>Name</th>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<th>Type</th>
|
|
||||||
|
|
||||||
<?js if (props.hasAttributes) {?>
|
|
||||||
<th>Argument</th>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (props.hasDefault) {?>
|
|
||||||
<th>Default</th>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
props.forEach(function(prop) {
|
|
||||||
if (!prop) { return; }
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<?js if (props.hasName) {?>
|
|
||||||
<td class="name"><code><?js= prop.name ?></code></td>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
<?js if (prop.type && prop.type.names) {?>
|
|
||||||
<?js= self.partial('type.tmpl', prop.type.names) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<?js if (props.hasAttributes) {?>
|
|
||||||
<td class="attributes">
|
|
||||||
<?js if (prop.optional) { ?>
|
|
||||||
<optional><br>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (prop.nullable) { ?>
|
|
||||||
<nullable><br>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (props.hasDefault) {?>
|
|
||||||
<td class="default">
|
|
||||||
<?js if (typeof prop.defaultvalue !== 'undefined') { ?>
|
|
||||||
<?js= self.htmlsafe(prop.defaultvalue) ?>
|
|
||||||
<?js } ?>
|
|
||||||
</td>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<td class="description last"><?js= prop.description ?><?js if (prop.subprops) { ?>
|
|
||||||
<h6>Properties</h6><?js= self.partial('properties.tmpl', prop.subprops) ?>
|
|
||||||
<?js } ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?js }); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
<?js
|
|
||||||
var returns = obj;
|
|
||||||
var parentReturn = null;
|
|
||||||
|
|
||||||
returns.forEach(function (ret, i) {
|
|
||||||
if (ret && (ret.description || ret.name)) {
|
|
||||||
ret.description = ret.description.toString().replace(/<\/?p>/g, '');
|
|
||||||
|
|
||||||
var isNamed = ret.name ? true : false;
|
|
||||||
var name = ret.name || ret.description;
|
|
||||||
var startSpacePos = name.indexOf(" ");
|
|
||||||
|
|
||||||
if (parentReturn !== null && name.indexOf(parentReturn.name + '.') === 0) {
|
|
||||||
ret.name = isNamed ? name.substr(parentReturn.name.length + 1) : name.substr(parentReturn.name.length + 1, startSpacePos - (parentReturn.name.length + 1));
|
|
||||||
|
|
||||||
parentReturn.subReturns = parentReturn.subReturns || [];
|
|
||||||
parentReturn.subReturns.push(ret);
|
|
||||||
returns[i] = null;
|
|
||||||
} else {
|
|
||||||
if (!isNamed) {
|
|
||||||
ret.name = ret.description.substr(0, startSpacePos !== -1 ? startSpacePos : ret.description.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
parentReturn = ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?js
|
|
||||||
if (returns.length > 1) {
|
|
||||||
?>
|
|
||||||
<table class="params">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?js
|
|
||||||
var self = this;
|
|
||||||
returns.forEach(function(ret) {
|
|
||||||
if (!ret) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="name"><code><?js= ret.name ?></code></td>
|
|
||||||
<td class="type">
|
|
||||||
<?js
|
|
||||||
if (ret.type && ret.type.names) {
|
|
||||||
ret.type.names.forEach(function(name, i) { ?>
|
|
||||||
<?js= self.linkto(name, self.htmlsafe(name)) ?>
|
|
||||||
<?js if (i < ret.type.names.length-1) { ?> | <?js } ?>
|
|
||||||
<?js });
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td class="description last"><?js= ret.description ?><?js if (ret.subReturns) { ?>
|
|
||||||
<?js= self.partial('returns.tmpl', ret.subReturns) ?>
|
|
||||||
<?js } ?></td>
|
|
||||||
</tr>
|
|
||||||
<?js }); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?js } else if (returns[0].description) { ?>
|
|
||||||
<h5>Returns:</h5>
|
|
||||||
<?js= returns[0].description ?>
|
|
||||||
<br />
|
|
||||||
<?js } ?>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
?>
|
|
||||||
<section>
|
|
||||||
<article>
|
|
||||||
<pre class="prettyprint source"><code><?js= data.code ?></code></pre>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
if (data.stability != 'stable') { ?>
|
|
||||||
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
|
|
||||||
<?js } ?>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
<?js if (children.length > 0) { ?>
|
|
||||||
<ul><?js
|
|
||||||
var self = this;
|
|
||||||
children.forEach(function(t) { ?>
|
|
||||||
<li><?js= self.tutoriallink(t.name) ?></li>
|
|
||||||
<?js }); ?></ul>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<h2><?js= header ?></h2>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<?js= content ?>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?js
|
|
||||||
var data = obj;
|
|
||||||
var self = this;
|
|
||||||
data.forEach(function(name, i) { ?>
|
|
||||||
<span class="param-type"><?js= self.linkto(name, self.htmlsafe(name)) ?></span>
|
|
||||||
<?js if (i < data.length-1) { ?>|<?js } ?>
|
|
||||||
<?js }); ?>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,33 +0,0 @@
|
|||||||
//
|
|
||||||
// A PhantomJS script used to check that the hosted examples load
|
|
||||||
// without errors. This script is executed by the build tool's
|
|
||||||
// check-examples target.
|
|
||||||
//
|
|
||||||
var args = require('system').args;
|
|
||||||
if (args.length != 2) {
|
|
||||||
phantom.exit(2);
|
|
||||||
}
|
|
||||||
var examplePath = args[1];
|
|
||||||
var page = require('webpage').create();
|
|
||||||
page.onError = function(msg, trace) {
|
|
||||||
var msgStack = ['JavaScript ERROR: ' + msg];
|
|
||||||
if (trace) {
|
|
||||||
msgStack.push('TRACE:');
|
|
||||||
trace.forEach(function(t) {
|
|
||||||
msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : ''));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
console.error(msgStack.join('\n'));
|
|
||||||
phantom.exit(1);
|
|
||||||
};
|
|
||||||
page.open(examplePath, function(s) {
|
|
||||||
var exitCode = 0;
|
|
||||||
if (s != 'success') {
|
|
||||||
exitCode = 1;
|
|
||||||
console.error('PAGE LOAD ERROR');
|
|
||||||
}
|
|
||||||
phantom.exit(exitCode);
|
|
||||||
});
|
|
||||||
page.onConsoleMessage = function(msg) {
|
|
||||||
console.log('console:', msg);
|
|
||||||
};
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
|
||||||
examples = {}
|
|
||||||
requires = set()
|
|
||||||
for filename in argv[1:]:
|
|
||||||
lines = open(filename, 'rU').readlines()
|
|
||||||
if len(lines) > 0 and lines[0].startswith('// NOCOMPILE'):
|
|
||||||
continue
|
|
||||||
requires.update(line for line in lines if line.startswith('goog.require'))
|
|
||||||
examples[filename] = [line for line in lines if not line.startswith('goog.require')]
|
|
||||||
for require in sorted(requires):
|
|
||||||
sys.stdout.write(require)
|
|
||||||
for filename in sorted(examples.keys()):
|
|
||||||
sys.stdout.write('// ' + filename + '\n')
|
|
||||||
sys.stdout.write('(function(){\n')
|
|
||||||
for line in examples[filename]:
|
|
||||||
sys.stdout.write(line)
|
|
||||||
sys.stdout.write('})();\n')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.exit(main(sys.argv))
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This script is supposed to be executed via phantomjs. It will generate
|
|
||||||
* screenshots of the html files in the directory specified by a commandline
|
|
||||||
* option when these files are served through a webserver which can also be
|
|
||||||
* specified. The screenshots will be in the current working directory.
|
|
||||||
*
|
|
||||||
* Example usage:
|
|
||||||
*
|
|
||||||
* user@host:~/ol3/bin $ phantomjs example-screenshot.js \
|
|
||||||
* http://localhost:8000/ol3/examples/ \
|
|
||||||
* ../examples
|
|
||||||
*
|
|
||||||
* The above command will generate `*.png` files in `examples/` for all html
|
|
||||||
* files that are served through `http://localhost:8000/ol3/examples/`.
|
|
||||||
*
|
|
||||||
* So if there is a file `my-humpty-example.html` inside of the relative folder
|
|
||||||
* `../examples/` which is being served through the webserver so that
|
|
||||||
* `http://localhost:8000/ol3/examples/my-humpty-example.html` is a valid and
|
|
||||||
* reachable URL, this script will generate a screenshot and store it as
|
|
||||||
* `my-humpty-example.html.png`.
|
|
||||||
*
|
|
||||||
* The query string `?mode=raw` will be appended to the generated URL.
|
|
||||||
*
|
|
||||||
* Known limitations:
|
|
||||||
*
|
|
||||||
* As phantomjs doesn't support WebGL (see e.g.
|
|
||||||
* https://github.com/ariya/phantomjs/wiki/Supported-Web-Standards and
|
|
||||||
* http://code.google.com/p/phantomjs/issues/detail?id=273) This won't render
|
|
||||||
* OpenLayers maps rendered through the webglrenderer.
|
|
||||||
*
|
|
||||||
* In parts based upon this gist: https://gist.github.com/crazy4groovy/3160121
|
|
||||||
*/
|
|
||||||
(function() { // global closure
|
|
||||||
|
|
||||||
var page = require('webpage').create(), // imports
|
|
||||||
fs = require('fs'),
|
|
||||||
system = require('system'),
|
|
||||||
// arguments
|
|
||||||
baseExamplesUrl = system.args[1],
|
|
||||||
exampleDir = system.args[2],
|
|
||||||
// various settings
|
|
||||||
ignoreFiles = [
|
|
||||||
'index.html'
|
|
||||||
],
|
|
||||||
intervalMillisecs = 25,
|
|
||||||
renderMillisecs = 2000,
|
|
||||||
// basic variables
|
|
||||||
curDir = fs.workingDirectory,
|
|
||||||
exampleDirList = fs.list(exampleDir),
|
|
||||||
pageindex = 0,
|
|
||||||
fileName = '',
|
|
||||||
htmlFiles = [],
|
|
||||||
lenHtmlFiles = 0,
|
|
||||||
loadInProgress = false;
|
|
||||||
|
|
||||||
// simple object with helper functions
|
|
||||||
var util = {
|
|
||||||
/**
|
|
||||||
* Returns the basename of a file given a path.
|
|
||||||
*/
|
|
||||||
baseName: function(path) {
|
|
||||||
var parts = path.split(fs.separator);
|
|
||||||
return parts[parts.length - 1];
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Super basic test whether a file can be considered a HTML-file.
|
|
||||||
*/
|
|
||||||
isHtmlFile: function(filename) {
|
|
||||||
return (/\.html?$/).test(filename);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Appends a slash to given string if it isn't there already.
|
|
||||||
*/
|
|
||||||
appendSlash: function(str) {
|
|
||||||
return ((/\/$/).test(str)) ? str : str + '/';
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Generates an URL out of given baseurl and path.
|
|
||||||
*/
|
|
||||||
buildUrl: function(baseurl, path) {
|
|
||||||
var name = util.baseName(path),
|
|
||||||
mode = 'raw';
|
|
||||||
return util.appendSlash(baseurl) + name + '?mode=' + mode;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Simple progressbar logger that uses our globals pageindex & lenHtmlFiles.
|
|
||||||
*/
|
|
||||||
logProgress: function() {
|
|
||||||
var doneSymbol = '-',
|
|
||||||
todoSymbol = ' ',
|
|
||||||
currentSymbol = '>',
|
|
||||||
barStrLeft = '[',
|
|
||||||
barStrRight = ']',
|
|
||||||
progresStep = 5, // one doneSymbol equals this percentage
|
|
||||||
totalSteps = Math.round(100 / progresStep),
|
|
||||||
ratio = (lenHtmlFiles === 0) ? 0 : (pageindex / lenHtmlFiles),
|
|
||||||
percent = (ratio === 0) ? 0 : ratio * 100,
|
|
||||||
normalizedNumDone = Math.floor(ratio * totalSteps),
|
|
||||||
normalizedNumTodo = totalSteps - normalizedNumDone,
|
|
||||||
progressLine = '',
|
|
||||||
i = 0;
|
|
||||||
// the progress bar
|
|
||||||
progressLine += barStrLeft;
|
|
||||||
for (; i < normalizedNumDone; i++) {
|
|
||||||
progressLine += doneSymbol;
|
|
||||||
}
|
|
||||||
for (i = 0; i < normalizedNumTodo; i++) {
|
|
||||||
progressLine += (i === 0) ? currentSymbol : todoSymbol;
|
|
||||||
}
|
|
||||||
progressLine += barStrRight;
|
|
||||||
// the percentage information
|
|
||||||
// pad if necessary
|
|
||||||
if (percent < 10) {
|
|
||||||
progressLine += ' ';
|
|
||||||
} else if (percent < 100) {
|
|
||||||
progressLine += ' ';
|
|
||||||
}
|
|
||||||
progressLine += ' ' + percent.toFixed(1) + ' % done';
|
|
||||||
// additional information
|
|
||||||
if (fileName !== '') {
|
|
||||||
progressLine += ', ' + util.baseName(fileName) + '';
|
|
||||||
}
|
|
||||||
console.log(progressLine);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// iterate over all files in examples directory
|
|
||||||
// and find the HTML files.
|
|
||||||
for (var i = 0; i < exampleDirList.length; i++) {
|
|
||||||
var fullpath = exampleDir + fs.separator + exampleDirList[i];
|
|
||||||
if (fs.isFile(fullpath) && util.isHtmlFile(fullpath) &&
|
|
||||||
ignoreFiles.indexOf(util.baseName(fullpath)) === -1) {
|
|
||||||
//TODO: make this more async (i.e. pop on/off stack WHILE rending pages)
|
|
||||||
htmlFiles.push(fullpath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lenHtmlFiles = htmlFiles.length;
|
|
||||||
|
|
||||||
console.log('Capturing ' + lenHtmlFiles + ' example screenshots.');
|
|
||||||
|
|
||||||
// The main interval function that is executed regularily and renders a
|
|
||||||
// page to a file
|
|
||||||
var interval = setInterval(function() {
|
|
||||||
if (!loadInProgress && pageindex < lenHtmlFiles) {
|
|
||||||
util.logProgress();
|
|
||||||
fileName = htmlFiles[pageindex];
|
|
||||||
page.viewportSize = { width: 800, height: 600 };
|
|
||||||
page.clipRect = {
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: page.viewportSize.width,
|
|
||||||
height: page.viewportSize.height
|
|
||||||
};
|
|
||||||
page.open(util.buildUrl(baseExamplesUrl, htmlFiles[pageindex]));
|
|
||||||
}
|
|
||||||
if (pageindex == lenHtmlFiles) {
|
|
||||||
util.logProgress();
|
|
||||||
console.log(lenHtmlFiles + ' screenshots captured.');
|
|
||||||
phantom.exit();
|
|
||||||
}
|
|
||||||
}, intervalMillisecs);
|
|
||||||
|
|
||||||
// set loadInProgress flag so we only process one image at time.
|
|
||||||
page.onLoadStarted = function() {
|
|
||||||
loadInProgress = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// When the page is loaded, render it to an image
|
|
||||||
page.onLoadFinished = function() {
|
|
||||||
var dest = exampleDir + fs.separator + util.baseName(fileName) + '.png';
|
|
||||||
window.setTimeout(function() {
|
|
||||||
loadInProgress = false;
|
|
||||||
page.render(dest); // actually render the page.
|
|
||||||
pageindex++;
|
|
||||||
}, renderMillisecs);
|
|
||||||
};
|
|
||||||
|
|
||||||
})(); // eof global closure
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import time
|
|
||||||
from xml.dom.minidom import Document
|
|
||||||
|
|
||||||
try:
|
|
||||||
import xml.etree.ElementTree as ElementTree
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
import cElementTree as ElementTree # NOQA
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
import elementtree.ElementTree as ElementTree # NOQA
|
|
||||||
except ImportError:
|
|
||||||
import lxml.etree as ElementTree # NOQA
|
|
||||||
|
|
||||||
missing_deps = False
|
|
||||||
try:
|
|
||||||
import json
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
import simplejson as json # NOQA
|
|
||||||
except ImportError, E:
|
|
||||||
missing_deps = E
|
|
||||||
|
|
||||||
try:
|
|
||||||
from BeautifulSoup import BeautifulSoup
|
|
||||||
except ImportError, E:
|
|
||||||
missing_deps = E
|
|
||||||
|
|
||||||
feedName = "example-list.xml"
|
|
||||||
feedPath = "http://openlayers.github.io/ol3/master/examples/"
|
|
||||||
|
|
||||||
|
|
||||||
def getListOfExamples(relPath):
|
|
||||||
"""
|
|
||||||
returns list of .html filenames within a given path - excludes
|
|
||||||
index.html
|
|
||||||
"""
|
|
||||||
examples = os.listdir(relPath)
|
|
||||||
examples = [example for example in examples if
|
|
||||||
example.endswith('.html') and example != "index.html"]
|
|
||||||
return examples
|
|
||||||
|
|
||||||
|
|
||||||
def getExampleHtml(path):
|
|
||||||
"""
|
|
||||||
returns html of a specific example
|
|
||||||
"""
|
|
||||||
print '.',
|
|
||||||
f = open(path)
|
|
||||||
html = f.read()
|
|
||||||
f.close()
|
|
||||||
return html
|
|
||||||
|
|
||||||
|
|
||||||
def extractById(soup, tagId, value=None):
|
|
||||||
"""
|
|
||||||
returns full contents of a particular tag id
|
|
||||||
"""
|
|
||||||
beautifulTag = soup.find(id=tagId)
|
|
||||||
if beautifulTag:
|
|
||||||
if beautifulTag.contents:
|
|
||||||
value = str(beautifulTag.renderContents()).strip()
|
|
||||||
value = value.replace('\t', '')
|
|
||||||
value = value.replace('\n', '')
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def getRelatedClasses(html):
|
|
||||||
"""
|
|
||||||
parses the html, and returns a list of all OpenLayers Classes
|
|
||||||
used within (ie what parts of OL the javascript uses).
|
|
||||||
"""
|
|
||||||
rawstr = r'''(?P<class>ol\..*?)\('''
|
|
||||||
return re.findall(rawstr, html)
|
|
||||||
|
|
||||||
|
|
||||||
def parseHtml(html, ids):
|
|
||||||
"""
|
|
||||||
returns dictionary of items of interest
|
|
||||||
"""
|
|
||||||
soup = BeautifulSoup(html)
|
|
||||||
d = {}
|
|
||||||
for tagId in ids:
|
|
||||||
d[tagId] = extractById(soup, tagId)
|
|
||||||
#classes should eventually be parsed from docs - not automatically created.
|
|
||||||
classes = getRelatedClasses(html)
|
|
||||||
d['classes'] = classes
|
|
||||||
return d
|
|
||||||
|
|
||||||
|
|
||||||
def getGitInfo(exampleDir, exampleName):
|
|
||||||
orig = os.getcwd()
|
|
||||||
os.chdir(exampleDir)
|
|
||||||
h = os.popen("git log -n 1 --pretty=format:'%an|%ai' " + exampleName)
|
|
||||||
os.chdir(orig)
|
|
||||||
log = h.read()
|
|
||||||
h.close()
|
|
||||||
d = {}
|
|
||||||
if log:
|
|
||||||
parts = log.split("|")
|
|
||||||
d["author"] = parts[0]
|
|
||||||
# compensate for spaces in git log time
|
|
||||||
td = parts[1].split(" ")
|
|
||||||
td.insert(1, "T")
|
|
||||||
d["date"] = "".join(td)
|
|
||||||
else:
|
|
||||||
d["author"] = ""
|
|
||||||
d["date"] = ""
|
|
||||||
return d
|
|
||||||
|
|
||||||
|
|
||||||
def createFeed(examples):
|
|
||||||
doc = Document()
|
|
||||||
atomuri = "http://www.w3.org/2005/Atom"
|
|
||||||
feed = doc.createElementNS(atomuri, "feed")
|
|
||||||
feed.setAttribute("xmlns", atomuri)
|
|
||||||
title = doc.createElementNS(atomuri, "title")
|
|
||||||
title.appendChild(doc.createTextNode("OpenLayers Examples"))
|
|
||||||
feed.appendChild(title)
|
|
||||||
link = doc.createElementNS(atomuri, "link")
|
|
||||||
link.setAttribute("rel", "self")
|
|
||||||
link.setAttribute("href", feedPath + feedName)
|
|
||||||
|
|
||||||
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
|
||||||
id = doc.createElementNS(atomuri, "id")
|
|
||||||
id.appendChild(doc.createTextNode(
|
|
||||||
"%s%s#%s" % (feedPath, feedName, modtime)))
|
|
||||||
feed.appendChild(id)
|
|
||||||
|
|
||||||
updated = doc.createElementNS(atomuri, "updated")
|
|
||||||
updated.appendChild(doc.createTextNode(modtime))
|
|
||||||
feed.appendChild(updated)
|
|
||||||
|
|
||||||
examples.sort(key=lambda x: x["modified"])
|
|
||||||
for example in sorted(examples, key=lambda x: x["modified"], reverse=True):
|
|
||||||
entry = doc.createElementNS(atomuri, "entry")
|
|
||||||
|
|
||||||
title = doc.createElementNS(atomuri, "title")
|
|
||||||
title.appendChild(doc.createTextNode(example["title"] or
|
|
||||||
example["example"]))
|
|
||||||
entry.appendChild(title)
|
|
||||||
|
|
||||||
tags = doc.createElementNS(atomuri, "tags")
|
|
||||||
tags.appendChild(doc.createTextNode(example["tags"] or
|
|
||||||
example["example"]))
|
|
||||||
entry.appendChild(tags)
|
|
||||||
|
|
||||||
link = doc.createElementNS(atomuri, "link")
|
|
||||||
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
|
|
||||||
entry.appendChild(link)
|
|
||||||
|
|
||||||
summary = doc.createElementNS(atomuri, "summary")
|
|
||||||
summary.appendChild(doc.createTextNode(example["shortdesc"] or
|
|
||||||
example["example"]))
|
|
||||||
entry.appendChild(summary)
|
|
||||||
|
|
||||||
updated = doc.createElementNS(atomuri, "updated")
|
|
||||||
updated.appendChild(doc.createTextNode(example["modified"]))
|
|
||||||
entry.appendChild(updated)
|
|
||||||
|
|
||||||
author = doc.createElementNS(atomuri, "author")
|
|
||||||
name = doc.createElementNS(atomuri, "name")
|
|
||||||
name.appendChild(doc.createTextNode(example["author"]))
|
|
||||||
author.appendChild(name)
|
|
||||||
entry.appendChild(author)
|
|
||||||
|
|
||||||
id = doc.createElementNS(atomuri, "id")
|
|
||||||
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath,
|
|
||||||
example["example"],
|
|
||||||
example["modified"])))
|
|
||||||
entry.appendChild(id)
|
|
||||||
|
|
||||||
feed.appendChild(entry)
|
|
||||||
|
|
||||||
doc.appendChild(feed)
|
|
||||||
return doc
|
|
||||||
|
|
||||||
|
|
||||||
def wordIndex(examples):
|
|
||||||
"""
|
|
||||||
Create an inverted index based on words in title and shortdesc. Keys are
|
|
||||||
lower cased words. Values are dictionaries with example index keys and
|
|
||||||
count values.
|
|
||||||
"""
|
|
||||||
index = {}
|
|
||||||
unword = re.compile("\\W+")
|
|
||||||
keys = ["shortdesc", "title", "tags"]
|
|
||||||
for i in range(len(examples)):
|
|
||||||
for key in keys:
|
|
||||||
text = examples[i][key]
|
|
||||||
if text:
|
|
||||||
words = unword.split(text)
|
|
||||||
for word in words:
|
|
||||||
if word:
|
|
||||||
word = word.lower()
|
|
||||||
if word in index:
|
|
||||||
if i in index[word]:
|
|
||||||
index[word][i] += 1
|
|
||||||
else:
|
|
||||||
index[word][i] = 1
|
|
||||||
else:
|
|
||||||
index[word] = {i: 1}
|
|
||||||
return index
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
if missing_deps:
|
|
||||||
print """This script requires json or simplejson and BeautifulSoup.
|
|
||||||
You don't have them. \n(%s)""" % E
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
if len(sys.argv) == 3:
|
|
||||||
inExampleDir = sys.argv[1]
|
|
||||||
outExampleDir = sys.argv[2]
|
|
||||||
else:
|
|
||||||
inExampleDir = "../examples"
|
|
||||||
outExampleDir = "../examples"
|
|
||||||
|
|
||||||
outFile = open(os.path.join(outExampleDir, "example-list.js"), "w")
|
|
||||||
|
|
||||||
print 'Reading examples from %s and writing out to %s' % (inExampleDir,
|
|
||||||
outFile.name)
|
|
||||||
|
|
||||||
exampleList = []
|
|
||||||
docIds = ['title', 'shortdesc', 'tags']
|
|
||||||
|
|
||||||
examples = getListOfExamples(inExampleDir)
|
|
||||||
|
|
||||||
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
|
||||||
|
|
||||||
for example in examples:
|
|
||||||
path = os.path.join(inExampleDir, example)
|
|
||||||
html = getExampleHtml(path)
|
|
||||||
tagvalues = parseHtml(html, docIds)
|
|
||||||
tagvalues['example'] = example
|
|
||||||
# add in author/date info
|
|
||||||
d = getGitInfo(inExampleDir, example)
|
|
||||||
tagvalues["author"] = d["author"] or "anonymous"
|
|
||||||
tagvalues["modified"] = d["date"] or modtime
|
|
||||||
tagvalues['link'] = example
|
|
||||||
|
|
||||||
exampleList.append(tagvalues)
|
|
||||||
|
|
||||||
print
|
|
||||||
|
|
||||||
exampleList.sort(key=lambda x: x['example'].lower())
|
|
||||||
|
|
||||||
index = wordIndex(exampleList)
|
|
||||||
|
|
||||||
json = json.dumps({"examples": exampleList, "index": index})
|
|
||||||
# Give the json a global variable we can use in our js.
|
|
||||||
# This should be replaced or made optional.
|
|
||||||
json = 'var info=' + json + ';'
|
|
||||||
outFile.write(json)
|
|
||||||
outFile.close()
|
|
||||||
|
|
||||||
outFeedPath = os.path.join(outExampleDir, feedName)
|
|
||||||
print "writing feed to %s " % outFeedPath
|
|
||||||
atom = open(outFeedPath, 'w')
|
|
||||||
doc = createFeed(exampleList)
|
|
||||||
atom.write(doc.toxml())
|
|
||||||
atom.close()
|
|
||||||
|
|
||||||
print 'complete'
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
from optparse import OptionParser
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import pystache
|
|
||||||
|
|
||||||
|
|
||||||
ESCAPE_SEQUENCE = {
|
|
||||||
'\\': '\\\\',
|
|
||||||
'\n': '\\n',
|
|
||||||
'\t': '\\t'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def js_escape(s):
|
|
||||||
return ''.join(ESCAPE_SEQUENCE.get(c, c) for c in s)
|
|
||||||
|
|
||||||
|
|
||||||
def glsl_compress(s, shortNames):
|
|
||||||
# strip leading whitespace
|
|
||||||
s = re.sub(r'\A\s+', '', s)
|
|
||||||
# strip trailing whitespace
|
|
||||||
s = re.sub(r'\s+\Z', '', s)
|
|
||||||
# strip multi-line comments
|
|
||||||
s = re.sub(r'/\*.*?\*/', '', s)
|
|
||||||
# strip single line comments
|
|
||||||
s = re.sub(r'//.*?\n', '', s)
|
|
||||||
# replace multiple whitespace with a single space
|
|
||||||
s = re.sub(r'\s+', ' ', s)
|
|
||||||
# remove whitespace between non-word tokens
|
|
||||||
s = re.sub(r'(\S)\s+([^\w])', r'\1\2', s)
|
|
||||||
s = re.sub(r'([^\w])\s+(\S)', r'\1\2', s)
|
|
||||||
# replace original names with short names
|
|
||||||
for originalName, shortName in shortNames.items():
|
|
||||||
s = s.replace(originalName, shortName)
|
|
||||||
return s
|
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
|
||||||
option_parser = OptionParser()
|
|
||||||
option_parser.add_option('--input')
|
|
||||||
option_parser.add_option('--output')
|
|
||||||
option_parser.add_option('--template')
|
|
||||||
options, args = option_parser.parse_args(argv[1:])
|
|
||||||
|
|
||||||
context = {}
|
|
||||||
nextShortName = ord('a')
|
|
||||||
shortNames = {}
|
|
||||||
|
|
||||||
common, vertex, fragment = [], [], []
|
|
||||||
attributes, uniforms, varyings = {}, {}, {}
|
|
||||||
block = None
|
|
||||||
for line in open(options.input, 'rU'):
|
|
||||||
if line.startswith('//!'):
|
|
||||||
m = re.match(r'//!\s+NAMESPACE=(\S+)\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
context['namespace'] = m.group(1)
|
|
||||||
continue
|
|
||||||
m = re.match(r'//!\s+CLASS=(\S+)\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
context['className'] = m.group(1)
|
|
||||||
continue
|
|
||||||
m = re.match(r'//!\s+COMMON\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
block = common
|
|
||||||
continue
|
|
||||||
m = re.match(r'//!\s+VERTEX\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
block = vertex
|
|
||||||
continue
|
|
||||||
m = re.match(r'//!\s+FRAGMENT\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
block = fragment
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
if block is None:
|
|
||||||
assert line.rstrip() == ''
|
|
||||||
else:
|
|
||||||
block.append(line)
|
|
||||||
m = re.match(r'attribute\s+\S+\s+(\S+);\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
attribute = m.group(1)
|
|
||||||
if attribute not in attributes:
|
|
||||||
shortName = chr(nextShortName)
|
|
||||||
nextShortName += 1
|
|
||||||
attributes[attribute] = {'originalName': attribute, 'shortName': shortName}
|
|
||||||
shortNames[attribute] = shortName
|
|
||||||
m = re.match(r'uniform\s+\S+\s+(\S+);\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
uniform = m.group(1)
|
|
||||||
if uniform not in uniforms:
|
|
||||||
shortName = chr(nextShortName)
|
|
||||||
nextShortName += 1
|
|
||||||
uniforms[uniform] = {'originalName': uniform, 'shortName': shortName}
|
|
||||||
shortNames[uniform] = shortName
|
|
||||||
m = re.match(r'varying\s+\S+\s+(\S+);\s*\Z', line)
|
|
||||||
if m:
|
|
||||||
varying = m.group(1)
|
|
||||||
if varying not in varyings:
|
|
||||||
shortName = chr(nextShortName)
|
|
||||||
nextShortName += 1
|
|
||||||
shortNames[varying] = shortName
|
|
||||||
|
|
||||||
context['getOriginalFragmentSource'] = js_escape(''.join(common + fragment))
|
|
||||||
context['getOriginalVertexSource'] = js_escape(''.join(common + vertex))
|
|
||||||
context['getFragmentSource'] = glsl_compress(''.join(common + fragment), shortNames)
|
|
||||||
context['getVertexSource'] = glsl_compress(''.join(common + vertex), shortNames)
|
|
||||||
context['getAttributes'] = [attributes[a] for a in sorted(attributes.keys())]
|
|
||||||
context['getUniforms'] = [uniforms[u] for u in sorted(uniforms.keys())]
|
|
||||||
|
|
||||||
if options.output and options.output != '-':
|
|
||||||
output = open(options.output, 'wb')
|
|
||||||
else:
|
|
||||||
output = sys.stdout
|
|
||||||
output.write(pystache.render(open(options.template, 'rb').read(), context))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.exit(main(sys.argv))
|
|
||||||
@@ -1,765 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
from cStringIO import StringIO
|
|
||||||
import gzip
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import glob
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pake import Target
|
|
||||||
from pake import ifind, main, output, rule, target, variables, virtual, which
|
|
||||||
|
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
|
|
||||||
win = {
|
|
||||||
'GIT': 'git.exe',
|
|
||||||
'GJSLINT': 'gjslint.exe',
|
|
||||||
'JAVA': 'java.exe',
|
|
||||||
'JAR': 'jar.exe',
|
|
||||||
'JSDOC': './node_modules/.bin/jsdoc',
|
|
||||||
'JSHINT': './node_modules/.bin/jshint',
|
|
||||||
'PYTHON': 'python.exe',
|
|
||||||
'PHANTOMJS': './node_modules/.bin/phantomjs'
|
|
||||||
}
|
|
||||||
|
|
||||||
sys_dir = os.environ.get('SYSTEMDRIVE')
|
|
||||||
program_files = os.environ.get('PROGRAMFILES')
|
|
||||||
java_home = os.environ.get('JAVA_HOME')
|
|
||||||
|
|
||||||
if not java_home:
|
|
||||||
# Following lines choose sensible defaults to guess JAVA_HOME in
|
|
||||||
# 32/64bit Program Files folder opting for the most current version.
|
|
||||||
search_term = os.path.join(sys_dir, os.sep, 'Program Files*', 'Java', 'jdk*')
|
|
||||||
found_jdks = sorted(glob.glob(search_term), key=lambda x: x[-8:])
|
|
||||||
if found_jdks:
|
|
||||||
java_home = found_jdks[-1]
|
|
||||||
|
|
||||||
if java_home:
|
|
||||||
if not which(win['JAVA']):
|
|
||||||
win['JAVA'] = os.path.join(java_home, 'bin', 'java.exe')
|
|
||||||
if not which(win['JAR']):
|
|
||||||
win['JAR'] = os.path.join(java_home, 'bin', 'jar.exe')
|
|
||||||
elif not which(win['JAVA']):
|
|
||||||
win['JAVA'] = os.path.join(program_files,
|
|
||||||
'Java', 'jre7', 'bin', 'java.exe')
|
|
||||||
|
|
||||||
if not which(win['GIT']):
|
|
||||||
win['GIT'] = os.path.join(program_files, 'Git', 'cmd', 'git.exe')
|
|
||||||
if not which(win['GIT']):
|
|
||||||
win['GIT'] = os.path.join(program_files, 'Git', 'bin', 'git.exe')
|
|
||||||
|
|
||||||
if not which(win['PYTHON']):
|
|
||||||
win['PYTHON'] = os.path.join(sys_dir, 'Python27', 'python.exe')
|
|
||||||
|
|
||||||
if not which(win['GJSLINT']):
|
|
||||||
win['GJSLINT'] = os.path.join(sys_dir, 'Python27', 'Scripts', 'gjslint.exe')
|
|
||||||
|
|
||||||
if not which(win['PHANTOMJS']):
|
|
||||||
win['PHANTOMJS'] = 'phantomjs.exe'
|
|
||||||
if not which(win['PHANTOMJS']):
|
|
||||||
win['PHANTOMJS'] = os.path.join(sys_dir, 'phantomjs-1.9.7-windows', 'phantomjs.exe')
|
|
||||||
|
|
||||||
if not which(win['JSDOC']):
|
|
||||||
win['JSDOC'] = os.path.join(program_files, 'jsdoc3', 'jsdoc.cmd')
|
|
||||||
|
|
||||||
for program, path in win.iteritems():
|
|
||||||
setattr(variables, program, path)
|
|
||||||
|
|
||||||
else:
|
|
||||||
variables.GIT = 'git'
|
|
||||||
variables.GJSLINT = 'gjslint'
|
|
||||||
variables.JSHINT = './node_modules/.bin/jshint'
|
|
||||||
variables.JAVA = 'java'
|
|
||||||
variables.JAR = 'jar'
|
|
||||||
variables.JSDOC = './node_modules/.bin/jsdoc'
|
|
||||||
variables.PYTHON = 'python'
|
|
||||||
variables.PHANTOMJS = './node_modules/.bin/phantomjs'
|
|
||||||
|
|
||||||
variables.BRANCH = output(
|
|
||||||
'%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
|
|
||||||
|
|
||||||
EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
|
|
||||||
variables.JSDOC, variables.JSHINT, variables.PYTHON,
|
|
||||||
variables.PHANTOMJS]
|
|
||||||
|
|
||||||
EXPORTS = 'build/exports.js'
|
|
||||||
|
|
||||||
EXAMPLES = [path
|
|
||||||
for path in ifind('examples')
|
|
||||||
if path.endswith('.html')
|
|
||||||
if path != 'examples/index.html']
|
|
||||||
|
|
||||||
EXAMPLES_SRC = [path
|
|
||||||
for path in ifind('examples')
|
|
||||||
if path.endswith('.js')
|
|
||||||
if not path.endswith('.combined.js')
|
|
||||||
if not path.startswith('examples/bootstrap')
|
|
||||||
if path != 'examples/Jugl.js'
|
|
||||||
if path != 'examples/jquery.min.js'
|
|
||||||
if path != 'examples/example-list.js']
|
|
||||||
|
|
||||||
EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
|
|
||||||
for example in EXAMPLES]
|
|
||||||
|
|
||||||
EXAMPLES_COMBINED = ['build/' + example.replace('.html', '.combined.js')
|
|
||||||
for example in EXAMPLES]
|
|
||||||
|
|
||||||
GLSL_SRC = [path
|
|
||||||
for path in ifind('src')
|
|
||||||
if path.endswith('.glsl')]
|
|
||||||
|
|
||||||
JSDOC_SRC = [path
|
|
||||||
for path in ifind('src')
|
|
||||||
if path.endswith('.jsdoc')]
|
|
||||||
|
|
||||||
SHADER_SRC = [path.replace('.glsl', 'shader.js')
|
|
||||||
for path in GLSL_SRC]
|
|
||||||
|
|
||||||
SPEC = [path
|
|
||||||
for path in ifind('test/spec')
|
|
||||||
if path.endswith('.js')]
|
|
||||||
|
|
||||||
SRC = [path
|
|
||||||
for path in ifind('src/ol')
|
|
||||||
if path.endswith('.js')
|
|
||||||
if path not in SHADER_SRC]
|
|
||||||
|
|
||||||
|
|
||||||
def report_sizes(t):
|
|
||||||
stringio = StringIO()
|
|
||||||
gzipfile = gzip.GzipFile(t.name, 'w', 9, stringio)
|
|
||||||
with open(t.name, 'rb') as f:
|
|
||||||
shutil.copyfileobj(f, gzipfile)
|
|
||||||
gzipfile.close()
|
|
||||||
rawsize = os.stat(t.name).st_size
|
|
||||||
gzipsize = len(stringio.getvalue())
|
|
||||||
savings = '{0:.2%}'.format((rawsize - gzipsize)/float(rawsize))
|
|
||||||
t.info('uncompressed: %8d bytes', rawsize)
|
|
||||||
t.info(' compressed: %8d bytes, (saved %s)', gzipsize, savings)
|
|
||||||
|
|
||||||
|
|
||||||
virtual('default', 'build')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('ci', 'lint', 'jshint', 'build', 'build-all',
|
|
||||||
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('build', 'build/ol.css', 'build/ol.js',
|
|
||||||
'build/ol-simple.js', 'build/ol-whitespace.js')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('todo', 'fixme')
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol.css', 'build/ol.js')
|
|
||||||
def build_ol_css(t):
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol.js', SRC, SHADER_SRC, 'buildcfg/ol.json')
|
|
||||||
def build_ol_new_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol.json', 'build/ol.js')
|
|
||||||
report_sizes(t)
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-simple.js', SRC, SHADER_SRC, 'buildcfg/ol-simple.json')
|
|
||||||
def build_ol_simple_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-simple.json', 'build/ol-simple.js')
|
|
||||||
report_sizes(t)
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-whitespace.js', SRC, SHADER_SRC, 'buildcfg/ol-whitespace.json')
|
|
||||||
def build_ol_whitespace_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-whitespace.json', 'build/ol-whitespace.js')
|
|
||||||
report_sizes(t)
|
|
||||||
|
|
||||||
|
|
||||||
virtual('build-all', 'build/ol-all.js')
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-all.js', SRC, SHADER_SRC, 'buildcfg/ol-all.json')
|
|
||||||
def build_ol_all_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-all.json', 'build/ol-all.js')
|
|
||||||
|
|
||||||
|
|
||||||
@target(EXPORTS, SRC)
|
|
||||||
def build_exports_js(t):
|
|
||||||
t.run('node', 'tasks/generate-exports.js', EXPORTS)
|
|
||||||
|
|
||||||
|
|
||||||
for glsl_src in GLSL_SRC:
|
|
||||||
def shader_src_helper(glsl_src):
|
|
||||||
@target(glsl_src.replace('.glsl', 'shader.js'), glsl_src,
|
|
||||||
'src/ol/webgl/shader.mustache', 'bin/pyglslunit.py')
|
|
||||||
def shader_src(t):
|
|
||||||
t.run('%(PYTHON)s', 'bin/pyglslunit.py',
|
|
||||||
'--input', glsl_src,
|
|
||||||
'--template', 'src/ol/webgl/shader.mustache',
|
|
||||||
'--output', t.name)
|
|
||||||
shader_src_helper(glsl_src)
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/test/requireall.js', SPEC)
|
|
||||||
def build_test_requireall_js(t):
|
|
||||||
requires = set()
|
|
||||||
for dependency in t.dependencies:
|
|
||||||
for line in open(dependency, 'rU'):
|
|
||||||
match = re.match(r'goog\.provide\(\'(.*)\'\);', line)
|
|
||||||
if match:
|
|
||||||
requires.add(match.group(1))
|
|
||||||
with open(t.name, 'wb') as f:
|
|
||||||
for require in sorted(requires):
|
|
||||||
f.write('goog.require(\'%s\');\n' % (require,))
|
|
||||||
|
|
||||||
|
|
||||||
virtual('build-examples', 'examples', 'build/examples/all.combined.js',
|
|
||||||
EXAMPLES_COMBINED)
|
|
||||||
|
|
||||||
|
|
||||||
virtual('examples', 'examples/example-list.xml', EXAMPLES_JSON)
|
|
||||||
|
|
||||||
|
|
||||||
@target('examples/example-list.xml', 'examples/example-list.js')
|
|
||||||
def examples_examples_list_xml(t):
|
|
||||||
t.touch() # already generated by bin/exampleparser.py
|
|
||||||
|
|
||||||
|
|
||||||
@target('examples/example-list.js', 'bin/exampleparser.py', EXAMPLES)
|
|
||||||
def examples_examples_list_js(t):
|
|
||||||
t.run('%(PYTHON)s', 'bin/exampleparser.py', 'examples', 'examples')
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/examples/all.combined.js', 'build/examples/all.js',
|
|
||||||
SRC, SHADER_SRC, 'buildcfg/examples-all.json')
|
|
||||||
def build_examples_all_combined_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/examples-all.json',
|
|
||||||
'build/examples/all.combined.js')
|
|
||||||
report_sizes(t)
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/examples/all.js', EXAMPLES_SRC)
|
|
||||||
def build_examples_all_js(t):
|
|
||||||
t.output('%(PYTHON)s', 'bin/combine-examples.py', t.dependencies)
|
|
||||||
|
|
||||||
|
|
||||||
@rule(r'\Abuild/examples/(?P<id>.*).json\Z')
|
|
||||||
def examples_star_json(name, match):
|
|
||||||
def action(t):
|
|
||||||
# It would make more sense to use olx.js as an input file here. We use
|
|
||||||
# it as an externs file instead to prevent "Cannot read property '*' of
|
|
||||||
# undefined" error when running examples in "raw" or "whitespace" mode.
|
|
||||||
# Note that we use the proper way in buildcfg/examples-all.json, which
|
|
||||||
# is only used to check the examples code using the compiler.
|
|
||||||
content = json.dumps({
|
|
||||||
"exports": [],
|
|
||||||
"src": ["src/**/*.js", "examples/%(id)s.js" % match.groupdict()],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/bootstrap.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/example.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/jquery-1.7.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkDebuggerStatement",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkProvides",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicate",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingProperties",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"suspiciousCode",
|
|
||||||
"typeInvalidation",
|
|
||||||
"tweakValidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"violatedModuleDep",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
|
||||||
"use_types_for_optimization": True,
|
|
||||||
"manage_closure_dependencies": True
|
|
||||||
}
|
|
||||||
})
|
|
||||||
with open(t.name, 'wb') as f:
|
|
||||||
f.write(content)
|
|
||||||
return Target(name, action=action, dependencies=[__file__])
|
|
||||||
|
|
||||||
|
|
||||||
@rule(r'\Abuild/examples/(?P<id>.*).combined.js\Z')
|
|
||||||
def examples_star_combined_js(name, match):
|
|
||||||
def action(t):
|
|
||||||
config = 'build/examples/%(id)s.json' % match.groupdict()
|
|
||||||
t.run('node', 'tasks/build.js', config, name)
|
|
||||||
report_sizes(t)
|
|
||||||
dependencies = [SRC, SHADER_SRC,
|
|
||||||
'examples/%(id)s.js' % match.groupdict(),
|
|
||||||
'build/examples/%(id)s.json' % match.groupdict()]
|
|
||||||
return Target(name, action=action, dependencies=dependencies)
|
|
||||||
|
|
||||||
|
|
||||||
@target('serve', 'examples')
|
|
||||||
def serve(t):
|
|
||||||
t.run('node', 'tasks/serve.js')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
|
||||||
'build/check-whitespace-timestamp')
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/lint-timestamp', SRC, EXPORTS, EXAMPLES_SRC, SPEC, precious=True)
|
|
||||||
def build_lint_src_timestamp(t):
|
|
||||||
t.run('%(GJSLINT)s',
|
|
||||||
'--jslint_error=all',
|
|
||||||
'--custom_jsdoc_tags=event,fires,function,classdesc,api,observable',
|
|
||||||
'--strict',
|
|
||||||
t.newer(t.dependencies))
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
virtual('jshint', 'build/jshint-timestamp')
|
|
||||||
|
|
||||||
@target('build/jshint-timestamp', SRC, EXPORTS, EXAMPLES_SRC, SPEC,
|
|
||||||
precious=True)
|
|
||||||
def build_jshint_timestamp(t):
|
|
||||||
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
def _strip_comments(lines):
|
|
||||||
# FIXME this is a horribe hack, we should use a proper JavaScript parser
|
|
||||||
# here
|
|
||||||
in_multiline_comment = False
|
|
||||||
lineno = 0
|
|
||||||
for line in lines:
|
|
||||||
lineno += 1
|
|
||||||
if in_multiline_comment:
|
|
||||||
index = line.find('*/')
|
|
||||||
if index != -1:
|
|
||||||
in_multiline_comment = False
|
|
||||||
line = line[index + 2:]
|
|
||||||
if not in_multiline_comment:
|
|
||||||
line = re.sub(r'//[^\n]*', '', line)
|
|
||||||
line = re.sub(r'/\*.*?\*/', '', line)
|
|
||||||
index = line.find('/*')
|
|
||||||
if index != -1:
|
|
||||||
yield lineno, line[:index]
|
|
||||||
in_multiline_comment = True
|
|
||||||
else:
|
|
||||||
yield lineno, line
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/check-requires-timestamp', SRC, EXAMPLES_SRC, SHADER_SRC, SPEC)
|
|
||||||
def build_check_requires_timestamp(t):
|
|
||||||
unused_count = 0
|
|
||||||
all_provides = set()
|
|
||||||
closure_lib_path = output('node', '-e',
|
|
||||||
'process.stdout.write(require("closure-util").getLibraryPath())')
|
|
||||||
for filename in ifind(closure_lib_path):
|
|
||||||
if filename.endswith('.js'):
|
|
||||||
if not re.match(r'.*/closure/goog/', filename):
|
|
||||||
continue
|
|
||||||
# Skip goog.i18n because it contains so many modules that it causes
|
|
||||||
# the generated regular expression to exceed Python's limits
|
|
||||||
if re.match(r'.*/closure/goog/i18n/', filename):
|
|
||||||
continue
|
|
||||||
for line in open(filename, 'rU'):
|
|
||||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
all_provides.add(m.group(1))
|
|
||||||
for filename in sorted(t.dependencies):
|
|
||||||
require_linenos = {}
|
|
||||||
uses = set()
|
|
||||||
lines = open(filename, 'rU').readlines()
|
|
||||||
for lineno, line in _strip_comments(lines):
|
|
||||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
all_provides.add(m.group(1))
|
|
||||||
continue
|
|
||||||
m = re.match(r'goog.require\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
require_linenos[m.group(1)] = lineno
|
|
||||||
continue
|
|
||||||
ignore_linenos = require_linenos.values()
|
|
||||||
for lineno, line in enumerate(lines):
|
|
||||||
if lineno in ignore_linenos:
|
|
||||||
continue
|
|
||||||
for require in require_linenos.iterkeys():
|
|
||||||
if require in line:
|
|
||||||
uses.add(require)
|
|
||||||
for require in sorted(set(require_linenos.keys()) - uses):
|
|
||||||
t.info('%s:%d: unused goog.require: %r' % (
|
|
||||||
filename, require_linenos[require], require))
|
|
||||||
unused_count += 1
|
|
||||||
all_provides.discard('ol')
|
|
||||||
all_provides.discard('ol.MapProperty')
|
|
||||||
|
|
||||||
class Node(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.present = False
|
|
||||||
self.children = {}
|
|
||||||
|
|
||||||
def _build_re(self, key):
|
|
||||||
if key == '*':
|
|
||||||
assert len(self.children) == 0
|
|
||||||
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
|
|
||||||
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
|
|
||||||
elif len(self.children) == 1:
|
|
||||||
child_key, child = next(self.children.iteritems())
|
|
||||||
child_re = child._build_re(child_key)
|
|
||||||
if child_key != '*':
|
|
||||||
child_re = '\\.' + child_re
|
|
||||||
if self.present:
|
|
||||||
return key + '(' + child_re + ')?'
|
|
||||||
else:
|
|
||||||
return key + child_re
|
|
||||||
elif self.children:
|
|
||||||
children_re = '(?:' + '|'.join(
|
|
||||||
('\\.' if k != '*' else '') + self.children[k]._build_re(k)
|
|
||||||
for k in sorted(self.children.keys())) + ')'
|
|
||||||
if self.present:
|
|
||||||
return key + children_re + '?'
|
|
||||||
else:
|
|
||||||
return key + children_re
|
|
||||||
else:
|
|
||||||
assert self.present
|
|
||||||
return key
|
|
||||||
|
|
||||||
def build_re(self, key):
|
|
||||||
return re.compile('\\b' + self._build_re(key) + '\\b')
|
|
||||||
root = Node()
|
|
||||||
for provide in all_provides:
|
|
||||||
node = root
|
|
||||||
for component in provide.split('.'):
|
|
||||||
if component not in node.children:
|
|
||||||
node.children[component] = Node()
|
|
||||||
node = node.children[component]
|
|
||||||
if component[0].islower():
|
|
||||||
# We've arrived at a namespace provide like `ol.foo`.
|
|
||||||
# In this case, we want to match uses like `ol.foo.doIt()` but
|
|
||||||
# not match things like `new ol.foo.SomeClass()`.
|
|
||||||
# For this purpose, we use the special wildcard key for the child.
|
|
||||||
node.children['*'] = Node()
|
|
||||||
else:
|
|
||||||
node.present = True
|
|
||||||
provide_res = [child.build_re(key)
|
|
||||||
for key, child in root.children.iteritems()]
|
|
||||||
missing_count = 0
|
|
||||||
for filename in sorted(t.dependencies):
|
|
||||||
provides = set()
|
|
||||||
requires = set()
|
|
||||||
uses = set()
|
|
||||||
uses_linenos = {}
|
|
||||||
for lineno, line in _strip_comments(open(filename, 'rU')):
|
|
||||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
provides.add(m.group(1))
|
|
||||||
continue
|
|
||||||
m = re.match(r'goog.require\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
requires.add(m.group(1))
|
|
||||||
continue
|
|
||||||
while True:
|
|
||||||
for provide_re in provide_res:
|
|
||||||
m = provide_re.search(line)
|
|
||||||
if m:
|
|
||||||
uses.add(m.group())
|
|
||||||
uses_linenos[m.group()] = lineno
|
|
||||||
line = line[:m.start()] + line[m.end():]
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
if filename == 'src/ol/renderer/layerrenderer.js':
|
|
||||||
uses.discard('ol.renderer.Map')
|
|
||||||
m = re.match(
|
|
||||||
r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
|
|
||||||
if m:
|
|
||||||
uses.discard('ol.renderer.Map')
|
|
||||||
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
|
|
||||||
missing_requires = uses - requires - provides
|
|
||||||
if missing_requires:
|
|
||||||
for missing_require in sorted(missing_requires):
|
|
||||||
t.info("%s:%d missing goog.require('%s')" %
|
|
||||||
(filename, uses_linenos[missing_require], missing_require))
|
|
||||||
missing_count += 1
|
|
||||||
if unused_count or missing_count:
|
|
||||||
t.error('%d unused goog.requires, %d missing goog.requires' %
|
|
||||||
(unused_count, missing_count))
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/check-whitespace-timestamp', SRC, EXPORTS, EXAMPLES_SRC,
|
|
||||||
SPEC, JSDOC_SRC, precious=True)
|
|
||||||
def build_check_whitespace_timestamp(t):
|
|
||||||
CR_RE = re.compile(r'\r')
|
|
||||||
LEADING_WHITESPACE_RE = re.compile(r'\s+')
|
|
||||||
TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z')
|
|
||||||
NO_NEWLINE_RE = re.compile(r'[^\n]\Z')
|
|
||||||
ALL_WHITESPACE_RE = re.compile(r'\s+\Z')
|
|
||||||
errors = 0
|
|
||||||
for filename in sorted(t.newer(t.dependencies)):
|
|
||||||
whitespace = False
|
|
||||||
for lineno, line in enumerate(open(filename, 'rU')):
|
|
||||||
if lineno == 0 and LEADING_WHITESPACE_RE.match(line):
|
|
||||||
t.info('%s:%d: leading whitespace', filename, lineno + 1)
|
|
||||||
errors += 1
|
|
||||||
if CR_RE.search(line):
|
|
||||||
t.info('%s:%d: carriage return character in line', filename, lineno + 1)
|
|
||||||
errors += 1
|
|
||||||
if TRAILING_WHITESPACE_RE.search(line):
|
|
||||||
t.info('%s:%d: trailing whitespace', filename, lineno + 1)
|
|
||||||
errors += 1
|
|
||||||
if NO_NEWLINE_RE.search(line):
|
|
||||||
t.info('%s:%d: no newline at end of file', filename, lineno + 1)
|
|
||||||
errors += 1
|
|
||||||
whitespace = ALL_WHITESPACE_RE.match(line)
|
|
||||||
if whitespace:
|
|
||||||
t.info('%s: trailing whitespace at end of file', filename)
|
|
||||||
errors += 1
|
|
||||||
if errors:
|
|
||||||
t.error('%d whitespace errors' % (errors,))
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
virtual('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
|
|
||||||
EXPORTS, SRC, SHADER_SRC,
|
|
||||||
ifind('apidoc/template'))
|
|
||||||
def jsdoc_BRANCH_timestamp(t):
|
|
||||||
t.run('%(JSDOC)s', 'apidoc/index.md', '-c', 'apidoc/conf.json',
|
|
||||||
'-d', 'build/hosted/%(BRANCH)s/apidoc')
|
|
||||||
t.touch()
|
|
||||||
|
|
||||||
|
|
||||||
def split_example_file(example, dst_dir):
|
|
||||||
lines = open(example, 'rU').readlines()
|
|
||||||
|
|
||||||
target_lines = []
|
|
||||||
target_require_lines = []
|
|
||||||
|
|
||||||
found_requires = False
|
|
||||||
found_code = False
|
|
||||||
for line in lines:
|
|
||||||
m = re.match(r'goog.require\(\'(.*)\'\);', line)
|
|
||||||
if m:
|
|
||||||
found_requires = True
|
|
||||||
target_require_lines.append(line)
|
|
||||||
elif found_requires:
|
|
||||||
if found_code or line not in ('\n', '\r\n'):
|
|
||||||
found_code = True
|
|
||||||
target_lines.append(line)
|
|
||||||
|
|
||||||
target = open(
|
|
||||||
os.path.join(dst_dir, os.path.basename(example)), 'wb')
|
|
||||||
target_require = open(
|
|
||||||
os.path.join(dst_dir, os.path.basename(example)
|
|
||||||
.replace('.js', '-require.js')),
|
|
||||||
'wb')
|
|
||||||
|
|
||||||
target.writelines(target_lines)
|
|
||||||
target.close()
|
|
||||||
|
|
||||||
target_require.writelines(target_require_lines)
|
|
||||||
target_require.close()
|
|
||||||
|
|
||||||
|
|
||||||
@target('host-resources', phony=True)
|
|
||||||
def host_resources(t):
|
|
||||||
resources_dir = 'build/hosted/%(BRANCH)s/resources'
|
|
||||||
t.rm_rf(resources_dir)
|
|
||||||
t.cp_r('resources', resources_dir)
|
|
||||||
|
|
||||||
|
|
||||||
@target('host-examples', 'build', 'host-resources', 'examples', phony=True)
|
|
||||||
def host_examples(t):
|
|
||||||
examples_dir = 'build/hosted/%(BRANCH)s/examples'
|
|
||||||
build_dir = 'build/hosted/%(BRANCH)s/build'
|
|
||||||
css_dir = 'build/hosted/%(BRANCH)s/css'
|
|
||||||
closure_lib_path = output('node', '-e',
|
|
||||||
'process.stdout.write(require("closure-util").getLibraryPath())')
|
|
||||||
t.rm_rf(examples_dir)
|
|
||||||
t.makedirs(examples_dir)
|
|
||||||
t.rm_rf(build_dir)
|
|
||||||
t.makedirs(build_dir)
|
|
||||||
t.rm_rf(css_dir)
|
|
||||||
t.makedirs(css_dir)
|
|
||||||
t.cp(EXAMPLES, examples_dir)
|
|
||||||
for example in [path.replace('.html', '.js') for path in EXAMPLES]:
|
|
||||||
split_example_file(example, examples_dir % vars(variables))
|
|
||||||
t.cp_r('examples/data', examples_dir + '/data')
|
|
||||||
t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js')
|
|
||||||
t.cp('build/ol.js', 'build/ol-simple.js', 'build/ol-whitespace.js',
|
|
||||||
build_dir)
|
|
||||||
t.cp('build/ol.css', css_dir)
|
|
||||||
t.cp('examples/index.html', 'examples/example-list.js',
|
|
||||||
'examples/example-list.xml', 'examples/Jugl.js',
|
|
||||||
'examples/jquery.min.js', examples_dir)
|
|
||||||
t.rm_rf('build/hosted/%(BRANCH)s/closure-library')
|
|
||||||
t.cp_r(closure_lib_path, 'build/hosted/%(BRANCH)s/closure-library')
|
|
||||||
t.rm_rf('build/hosted/%(BRANCH)s/ol')
|
|
||||||
t.makedirs('build/hosted/%(BRANCH)s/ol')
|
|
||||||
t.cp_r('src/ol', 'build/hosted/%(BRANCH)s/ol/ol')
|
|
||||||
t.run('%(PYTHON)s', closure_lib_path + '/closure/bin/build/depswriter.py',
|
|
||||||
'--root_with_prefix', 'src ../../../ol',
|
|
||||||
'--root', 'build/hosted/%(BRANCH)s/closure-library/closure/goog',
|
|
||||||
'--root_with_prefix', 'build/hosted/%(BRANCH)s/closure-library/'
|
|
||||||
'third_party ../../third_party',
|
|
||||||
'--output_file', 'build/hosted/%(BRANCH)s/build/ol-deps.js')
|
|
||||||
|
|
||||||
|
|
||||||
@target('check-examples', 'host-examples', phony=True)
|
|
||||||
def check_examples(t):
|
|
||||||
examples = ['build/hosted/%(BRANCH)s/' + e
|
|
||||||
for e in EXAMPLES
|
|
||||||
if not open(e.replace('.html', '.js'), 'rU').readline().startswith('// NOCOMPILE')]
|
|
||||||
all_examples = \
|
|
||||||
[e + '?mode=advanced' for e in examples]
|
|
||||||
for example in all_examples:
|
|
||||||
t.run('%(PHANTOMJS)s', 'bin/check-example.js', example)
|
|
||||||
|
|
||||||
|
|
||||||
@target('test', phony=True)
|
|
||||||
def test(t):
|
|
||||||
t.run('node', 'tasks/test.js')
|
|
||||||
|
|
||||||
|
|
||||||
@target('fixme', phony=True)
|
|
||||||
def find_fixme(t):
|
|
||||||
regex = re.compile('FIXME|TODO')
|
|
||||||
matches = dict()
|
|
||||||
totalcount = 0
|
|
||||||
for filename in SRC:
|
|
||||||
f = open(filename, 'r')
|
|
||||||
for lineno, line in enumerate(f):
|
|
||||||
if regex.search(line):
|
|
||||||
if (filename not in matches):
|
|
||||||
matches[filename] = list()
|
|
||||||
matches[filename].append('#%-10d %s' % (
|
|
||||||
lineno + 1, line.strip()))
|
|
||||||
totalcount += 1
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
for filename in matches:
|
|
||||||
num_matches = len(matches[filename])
|
|
||||||
noun = 'matches' if num_matches > 1 else 'match'
|
|
||||||
print ' %s has %d %s:' % (filename, num_matches, noun)
|
|
||||||
for match in matches[filename]:
|
|
||||||
print ' %s' % (match,)
|
|
||||||
print
|
|
||||||
print 'A total of %d TODO/FIXME(s) were found' % (totalcount,)
|
|
||||||
|
|
||||||
|
|
||||||
@target('reallyclean')
|
|
||||||
def reallyclean(t):
|
|
||||||
"""Removes untracked files and folders from previous builds."""
|
|
||||||
# -X => only clean up files that are usually ignored e.g.
|
|
||||||
# through .gitignore
|
|
||||||
# -d => also consider directories for deletion
|
|
||||||
# -f => if git configuration variable clean.requireForce != false,
|
|
||||||
# git clean will refuse to run unless given -f or -n.
|
|
||||||
t.run('%(GIT)s', 'clean', '-X', '-d', '-f', '.')
|
|
||||||
|
|
||||||
|
|
||||||
@target('checkdeps')
|
|
||||||
def check_dependencies(t):
|
|
||||||
for exe in EXECUTABLES:
|
|
||||||
status = 'present' if which(exe) else 'MISSING'
|
|
||||||
print 'Program "%s" seems to be %s.' % (exe, status)
|
|
||||||
print 'For certain targets all above programs need to be present.'
|
|
||||||
|
|
||||||
|
|
||||||
@target('help')
|
|
||||||
def display_help(t):
|
|
||||||
print '''
|
|
||||||
build.py - The OpenLayers 3 build script.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
./build.py [options] [target] (on Unix-based machines)
|
|
||||||
<python-executable.exe> build.py [options] [target] (on Windows machines)
|
|
||||||
|
|
||||||
There is one option:
|
|
||||||
-c - Cleans up the repository from previous builds.
|
|
||||||
|
|
||||||
The most common targets are:
|
|
||||||
serve - Serves files, on port 3000.
|
|
||||||
lint - Runs gjslint on all sourcefiles to enforce specific syntax.
|
|
||||||
build - Builds singlefile versions of OpenLayers JavaScript and
|
|
||||||
CSS. This is also the default build target which runs when
|
|
||||||
no target is specified.
|
|
||||||
test - Runs the testsuite and displays the results.
|
|
||||||
check - Runs the lint-target, builds some OpenLayers files, and
|
|
||||||
then runs test. Many developers call this target often
|
|
||||||
while working on the code.
|
|
||||||
help - Shows this help.
|
|
||||||
|
|
||||||
Other less frequently used targets are:
|
|
||||||
apidoc - Builds the API-Documentation using JSDoc3.
|
|
||||||
ci - Builds all examples in various modes and usually takes a
|
|
||||||
long time to finish. This target calls the following
|
|
||||||
targets: lint, build, build-all, test, build-examples,
|
|
||||||
check-examples and apidoc. This is the target run on
|
|
||||||
Travis CI.
|
|
||||||
reallyclean - Remove untracked files from the repository.
|
|
||||||
checkdeps - Checks whether all required development software is
|
|
||||||
installed on your machine.
|
|
||||||
fixme - Will print a list of parts of the code that are marked
|
|
||||||
with either TODO or FIXME.
|
|
||||||
todo - This is an alias for the fixme-target (see above).
|
|
||||||
|
|
||||||
If no target is given, the build-target will be executed.
|
|
||||||
|
|
||||||
The above list is not complete, please see the source code for not-mentioned
|
|
||||||
and only seldomly called targets.
|
|
||||||
'''
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": [],
|
|
||||||
"src": ["src/**/*.js", "build/examples/all.js"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/bootstrap.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/example.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/jquery-1.7.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
|
||||||
"use_types_for_optimization": true,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle the api annotation.
|
|
||||||
* @param {Object} dictionary The tag dictionary.
|
|
||||||
*/
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
|
|
||||||
dictionary.defineTag('api', {
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
doclet.api = tag.text || 'experimental';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"opts": {
|
|
||||||
"recurse": true,
|
|
||||||
"template": "buildcfg/jsdoc/info"
|
|
||||||
},
|
|
||||||
"tags": {
|
|
||||||
"allowUnknownTags": true
|
|
||||||
},
|
|
||||||
"source": {
|
|
||||||
"includePattern": "\\.js$"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"buildcfg/jsdoc/info/api-plugin",
|
|
||||||
"buildcfg/jsdoc/info/define-plugin"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* @fileoverview This plugin extracts info from boolean defines. This only
|
|
||||||
* handles boolean defines with the default value in the description. Default
|
|
||||||
* is assumed to be provided with something like "default is `true`" (case
|
|
||||||
* insensitive, with or without ticks).
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
var DEFAULT_VALUE = /default\s+is\s+`?(true|false)`?/i;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hook to define new tags.
|
|
||||||
* @param {Object} dictionary The tag dictionary.
|
|
||||||
*/
|
|
||||||
exports.defineTags = function(dictionary) {
|
|
||||||
|
|
||||||
dictionary.defineTag('define', {
|
|
||||||
canHaveType: true,
|
|
||||||
mustHaveValue: true,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
var types = tag.value.type.names;
|
|
||||||
if (types.length === 1 && types[0] === 'boolean') {
|
|
||||||
var match = tag.value.description.match(DEFAULT_VALUE);
|
|
||||||
if (match) {
|
|
||||||
doclet.define = {
|
|
||||||
default: match[1] === 'true'
|
|
||||||
};
|
|
||||||
doclet.description = tag.value.description;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/**
|
|
||||||
* @fileoverview Generates JSON output based on exportable symbols (those with
|
|
||||||
* an api tag) and boolean defines (with a define tag and a default value).
|
|
||||||
*/
|
|
||||||
var assert = require('assert');
|
|
||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Publish hook for the JSDoc template. Writes to JSON stdout.
|
|
||||||
* @param {function} data The root of the Taffy DB containing doclet records.
|
|
||||||
* @param {Object} opts Options.
|
|
||||||
*/
|
|
||||||
exports.publish = function(data, opts) {
|
|
||||||
var cwd = process.cwd();
|
|
||||||
|
|
||||||
// get all doclets with the "api" property or define (excluding enums,
|
|
||||||
// typedefs and events)
|
|
||||||
var docs = data(
|
|
||||||
[{define: {isObject: true}}, {api: {isString: true}}],
|
|
||||||
{isEnum: {'!is': true}},
|
|
||||||
{kind: {'!is': 'typedef'}},
|
|
||||||
{kind: {'!is': 'event'}}).get();
|
|
||||||
|
|
||||||
// get symbols data, filter out those that are members of private classes
|
|
||||||
var symbols = [];
|
|
||||||
var defines = [];
|
|
||||||
docs.filter(function(doc) {
|
|
||||||
var include = true;
|
|
||||||
var constructor = doc.memberof;
|
|
||||||
if (constructor && constructor.substr(-1) === '_') {
|
|
||||||
assert.strictEqual(doc.inherited, true,
|
|
||||||
'Unexpected export on private class: ' + doc.longname);
|
|
||||||
include = false;
|
|
||||||
}
|
|
||||||
return include;
|
|
||||||
}).forEach(function(doc) {
|
|
||||||
if (doc.define) {
|
|
||||||
defines.push({
|
|
||||||
name: doc.longname,
|
|
||||||
description: doc.description,
|
|
||||||
path: path.join(doc.meta.path, doc.meta.filename),
|
|
||||||
default: doc.define.default
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
symbols.push({
|
|
||||||
name: doc.longname,
|
|
||||||
kind: doc.kind,
|
|
||||||
description: doc.classdesc || doc.description,
|
|
||||||
extends: doc.augments,
|
|
||||||
path: path.join(doc.meta.path, doc.meta.filename)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
process.stdout.write(
|
|
||||||
JSON.stringify({symbols: symbols, defines: defines}, null, 2));
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"src": ["src/**/*.js"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
|
||||||
"use_types_for_optimization": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"src": ["src/**/*.js"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "SIMPLE",
|
|
||||||
"output_wrapper": "%output%",
|
|
||||||
"use_types_for_optimization": false,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"src": ["src/**/*.js"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "WHITESPACE_ONLY",
|
|
||||||
"output_wrapper": "var CLOSURE_DEPS = false;\n%output%",
|
|
||||||
"use_types_for_optimization": false,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"src": ["src/**/*.js"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
|
||||||
"use_types_for_optimization": true,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Build configs
|
|
||||||
|
|
||||||
This directory includes configuration files (json) for the tasks/build.js
|
|
||||||
build script.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
`use_types_for_optimization` is set to `false` for the SIMPLE and WHITESPACE
|
|
||||||
builds. If it was set to `true` we would get function names like
|
|
||||||
`ol_control_Control_prototype$setMap` in the compiled code when using the
|
|
||||||
SIMPLE compilation. `use_types_for_optimization` is only appropriate for
|
|
||||||
ADVANCED compilation. To be sure we also don't set it for WHITESPACE.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"library_url": "https://github.com/google/closure-library/archive/ab89cf45c216615d73a2f5dea720afb9d3415d1f.zip"
|
|
||||||
}
|
|
||||||
-282
@@ -1,282 +0,0 @@
|
|||||||
|
|
||||||
.ol-mouse-position {
|
|
||||||
top: 8px;
|
|
||||||
right: 8px;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-scale-line {
|
|
||||||
background: #95b9e6;
|
|
||||||
background: rgba(0,60,136,0.3);
|
|
||||||
border-radius: 4px;
|
|
||||||
bottom: 8px;
|
|
||||||
left: 8px;
|
|
||||||
padding: 2px;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
.ol-scale-line-inner {
|
|
||||||
border: 1px solid #eeeeee;
|
|
||||||
border-top: none;
|
|
||||||
color: #eeeeee;
|
|
||||||
font-size: 10px;
|
|
||||||
text-align: center;
|
|
||||||
margin: 1px;
|
|
||||||
padding: 0px 2px;
|
|
||||||
}
|
|
||||||
.ol-unsupported {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.ol-viewport .ol-unselectable {
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-control {
|
|
||||||
position: absolute;
|
|
||||||
background-color: #eee;
|
|
||||||
background-color: rgba(255,255,255,0.4);
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
.ol-control:hover {
|
|
||||||
background-color: rgba(255,255,255,0.6);
|
|
||||||
}
|
|
||||||
.ol-zoom {
|
|
||||||
top: .5em;
|
|
||||||
left: .5em;
|
|
||||||
}
|
|
||||||
.ol-rotate {
|
|
||||||
top: .5em;
|
|
||||||
right: .5em;
|
|
||||||
transition: opacity .25s;
|
|
||||||
}
|
|
||||||
.ol-zoom-extent {
|
|
||||||
top: 4.643em;
|
|
||||||
left: .5em;
|
|
||||||
}
|
|
||||||
.ol-full-screen {
|
|
||||||
right: .5em;
|
|
||||||
top: .5em;
|
|
||||||
}
|
|
||||||
@media print {
|
|
||||||
.ol-control {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-control button {
|
|
||||||
display: block;
|
|
||||||
margin: 1px;
|
|
||||||
padding: 0;
|
|
||||||
color: white;
|
|
||||||
font-size: 1.14em;
|
|
||||||
font-weight: bold;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
height: 1.375em;
|
|
||||||
width: 1.375em;
|
|
||||||
line-height: .4em;
|
|
||||||
background-color: #7b98bc;
|
|
||||||
background-color: rgba(0,60,136,0.5);
|
|
||||||
border: none;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
.ol-control button::-moz-focus-inner {
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.ol-zoom-extent button {
|
|
||||||
line-height: 1.4em;
|
|
||||||
}
|
|
||||||
.ol-compass {
|
|
||||||
display: block;
|
|
||||||
font-family: Arial;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
.ol-touch .ol-control button {
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
.ol-touch .ol-zoom-extent {
|
|
||||||
top: 5.5em;
|
|
||||||
}
|
|
||||||
.ol-control button:hover,
|
|
||||||
.ol-control button:focus {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: #4c6079;
|
|
||||||
background-color: rgba(0,60,136,0.7);
|
|
||||||
}
|
|
||||||
.ol-zoom-extent button:after {
|
|
||||||
content: "E";
|
|
||||||
}
|
|
||||||
.ol-zoom .ol-zoom-in {
|
|
||||||
border-radius: 2px 2px 0 0;
|
|
||||||
}
|
|
||||||
.ol-zoom .ol-zoom-out {
|
|
||||||
border-radius: 0 0 2px 2px;
|
|
||||||
}
|
|
||||||
button.ol-full-screen-false:after {
|
|
||||||
content: "\2194";
|
|
||||||
}
|
|
||||||
button.ol-full-screen-true:after {
|
|
||||||
content: "\00d7";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* invisible but not hidden */
|
|
||||||
.ol-has-tooltip [role=tooltip] {
|
|
||||||
position: absolute;
|
|
||||||
clip: rect(1px 1px 1px 1px); /* < IE8 */
|
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
height: 1px;
|
|
||||||
width: 1px;
|
|
||||||
overflow: hidden;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
text-shadow: 0 0 2px #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* show a tooltip offset to below and right */
|
|
||||||
.ol-has-tooltip:hover [role=tooltip], .ol-has-tooltip:focus [role=tooltip] {
|
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
-webkit-box-sizing: content-box;
|
|
||||||
box-sizing: content-box;
|
|
||||||
clip: auto;
|
|
||||||
padding: 0 .4em;
|
|
||||||
font-size: .8em;
|
|
||||||
height: 1.2em;
|
|
||||||
width: auto;
|
|
||||||
line-height: 1.2em;
|
|
||||||
z-index: 1100;
|
|
||||||
max-height: 100px;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline-block;
|
|
||||||
background: #FFF;
|
|
||||||
background: rgba(255,255,255,0.6);
|
|
||||||
color: #000;
|
|
||||||
border: 3px solid rgba(255,255,255,0);
|
|
||||||
border-left-width: 0;
|
|
||||||
border-radius: 0 4px 4px 0;
|
|
||||||
bottom: .3em;
|
|
||||||
left: 2.2em;
|
|
||||||
}
|
|
||||||
.ol-touch .ol-has-tooltip:hover [role=tooltip],
|
|
||||||
.ol-touch .ol-has-tooltip:focus [role=tooltip] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.ol-zoom .ol-has-tooltip:hover [role=tooltip],
|
|
||||||
.ol-zoom .ol-has-tooltip:focus [role=tooltip] {
|
|
||||||
top: 1.1em;
|
|
||||||
}
|
|
||||||
.ol-rotate .ol-has-tooltip:hover [role=tooltip],
|
|
||||||
.ol-rotate .ol-has-tooltip:focus [role=tooltip],
|
|
||||||
.ol-attribution .ol-has-tooltip:hover [role=tooltip],
|
|
||||||
.ol-attribution .ol-has-tooltip:focus [role=tooltip],
|
|
||||||
.ol-full-screen .ol-has-tooltip:hover [role=tooltip],
|
|
||||||
.ol-full-screen .ol-has-tooltip:focus [role=tooltip] {
|
|
||||||
right: 2.2em;
|
|
||||||
left: auto;
|
|
||||||
border-radius: 4px 0 0 4px;
|
|
||||||
border-left-width: 3px;
|
|
||||||
border-right-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-attribution {
|
|
||||||
text-align: right;
|
|
||||||
bottom: .5em;
|
|
||||||
right: .5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-attribution ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 .5em;
|
|
||||||
font-size: .7rem;
|
|
||||||
line-height: 1.375em;
|
|
||||||
color: #000;
|
|
||||||
text-shadow: 0 0 2px #fff;
|
|
||||||
}
|
|
||||||
.ol-attribution li {
|
|
||||||
display: inline;
|
|
||||||
list-style: none;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
.ol-attribution li:not(:last-child):after {
|
|
||||||
content: " ";
|
|
||||||
}
|
|
||||||
.ol-attribution img {
|
|
||||||
max-height: 2em;
|
|
||||||
}
|
|
||||||
.ol-attribution ul, .ol-attribution button {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.ol-attribution:not(.ol-collapsed) button:hover [role=tooltip],
|
|
||||||
.ol-attribution.ol-collapsed ul {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.ol-attribution:not(.ol-collapsed) {
|
|
||||||
background: rgba(255,255,255,0.8);
|
|
||||||
}
|
|
||||||
.ol-attribution.ol-uncollapsible {
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
border-radius: 4px 0 0;
|
|
||||||
height: 1.1em;
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
.ol-attribution.ol-uncollapsible img {
|
|
||||||
margin-top: -.2em;
|
|
||||||
max-height: 1.6em;
|
|
||||||
}
|
|
||||||
.ol-attribution.ol-uncollapsible button {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-zoomslider {
|
|
||||||
position: absolute;
|
|
||||||
top: 4.5em;
|
|
||||||
left: .5em;
|
|
||||||
background: #eee;
|
|
||||||
background: rgba(255, 255, 255, 0.4);
|
|
||||||
border-radius: 4px;
|
|
||||||
outline: none;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 1.5675em;
|
|
||||||
height: 200px;
|
|
||||||
padding: 3px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.ol-zoomslider-thumb {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
background: #7b98bc;
|
|
||||||
background: rgba(0,60,136,0.5);
|
|
||||||
border-radius: 2px;
|
|
||||||
outline: none;
|
|
||||||
overflow: hidden;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 1.14em;
|
|
||||||
height: 1em;
|
|
||||||
width: 1.375em;
|
|
||||||
margin: 3px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.ol-touch .ol-zoomslider {
|
|
||||||
top: 5.5em;
|
|
||||||
width: 2.052em;
|
|
||||||
}
|
|
||||||
.ol-touch .ol-zoomslider-thumb {
|
|
||||||
width: 1.8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ol-control button,
|
|
||||||
.ol-attribution,
|
|
||||||
.ol-scale-line-inner,
|
|
||||||
.ol-has-tooltip [role=tooltip] {
|
|
||||||
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
title: Documentation
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
If you're eager to get your first OpenLayers 3 map on a page, dive into the [quick start](quickstart.html).
|
|
||||||
|
|
||||||
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
|
|
||||||
|
|
||||||
Make sure to also check out the [OpenLayers 3 workshop](../../../ol3-workshop/).
|
|
||||||
|
|
||||||
Find additional reference material in the [API docs](../apidoc).
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
---
|
|
||||||
title: Quick Start
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Quick Start
|
|
||||||
|
|
||||||
## Put a map on a page
|
|
||||||
|
|
||||||
Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="http://ol3js.org/en/{{ latest }}/css/ol.css" type="text/css">
|
|
||||||
<style>
|
|
||||||
.map {
|
|
||||||
height: 400px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
|
||||||
<title>OpenLayers 3 example</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h2>My Map</h2>
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var map = new ol.Map({
|
|
||||||
target: 'map',
|
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({
|
|
||||||
source: new ol.source.MapQuest({layer: 'sat'})
|
|
||||||
})
|
|
||||||
],
|
|
||||||
view: new ol.View({
|
|
||||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
zoom: 4
|
|
||||||
})
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Understanding what is going on
|
|
||||||
|
|
||||||
To include a map a web page you will need 3 things:
|
|
||||||
|
|
||||||
1. Include OpenLayers
|
|
||||||
2. `<div>` map container
|
|
||||||
3. JavaScript to create a simple map
|
|
||||||
|
|
||||||
### Include OpenLayers
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the ol3js.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
|
||||||
|
|
||||||
|
|
||||||
### `<div>` to contain the map
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
```
|
|
||||||
|
|
||||||
The map in the application is contained in a [`<div>` HTML element](http://en.wikipedia.org/wiki/Span_and_div). Through this `<div>` the map properties like width, height and border can be controlled through CSS. Here's the CSS element used to make the map 400 pixels high and as wide as the browser window.
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<style>
|
|
||||||
.map {
|
|
||||||
height: 400px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
```
|
|
||||||
|
|
||||||
### JavaScript to create a simple map
|
|
||||||
|
|
||||||
```js
|
|
||||||
var map = new ol.Map({
|
|
||||||
target: 'map',
|
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({
|
|
||||||
source: new ol.source.MapQuest({layer: 'sat'})
|
|
||||||
})
|
|
||||||
],
|
|
||||||
view: new ol.View({
|
|
||||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
zoom: 4
|
|
||||||
})
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
|
|
||||||
|
|
||||||
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
|
|
||||||
|
|
||||||
```js
|
|
||||||
var map = new ol.Map({ ... });
|
|
||||||
```
|
|
||||||
|
|
||||||
To attach the map object to the `<div>`, the map object takes a `target` into arguments. The value is the `id` of the `<div>`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
target: 'map'
|
|
||||||
```
|
|
||||||
|
|
||||||
The `layers: [ ... ]` array is used to define the list of layers available in the map. The first and only layer right now is a tiled layer:
|
|
||||||
|
|
||||||
```js
|
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({
|
|
||||||
source: new ol.source.MapQuest({layer: 'sat'})
|
|
||||||
})
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Layers in OpenLayers 3 are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{ latest }}/apidoc/ol.source.html)
|
|
||||||
|
|
||||||
The next part of the `Map` object is the `View`. The view allow to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
|
||||||
|
|
||||||
```js
|
|
||||||
view: new ol.View({
|
|
||||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
zoom: 4
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
You will notice that the `center` specified is in lat/lon coordinates (EPSG:4326). Since the only layer we use is in Spherical Mercator projection (EPSG:3857), we can reproject them on the fly to be able to zoom the map on the right coordinates.
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
---
|
|
||||||
title: Basic Concepts
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Basic Concepts
|
|
||||||
|
|
||||||
## Map
|
|
||||||
The core component of OpenLayers 3 is the map (`ol.Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<div id="map" style="width: 100%, height: 400px"></div>
|
|
||||||
<script>
|
|
||||||
var map = new ol.Map({target: 'map'});
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
|
|
||||||
## View
|
|
||||||
`ol.Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of an `ol.View` instance.
|
|
||||||
|
|
||||||
```js
|
|
||||||
map.setView(new ol.View({
|
|
||||||
center: [0, 0],
|
|
||||||
zoom: 2
|
|
||||||
}));
|
|
||||||
```
|
|
||||||
|
|
||||||
An `ol.View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
|
||||||
|
|
||||||
The `zoom` option is a convenient way to specify the map resolution. The available zoom levels are determined by `maxZoom` (default: 28), `zoomFactor` (default: 2) and `maxResolution` (default is calculated in such a way that the projection's validity extent fits in a 256x256 pixel tile). Starting at zoom level 0 with a resolution of `maxResolution` units per pixel, subsequent zoom levels are calculated by dividing the previous zoom level's resolution by `zoomFactor`, until zoom level `maxZoom` is reached.
|
|
||||||
|
|
||||||
|
|
||||||
## Source
|
|
||||||
To get remote data for a layer, OpenLayers 3 uses `ol.source.Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
|
||||||
|
|
||||||
```js
|
|
||||||
var osmSource = new ol.source.OSM();
|
|
||||||
```
|
|
||||||
|
|
||||||
## Layer
|
|
||||||
A layer is a visual representation of data from a `source`. OpenLayers 3 has three basic types of layers: `ol.layer.Tile`, `ol.layer.Image` and `ol.layer.Vector`.
|
|
||||||
|
|
||||||
`ol.layer.Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
|
|
||||||
|
|
||||||
`ol.layer.Image` is for server rendered images that are available for arbitrary extents and resolutions.
|
|
||||||
|
|
||||||
`ol.layer.Vector` is for vector data that is rendered client-side.
|
|
||||||
|
|
||||||
```js
|
|
||||||
var osmLayer = new ol.layer.Tile({source: osmSource});
|
|
||||||
map.addLayer(osmLayer);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Putting it all together
|
|
||||||
|
|
||||||
|
|
||||||
The above snippets can be conflated to a self contained map configuration with view and layers:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<div id="map" style="width: 100%, height: 400px"></div>
|
|
||||||
<script>
|
|
||||||
new ol.Map({
|
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({source: new ol.source.OSM()})
|
|
||||||
],
|
|
||||||
view: new ol.View({
|
|
||||||
center: [0, 0],
|
|
||||||
zoom: 2
|
|
||||||
}),
|
|
||||||
target: 'map'
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
title: Tutorials
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Tutorials
|
|
||||||
|
|
||||||
We'll be putting together a more comprehensive set of tutorials here. For now, you can take a look at the [introduction](introduction.html) and [basic concepts](concepts.html) tutorial. Stay tuned for more!
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
title: Introduction
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Introduction
|
|
||||||
|
|
||||||
## Objectives
|
|
||||||
OpenLayers 3 (OL3) is a fundamental redesign of the OpenLayers web mapping library. Version 2 is widely used, but dates from the early days of Javascript development, and is increasingly showing its age. OL3 has been rewritten from the ground up to use modern design patterns.
|
|
||||||
|
|
||||||
The initial release aims to support much of the functionality provided by version 2, with support for a wide range of commercial and free tile sources, and the most popular open-source vector data formats. As with version 2, data can be in any projection. The initial release also adds some additional functionality, such as the ability to easily rotate or animate maps.
|
|
||||||
|
|
||||||
It is also designed such that major new features, such as displaying 3D maps, or using WebGL to quickly display large vector data sets, can be added in later releases.
|
|
||||||
|
|
||||||
## Closure Tools
|
|
||||||
OL3 is based on Google's Closure Tools. It makes heavy use of parts of the [__Closure Library__](https://developers.google.com/closure/library/). Using this to handle basics like DOM or event handling means the developers can concentrate on mapping functionality, and be sure that the underlying software is well-tested and cross-browser. Closure Library is specially designed to be optimized by the [__Closure Compiler__](https://developers.google.com/closure/compiler/). The 'advanced' optimizations that this provides offers a level of compression that far exceeds anything else available. OL3 has been designed to make full use of this.
|
|
||||||
|
|
||||||
## Public API
|
|
||||||
Using the advanced optimizations of the Closure Compiler means that properties and methods are renamed – `longMeaningfulName` might become `xB` – and so are effectively unusable in applications using the library. To be usable, they have to be explicitly `exported`. This means the exported names, those not renamed, effectively become the public API of the library. These __exportable__ properties and methods are marked in the source, and documented in the [API docs](../apidoc). This is the officially supported API of the library. A build containing all these exportable names is known as a __full build__. A hosted version of this is available, which can be used by any application.
|
|
||||||
|
|
||||||
Although Closure library functions are widely used within OL3, none of them are exported. You will see references to them (they are all in the `goog` namespace) in the API docs, but these are for information only. You can use the Closure library in your own applications if you like, but this is not required.
|
|
||||||
|
|
||||||
## Custom Builds
|
|
||||||
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
|
|
||||||
|
|
||||||
## Renderers and Browser Support
|
|
||||||
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support raster data from tile/image servers, but only the Canvas renderer currently supports vector data. This means that only those browsers that [support Canvas](http://caniuse.com/canvas) can handle vector data. In particular, this excludes Internet Explorer versions before 9, though there is some support for those in the DOM renderer. Clearly, the WebGL renderer can only be used on those devices and browsers supporting WebGL.
|
|
||||||
|
|
||||||
The library is intended for use on both desktop/laptop and mobile devices.
|
|
||||||
|
|
||||||
## Objects and Naming Conventions
|
|
||||||
OL3 uses a similar object hierarchy to the Closure library. There is a top-level `ol` namespace (basically, `var ol = {};`). Subdivisions of this are:
|
|
||||||
|
|
||||||
* further namespaces, such as `ol.layer`; these have a lower-case initial
|
|
||||||
* simple objects containing static properties and methods, such as `ol.animation`; these also have a lower-case initial
|
|
||||||
* types, which have an upper-case initial. These are mainly 'classes', which here means a constructor function with prototypal inheritance, such as `ol.Map` or `ol.layer.Vector` (the Vector class within the layer namespace). There are however other, simpler, types, such as `ol.Extent`, which is an array.
|
|
||||||
|
|
||||||
In the API docs, the index on the left lists the namespaces and simple objects first, followed by the classes.
|
|
||||||
|
|
||||||
Class namespaces, such as `ol.layer` have a base class type with the same name, such as `ol.layer.Layer`. These are mainly abstract classes, from which the other subclasses inherit.
|
|
||||||
|
|
||||||
Source files are similarly organised, with a directory for each class namespace. Names are however all lower-case, and the subclasses repeat the superclass type in their name, for example, `ol/layer/vectorlayer.js`.
|
|
||||||
|
|
||||||
The naming structure means that there are sometimes 2 objects with the same name but different initial, such as `ol.feature`, a simple object with static functions to be used with features, and `ol.Feature`, a class used to instantiate new features. These two objects are however stored in the same file, in this case, `ol/feature.js`
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user