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 { #container {
text-align: left; text-align: left;
margin: 0 auto; margin: 0 auto;
width: 600px; width: 780px;
} }
#deplist { #deplist {
list-style: none; list-style: none;
padding: 0; padding: 0;
} }
#deplist li { #deplist li {
padding-top: 10px; padding-top: 7px;
padding-bottom: 10px; padding-bottom: 7px;
border-top: 1px solid #eee; border-bottom: 1px solid #ddd;
} }
#deplist li.heading { #deplist li.heading {
border: none; border: none;
background: #eee; background: #ddd;
padding: 5px 10px; padding: 5px 10px;
margin-top: 10px; margin-top: 25px;
border-radius: 5px;
} }
#deplist input { #deplist input {
float: left; float: left;
@ -38,7 +39,7 @@
} }
#deplist label { #deplist label {
float: left; float: left;
width: 190px; width: 160px;
font-weight: bold; font-weight: bold;
} }
#deplist div { #deplist div {
@ -55,25 +56,36 @@
#command, #command2 { #command, #command2 {
width: 100%; width: 100%;
} }
#toolbar {
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
margin-top: 2em;
}
</style> </style>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<h1>Leaflet Build Helper</h1> <h1>Leaflet Build Helper</h1>
<p> <p id="toolbar">
<a id="select-all" href="#all">Select All</a> | <a id="select-all" href="#all">Select All</a> |
<a id="deselect-all" href="#none">Deselect All</a> <a id="deselect-all" href="#none">Deselect All</a>
</p> </p>
<ul id="deplist"></ul> <ul id="deplist"></ul>
<h2>Building using Node and UglifyJS</h2>
<p> <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" /> <input type="text" id="command2" />
</p> </p>
<h2>Building using Closure Compiler</h2>
<p> <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" /> <input type="text" id="command" />
</p> </p>
</div> </div>
@ -108,10 +120,10 @@
var checks = deplist.getElementsByTagName('input'); var checks = deplist.getElementsByTagName('input');
var compsStr = ''; var compsStr = '';
for (var i = 0; i < checks.length; i++) { for (var i = 0, len = checks.length; i < len; i++) {
if (checks[i].checked) { if (checks[i].checked) {
var srcs = deps[checks[i].id].src; 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; files[srcs[j]] = true;
} }
compsStr = '1' + compsStr; compsStr = '1' + compsStr;

View File

@ -192,7 +192,7 @@ var deps = {
}, },
MapAnimationNative: { AnimationNative: {
src: ['dom/DomEvent.js', src: ['dom/DomEvent.js',
'dom/transition/Transition.js', 'dom/transition/Transition.js',
'dom/transition/Transition.Native.js'], 'dom/transition/Transition.Native.js'],
@ -200,26 +200,26 @@ var deps = {
heading: 'Visual effects' heading: 'Visual effects'
}, },
MapAnimationFallback: { AnimationTimer: {
src: ['dom/transition/Transition.Timer.js'], src: ['dom/transition/Transition.Timer.js'],
deps: ['MapAnimationNative'], deps: ['AnimationNative'],
desc: 'Timer-based animation fallback for browsers that don\'t support CSS3 transitions.' desc: 'Timer-based animation fallback for browsers that don\'t support CSS3 transitions.'
}, },
MapAnimationPan: { AnimationPan: {
src: ['map/ext/Map.PanAnimation.js'], src: ['map/ext/Map.PanAnimation.js'],
deps: ['MapAnimationNative'], deps: ['AnimationPan'],
desc: 'Panning animation. Can use both native and timer-based animation.' desc: 'Panning animation. Can use both native and timer-based animation.'
}, },
MapAnimationZoom: { AnimationZoom: {
src: ['map/ext/Map.ZoomAnimation.js'], 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.' desc: 'Smooth zooming animation. So far it works only on browsers that support CSS3 Transitions.'
}, },
MapGeolocation: { Geolocation: {
src: ['map/ext/Map.Geolocation.js'], src: ['map/ext/Map.Geolocation.js'],
desc: 'Adds Map#locate method and related events to make geolocation easier.', desc: 'Adds Map#locate method and related events to make geolocation easier.',
heading: 'Misc' heading: 'Misc'