Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Linton committed Sep 17, 2010
0 parents commit affc8e2
Show file tree
Hide file tree
Showing 17 changed files with 4,489 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Buildfile
@@ -0,0 +1,7 @@
# ===========================================================================
# Project: SCXIB
# Copyright: ©2010 Robert Linton
# Contributors: Devin Torres, Kurt Williams
# ===========================================================================

config :scxib, :required => :sproutcore
15 changes: 15 additions & 0 deletions LICENSE
@@ -0,0 +1,15 @@
SCXIB - Interface Builder for the Web
Copyright (c) 2010 Robert Linton <robertjlinton@gmail.com>
Copyright (c) 2010 Devin Torres <devin@devintorres.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
55 changes: 55 additions & 0 deletions README.md
@@ -0,0 +1,55 @@
SCXIB - Interface Builder for the Web
=====================================

SCXIB (pronounced ska-zib) grew out of the desire to use Interface Builder
as a design tool for SproutCore applications.

[View the Demo Video]

## How to use SCXIB

### On-the-fly Application loading

Transform XIB files for your SproutCore application to load and use during development:

SCXIB.loadXibWithOptions(sc_static('MainPage.xib'), {
namespace: DemoApp.NAMESPACE,
pageName: 'mainPage',
callback: function () {
DemoApp.getPath('mainPage.mainPane').append();
}
});

### XIB to JavaScript

Transform a XIB file into a JavaScript file for your SproutCore application
using a command line tool:
`./bin/scxib -namespace DemoApp -page mainPage apps/demo_app/resources/MainPage.xib`

## Requirements

- Interface Builder for XCode 3.2.x
- SproutCore

## Current Class Mappings

- NSWindow -> SC.Page
- NSPanel -> SC.Panel
- NSView -> SC.View
- NSCustomView -> your app's custom view name
- NSLabel -> SC.LabelView
- NSTextField -> SC.TextFieldView
- NSSplitView -> SC.SplitView
- IKImageView -> SC.ImageView
- NSCheckBox -> SC.CheckBoxView
- NSButton -> SC.ButtonView
- NSPopUpButton -> SC.SelectFieldView
- NSSegmentedControl -> SC.SegmentedView
- NSCollectionView -> SC.SourceListView
- NSScrollView -> SC.ScrollView
- NSWebView -> SC.WebView
- NSMatrix -> SC.RadioView
- NSTabView -> SC.TabView
- NSBox Horizontal/Vertical -> SC.SeparatorView:layoutDirection SC.LAYOUT\_HORIZONTAL/SC.LAYOUT\_VERTICAL

[View the Demo Video]: http://vimeo.com/
7 changes: 7 additions & 0 deletions apps/demo_app/Buildfile
@@ -0,0 +1,7 @@
# ===========================================================================
# Project: SCXIB
# Copyright: ©2010 Robert Linton
# Contributors: Devin Torres, Kurt Williams
# ===========================================================================

config :demo_app, :required => :scxib
13 changes: 13 additions & 0 deletions apps/demo_app/controllers/demo.js
@@ -0,0 +1,13 @@
// ==========================================================================
// Project: DemoApp
// Copyright: ©2010 Robert Linton
// Contributors: Devin Torres, Kurt Williams
// ==========================================================================
/*globals DemoApp */

DemoApp.demoController = SC.Object.create({

people: [],
message: 'foobar'

});
15 changes: 15 additions & 0 deletions apps/demo_app/core.js
@@ -0,0 +1,15 @@
// ==========================================================================
// Project: DemoApp
// Copyright: ©2010 Robert Linton
// Contributors: Devin Torres, Kurt Williams
// ==========================================================================
/*globals DemoApp */

DemoApp = SC.Application.create({

NAMESPACE: 'DemoApp',
VERSION: '0.1.0',

store: SC.Store.create().from(SC.Record.fixtures)

});
25 changes: 25 additions & 0 deletions apps/demo_app/fixtures/person.js
@@ -0,0 +1,25 @@
sc_require('models/person');

DemoApp.Person.FIXTURES = [

{ guid: 1,
firstName: "Michael",
lastName: "Scott" },

{ guid: 2,
firstName: "Dwight",
lastName: "Schrute" },

{ guid: 3,
firstName: "Jim",
lastName: "Halpert" },

{ guid: 4,
firstName: "Pam",
lastName: "Beesly" },

{ guid: 5,
firstName: "Ryan",
lastName: "Howard" }

];
21 changes: 21 additions & 0 deletions apps/demo_app/main.js
@@ -0,0 +1,21 @@
// ==========================================================================
// Project: DemoApp
// Copyright: ©2010 Robert Linton
// Contributors: Devin Torres, Kurt Williams
// ==========================================================================
/*globals DemoApp */

DemoApp.main = function main() {

SCXIB.loadXibWithOptions(sc_static('MainPage.xib'), {
namespace: DemoApp.NAMESPACE,
callback: function () {
var people = DemoApp.store.find(DemoApp.Person);
DemoApp.demoController.set('people', people);
DemoApp.getPath('mainPage.mainPane').append();
}
});

};

function main() { DemoApp.main(); }
15 changes: 15 additions & 0 deletions apps/demo_app/models/person.js
@@ -0,0 +1,15 @@
// ==========================================================================
// Project: DemoApp.Person
// Copyright: ©2010 Robert Linton
// Contributors: Devin Torres, Kurt Williams
// ==========================================================================
/*globals DemoApp */

DemoApp.Person = SC.Record.extend({

// TODO: Add your own code here.
name: function(){
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName').cacheable(),

}) ;

0 comments on commit affc8e2

Please sign in to comment.