Skip to content

Instantly share code, notes, and snippets.

@geojeff
Created May 21, 2010 22:40
Show Gist options
  • Save geojeff/409527 to your computer and use it in GitHub Desktop.
Save geojeff/409527 to your computer and use it in GitHub Desktop.
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.groupController = SC.ObjectController.create(
/** @scope PhoneControls.groupController.prototype */ {
contentBinding: "PhoneControls.groupsController.selection",
contentBindingDefault: SC.Binding.single(),
}) ;
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.groupsController = SC.ArrayController.create({
});
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.groups = [
SC.Object.create({
name: "Controls",
categories: [
SC.Object.create({
name: "Buttons",
show: "buttons_page",
}),
SC.Object.create({
name: "Checkboxes",
show: "checkboxes_page",
}),
SC.Object.create({
name: "Progress",
show: "progress_page",
}),
SC.Object.create({
name: "Radio",
show: "radio_page",
}),
SC.Object.create({
name: "Segmented Button",
show: "segmented_page",
}),
SC.Object.create({
name: "Select Button",
show: "select_page",
}),
SC.Object.create({
name: "Sliders",
show: "sliders_page",
}),
SC.Object.create({
name: "Tabbed View",
show: "tab_page",
})
]
}),
SC.Object.create({
name: "Collections",
categories: [
SC.Object.create({
name: "List",
show: "list_page",
})
]
}),
SC.Object.create({
name: "Fields",
categories: [
SC.Object.create({
name: "Text Field",
show: "text_field_page",
})
]
}),
SC.Object.create({
name: "Layout",
categories: [
SC.Object.create({
name: "Flow Layout",
show: "flow_layout_page",
}),
]
}),
SC.Object.create({
name: "Scroll",
categories: [
SC.Object.create({
name: "Simple",
show: "scroll_page",
})
]
}),
]
PhoneControls.categoriesController = SC.ArrayController.create({
contentBinding: "PhoneControls.groupController.categories",
});
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.categoryController = SC.ObjectController.create(
/** @scope PhoneControls.categoryController.prototype */ {
contentBinding: "PhoneControls.categoriesController.selection",
contentBindingDefault: SC.Binding.single(),
nowShowing: "welcome",
delayShow: function() {
// wait a moment before loading to let things finish...
this.invokeLater(this.set, 50, "nowShowing", this.get("show") || "welcome");
}.observes("show"),
}) ;
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.groups = [
SC.Object.create({
name: "Controls",
categories: [
SC.Object.create({
name: "Buttons",
show: "buttons_page",
}),
SC.Object.create({
name: "Checkboxes",
show: "checkboxes_page",
}),
SC.Object.create({
name: "Progress",
show: "progress_page",
}),
SC.Object.create({
name: "Radio",
show: "radio_page",
}),
SC.Object.create({
name: "Segmented Button",
show: "segmented_page",
}),
SC.Object.create({
name: "Select Button",
show: "select_page",
}),
SC.Object.create({
name: "Sliders",
show: "sliders_page",
}),
SC.Object.create({
name: "Tabbed View",
show: "tab_page",
})
]
}),
SC.Object.create({
name: "Collections",
categories: [
SC.Object.create({
name: "List",
show: "list_page",
})
]
}),
SC.Object.create({
name: "Fields",
categories: [
SC.Object.create({
name: "Text Field",
show: "text_field_page",
})
]
}),
SC.Object.create({
name: "Layout",
categories: [
SC.Object.create({
name: "Flow Layout",
show: "flow_layout_page",
}),
]
}),
SC.Object.create({
name: "Scroll",
categories: [
SC.Object.create({
name: "Simple",
show: "scroll_page",
})
]
}),
]
PhoneControls.categoriesController = SC.ArrayController.create({
contentBinding: "PhoneControls.groupController.categories",
});
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
// Portions ©2008-2010 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals PhoneControls */
PhoneControls.categoryDisplayController = SC.ObjectController.create(
/** @scope PhoneControls.categoryDisplayController.prototype */ {
contentBinding: "PhoneControls.categoriesController.selection",
contentBindingDefault: SC.Binding.single(),
nowShowing: "welcome",
delayShow: function() {
// wait a moment before loading to let things finish...
this.invokeLater(this.set, 50, "nowShowing", PhoneControls.mainPage.get(this.get("show")) || "welcome");
}.observes("show"),
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment