aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Project
diff options
context:
space:
mode:
authorKris Kowal2012-07-09 16:38:08 -0700
committerKris Kowal2012-07-09 16:38:08 -0700
commit7bee50379c1df86bb571e0e8d6c08e24d25231f5 (patch)
tree5b11abd0414e0a3ab50ec6276b6334fbd168db7e /js/panels/Project
parent26d4b5ce30e6e0ea6e0fde870853c1e2a673a7b4 (diff)
downloadninja-7bee50379c1df86bb571e0e8d6c08e24d25231f5.tar.gz
BSD License
Diffstat (limited to 'js/panels/Project')
-rwxr-xr-xjs/panels/Project/ProjectPanel.js25
-rwxr-xr-xjs/panels/Project/projectpanelbase.reel/ProjectPanelBase.js315
-rwxr-xr-xjs/panels/Project/projectpanelbase.reel/projectpanelbase.html23
3 files changed, 183 insertions, 180 deletions
diff --git a/js/panels/Project/ProjectPanel.js b/js/panels/Project/ProjectPanel.js
index 5dcba3e7..0312eb80 100755
--- a/js/panels/Project/ProjectPanel.js
+++ b/js/panels/Project/ProjectPanel.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -33,7 +34,7 @@ var Montage = require("montage/core/core").Montage,
33 ProjectPanelBase = require("js/panels/Project/ProjectPanelBase.reel").ProjectPanelBase; 34 ProjectPanelBase = require("js/panels/Project/ProjectPanelBase.reel").ProjectPanelBase;
34 35
35exports.ProjectPanel = Montage.create(PanelBase, { 36exports.ProjectPanel = Montage.create(PanelBase, {
36 37
37 id: {value: "projectPanel", writable: true, enumerable: true, configurable: true}, 38 id: {value: "projectPanel", writable: true, enumerable: true, configurable: true},
38 panelName: {value: "Project/Assets", writable: true, enumerable: true, configurable: true}, 39 panelName: {value: "Project/Assets", writable: true, enumerable: true, configurable: true},
39 panelHeaderID: {value: "projectPanelHeader", writable: true, enumerable: true, configurable: true}, 40 panelHeaderID: {value: "projectPanelHeader", writable: true, enumerable: true, configurable: true},
diff --git a/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js b/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
index 51aebc31..c1141ba6 100755
--- a/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
+++ b/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -40,7 +41,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
40 numerable: false, 41 numerable: false,
41 value: false 42 value: false
42 }, 43 },
43 44
44 /* The current project that we have in memory */ 45 /* The current project that we have in memory */
45 _activeProject: { 46 _activeProject: {
46 value: false 47 value: false
@@ -53,7 +54,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
53 this._activeProject = objNewProject; 54 this._activeProject = objNewProject;
54 } 55 }
55 }, 56 },
56 57
57 /* Is the panel initialized? Helps keep us from re-initializing things when a project switches */ 58 /* Is the panel initialized? Helps keep us from re-initializing things when a project switches */
58 _isPanelInitialized: { 59 _isPanelInitialized: {
59 value: false 60 value: false
@@ -66,7 +67,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
66 this._isPanelInitialized = boolValue; 67 this._isPanelInitialized = boolValue;
67 } 68 }
68 }, 69 },
69 70
70 /* Project models: is there an active project, did the user just swap the project, etc. */ 71 /* Project models: is there an active project, did the user just swap the project, etc. */
71 _swapProject: { 72 _swapProject: {
72 value: false 73 value: false
@@ -122,7 +123,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
122 this.hasActiveProject = myVal; 123 this.hasActiveProject = myVal;
123 } 124 }
124 }, 125 },
125 126
126 /* Focus monitor: needed to modify keyboard navigation through panels. */ 127 /* Focus monitor: needed to modify keyboard navigation through panels. */
127 _hasFocus: { 128 _hasFocus: {
128 value: false 129 value: false
@@ -168,7 +169,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
168 } 169 }
169 } 170 }
170 } 171 }
171 }, 172 },
172 173
173 /* resizeColumn: Method to resize a column */ 174 /* resizeColumn: Method to resize a column */
174 resizeColumn: { 175 resizeColumn: {
@@ -186,7 +187,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
186 strNewWidth = "", 187 strNewWidth = "",
187 boolProjectView = true, 188 boolProjectView = true,
188 arrStoredWidths = this.panelState.projectColumnWidths; 189 arrStoredWidths = this.panelState.projectColumnWidths;
189 190
190 if (strSelectorBase.indexOf("assets") > -1) { 191 if (strSelectorBase.indexOf("assets") > -1) {
191 boolProjectView = false; 192 boolProjectView = false;
192 arrStoredWidths = this.panelState.assetColumnWidths; 193 arrStoredWidths = this.panelState.assetColumnWidths;
@@ -211,12 +212,12 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
211 if ((this.activeColumn === 3) && boolProjectView) { 212 if ((this.activeColumn === 3) && boolProjectView) {
212 return; 213 return;
213 } 214 }
214 215
215 // Adjust intAdjust: for the asset view it needs to be 0. 216 // Adjust intAdjust: for the asset view it needs to be 0.
216 if (strSelectorBase.indexOf("assets") >0) { 217 if (strSelectorBase.indexOf("assets") >0) {
217 intAdjust = 0; 218 intAdjust = 0;
218 } 219 }
219 220
220 // Get the total width of the headers and set the container to that width. 221 // Get the total width of the headers and set the container to that width.
221 for (i = 0; i < arrHeadersLength; i++) { 222 for (i = 0; i < arrHeadersLength; i++) {
222 intTotalWidth = intTotalWidth + parseInt(arrHeaders[i].offsetWidth); 223 intTotalWidth = intTotalWidth + parseInt(arrHeaders[i].offsetWidth);
@@ -235,14 +236,14 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
235 intNewWidth = arrStoredWidths[this.activeColumn]; 236 intNewWidth = arrStoredWidths[this.activeColumn];
236 } 237 }
237 strNewWidth = (intNewWidth - intAdjust) + "px"; 238 strNewWidth = (intNewWidth - intAdjust) + "px";
238 239
239 // Get the array of column elements to change, and change them 240 // Get the array of column elements to change, and change them
240 arrToChange = document.querySelectorAll(strSelector); 241 arrToChange = document.querySelectorAll(strSelector);
241 arrToChangeLength = arrToChange.length; 242 arrToChangeLength = arrToChange.length;
242 for (i = 0; i < arrToChangeLength; i++) { 243 for (i = 0; i < arrToChangeLength; i++) {
243 arrToChange[i].style.width = strNewWidth; 244 arrToChange[i].style.width = strNewWidth;
244 } 245 }