Skip to content

Instantly share code, notes, and snippets.

View tritchey's full-sized avatar

Tim Ritchey tritchey

View GitHub Profile
@tritchey
tritchey / core_statechart.js
Created March 24, 2011 20:27
the loginPane design
enterState: function() {
console.log("entering offlineState");
// present the login dialog box
var _loginPane = ScaleUI.LoginPane.create();
_loginPane.append();
},
{{#view "ScaleUI.ActiveDirectoryView"}}
{{#if content.isSummary}}
<div class="summary"><p>This is the active directory detail</p>
<p>{{content.domain}}</p>
<p>{{content.server}}</p>
{{#view "showDetailButtonView"}}
<button>Detail</button>
{{/view}}
systemStatus: SC.View.design(SC.ContentDisplay, {
layout: { bottom: 24, left: 24, width: 109, height: 141 },
contentBinding: 'ScaleUI.statusController',
contentDisplayProperties: 'dataOnline dataMirrored systemOK'.w(),
render: function(context, firstTime) {
var dataOnline = null;
var dataMirrored = null;
var systemOK = null;
@tritchey
tritchey / core_statechart.js
Created May 26, 2011 19:47
dns controllers
enterState: function() {
...
var _dnsConfigs = ScaleModel.store.find(ScaleModel.DNSConfig);
ScaleUI.dnsConfigsController.set('content', _dnsConfigs);
}
...
var _dnsConfigs = ScaleModel.getDNSConfigs();
ScaleUI.dnsConfigsController.set('content', _dnsConfigs);
...
@tritchey
tritchey / editview.js
Created June 9, 2011 14:58
collapsing textfieldviews
editView: ScaleUI.SystemSectionEditView.design({
useStaticLayout: YES,
layout: { top: 0, left: 50, right: 0 },
classNames: ['edit'],
contentBinding: 'ScaleUI.activeDirectoryController',
contentDisplayProperties: ['domain', 'server', 'username', 'password'],
childViews: 'domainField serverField usernameField passwordField'.w(),
@tritchey
tritchey / system_section.js
Created June 10, 2011 18:24
rendering buttons
ScaleUI.SystemSectionDetailView = SC.View.extend({
layout: { top: 0, left: 0, right: 0},
useStaticLayout: YES,
isVisibleBinding: '.parentView.parentView.isDetail',
childViews: 'showEditButton'.w(),
showEditButton: SC.ButtonView.extend({
useStaticLayout: YES,
action: 'editClicked',
@tritchey
tritchey / mainpage.js
Created June 23, 2011 02:16
multicolumn template
ListviewTest.testController = SC.ArrayController.create({
content: [ { 'name': 'Item 1', 'description': 'This is item 1' },
{ 'name': 'Item 2', 'description': 'This is item 2' } ],
});
ListviewTest.mainPage = SC.Page.design({
// The main pane is made visible on screen as soon as your app is loaded.
// Add childViews to this pane for views to display immediately on page
@tritchey
tritchey / field.handlebars
Created July 6, 2011 13:52
template with validator
<span class="label">{{loc "_Port"}}</span>
{{view PortField valueBinding="ScaleUI.alertSMTPController.port"}}
@tritchey
tritchey / tasks.js
Created July 22, 2011 17:40
filtering
ScaleUI.taskTagController = SC.ArrayController.create(
/** @scope ScaleUI.taskTagController.prototype */ {
queuedTasks: function() {
var content = this.get('content');
if(!SC.none(content)) {
return content.filterProperty('state', TaskState.QUEUED);
}
}.property('@each.state').cacheable(),