This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var B = typeof exports !== 'undefined' ? exports : {}; | |
// prefix for internal property state | |
var __PROP__ = '__PROP__'; | |
// default constructor used in setting up prototype chain | |
var ctor = function() {}; | |
B.extend = function(__super__, proto) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ### Events | |
// Event mixin copied from Backbone | |
var Events = { | |
bind: function(evt, callback) { | |
var events = this._events = this._events || {}; | |
var callbacks = events[evt] = events[evt] || []; | |
callbacks.push(callback); | |
}, | |
unbind: function(evt, callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface WBVector : NSObject <NSCopying> { | |
CGFloat _x; | |
CGFloat _y; | |
CGFloat _z; | |
} | |
@property (nonatomic) CGFloat x; | |
@property (nonatomic) CGFloat y; | |
@property (nonatomic) CGFloat z; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var extend = function(dest) { | |
var sources = Array.prototype.slice.call(arguments, 1), source, key; | |
for (var i = 0, l = sources.length; i < l; i++) { | |
source = sources[i]; | |
for (key in source) { | |
if (source.hasOwnProperty(key)) { | |
dest[key] = source[key]; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ### TableView | |
// TableView provides an efficient mechanism for progressively | |
// rendering from a data source provided by the owner object. | |
// Cells are queued for reuse when they go offscreen and then | |
// translated back into position with updated content as they | |
// are reused. | |
var TableView = exports.TableView = core.createClass({ | |
name: 'TableView', | |
extend: View, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// implement the table delegate protocol | |
var tableDelegate = (function() { | |
return { | |
sectionHeaderAtIndex: function() { | |
return null; | |
}, | |
heightForSectionHeader: function(section) { | |
return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we have a thing model with a property of name | |
Model.install('ThingModel', { | |
properties: { | |
name: 'a' | |
} | |
}); | |
// we have a thing collection that maintains our things | |
Collection.install('ThingCollection', { | |
extend: 'Collection', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declare a model with some properties | |
Model.install('Thing', { | |
properties: { | |
color:'#000000', | |
background:'#00FFFF' | |
} | |
}); | |
// declare a view with some properties | |
// and create appropriate setters that respond to changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
// handle args | |
var continuous = process.argv.indexOf('--watch') !== -1 ? true : false; | |
var minify = process.argv.indexOf('--minify') !== -1 ? true : false; | |
var releaseTarget = __dirname + '/release/'; | |
var jsTarget = releaseTarget + 'bolt.js'; | |
var cssTarget = releaseTarget + 'bolt.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var listFiles = function(path, match) { | |
var files = []; | |
var paths = fs.readdirSync(path); | |
paths.forEach(function(file) { | |
var stats = fs.statSync(path + '/' + file); | |
if (stats.isDirectory()) { | |
files = files.concat(listFiles(path + '/' + file, match)); | |
} else { |