From c8720030e315d8c440354f54cf48f0c1464d72cb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 9 Feb 2012 16:31:15 -0800 Subject: deleted old utils file and move single method into NJUtils Signed-off-by: Valerio Virgillito --- js/helper-classes/Utils.js | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 js/helper-classes/Utils.js (limited to 'js/helper-classes') 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 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -// Adding to the String Prototype little utility function to capitalize the first Char of a String. -String.prototype.capitalizeFirstChar = function() { - return this.charAt(0).toUpperCase() + this.slice(1); -}; - -exports.utils = Object.create(Object.prototype, { - - getValueAndUnits: { - value: function(str) - { - var numberValue = parseFloat(str); - // Ignore all whitespace, digits, negative sign and "." when looking for units label - // The units must come after one or more digits - var objRegExp = /(\-*\d+\.*\d*)(\s*)(\w*\%*)/; - var unitsString = str.replace(objRegExp, "$3"); - if(unitsString) - { - var noSpaces = /(\s*)(\S*)(\s*)/; - // strip out spaces and convert to lower case - var match = (unitsString.replace(noSpaces, "$2")).toLowerCase(); - } - - return [numberValue, match]; - } - } - -}); \ No newline at end of file -- cgit v1.2.3