minor build helper improvements

This commit is contained in:
mourner 2011-12-12 14:04:26 +02:00
parent 313f3d9ebe
commit 0e329c7b1b
2 changed files with 76 additions and 64 deletions

View File

@ -14,22 +14,23 @@
#container {
text-align: left;
margin: 0 auto;
width: 600px;
width: 780px;
}
#deplist {
list-style: none;
padding: 0;
}
#deplist li {
padding-top: 10px;
padding-bottom: 10px;
border-top: 1px solid #eee;
padding-top: 7px;
padding-bottom: 7px;
border-bottom: 1px solid #ddd;
}
#deplist li.heading {
border: none;
background: #eee;
background: #ddd;
padding: 5px 10px;
margin-top: 10px;
margin-top: 25px;
border-radius: 5px;
}
#deplist input {
float: left;
@ -38,7 +39,7 @@
}
#deplist label {
float: left;
width: 190px;
width: 160px;
font-weight: bold;
}
#deplist div {
@ -55,25 +56,36 @@
#command, #command2 {
width: 100%;
}
#toolbar {
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
margin-top: 2em;
}
</style>
</head>
<body>
<div id="container">
<h1>Leaflet Build Helper</h1>
<p>
<p id="toolbar">
<a id="select-all" href="#all">Select All</a> |
<a id="deselect-all" href="#none">Deselect All</a>
</p>
<ul id="deplist"></ul>
<h2>Building using Node and UglifyJS</h2>
<p>
To build using UglifyJS, <a href="http://nodejs.org/#download">install Node</a>, run <code>npm install -g jake</code>, then <code>npm install -g uglify-js</code>, then run this in the root Leaflet directory:<br />
<a href="http://nodejs.org/#download">Install Node</a>, install Jake & UglifyJS (<code>npm install -g jake</code>; <code>npm install -g uglify-js</code>), then run this in the root Leaflet directory:<br />
<input type="text" id="command2" />
</p>
<h2>Building using Closure Compiler</h2>
<p>
To build using Closure Compiler, <a href="http://closure-compiler.googlecode.com/files/compiler-latest.zip">download</a> and extract it into <code>lib/closure-compiler</code> directory and run this command in the root Leaflet directory:<br />
<a href="http://closure-compiler.googlecode.com/files/compiler-latest.zip">Download Closure Compiler</a> and extract it into <code>lib/closure-compiler</code> directory and run this command in the root Leaflet directory:<br />
<input type="text" id="command" />
</p>
</div>
@ -108,10 +120,10 @@
var checks = deplist.getElementsByTagName('input');
var compsStr = '';
for (var i = 0; i < checks.length; i++) {
for (var i = 0, len = checks.length; i < len; i++) {
if (checks[i].checked) {
var srcs = deps[checks[i].id].src;
for (var j = 0; j < srcs.length; j++) {
for (var j = 0, len2 = srcs.length; j < len2; j++) {
files[srcs[j]] = true;
}
compsStr = '1' + compsStr;

View File

@ -2,9 +2,9 @@ var deps = {
Core: {
src: ['Leaflet.js',
'core/Util.js',
'core/Class.js',
'core/Events.js',
'core/Browser.js',
'core/Class.js',
'core/Events.js',
'core/Browser.js',
'geometry/Point.js',
'geometry/Bounds.js',
'geometry/Transformation.js',
@ -20,78 +20,78 @@ var deps = {
'map/Map.js'],
desc: 'The core of the library, including OOP, events, DOM facilities, basic units, projections (EPSG:3857 and EPSG:4326) and the base Map class.'
},
EPSG3395: {
src: ['geo/projection/Projection.Mercator.js',
'geo/crs/CRS.EPSG3395.js'],
desc: 'EPSG:3395 projection (used by some map providers).',
heading: 'Additional projections'
},
TileLayer: {
src: ['layer/tile/TileLayer.js'],
desc: 'The base class for displaying tile layers on the map.',
heading: 'Layers'
},
TileLayerWMS: {
src: ['layer/tile/TileLayer.WMS.js'],
desc: 'WMS tile layer.',
deps: ['TileLayer']
},
TileLayerCanvas: {
src: ['layer/tile/TileLayer.Canvas.js'],
desc: 'Tile layer made from canvases (for custom drawing purposes).',
deps: ['TileLayer']
},
ImageOverlay: {
src: ['layer/ImageOverlay.js'],
desc: 'Used to display an image over a particular rectangular area of the map.'
},
Marker: {
src: ['layer/marker/Icon.js', 'layer/marker/Marker.js'],
desc: 'Markers to put on the map.'
},
Popup: {
src: ['layer/Popup.js', 'layer/marker/Marker.Popup.js', 'map/ext/Map.Popup.js'],
deps: ['Marker'],
desc: 'Used to display the map popup (used mostly for binding HTML data to markers and paths on click).'
},
LayerGroup: {
src: ['layer/LayerGroup.js'],
desc: 'Allows grouping several layers to handle them as one.'
},
FeatureGroup: {
src: ['layer/FeatureGroup.js'],
deps: ['LayerGroup', 'Popup'],
desc: 'Extends LayerGroup with mouse events and bindPopup method shared between layers.'
},
Path: {
src: ['layer/vector/Path.js', 'layer/vector/Path.SVG.js', 'layer/vector/Path.Popup.js'],
desc: 'Vector rendering core (SVG-powered), enables overlaying the map with SVG paths.',
heading: 'Vector layers'
},
PathVML: {
src: ['layer/vector/Path.VML.js'],
desc: 'VML fallback for vector rendering core (IE 6-8).'
},
Polyline: {
src: ['geometry/LineUtil.js', 'layer/vector/Polyline.js'],
deps: ['Path'],
desc: 'Polyline overlays.'
},
Polygon: {
src: ['geometry/PolyUtil.js', 'layer/vector/Polygon.js'],
deps: ['Polyline'],
@ -109,13 +109,13 @@ var deps = {
deps: ['Path'],
desc: 'Circle overlays (with radius in meters).'
},
CircleMarker: {
src: ['layer/vector/CircleMarker.js'],
deps: ['Circle'],
desc: 'Circle overlays with a constant pixel radius.'
},
PathCanvas: {
src: ['layer/vector/canvas/Path.Canvas.js',
'layer/vector/canvas/Polyline.Canvas.js',
@ -124,14 +124,14 @@ var deps = {
deps: ['Path', 'Polyline', 'Polygon', 'Circle'],
desc: 'Canvas fallback for vector layers (makes them work on Android 2+).'
},
GeoJSON: {
src: ['layer/GeoJSON.js'],
deps: ['Marker', 'MultiPoly', 'FeatureGroup'],
desc: 'GeoJSON layer, parses the data and adds corresponding layers above.'
},
MapDrag: {
src: ['dom/DomEvent.js',
'dom/Draggable.js',
@ -140,7 +140,7 @@ var deps = {
desc: 'Makes the map draggable (by mouse or touch).',
heading: 'Interaction'
},
MouseZoom: {
src: ['dom/DomEvent.js',
'handler/Handler.js',
@ -148,7 +148,7 @@ var deps = {
'handler/ScrollWheelZoom.js'],
desc: 'Scroll wheel zoom and double click zoom on the map.'
},
TouchZoom: {
src: ['dom/DomEvent.js',
'dom/DomEvent.DoubleTap.js',
@ -157,69 +157,69 @@ var deps = {
deps: ['MapAnimationZoom'],
desc: 'Enables smooth touch zooming on iOS and double tap on iOS/Android.'
},
ShiftDragZoom: {
src: ['handler/ShiftDragZoom.js'],
desc: 'Enables zooming to bounding box by shift-dragging the map.'
},
MarkerDrag: {
src: ['handler/MarkerDrag.js'],
desc: 'Makes markers draggable (by mouse or touch).'
},
ControlZoom: {
src: ['control/Control.js',
'map/ext/Map.Control.js',
src: ['control/Control.js',
'map/ext/Map.Control.js',
'control/Control.Zoom.js'],
heading: 'Controls',
desc: 'Basic zoom control with two buttons (zoom in / zoom out).'
},
ControlAttrib: {
src: ['control/Control.js',
'map/ext/Map.Control.js',
src: ['control/Control.js',
'map/ext/Map.Control.js',
'control/Control.Attribution.js'],
desc: 'Attribution control.'
},
ControlLayers: {
src: ['control/Control.js',
'map/ext/Map.Control.js',
src: ['control/Control.js',
'map/ext/Map.Control.js',
'control/Control.Layers.js'],
desc: 'Layer Switcher control.'
},
MapAnimationNative: {
AnimationNative: {
src: ['dom/DomEvent.js',
'dom/transition/Transition.js',
'dom/transition/Transition.Native.js'],
desc: 'Animation core that uses CSS3 Transitions (for powering pan & zoom animations). Works on mobile webkit-powered browsers and some modern desktop browsers.',
heading: 'Visual effects'
},
MapAnimationFallback: {
AnimationTimer: {
src: ['dom/transition/Transition.Timer.js'],
deps: ['MapAnimationNative'],
deps: ['AnimationNative'],
desc: 'Timer-based animation fallback for browsers that don\'t support CSS3 transitions.'
},
MapAnimationPan: {
AnimationPan: {
src: ['map/ext/Map.PanAnimation.js'],
deps: ['MapAnimationNative'],
deps: ['AnimationPan'],
desc: 'Panning animation. Can use both native and timer-based animation.'
},
MapAnimationZoom: {
AnimationZoom: {
src: ['map/ext/Map.ZoomAnimation.js'],
deps: ['MapAnimationPan', 'MapAnimationNative'],
deps: ['AnimationPan', 'AnimationNative'],
desc: 'Smooth zooming animation. So far it works only on browsers that support CSS3 Transitions.'
},
MapGeolocation: {
Geolocation: {
src: ['map/ext/Map.Geolocation.js'],
desc: 'Adds Map#locate method and related events to make geolocation easier.',
heading: 'Misc'
@ -228,4 +228,4 @@ var deps = {
if (typeof exports !== 'undefined') {
exports.deps = deps;
}
}