aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-02-07 16:55:34 -0800
committerArmen Kesablyan2012-02-07 16:55:34 -0800
commit10f0ad4c15f090b2d0d50d11e4c7aaf291e9eb0e (patch)
tree12b31910a3c7c7fa2ee0b26d8aaa611710e139a5 /js
parent7f8730c3add146f1ba107e6fc22d1f5a8348ed8b (diff)
parent668510892537eaaeb2e11520831d87b44b2489b7 (diff)
downloadninja-10f0ad4c15f090b2d0d50d11e4c7aaf291e9eb0e.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into text-tool
Conflicts: _scss/compass_app_log.txt css/ninja.css
Diffstat (limited to 'js')
-rw-r--r--js/components/combobox.reel/combobox.js2
-rw-r--r--js/components/controllers/tree-controller.js185
-rw-r--r--js/components/layout/bread-crumb.reel/bread-crumb.css1
-rw-r--r--js/components/radio.reel/radio.js6
-rw-r--r--js/components/tools-properties/rect-properties.reel/rect-properties.js2
-rw-r--r--js/components/tree.reel/tree.js2
-rw-r--r--js/components/treeview/branch.reel/branch.css22
-rw-r--r--js/components/treeview/branch.reel/branch.html147
-rw-r--r--js/components/treeview/branch.reel/branch.js48
-rw-r--r--js/components/treeview/leaf.reel/leaf.css10
-rw-r--r--js/components/treeview/leaf.reel/leaf.html43
-rw-r--r--js/components/treeview/leaf.reel/leaf.js44
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.css40
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.html150
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.js131
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.css28
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.html43
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.js41
-rw-r--r--js/components/treeview/tree-node.js103
-rw-r--r--js/components/treeview/treeview.reel/treeview.css5
-rw-r--r--js/components/treeview/treeview.reel/treeview.html55
-rw-r--r--js/components/treeview/treeview.reel/treeview.js129
-rw-r--r--js/controllers/color-controller.js100
-rw-r--r--js/controllers/elements/canvas-controller.js14
-rw-r--r--js/controllers/elements/element-controller.js150
-rw-r--r--js/controllers/elements/shapes-controller.js58
-rw-r--r--js/controllers/styles-controller.js161
-rw-r--r--js/controllers/tree-controller.js185
-rw-r--r--js/data/pi/pi-data.js52
-rw-r--r--js/data/tools-data.js6
-rw-r--r--js/helper-classes/3D/draw-utils.js71
-rw-r--r--js/helper-classes/3D/math-utils.js54
-rw-r--r--js/helper-classes/3D/snap-manager.js26
-rw-r--r--js/helper-classes/Properties3D.js82
-rw-r--r--js/helper-classes/RDGE/GLBrushStroke.js1
-rw-r--r--js/helper-classes/RDGE/GLSubpath.js1
-rw-r--r--js/mediators/drag-drop-mediator.js9
-rw-r--r--js/mediators/element-mediator.js38
-rw-r--r--js/mediators/keyboard-mediator.js6
-rw-r--r--js/models/color-model.js43
-rw-r--r--js/models/element-model.js8
-rw-r--r--js/models/properties-3d.js6
-rw-r--r--js/models/shape-model.js2
-rw-r--r--js/ninja.reel/ninja.js20
-rw-r--r--js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.css2
-rw-r--r--js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js2
-rw-r--r--js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js2
-rw-r--r--js/panels/Color/colorchippopup.reel/colorchippopup.js2
-rw-r--r--js/panels/Color/colorpopup-manager.js64
-rw-r--r--js/panels/Color/colortoolbar.reel/colortoolbar.js68
-rw-r--r--js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js4
-rw-r--r--js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js6
-rw-r--r--js/panels/properties/content.reel/content.js149
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.html12
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.js86
-rwxr-xr-xjs/preloader/Preloader.js1
-rw-r--r--js/stage/layout.js86
-rw-r--r--js/stage/stage.reel/stage.js63
-rw-r--r--js/tools/FillTool.js20
-rw-r--r--js/tools/LineTool.js5
-rw-r--r--js/tools/OvalTool.js8
-rw-r--r--js/tools/PanTool.js33
-rw-r--r--js/tools/RectTool.js8
-rw-r--r--js/tools/SelectionTool.js1
-rw-r--r--js/tools/ShapeTool.js1
-rw-r--r--js/tools/ZoomTool.js39
-rw-r--r--js/tools/drawing-tool-base.js1
67 files changed, 2311 insertions, 682 deletions
diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js
index f262bb06..a68a7d6b 100644
--- a/js/components/combobox.reel/combobox.js
+++ b/js/components/combobox.reel/combobox.js
@@ -67,7 +67,7 @@ exports.Combobox = Montage.create(Component, {
67 var e = document.createEvent("CustomEvent"); 67 var e = document.createEvent("CustomEvent");
68 e.initEvent("change", true, true); 68 e.initEvent("change", true, true);
69 e.type = "change"; 69 e.type = "change";
70 e._wasSetByCode = this._wasSetByCode; 70 e.wasSetByCode = this._wasSetByCode;
71 e.value = this._value; 71 e.value = this._value;
72 this.dispatchEvent(e); 72 this.dispatchEvent(e);
73 73
diff --git a/js/components/controllers/tree-controller.js b/js/components/controllers/tree-controller.js
new file mode 100644
index 00000000..03ef7b9e
--- /dev/null
+++ b/js/components/controllers/tree-controller.js
@@ -0,0 +1,185 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6/**
7 @module montage/ui/controller/tree-controller
8 @requires montage/core/core
9 @requires montage/ui/controller/object-controller
10 @requires montage/core/event/mutable-event
11 */
12var Montage = require("montage").Montage,
13 ObjectController = require("montage/ui/controller/object-controller").ObjectController,
14 ArrayController = require("montage/ui/controller/array-controller").ArrayController,
15 MutableEvent = require("montage/core/event/mutable-event").MutableEvent;
16/**
17 TODO: Write description like the array controllers: The ArrayController helps with organizing a hierarchical
18 collection of objects, and managing user selection within that collection.
19 You can assign a TreeController instance as the <code>contentProvider</code> property for a TreeView object.
20 @class module:montage/ui/controller/tree-controller.TreeController
21 @classdesc
22 @extends module:montage/ui/controller/object-controller.ObjectController
23*/
24var TreeController = exports.TreeController = Montage.create(ObjectController, /** @lends module:montage/ui/controller/tree-controller.TreeController# */ {
25
26 rootKey : {
27 value: null
28 },
29
30 branchKey : {
31 value: 'children'
32 },
33
34 _root : {
35 value : null
36 },
37 root : {
38 get: function() {
39 return this._root;
40 },
41 set: function(value) {
42 this._root = value;
43
44 this.initArrayControllers();
45 }
46 },
47
48 rootController: {
49 value: null
50 },
51
52 initArrayControllers : {
53 value: function() {
54 var self = this;
55
56 ///// Recursive function that finds all branch nodes and initializes
57 ///// sets the tree node type to "branch" or "leaf"
58
59 function walk(node, init, depth) {
60 var branch = node[self.branchKey];
61
62 if(branch) {
63 branch.forEach(function(node) {
64 walk(node, init, ++depth);
65 });
66
67 node['treeNodeType'] = 'branch';
68 } else {
69 node['treeNodeType'] = 'leaf';
70 }
71 }
72
73 walk(this._root, 0);
74
75 }
76 },
77
78 /**
79 @private
80 */
81 _selectedIndexes: {
82 value: null,
83 enumerable: false
84 },
85
86 /**
87 Description TODO
88 @type {Function}
89 @default null
90 */
91 selectedIndexes: {
92 get: function() {
93 return this._selectedIndexes;
94 },
95 set: function(value) {
96 this._selectedIndexes = value;
97 }
98 },
99
100 branchControllers: {
101 value: []
102 },