aboutsummaryrefslogtreecommitdiff
path: root/js/components/converter/string-units-converter.js
diff options
context:
space:
mode:
authorJonathan Duran2012-05-31 08:54:48 -0700
committerJonathan Duran2012-05-31 08:54:48 -0700
commitf297093b5bfa62c9832829751a12f0e556bb5cc0 (patch)
tree6e04cdf142cb1b36e2197970c9dc2141017a2be7 /js/components/converter/string-units-converter.js
parent9253e2ce98d748edd8c3929f113a597923960387 (diff)
parentd49c909cff7f0c5e5d0b127ad84a2fefc6677dc6 (diff)
downloadninja-f297093b5bfa62c9832829751a12f0e556bb5cc0.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Conflicts: js/panels/Timeline/Layer.reel/Layer.js js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js js/panels/properties.reel/properties.js Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/components/converter/string-units-converter.js')
-rw-r--r--js/components/converter/string-units-converter.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/js/components/converter/string-units-converter.js b/js/components/converter/string-units-converter.js
new file mode 100644
index 00000000..6b97d5c5
--- /dev/null
+++ b/js/components/converter/string-units-converter.js
@@ -0,0 +1,31 @@
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> */
6var Montage = require("montage").Montage,
7 Converter = require("montage/core/converter/converter").Converter,
8 NJUtils = require("js/lib/NJUtils").NJUtils;
9
10exports.StringUnitsConverter = Montage.create(Converter, {
11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: {
14 value: function(value) {
15 if(value) {
16 console.log("convert string to unit ", value);
17 var tmp = NJUtils.getValueAndUnits(value);
18 return tmp[1];
19 }
20 }
21 },
22
23 // revert celsius to fahrenheit
24 revert: {
25 value: function(value) {
26 console.log("revert string to unit ", value);
27 return value;
28 }
29 }
30
31});