diff options
author | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
commit | 8592cfb89db05f0e52d8c1b8c7046e6f49e3522d (patch) | |
tree | a6f9b5adfe16fd6232708f8a2345cd79056caca9 /node_modules/montage-user/core/converter/upper-case-converter.js | |
parent | c6d1a1da9e7cdf477daf32410d80691eb1e828d5 (diff) | |
download | ninja-8592cfb89db05f0e52d8c1b8c7046e6f49e3522d.tar.gz |
Adding a montage framework copy for the user document
Adding a new montage copy containing the latest version of montage to use the new native widgets
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage-user/core/converter/upper-case-converter.js')
-rwxr-xr-x | node_modules/montage-user/core/converter/upper-case-converter.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/node_modules/montage-user/core/converter/upper-case-converter.js b/node_modules/montage-user/core/converter/upper-case-converter.js new file mode 100755 index 00000000..33ec0055 --- /dev/null +++ b/node_modules/montage-user/core/converter/upper-case-converter.js | |||
@@ -0,0 +1,51 @@ | |||
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/core/converter/upper-case-converter | ||
8 | @requires montage/core/core | ||
9 | @requires montage/core/converter/converter | ||
10 | */ | ||
11 | var Montage = require("montage").Montage; | ||
12 | var Converter = require('core/converter/converter').Converter; | ||
13 | |||
14 | // uppercase formatter | ||
15 | /** | ||
16 | @class module:montage/core/converter/upper-case-converter.UpperCaseConverter | ||
17 | @classdesc Converts a string to upper-case. | ||
18 | */ | ||
19 | exports.UpperCaseConverter = Montage.create(Converter, /** @lends module:montage/core/converter/upper-case-converter.UpperCaseConverter# */ { | ||
20 | /** | ||
21 | @private | ||
22 | */ | ||
23 | _convert: { | ||
24 | value: function(v) { | ||
25 | if (v && typeof v === 'string') { | ||
26 | return (v.toUpperCase ? v.toUpperCase() : v); | ||
27 | } | ||
28 | return v; | ||
29 | } | ||
30 | }, | ||
31 | |||
32 | /** | ||
33 | Converts the specified string to all upper case letters. | ||
34 | @function | ||
35 | @param {String} v The string to convert. | ||
36 | @returns {String} The converted string. | ||
37 | */ | ||
38 | convert: {value: function(v) { | ||
39 | return this._convert(v); | ||
40 | }}, | ||
41 | |||
42 | /** | ||
43 | Reverts the specified string. | ||
44 | @function | ||
45 | @param {String} v The specified string. | ||
46 | @returns {String} | ||
47 | */ | ||
48 | revert: {value: function(v) { | ||
49 | return this._convert(v); | ||
50 | }} | ||
51 | }); | ||