├── .gitignore ├── README.md └── static ├── Gemfile ├── build.sh ├── dev ├── config.rb ├── images │ └── empty.txt ├── index.html ├── sass │ ├── app │ │ └── main.sass │ └── screen.sass ├── scripts │ ├── LICENSE.txt │ ├── app.build.js │ ├── main.js │ ├── require-jquery.js │ ├── sproutcore.js │ └── underscore.js └── stylesheets │ ├── app │ └── main.css │ ├── ie.css │ ├── print.css │ └── screen.css ├── r.js ├── serveBuild.sh ├── serveDev.sh ├── vendor └── cache │ ├── chunky_png-1.2.0.gem │ ├── compass-0.11.5.gem │ ├── fssm-0.2.7.gem │ ├── rb-fsevent-0.4.2.gem │ └── sass-3.1.7.gem └── watchSass.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.sassc 2 | *.scssc 3 | static/Gemfile.lock 4 | static/build/* 5 | 6 | # Numerous always-ignore extensions 7 | *.diff 8 | *.err 9 | *.orig 10 | *.log 11 | *.rej 12 | *.swo 13 | *.swp 14 | *.vi 15 | *~ 16 | *.sass-cache 17 | 18 | # OS or Editor folders 19 | .DS_Store 20 | .cache 21 | .project 22 | .settings 23 | nbproject 24 | Thumbs.db 25 | 26 | # Dreamweaver added files 27 | _notes 28 | dwsync.xml 29 | 30 | # Komodo 31 | *.komodoproject 32 | .komodotools 33 | 34 | # Folders to ignore 35 | .hg 36 | .svn 37 | intermediate 38 | publish 39 | .idea 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Alex Sexton's Static Build 2 | 3 | Pretty much just a starting off point for a static site with a build process. 4 | 5 | ## What's in it? 6 | 7 | It's a `require.js` (v0.25.0) based app with `jQuery` 1.6.2, `Sproutcore` 2.0 Beta, and `Underscore.js` all modified to be modules in require that don't leak globally. 8 | 9 | The CSS is Compass on SASS (feel free to change it to SCSS if that's your jam). 10 | 11 | ## Known Issues 12 | 13 | * So far sproutcore doesn't like it if `window.sc_assert` is not global. So whatever... 14 | 15 | ## Running Static Builds 16 | 17 | `cd static` 18 | 19 | ### Run in development mode 20 | 21 | `./serveDev.sh` 22 | 23 | This will initially install the correct gems and packages necessary to serve the static directory in development mode. 24 | 25 | It will automatically watch your .sass files for changes (based on the `config.rb` file) and update the generated .css files on the fly. It will also start up the python simpleServer in order to serve the directory. RequireJS works out of the box here, since it was designed to be programmed in 'development mode' - and then built for efficiency. 26 | 27 | ### Run a build 28 | 29 | `./build.sh` 30 | 31 | This will just run a build. It won't watch anything in any folder for changes. It will just output a `/build` folder with the necessary output for a built static folder. 32 | 33 | ### Serve a build (Usually for testing builds) 34 | 35 | `/.serveBuild.sh` 36 | 37 | This will run `build.sh` and then serve the `/build` folder. It will not watch for changes (as you shouldn't be updating builds). Anything in the `/build` folder is ignored in version control. 38 | 39 | ## Requirements 40 | 41 | * NodeJS >= 0.4.x (for requirejs builds) ( `npm` and `nvm` suggested tools ) 42 | * UglifyJS ( `npm install uglify-js -g` - I think this might happen automatically... not sure though. Happens in Require ) 43 | * Ruby (I prefer 1.9.2 cause it makes me feel cool, but I think it all works) 44 | * RubyGems 45 | * Bundler (installed via RubyGems, automatically) 46 | * Compass (installed via bundler) 47 | * fsevent gem (installed via bundler) 48 | -------------------------------------------------------------------------------- /static/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | source "http://rubygems.org" 3 | 4 | gem "compass" 5 | gem "rb-fsevent" 6 | -------------------------------------------------------------------------------- /static/build.sh: -------------------------------------------------------------------------------- 1 | mkdir -p build 2 | rm -rf build/* 3 | node r.js -o dev/scripts/app.build.js 4 | sudo gem install bundler --no-rdoc --no-ri 5 | bundle install --local 6 | cd build 7 | cat scripts/LICENSE.txt | cat - scripts/main.js > /tmp/staticbuildout && mv /tmp/staticbuildout scripts/main.js 8 | echo "\n" >> config.rb 9 | echo "output_style = :compressed" >> config.rb 10 | compass compile . 11 | cd .. 12 | 13 | -------------------------------------------------------------------------------- /static/dev/config.rb: -------------------------------------------------------------------------------- 1 | # Require any additional compass plugins here. 2 | 3 | # Set this to the root of your project when deployed: 4 | http_path = "/" 5 | css_dir = "stylesheets" 6 | sass_dir = "sass" 7 | images_dir = "images" 8 | javascripts_dir = "scripts" 9 | 10 | # You can select your preferred output style here (can be overridden via the command line): 11 | # output_style = :expanded or :nested or :compact or :compressed 12 | # output_style = :compressed 13 | 14 | # To enable relative paths to assets via compass helper functions. Uncomment: 15 | # relative_assets = true 16 | 17 | # To disable debugging comments that display the original location of your selectors. Uncomment: 18 | # line_comments = false 19 | 20 | preferred_syntax = :sass 21 | -------------------------------------------------------------------------------- /static/dev/images/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/dev/images/empty.txt -------------------------------------------------------------------------------- /static/dev/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 |content
20 | links 21 | 22 | 23 | 24 | 32 | 33 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /static/dev/sass/app/main.sass: -------------------------------------------------------------------------------- 1 | body 2 | color: #333 3 | 4 | html 5 | color: #222 6 | 7 | @import compass/typography/links/hover-link 8 | a 9 | @include hover-link 10 | -------------------------------------------------------------------------------- /static/dev/sass/screen.sass: -------------------------------------------------------------------------------- 1 | /* 2 | Welcome to Compass. 3 | In this file you should write your main styles. (or centralize your imports) 4 | Import this file using the following HTML or equivalent: 5 | 6 | 7 | @import compass/reset 8 | @import app/main 9 | -------------------------------------------------------------------------------- /static/dev/scripts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | jQuery.js v1.6.2 3 | ------------------------------------------------- 4 | Copyright: 2009 John Resig, http://jquery.com/ 5 | License: MIT License 6 | 7 | Sproutcore.js v2.0b3 8 | ------------------------------------------------- 9 | Project: SproutCore - JavaScript Application Framework 10 | Copyright: 2006-2011 Strobe Inc. and contributors. 11 | Portions 2008-2011 Apple Inc. All rights reserved. 12 | License: Licensed under MIT license 13 | 14 | Underscore.js v1.1.7 15 | ------------------------------------------------- 16 | (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. 17 | Underscore is freely distributable under the MIT license. 18 | Portions of Underscore are inspired or borrowed from Prototype, 19 | Oliver Steele's Functional, and John Resig's Micro-Templating. 20 | For all details and documentation: 21 | http://documentcloud.github.com/underscore 22 | */ 23 | -------------------------------------------------------------------------------- /static/dev/scripts/app.build.js: -------------------------------------------------------------------------------- 1 | ({ 2 | appDir: "../", 3 | baseUrl: "scripts/", 4 | dir: "../../build", 5 | 6 | // This is done with SASS & Compass 7 | optimizeCss: "none", 8 | inlineText: true, 9 | 10 | paths: { 11 | "jquery": "require-jquery" 12 | }, 13 | 14 | pragmas: { 15 | //buildExclude: true 16 | }, 17 | 18 | modules: [ 19 | //Optimize the require-jquery.js file by applying any minification 20 | //that is desired via the optimize: setting above. 21 | { 22 | name: "require-jquery" 23 | }, 24 | 25 | //Optimize the application files. Exclude jQuery since it is 26 | //included already in require-jquery.js 27 | { 28 | name: "main", 29 | exclude: ["jquery"] 30 | } 31 | ] 32 | }) 33 | -------------------------------------------------------------------------------- /static/dev/scripts/main.js: -------------------------------------------------------------------------------- 1 | require(["jquery", "sproutcore", "underscore"], function( $, SC, _ ) { 2 | console.log( $, SC, _ ); 3 | }); 4 | -------------------------------------------------------------------------------- /static/dev/scripts/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.1.7 2 | // (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | 9 | // START STATIC-BUILD ADDED 10 | define( 'underscore', [], function () { 11 | var fakeRoot = {}; 12 | // END STATIC-BUILD ADDED 13 | 14 | (function() { 15 | 16 | // Baseline setup 17 | // -------------- 18 | 19 | // Establish the root object, `window` in the browser, or `global` on the server. 20 | // START STATIC-BUILD ADDED 21 | var root = fakeRoot; 22 | // END STATIC-BUILD ADDED 23 | 24 | // Save the previous value of the `_` variable. 25 | var previousUnderscore = root._; 26 | 27 | // Establish the object that gets returned to break out of a loop iteration. 28 | var breaker = {}; 29 | 30 | // Save bytes in the minified (but not gzipped) version: 31 | var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; 32 | 33 | // Create quick reference variables for speed access to core prototypes. 34 | var slice = ArrayProto.slice, 35 | unshift = ArrayProto.unshift, 36 | toString = ObjProto.toString, 37 | hasOwnProperty = ObjProto.hasOwnProperty; 38 | 39 | // All **ECMAScript 5** native function implementations that we hope to use 40 | // are declared here. 41 | var 42 | nativeForEach = ArrayProto.forEach, 43 | nativeMap = ArrayProto.map, 44 | nativeReduce = ArrayProto.reduce, 45 | nativeReduceRight = ArrayProto.reduceRight, 46 | nativeFilter = ArrayProto.filter, 47 | nativeEvery = ArrayProto.every, 48 | nativeSome = ArrayProto.some, 49 | nativeIndexOf = ArrayProto.indexOf, 50 | nativeLastIndexOf = ArrayProto.lastIndexOf, 51 | nativeIsArray = Array.isArray, 52 | nativeKeys = Object.keys, 53 | nativeBind = FuncProto.bind; 54 | 55 | // Create a safe reference to the Underscore object for use below. 56 | var _ = function(obj) { return new wrapper(obj); }; 57 | 58 | // Export the Underscore object for **CommonJS**, with backwards-compatibility 59 | // for the old `require()` API. If we're not in CommonJS, add `_` to the 60 | // global object. 61 | if (typeof module !== 'undefined' && module.exports) { 62 | module.exports = _; 63 | _._ = _; 64 | } else { 65 | // Exported as a string, for Closure Compiler "advanced" mode. 66 | root['_'] = _; 67 | } 68 | 69 | // Current version. 70 | _.VERSION = '1.1.7'; 71 | 72 | // Collection Functions 73 | // -------------------- 74 | 75 | // The cornerstone, an `each` implementation, aka `forEach`. 76 | // Handles objects with the built-in `forEach`, arrays, and raw objects. 77 | // Delegates to **ECMAScript 5**'s native `forEach` if available. 78 | var each = _.each = _.forEach = function(obj, iterator, context) { 79 | if (obj == null) return; 80 | if (nativeForEach && obj.forEach === nativeForEach) { 81 | obj.forEach(iterator, context); 82 | } else if (obj.length === +obj.length) { 83 | for (var i = 0, l = obj.length; i < l; i++) { 84 | if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; 85 | } 86 | } else { 87 | for (var key in obj) { 88 | if (hasOwnProperty.call(obj, key)) { 89 | if (iterator.call(context, obj[key], key, obj) === breaker) return; 90 | } 91 | } 92 | } 93 | }; 94 | 95 | // Return the results of applying the iterator to each element. 96 | // Delegates to **ECMAScript 5**'s native `map` if available. 97 | _.map = function(obj, iterator, context) { 98 | var results = []; 99 | if (obj == null) return results; 100 | if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); 101 | each(obj, function(value, index, list) { 102 | results[results.length] = iterator.call(context, value, index, list); 103 | }); 104 | return results; 105 | }; 106 | 107 | // **Reduce** builds up a single result from a list of values, aka `inject`, 108 | // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. 109 | _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { 110 | var initial = memo !== void 0; 111 | if (obj == null) obj = []; 112 | if (nativeReduce && obj.reduce === nativeReduce) { 113 | if (context) iterator = _.bind(iterator, context); 114 | return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); 115 | } 116 | each(obj, function(value, index, list) { 117 | if (!initial) { 118 | memo = value; 119 | initial = true; 120 | } else { 121 | memo = iterator.call(context, memo, value, index, list); 122 | } 123 | }); 124 | if (!initial) throw new TypeError("Reduce of empty array with no initial value"); 125 | return memo; 126 | }; 127 | 128 | // The right-associative version of reduce, also known as `foldr`. 129 | // Delegates to **ECMAScript 5**'s native `reduceRight` if available. 130 | _.reduceRight = _.foldr = function(obj, iterator, memo, context) { 131 | if (obj == null) obj = []; 132 | if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { 133 | if (context) iterator = _.bind(iterator, context); 134 | return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); 135 | } 136 | var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse(); 137 | return _.reduce(reversed, iterator, memo, context); 138 | }; 139 | 140 | // Return the first value which passes a truth test. Aliased as `detect`. 141 | _.find = _.detect = function(obj, iterator, context) { 142 | var result; 143 | any(obj, function(value, index, list) { 144 | if (iterator.call(context, value, index, list)) { 145 | result = value; 146 | return true; 147 | } 148 | }); 149 | return result; 150 | }; 151 | 152 | // Return all the elements that pass a truth test. 153 | // Delegates to **ECMAScript 5**'s native `filter` if available. 154 | // Aliased as `select`. 155 | _.filter = _.select = function(obj, iterator, context) { 156 | var results = []; 157 | if (obj == null) return results; 158 | if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); 159 | each(obj, function(value, index, list) { 160 | if (iterator.call(context, value, index, list)) results[results.length] = value; 161 | }); 162 | return results; 163 | }; 164 | 165 | // Return all the elements for which a truth test fails. 166 | _.reject = function(obj, iterator, context) { 167 | var results = []; 168 | if (obj == null) return results; 169 | each(obj, function(value, index, list) { 170 | if (!iterator.call(context, value, index, list)) results[results.length] = value; 171 | }); 172 | return results; 173 | }; 174 | 175 | // Determine whether all of the elements match a truth test. 176 | // Delegates to **ECMAScript 5**'s native `every` if available. 177 | // Aliased as `all`. 178 | _.every = _.all = function(obj, iterator, context) { 179 | var result = true; 180 | if (obj == null) return result; 181 | if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); 182 | each(obj, function(value, index, list) { 183 | if (!(result = result && iterator.call(context, value, index, list))) return breaker; 184 | }); 185 | return result; 186 | }; 187 | 188 | // Determine if at least one element in the object matches a truth test. 189 | // Delegates to **ECMAScript 5**'s native `some` if available. 190 | // Aliased as `any`. 191 | var any = _.some = _.any = function(obj, iterator, context) { 192 | iterator = iterator || _.identity; 193 | var result = false; 194 | if (obj == null) return result; 195 | if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); 196 | each(obj, function(value, index, list) { 197 | if (result |= iterator.call(context, value, index, list)) return breaker; 198 | }); 199 | return !!result; 200 | }; 201 | 202 | // Determine if a given value is included in the array or object using `===`. 203 | // Aliased as `contains`. 204 | _.include = _.contains = function(obj, target) { 205 | var found = false; 206 | if (obj == null) return found; 207 | if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; 208 | any(obj, function(value) { 209 | if (found = value === target) return true; 210 | }); 211 | return found; 212 | }; 213 | 214 | // Invoke a method (with arguments) on every item in a collection. 215 | _.invoke = function(obj, method) { 216 | var args = slice.call(arguments, 2); 217 | return _.map(obj, function(value) { 218 | return (method.call ? method || value : value[method]).apply(value, args); 219 | }); 220 | }; 221 | 222 | // Convenience version of a common use case of `map`: fetching a property. 223 | _.pluck = function(obj, key) { 224 | return _.map(obj, function(value){ return value[key]; }); 225 | }; 226 | 227 | // Return the maximum element or (element-based computation). 228 | _.max = function(obj, iterator, context) { 229 | if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj); 230 | var result = {computed : -Infinity}; 231 | each(obj, function(value, index, list) { 232 | var computed = iterator ? iterator.call(context, value, index, list) : value; 233 | computed >= result.computed && (result = {value : value, computed : computed}); 234 | }); 235 | return result.value; 236 | }; 237 | 238 | // Return the minimum element (or element-based computation). 239 | _.min = function(obj, iterator, context) { 240 | if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj); 241 | var result = {computed : Infinity}; 242 | each(obj, function(value, index, list) { 243 | var computed = iterator ? iterator.call(context, value, index, list) : value; 244 | computed < result.computed && (result = {value : value, computed : computed}); 245 | }); 246 | return result.value; 247 | }; 248 | 249 | // Sort the object's values by a criterion produced by an iterator. 250 | _.sortBy = function(obj, iterator, context) { 251 | return _.pluck(_.map(obj, function(value, index, list) { 252 | return { 253 | value : value, 254 | criteria : iterator.call(context, value, index, list) 255 | }; 256 | }).sort(function(left, right) { 257 | var a = left.criteria, b = right.criteria; 258 | return a < b ? -1 : a > b ? 1 : 0; 259 | }), 'value'); 260 | }; 261 | 262 | // Groups the object's values by a criterion produced by an iterator 263 | _.groupBy = function(obj, iterator) { 264 | var result = {}; 265 | each(obj, function(value, index) { 266 | var key = iterator(value, index); 267 | (result[key] || (result[key] = [])).push(value); 268 | }); 269 | return result; 270 | }; 271 | 272 | // Use a comparator function to figure out at what index an object should 273 | // be inserted so as to maintain order. Uses binary search. 274 | _.sortedIndex = function(array, obj, iterator) { 275 | iterator || (iterator = _.identity); 276 | var low = 0, high = array.length; 277 | while (low < high) { 278 | var mid = (low + high) >> 1; 279 | iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; 280 | } 281 | return low; 282 | }; 283 | 284 | // Safely convert anything iterable into a real, live array. 285 | _.toArray = function(iterable) { 286 | if (!iterable) return []; 287 | if (iterable.toArray) return iterable.toArray(); 288 | if (_.isArray(iterable)) return slice.call(iterable); 289 | if (_.isArguments(iterable)) return slice.call(iterable); 290 | return _.values(iterable); 291 | }; 292 | 293 | // Return the number of elements in an object. 294 | _.size = function(obj) { 295 | return _.toArray(obj).length; 296 | }; 297 | 298 | // Array Functions 299 | // --------------- 300 | 301 | // Get the first element of an array. Passing **n** will return the first N 302 | // values in the array. Aliased as `head`. The **guard** check allows it to work 303 | // with `_.map`. 304 | _.first = _.head = function(array, n, guard) { 305 | return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; 306 | }; 307 | 308 | // Returns everything but the first entry of the array. Aliased as `tail`. 309 | // Especially useful on the arguments object. Passing an **index** will return 310 | // the rest of the values in the array from that index onward. The **guard** 311 | // check allows it to work with `_.map`. 312 | _.rest = _.tail = function(array, index, guard) { 313 | return slice.call(array, (index == null) || guard ? 1 : index); 314 | }; 315 | 316 | // Get the last element of an array. 317 | _.last = function(array) { 318 | return array[array.length - 1]; 319 | }; 320 | 321 | // Trim out all falsy values from an array. 322 | _.compact = function(array) { 323 | return _.filter(array, function(value){ return !!value; }); 324 | }; 325 | 326 | // Return a completely flattened version of an array. 327 | _.flatten = function(array) { 328 | return _.reduce(array, function(memo, value) { 329 | if (_.isArray(value)) return memo.concat(_.flatten(value)); 330 | memo[memo.length] = value; 331 | return memo; 332 | }, []); 333 | }; 334 | 335 | // Return a version of the array that does not contain the specified value(s). 336 | _.without = function(array) { 337 | return _.difference(array, slice.call(arguments, 1)); 338 | }; 339 | 340 | // Produce a duplicate-free version of the array. If the array has already 341 | // been sorted, you have the option of using a faster algorithm. 342 | // Aliased as `unique`. 343 | _.uniq = _.unique = function(array, isSorted) { 344 | return _.reduce(array, function(memo, el, i) { 345 | if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo[memo.length] = el; 346 | return memo; 347 | }, []); 348 | }; 349 | 350 | // Produce an array that contains the union: each distinct element from all of 351 | // the passed-in arrays. 352 | _.union = function() { 353 | return _.uniq(_.flatten(arguments)); 354 | }; 355 | 356 | // Produce an array that contains every item shared between all the 357 | // passed-in arrays. (Aliased as "intersect" for back-compat.) 358 | _.intersection = _.intersect = function(array) { 359 | var rest = slice.call(arguments, 1); 360 | return _.filter(_.uniq(array), function(item) { 361 | return _.every(rest, function(other) { 362 | return _.indexOf(other, item) >= 0; 363 | }); 364 | }); 365 | }; 366 | 367 | // Take the difference between one array and another. 368 | // Only the elements present in just the first array will remain. 369 | _.difference = function(array, other) { 370 | return _.filter(array, function(value){ return !_.include(other, value); }); 371 | }; 372 | 373 | // Zip together multiple lists into a single array -- elements that share 374 | // an index go together. 375 | _.zip = function() { 376 | var args = slice.call(arguments); 377 | var length = _.max(_.pluck(args, 'length')); 378 | var results = new Array(length); 379 | for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); 380 | return results; 381 | }; 382 | 383 | // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), 384 | // we need this function. Return the position of the first occurrence of an 385 | // item in an array, or -1 if the item is not included in the array. 386 | // Delegates to **ECMAScript 5**'s native `indexOf` if available. 387 | // If the array is large and already in sort order, pass `true` 388 | // for **isSorted** to use binary search. 389 | _.indexOf = function(array, item, isSorted) { 390 | if (array == null) return -1; 391 | var i, l; 392 | if (isSorted) { 393 | i = _.sortedIndex(array, item); 394 | return array[i] === item ? i : -1; 395 | } 396 | if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); 397 | for (i = 0, l = array.length; i < l; i++) if (array[i] === item) return i; 398 | return -1; 399 | }; 400 | 401 | 402 | // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. 403 | _.lastIndexOf = function(array, item) { 404 | if (array == null) return -1; 405 | if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); 406 | var i = array.length; 407 | while (i--) if (array[i] === item) return i; 408 | return -1; 409 | }; 410 | 411 | // Generate an integer Array containing an arithmetic progression. A port of 412 | // the native Python `range()` function. See 413 | // [the Python documentation](http://docs.python.org/library/functions.html#range). 414 | _.range = function(start, stop, step) { 415 | if (arguments.length <= 1) { 416 | stop = start || 0; 417 | start = 0; 418 | } 419 | step = arguments[2] || 1; 420 | 421 | var len = Math.max(Math.ceil((stop - start) / step), 0); 422 | var idx = 0; 423 | var range = new Array(len); 424 | 425 | while(idx < len) { 426 | range[idx++] = start; 427 | start += step; 428 | } 429 | 430 | return range; 431 | }; 432 | 433 | // Function (ahem) Functions 434 | // ------------------ 435 | 436 | // Create a function bound to a given object (assigning `this`, and arguments, 437 | // optionally). Binding with arguments is also known as `curry`. 438 | // Delegates to **ECMAScript 5**'s native `Function.bind` if available. 439 | // We check for `func.bind` first, to fail fast when `func` is undefined. 440 | _.bind = function(func, obj) { 441 | if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); 442 | var args = slice.call(arguments, 2); 443 | return function() { 444 | return func.apply(obj, args.concat(slice.call(arguments))); 445 | }; 446 | }; 447 | 448 | // Bind all of an object's methods to that object. Useful for ensuring that 449 | // all callbacks defined on an object belong to it. 450 | _.bindAll = function(obj) { 451 | var funcs = slice.call(arguments, 1); 452 | if (funcs.length == 0) funcs = _.functions(obj); 453 | each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); 454 | return obj; 455 | }; 456 | 457 | // Memoize an expensive function by storing its results. 458 | _.memoize = function(func, hasher) { 459 | var memo = {}; 460 | hasher || (hasher = _.identity); 461 | return function() { 462 | var key = hasher.apply(this, arguments); 463 | return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); 464 | }; 465 | }; 466 | 467 | // Delays a function for the given number of milliseconds, and then calls 468 | // it with the arguments supplied. 469 | _.delay = function(func, wait) { 470 | var args = slice.call(arguments, 2); 471 | return setTimeout(function(){ return func.apply(func, args); }, wait); 472 | }; 473 | 474 | // Defers a function, scheduling it to run after the current call stack has 475 | // cleared. 476 | _.defer = function(func) { 477 | return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); 478 | }; 479 | 480 | // Internal function used to implement `_.throttle` and `_.debounce`. 481 | var limit = function(func, wait, debounce) { 482 | var timeout; 483 | return function() { 484 | var context = this, args = arguments; 485 | var throttler = function() { 486 | timeout = null; 487 | func.apply(context, args); 488 | }; 489 | if (debounce) clearTimeout(timeout); 490 | if (debounce || !timeout) timeout = setTimeout(throttler, wait); 491 | }; 492 | }; 493 | 494 | // Returns a function, that, when invoked, will only be triggered at most once 495 | // during a given window of time. 496 | _.throttle = function(func, wait) { 497 | return limit(func, wait, false); 498 | }; 499 | 500 | // Returns a function, that, as long as it continues to be invoked, will not 501 | // be triggered. The function will be called after it stops being called for 502 | // N milliseconds. 503 | _.debounce = function(func, wait) { 504 | return limit(func, wait, true); 505 | }; 506 | 507 | // Returns a function that will be executed at most one time, no matter how 508 | // often you call it. Useful for lazy initialization. 509 | _.once = function(func) { 510 | var ran = false, memo; 511 | return function() { 512 | if (ran) return memo; 513 | ran = true; 514 | return memo = func.apply(this, arguments); 515 | }; 516 | }; 517 | 518 | // Returns the first function passed as an argument to the second, 519 | // allowing you to adjust arguments, run code before and after, and 520 | // conditionally execute the original function. 521 | _.wrap = function(func, wrapper) { 522 | return function() { 523 | var args = [func].concat(slice.call(arguments)); 524 | return wrapper.apply(this, args); 525 | }; 526 | }; 527 | 528 | // Returns a function that is the composition of a list of functions, each 529 | // consuming the return value of the function that follows. 530 | _.compose = function() { 531 | var funcs = slice.call(arguments); 532 | return function() { 533 | var args = slice.call(arguments); 534 | for (var i = funcs.length - 1; i >= 0; i--) { 535 | args = [funcs[i].apply(this, args)]; 536 | } 537 | return args[0]; 538 | }; 539 | }; 540 | 541 | // Returns a function that will only be executed after being called N times. 542 | _.after = function(times, func) { 543 | return function() { 544 | if (--times < 1) { return func.apply(this, arguments); } 545 | }; 546 | }; 547 | 548 | 549 | // Object Functions 550 | // ---------------- 551 | 552 | // Retrieve the names of an object's properties. 553 | // Delegates to **ECMAScript 5**'s native `Object.keys` 554 | _.keys = nativeKeys || function(obj) { 555 | if (obj !== Object(obj)) throw new TypeError('Invalid object'); 556 | var keys = []; 557 | for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key; 558 | return keys; 559 | }; 560 | 561 | // Retrieve the values of an object's properties. 562 | _.values = function(obj) { 563 | return _.map(obj, _.identity); 564 | }; 565 | 566 | // Return a sorted list of the function names available on the object. 567 | // Aliased as `methods` 568 | _.functions = _.methods = function(obj) { 569 | var names = []; 570 | for (var key in obj) { 571 | if (_.isFunction(obj[key])) names.push(key); 572 | } 573 | return names.sort(); 574 | }; 575 | 576 | // Extend a given object with all the properties in passed-in object(s). 577 | _.extend = function(obj) { 578 | each(slice.call(arguments, 1), function(source) { 579 | for (var prop in source) { 580 | if (source[prop] !== void 0) obj[prop] = source[prop]; 581 | } 582 | }); 583 | return obj; 584 | }; 585 | 586 | // Fill in a given object with default properties. 587 | _.defaults = function(obj) { 588 | each(slice.call(arguments, 1), function(source) { 589 | for (var prop in source) { 590 | if (obj[prop] == null) obj[prop] = source[prop]; 591 | } 592 | }); 593 | return obj; 594 | }; 595 | 596 | // Create a (shallow-cloned) duplicate of an object. 597 | _.clone = function(obj) { 598 | return _.isArray(obj) ? obj.slice() : _.extend({}, obj); 599 | }; 600 | 601 | // Invokes interceptor with the obj, and then returns obj. 602 | // The primary purpose of this method is to "tap into" a method chain, in 603 | // order to perform operations on intermediate results within the chain. 604 | _.tap = function(obj, interceptor) { 605 | interceptor(obj); 606 | return obj; 607 | }; 608 | 609 | // Perform a deep comparison to check if two objects are equal. 610 | _.isEqual = function(a, b) { 611 | // Check object identity. 612 | if (a === b) return true; 613 | // Different types? 614 | var atype = typeof(a), btype = typeof(b); 615 | if (atype != btype) return false; 616 | // Basic equality test (watch out for coercions). 617 | if (a == b) return true; 618 | // One is falsy and the other truthy. 619 | if ((!a && b) || (a && !b)) return false; 620 | // Unwrap any wrapped objects. 621 | if (a._chain) a = a._wrapped; 622 | if (b._chain) b = b._wrapped; 623 | // One of them implements an isEqual()? 624 | if (a.isEqual) return a.isEqual(b); 625 | if (b.isEqual) return b.isEqual(a); 626 | // Check dates' integer values. 627 | if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime(); 628 | // Both are NaN? 629 | if (_.isNaN(a) && _.isNaN(b)) return false; 630 | // Compare regular expressions. 631 | if (_.isRegExp(a) && _.isRegExp(b)) 632 | return a.source === b.source && 633 | a.global === b.global && 634 | a.ignoreCase === b.ignoreCase && 635 | a.multiline === b.multiline; 636 | // If a is not an object by this point, we can't handle it. 637 | if (atype !== 'object') return false; 638 | // Check for different array lengths before comparing contents. 639 | if (a.length && (a.length !== b.length)) return false; 640 | // Nothing else worked, deep compare the contents. 641 | var aKeys = _.keys(a), bKeys = _.keys(b); 642 | // Different object sizes? 643 | if (aKeys.length != bKeys.length) return false; 644 | // Recursive comparison of contents. 645 | for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false; 646 | return true; 647 | }; 648 | 649 | // Is a given array or object empty? 650 | _.isEmpty = function(obj) { 651 | if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; 652 | for (var key in obj) if (hasOwnProperty.call(obj, key)) return false; 653 | return true; 654 | }; 655 | 656 | // Is a given value a DOM element? 657 | _.isElement = function(obj) { 658 | return !!(obj && obj.nodeType == 1); 659 | }; 660 | 661 | // Is a given value an array? 662 | // Delegates to ECMA5's native Array.isArray 663 | _.isArray = nativeIsArray || function(obj) { 664 | return toString.call(obj) === '[object Array]'; 665 | }; 666 | 667 | // Is a given variable an object? 668 | _.isObject = function(obj) { 669 | return obj === Object(obj); 670 | }; 671 | 672 | // Is a given variable an arguments object? 673 | _.isArguments = function(obj) { 674 | return !!(obj && hasOwnProperty.call(obj, 'callee')); 675 | }; 676 | 677 | // Is a given value a function? 678 | _.isFunction = function(obj) { 679 | return !!(obj && obj.constructor && obj.call && obj.apply); 680 | }; 681 | 682 | // Is a given value a string? 683 | _.isString = function(obj) { 684 | return !!(obj === '' || (obj && obj.charCodeAt && obj.substr)); 685 | }; 686 | 687 | // Is a given value a number? 688 | _.isNumber = function(obj) { 689 | return !!(obj === 0 || (obj && obj.toExponential && obj.toFixed)); 690 | }; 691 | 692 | // Is the given value `NaN`? `NaN` happens to be the only value in JavaScript 693 | // that does not equal itself. 694 | _.isNaN = function(obj) { 695 | return obj !== obj; 696 | }; 697 | 698 | // Is a given value a boolean? 699 | _.isBoolean = function(obj) { 700 | return obj === true || obj === false; 701 | }; 702 | 703 | // Is a given value a date? 704 | _.isDate = function(obj) { 705 | return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear); 706 | }; 707 | 708 | // Is the given value a regular expression? 709 | _.isRegExp = function(obj) { 710 | return !!(obj && obj.test && obj.exec && (obj.ignoreCase || obj.ignoreCase === false)); 711 | }; 712 | 713 | // Is a given value equal to null? 714 | _.isNull = function(obj) { 715 | return obj === null; 716 | }; 717 | 718 | // Is a given variable undefined? 719 | _.isUndefined = function(obj) { 720 | return obj === void 0; 721 | }; 722 | 723 | // Utility Functions 724 | // ----------------- 725 | 726 | // Run Underscore.js in *noConflict* mode, returning the `_` variable to its 727 | // previous owner. Returns a reference to the Underscore object. 728 | _.noConflict = function() { 729 | root._ = previousUnderscore; 730 | return this; 731 | }; 732 | 733 | // Keep the identity function around for default iterators. 734 | _.identity = function(value) { 735 | return value; 736 | }; 737 | 738 | // Run a function **n** times. 739 | _.times = function (n, iterator, context) { 740 | for (var i = 0; i < n; i++) iterator.call(context, i); 741 | }; 742 | 743 | // Add your own custom functions to the Underscore object, ensuring that 744 | // they're correctly added to the OOP wrapper as well. 745 | _.mixin = function(obj) { 746 | each(_.functions(obj), function(name){ 747 | addToWrapper(name, _[name] = obj[name]); 748 | }); 749 | }; 750 | 751 | // Generate a unique integer id (unique within the entire client session). 752 | // Useful for temporary DOM ids. 753 | var idCounter = 0; 754 | _.uniqueId = function(prefix) { 755 | var id = idCounter++; 756 | return prefix ? prefix + id : id; 757 | }; 758 | 759 | // By default, Underscore uses ERB-style template delimiters, change the 760 | // following template settings to use alternative delimiters. 761 | _.templateSettings = { 762 | evaluate : /<%([\s\S]+?)%>/g, 763 | interpolate : /<%=([\s\S]+?)%>/g 764 | }; 765 | 766 | // JavaScript micro-templating, similar to John Resig's implementation. 767 | // Underscore templating handles arbitrary delimiters, preserves whitespace, 768 | // and correctly escapes quotes within interpolated code. 769 | _.template = function(str, data) { 770 | var c = _.templateSettings; 771 | var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + 772 | 'with(obj||{}){__p.push(\'' + 773 | str.replace(/\\/g, '\\\\') 774 | .replace(/'/g, "\\'") 775 | .replace(c.interpolate, function(match, code) { 776 | return "'," + code.replace(/\\'/g, "'") + ",'"; 777 | }) 778 | .replace(c.evaluate || null, function(match, code) { 779 | return "');" + code.replace(/\\'/g, "'") 780 | .replace(/[\r\n\t]/g, ' ') + "__p.push('"; 781 | }) 782 | .replace(/\r/g, '\\r') 783 | .replace(/\n/g, '\\n') 784 | .replace(/\t/g, '\\t') 785 | + "');}return __p.join('');"; 786 | var func = new Function('obj', tmpl); 787 | return data ? func(data) : func; 788 | }; 789 | 790 | // The OOP Wrapper 791 | // --------------- 792 | 793 | // If Underscore is called as a function, it returns a wrapped object that 794 | // can be used OO-style. This wrapper holds altered versions of all the 795 | // underscore functions. Wrapped objects may be chained. 796 | var wrapper = function(obj) { this._wrapped = obj; }; 797 | 798 | // Expose `wrapper.prototype` as `_.prototype` 799 | _.prototype = wrapper.prototype; 800 | 801 | // Helper function to continue chaining intermediate results. 802 | var result = function(obj, chain) { 803 | return chain ? _(obj).chain() : obj; 804 | }; 805 | 806 | // A method to easily add functions to the OOP wrapper. 807 | var addToWrapper = function(name, func) { 808 | wrapper.prototype[name] = function() { 809 | var args = slice.call(arguments); 810 | unshift.call(args, this._wrapped); 811 | return result(func.apply(_, args), this._chain); 812 | }; 813 | }; 814 | 815 | // Add all of the Underscore functions to the wrapper object. 816 | _.mixin(_); 817 | 818 | // Add all mutator Array functions to the wrapper. 819 | each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { 820 | var method = ArrayProto[name]; 821 | wrapper.prototype[name] = function() { 822 | method.apply(this._wrapped, arguments); 823 | return result(this._wrapped, this._chain); 824 | }; 825 | }); 826 | 827 | // Add all accessor Array functions to the wrapper. 828 | each(['concat', 'join', 'slice'], function(name) { 829 | var method = ArrayProto[name]; 830 | wrapper.prototype[name] = function() { 831 | return result(method.apply(this._wrapped, arguments), this._chain); 832 | }; 833 | }); 834 | 835 | // Start chaining a wrapped Underscore object. 836 | wrapper.prototype.chain = function() { 837 | this._chain = true; 838 | return this; 839 | }; 840 | 841 | // Extracts the result from a wrapped and chained object. 842 | wrapper.prototype.value = function() { 843 | return this._wrapped; 844 | }; 845 | 846 | })(); 847 | 848 | // START STATIC-BUILD ADDED 849 | return fakeRoot._.noConflict(); 850 | }); 851 | // END STATIC-BUILD ADDED 852 | -------------------------------------------------------------------------------- /static/dev/stylesheets/app/main.css: -------------------------------------------------------------------------------- 1 | /* line 1, ../../sass/app/main.sass */ 2 | body { 3 | color: #333333; 4 | } 5 | 6 | /* line 4, ../../sass/app/main.sass */ 7 | html { 8 | color: #222222; 9 | } 10 | 11 | /* line 8, ../../sass/app/main.sass */ 12 | a { 13 | text-decoration: none; 14 | } 15 | /* line 4, ../../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_hover-link.scss */ 16 | a:hover { 17 | text-decoration: underline; 18 | } 19 | -------------------------------------------------------------------------------- /static/dev/stylesheets/ie.css: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to write IE specific override styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 6 | -------------------------------------------------------------------------------- /static/dev/stylesheets/print.css: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. Use this file to define print styles. 2 | * Import this file using the following HTML or equivalent: 3 | * */ 4 | -------------------------------------------------------------------------------- /static/dev/stylesheets/screen.css: -------------------------------------------------------------------------------- 1 | /* Welcome to Compass. 2 | * In this file you should write your main styles. (or centralize your imports) 3 | * Import this file using the following HTML or equivalent: 4 | * */ 5 | /* line 17, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | 27 | /* line 20, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 28 | body { 29 | line-height: 1; 30 | } 31 | 32 | /* line 22, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 33 | ol, ul { 34 | list-style: none; 35 | } 36 | 37 | /* line 24, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 38 | table { 39 | border-collapse: collapse; 40 | border-spacing: 0; 41 | } 42 | 43 | /* line 26, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 44 | caption, th, td { 45 | text-align: left; 46 | font-weight: normal; 47 | vertical-align: middle; 48 | } 49 | 50 | /* line 28, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 51 | q, blockquote { 52 | quotes: none; 53 | } 54 | /* line 101, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 55 | q:before, q:after, blockquote:before, blockquote:after { 56 | content: ""; 57 | content: none; 58 | } 59 | 60 | /* line 30, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 61 | a img { 62 | border: none; 63 | } 64 | 65 | /* line 114, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ 66 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { 67 | display: block; 68 | } 69 | 70 | /* line 1, ../sass/app/main.sass */ 71 | body { 72 | color: #333333; 73 | } 74 | 75 | /* line 4, ../sass/app/main.sass */ 76 | html { 77 | color: #222222; 78 | } 79 | 80 | /* line 8, ../sass/app/main.sass */ 81 | a { 82 | text-decoration: none; 83 | } 84 | /* line 4, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_hover-link.scss */ 85 | a:hover { 86 | text-decoration: underline; 87 | } 88 | -------------------------------------------------------------------------------- /static/serveBuild.sh: -------------------------------------------------------------------------------- 1 | ./build.sh 2 | cd build 3 | echo "Starting up simple static server..." 4 | sudo python -m SimpleHTTPServer 80 5 | -------------------------------------------------------------------------------- /static/serveDev.sh: -------------------------------------------------------------------------------- 1 | sudo gem install bundler --no-rdoc --no-ri 2 | bundle install --local 3 | cd dev 4 | sudo python -m SimpleHTTPServer 80 & 5 | compass watch . & 6 | echo "Starting up simple static server..." & 7 | wait 8 | -------------------------------------------------------------------------------- /static/vendor/cache/chunky_png-1.2.0.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/vendor/cache/chunky_png-1.2.0.gem -------------------------------------------------------------------------------- /static/vendor/cache/compass-0.11.5.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/vendor/cache/compass-0.11.5.gem -------------------------------------------------------------------------------- /static/vendor/cache/fssm-0.2.7.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/vendor/cache/fssm-0.2.7.gem -------------------------------------------------------------------------------- /static/vendor/cache/rb-fsevent-0.4.2.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/vendor/cache/rb-fsevent-0.4.2.gem -------------------------------------------------------------------------------- /static/vendor/cache/sass-3.1.7.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SlexAxton/static-build/8623c02c90152546619c0b95ebcb9c1707ff99a5/static/vendor/cache/sass-3.1.7.gem -------------------------------------------------------------------------------- /static/watchSass.sh: -------------------------------------------------------------------------------- 1 | cd dev 2 | compass watch . 3 | --------------------------------------------------------------------------------