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
// controller | |
coursesDidChange: function(){ | |
console.log('coursesArray'); | |
var courseItems = this.CourseItem.create({ | |
// treeItemChildren: groups, | |
treeItemIsGrouped: NO | |
}); | |
this.set('content', courseItems); |
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 Foo = SC.Object.extend({ | |
values: [] | |
}); | |
var bar1 = Foo.create(); | |
bar1.get('values').push("One"); | |
bar1.get('values').push("Two"); | |
bar1.get('values').push("Three"); | |
console.log(bar1.get('values')); |
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.MyView = SC.View.extend({ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
childViews: 'listView'.w(), | |
contentPath: '', | |
selectionPath: '', | |
listView:SC.ListView.design({ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
contentBinding: 'MyApp.controller.arrangedObjects', | |
selectionBinding: 'MyApp.controller.selection' |
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
DarkHorse.SchoolFeedItem = SC.View.extend(SC.StaticLayout, SC.Control,{ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
childViews: 'contentView'.w(), | |
contentView: SC.View.extend({ | |
layout: { top: 10, right: 10, bottom: 10, left: 10 }, | |
childViews: 'label'.w(), | |
classNames: 'feedItem schoolFeedItem', | |
label:SC.LabelView.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
contentView: SC.View.design({ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
childViews: 'stackedView'.w(), | |
stackedView: SC.StackedView.design({ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
contentBinding: 'DarkHorse.feedsController.arrangedObjects', | |
selectionBinding: 'DarkHorse.feedsController.selection', | |
contentExampleView: DarkHorse.FeedItemView | |
}) |
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: DarkHorse - The PC Browser targeted face of the Matygo Web App | |
// Copyright: ©2010 Matygo Educational Incorporated | |
// ========================================================================== | |
/*globals DarkHorse */ | |
/** @class | |
(Document Your Controller Here) |
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
commentControl: SC.View.design({ | |
useStaticLayout: YES, | |
classNames: 'static'.w(), | |
childViews: "content".w(), | |
layout: {left: 289, width:320}, | |
init: function(){ | |
sc_super(); | |
this.set('commentButton',this.createChildView(this.get('commentButton'))); | |
}, |
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
addComment: function(source){ | |
console.log("Add Coment!"); | |
var commentBox = source.getPath('parentView.parentView'); | |
var body = commentBox.getPath('commentControl.content.value'); | |
var feedItem = commentBox.get('feedItem'); | |
var user = DarkHorse.store.find(DarkHorse.User,DarkHorse.currentUser.get('guid')); | |
var comment = DarkHorse.store.createRecord(DarkHorse.Comment,{ | |
body: body, | |
user: user, | |
feedItem: feedItem |
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
DarkHorse.FeedItemRenderer = SC.Renderer.extend({ | |
init: function(attrs){ | |
sc_super(); | |
console.log("FeedItemRenderer:Render"); | |
console.log(attrs); | |
}, | |
render: function(context){ | |
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
<div id="sc1294" class="sc-view sc-collection-view sc-stacked-view feedList sc-empty ace sc-static-layout" style="left: 0px; right: 0px; top: 0px; height: 1px"> | |
<div id="sc1294-0" class="sc-view schoolFeedItem sc-collection-item sc-empty ace sc-static-layout static" style="left: 0px; right: 0px; top: 0px; bottom: 0px"> | |
</div> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum placerat, dui sed porttitor tempus, metus quam placerat ligula, eget elementum neque velit non odio. Integer rutrum, nisl venenatis condimentum porttitor, ante ipsum consectetur odio, vel sagittis sem nibh a tortor. Proin vel ligula ac enim sodales dictum. Nulla nisi lorem, elementum ut lacinia non, rutrum eu tellus. Donec quis nulla at magna pellentesque ultrices ac sed mauris. Duis aliquam dapibus orci, a rhoncus nisi mollis a. Duis sodales egestas ornare. Curabitur rutrum magna augue. Nam sit amet augue vitae massa porttitor sagittis non auctor metus. Nullam quis nisl mollis leo suscipit tristique sed et diam. Mauri |