Skip to content

Instantly share code, notes, and snippets.

View topherfangio's full-sized avatar

Topher Fangio topherfangio

View GitHub Profile
MT.ReportTemplateContainerView = SC.ContainerView.extend({
contentView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_show'
}),
editView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_edit'
})
});
var requests = nestedStore.find(requestsQuery);
console.log("\n");
console.log('BEGIN');
var responseSets = nestedEvaluation.get('response_sets');
console.log(' responseSets BEFORE forEach:', responseSets.toArray());
requests.forEach(function(request) {
@topherfangio
topherfangio / rental_units_list.js
Created May 10, 2011 17:07
Basic List/Example Views
ScHerestay.RentalUnitsIndex = SC.View.extend(SC.Control, {
childViews: 'list'.w(),
list: SC.ScrollView.design({
layout: {top: 10, left: 2, right: 2, buttom: 5},
contentView: SC.ListView.design({
layout: {top: 0, bottom: 0, left: 0, right: 0},
contentBinding: 'ScHerestay.rentalUnitsController.content',
exampleView: ScHerestay.UnitRow,
class AuditsController < ApiController
def index
@audits = current_member.audit_responses.where('updated_at IS NULL').map{ |ar| ar.audit.attributes }.uniq
respond_with @audits
end
@topherfangio
topherfangio / main_page.js
Created June 16, 2011 16:07
Basic SC Bindings Example
...
editingPane: MyApp.editingPane.extend({}),
...
@topherfangio
topherfangio / popup_example.js
Created June 17, 2011 16:01
Example of a popup using the popover theme
MyApp.myPopoverView = SC.PickerPane.create({
layout: { width: 300, height: 150 },
themeName: 'popover',
contentView: SC.WorkspaceView.extend({
topToolbar: null,
bottomToolbar: null,
contentView: SC.View.extend({
@topherfangio
topherfangio / example.js
Created July 16, 2011 15:12
Eample of SC SelectAll
selectAllClicked: function(evt) {
/*
* Go ahead and deselect all objects first so that we don't confuse the user
*/
Pharos360.studentsController.selectObject();
/*
* Now, select only those students that aren't currently selected
*/
var students = Pharos360.filteredStudentsController.get('arrangedObjects');
@topherfangio
topherfangio / example.js
Created July 19, 2011 07:38
Example of a computed property using @each
MyApp.Project = SC.Record.create({
tasks: SC.Record.toMany(...),
tasksNeedUpdate: 0,
tasksDidUpdate: function() {
this.set('tasksNeedUpate', this.get('tasksNeedUpdate') + 1);
}.observes('*tasks.@each.isComplete'),
allTasksCompleted: function() {
{
"name": "planitly",
"version": "0.0.1",
"bpm": "1.0.0",
"description": "DESCRIPTION HERE",
"author": "YOUR NAME HERE",
"homepage": "URL",
"directories": {
"lib": "./lib",
"tests": "./tests"
<body>
<script src="assets/bpm_libs.js" type="text/javascript"></script>
<script type="text/javascript">
spade.require('Planitly');
</script>
<script type="text/x-handlebars">
<div class='container_16'>