diff options
author | Valerio Virgillito | 2012-02-09 16:39:38 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-09 16:39:38 -0800 |
commit | b2155233351966ff579db41a7b85be554c643a97 (patch) | |
tree | db6b9c79e27b3de81f7bca25c3cb7252409d3aaa | |
parent | cebd27bd649d01c8b8713651df3878da14b5e9a8 (diff) | |
parent | f0a833b589cd3bcd3ba26037070c06e945ef6e29 (diff) | |
download | ninja-b2155233351966ff579db41a7b85be554c643a97.tar.gz |
Merge branch 'code-cleanup' of https://github.com/mencio/ninja-internal into feature-branch
-rw-r--r-- | css/ninja.css | 2 | ||||
-rw-r--r-- | js/components/package.json | 8 | ||||
-rw-r--r-- | js/helper-classes/Utils.js | 33 | ||||
-rw-r--r-- | js/lib/NJUtils.js | 21 | ||||
-rw-r--r-- | scss/imports/scss/_MainWindow.scss | 5 |
5 files changed, 21 insertions, 48 deletions
diff --git a/css/ninja.css b/css/ninja.css index 5a25cc84..26031a3a 100644 --- a/css/ninja.css +++ b/css/ninja.css | |||
@@ -164,8 +164,6 @@ body { position: absolute; margin: 0px; width: 100%; height: 100%; background-co | |||
164 | 164 | ||
165 | #rightPanelContent { overflow-y: hidden; } | 165 | #rightPanelContent { overflow-y: hidden; } |
166 | 166 | ||
167 | .contextMenu { position: absolute; z-index: 999; } | ||
168 | |||
169 | #openDocumentsTabComponent { height: 25px; position: relative; overflow: hidden; color: white; } | 167 | #openDocumentsTabComponent { height: 25px; position: relative; overflow: hidden; color: white; } |
170 | 168 | ||
171 | #openDocuments { float: left; height: 25px; width: 100%; font-size: 12px; list-style: none; margin: 0; padding: 0; position: relative; text-decoration: none; } | 169 | #openDocuments { float: left; height: 25px; width: 100%; font-size: 12px; list-style: none; margin: 0; padding: 0; position: relative; text-decoration: none; } |
diff --git a/js/components/package.json b/js/components/package.json deleted file mode 100644 index f3a6f0e0..00000000 --- a/js/components/package.json +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | { | ||
2 | "directories": { | ||
3 | "lib": "../../" | ||
4 | }, | ||
5 | "mappings": { | ||
6 | "montage": "../../node_modules/montage/" | ||
7 | } | ||
8 | } \ No newline at end of file | ||
diff --git a/js/helper-classes/Utils.js b/js/helper-classes/Utils.js deleted file mode 100644 index 1cfc390e..00000000 --- a/js/helper-classes/Utils.js +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
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 | // Adding to the String Prototype little utility function to capitalize the first Char of a String. | ||
8 | String.prototype.capitalizeFirstChar = function() { | ||
9 | return this.charAt(0).toUpperCase() + this.slice(1); | ||
10 | }; | ||
11 | |||
12 | exports.utils = Object.create(Object.prototype, { | ||
13 | |||
14 | getValueAndUnits: { | ||
15 | value: function(str) | ||
16 | { | ||
17 | var numberValue = parseFloat(str); | ||
18 | // Ignore all whitespace, digits, negative sign and "." when looking for units label | ||
19 | // The units must come after one or more digits | ||
20 | var objRegExp = /(\-*\d+\.*\d*)(\s*)(\w*\%*)/; | ||
21 | var unitsString = str.replace(objRegExp, "$3"); | ||
22 | if(unitsString) | ||
23 | { | ||
24 | var noSpaces = /(\s*)(\S*)(\s*)/; | ||
25 | // strip out spaces and convert to lower case | ||
26 | var match = (unitsString.replace(noSpaces, "$2")).toLowerCase(); | ||
27 | } | ||
28 | |||
29 | return [numberValue, match]; | ||
30 | } | ||
31 | } | ||
32 | |||
33 | }); \ No newline at end of file | ||
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index d6548871..0e886ae7 100644 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -183,6 +183,27 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
183 | 183 | ||
184 | }, | 184 | }, |
185 | 185 | ||
186 | // Returns the numerical value and unit string from a string. | ||
187 | // Useful for element properties. | ||
188 | // 100px will return the following array: [100, px] | ||
189 | getValueAndUnits: { | ||
190 | value: function(input) { | ||
191 | var numberValue = parseFloat(input); | ||
192 | |||
193 | // Ignore all whitespace, digits, negative sign and "." when looking for units label | ||
194 | // The units must come after one or more digits | ||
195 | var objRegExp = /(\-*\d+\.*\d*)(\s*)(\w*\%*)/; | ||
196 | var unitsString = input.replace(objRegExp, "$3"); | ||
197 | if(unitsString) { | ||
198 | var noSpaces = /(\s*)(\S*)(\s*)/; | ||
199 | // strip out spaces and convert to lower case | ||
200 | var match = (unitsString.replace(noSpaces, "$2")).toLowerCase(); | ||
201 | } | ||
202 | |||
203 | return [numberValue, match]; | ||
204 | } | ||
205 | }, | ||
206 | |||
186 | /* ================= Style methods ================= */ | 207 | /* ================= Style methods ================= */ |
187 | 208 | ||
188 | ///// Get computed height of element | 209 | ///// Get computed height of element |
diff --git a/scss/imports/scss/_MainWindow.scss b/scss/imports/scss/_MainWindow.scss index 99028b2a..a2d5eef4 100644 --- a/scss/imports/scss/_MainWindow.scss +++ b/scss/imports/scss/_MainWindow.scss | |||
@@ -291,11 +291,6 @@ | |||
291 | overflow-y:hidden; | 291 | overflow-y:hidden; |
292 | } | 292 | } |
293 | 293 | ||
294 | .contextMenu { | ||
295 | position:absolute; | ||
296 | z-index:999; | ||
297 | } | ||
298 | |||
299 | #openDocumentsTabComponent { | 294 | #openDocumentsTabComponent { |
300 | height: 25px; | 295 | height: 25px; |
301 | position: relative; | 296 | position: relative; |