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
// give CoreOI.Server time to load... | |
SC.ready(function() { | |
CoreOI.store = SC.Store.create().from(CoreOI.Server.create()) ; | |
}); |
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
MyApp.menuPane.statechart: SC.Statechart.create({ | |
}); | |
MyApp.myPage = SC.Page.design({ | |
menuPane: SC.Pane.design({ |
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 peg = require('./peg') ; | |
var sys = require('sys') ; | |
var posix = require('posix') ; | |
posix.cat("./ECMAScript_jsdoc.peg").addCallback(function (grammar) { | |
var parser = peg.generateParser(grammar) ; | |
sys.puts(parser) ; | |
}); |
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
; The entire ECMAScript grammar expressed as a single PEG | |
; Parser rules which share a name with ECMA-262 productions are intended to match the same language. | |
Program ← | |
(S? (Statement / FunctionDeclaration))* S? | |
FunctionBody ← | |
(S? (Statement / FunctionDeclaration))* S? |
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
/* PEG → JavaScript parser generator, with its dependencies. | |
* See http://inimino.org/~inimino/blog/peg_first_release */ | |
var sys = require('sys') ; | |
;(function(exports){ | |
exports.generateParser=generateParser | |
exports.generateParserThrowing=generateParserThrowing |
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
// ========================================================================== | |
// Project: hub.js - cloud-friendly object graph sync | |
// Copyright: ©2010 Erich Ocean. | |
// Portions ©2006-2009 Sprout Systems, Inc. and contributors. | |
// Portions ©2008-2009 Apple Inc. All rights reserved. | |
// License: Licensed under an MIT license (see license.js). | |
// ========================================================================== | |
function Program(str){ | |
var tbl=[],pos=0,l=str.length+1;while(l--)tbl.push([]);l=str.length; |
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
# An ordered list of files in ../src that are concatenated to produce hub.js, | |
# one file per line. Lines beginning with # are skipped. On node.js, the | |
# index.js file uses the contents of this file to assemble hub.js dynamically | |
# during development. | |
# | |
# To generate a custom build of hub.js, modify this BUILD file to include the | |
# list of files you need/want in the correct order. | |
# | |
# NOTE: In a production build, lines matching /^development[/].*/ will be | |
# skipped, and calls to hub_assert(), hub_precondition(), hub_postconditon(), |
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
// Add Bindings | |
this.bindings = []; // will be filled in by the bind() method. | |
if (keys = this._bindings) { | |
for(loc=0, keysLen = keys.length; loc < keysLen;loc++) { | |
// get propertyKey | |
key = keys[loc] ; value = this[key] ; | |
propertyKey = key.slice(0,-7) ; // contentBinding => content | |
this[key] = this.bind(propertyKey, value) ; | |
} | |
} |
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
messages: SC.RecordAttribute.create({ | |
toType: function(record, key, value) { | |
var ary = record._messages ; | |
if (!ary) { | |
console.log('creating a messages query for Mailbox[%@]'.fmt(record.get('guid'))); | |
CoreOI.Record.messages++ ; | |
ary = record._messages = record.get('store').findAll(SC.Query.create({ | |
recordType: 'CoreOI.Message', | |
conditions: "mailbox = %@", | |
parameters: [record], |
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
sc_require('controllers/mailboxes'); | |
sc_require('controllers/messages'); | |
SC.mixin(OI, { | |
registerStatechartObservers: function() { | |
var fun = this.folderSelectionDidChange ; | |
OI.foldersController.addObserver('selection', this, fun) ; | |
this.__mailboxesControllers__ = {} ; |