Created
June 6, 2012 18:09
-
-
Save coolhand79/2883667 to your computer and use it in GitHub Desktop.
how I created the sample
This file contains 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
lwc:cv lchambers$ svn diff frameworks/rubric_manager_core/ apps/rubric_manager/ | |
Index: frameworks/rubric_manager_core/views/manager/manager.js | |
=================================================================== | |
--- frameworks/rubric_manager_core/views/manager/manager.js (revision 9183) | |
+++ frameworks/rubric_manager_core/views/manager/manager.js (working copy) | |
@@ -45,8 +45,38 @@ | |
hint: RubricManagerCore.RUBRIC_NAME_HINT | |
}), | |
+ | |
+ | |
+ rubricActionsButtonView: SC.ButtonView.design({ | |
+ classNames: ['header-button', 'button-list'], | |
+ layout: { top: 3, height: 30, left: 10, width: 30 }, | |
+ action: function() { | |
+ SC.PickerPane.create({ | |
+ layout: { width: 300, height: 500 }, | |
+ contentView: SC.ScrollView.design({ | |
+ layout: { left: 10, right: 10, top: 10, bottom: 10}, | |
+ contentView: SC.SourceListView.extend({ | |
- rubricActionsButtonView: SC.PopupButtonView.design({ | |
+ contentBinding: 'RubricManagerCore.rubricTreeController.arrangedObjects', | |
+contentValueKey:'displayName' | |
+ // exampleView: SC.ListItemView.extend({ | |
+ // hasContentIcon: true, | |
+ // contentIconKey: 'icon', | |
+ // contentUnreadCountKey: 'count', | |
+ // contentValueKey: 'displayName' | |
+ // }), | |
+ // groupExampleView: SC.ListItemView.extend({ | |
+ // contentValueKey: 'displayName' | |
+ // }) | |
+ }) | |
+ | |
+ }) | |
+ }).popup(this, SC.PICKER_POINTER); | |
+ | |
+ } | |
+ }), | |
+ | |
+ _rubricActionsButtonView: SC.PopupButtonView.design({ | |
layout: { top: 3, height: 30, left: 10, width: 30 }, | |
/* title: '_options'.loc(),*/ | |
classNames: ['header-button', 'button-list'], | |
@@ -66,6 +96,8 @@ | |
{ name: "_Rename this rubric".loc(), isEnabledBinding: 'RubricManagerCore.editingRubricController.isEditable', action: 'beginEditing', target: 'RubricManagerCore.rubricTitleView'}, | |
{ name: "_Delete this rubric".loc(), isEnabledBinding: 'RubricManagerCore.editingRubricController.isEditable', action: 'deleteCurrentRubric', target: 'RubricManagerCore.rubricListController' }, | |
{ name: "", isEnabled: YES, icon: null, separator: YES}, | |
+ { name: 'Common Core Rubrics', subMenu: [{ title: 'Submenu item 1' }, { title: 'Submenu item 2'}] }, | |
+ | |
{ name: "_Rubrics".loc(), isEnabled: NO } | |
]; | |
Index: apps/rubric_manager/controllers/rubric_manager_core_controllers.js | |
=================================================================== | |
--- apps/rubric_manager/controllers/rubric_manager_core_controllers.js (revision 9183) | |
+++ apps/rubric_manager/controllers/rubric_manager_core_controllers.js (working copy) | |
@@ -12,4 +12,48 @@ | |
RubricManagerCore.rubricListController = RubricManagerCore.RubricListController.create(); | |
RubricManagerCore.userController = RubricManagerCore.UserController.create(); | |
RubricManagerCore.scalesController = RubricManagerCore.ScalesController.create(); | |
-RubricManagerCore.importController = RubricManagerCore.ImportController.create(); | |
\ No newline at end of file | |
+RubricManagerCore.importController = RubricManagerCore.ImportController.create(); | |
+ | |
+var fruit = "Apples Bananas Cherries Dates Eggfruit".w().map(function(name) { | |
+ return SC.Object.create({ | |
+ displayName: name | |
+ }); | |
+}); | |
+ var userOwnedGroup = SC.Object.create(SC.TreeItemContent, { | |
+ displayName: 'Owned by Me', | |
+ treeItemChildren: fruit, | |
+ treeItemIsExpanded: NO | |
+ | |
+ }); | |
+ var vegetables = "Arugula Beets Cucumbers Dandelions Endives".w().map(function(name) { | |
+ return SC.Object.create({ | |
+ displayName: name | |
+ }); | |
+ }); | |
+ var sharedGroup = SC.Object.create(SC.TreeItemContent, { | |
+ displayName: 'Shared to Me', | |
+ treeItemChildren: vegetables, | |
+ treeItemIsExpanded: NO | |
+ | |
+ }); | |
+ | |
+ var commonCoreGroup = SC.Object.create(SC.TreeItemContent, { | |
+ displayName: 'Common Core', | |
+ treeItemChildren: vegetables, | |
+ treeItemIsExpanded: NO | |
+ }); | |
+ | |
+var rContent = SC.Object.create(SC.TreeItemContent, { | |
+ treeItemIsGrouped: YES, | |
+ treeItemIsExpanded: YES, | |
+ treeItemChildren: [userOwnedGroup, sharedGroup, commonCoreGroup] | |
+}); | |
+ | |
+RubricManagerCore.rubricTreeController = SC.TreeController.create({ | |
+ | |
+ // itemsBinding: 'RubricManagerCore.rubricListController', | |
+ | |
+ content: rContent | |
+ | |
+ | |
+}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment