Comparing version 0.5.2 to 0.6.0
@@ -31,2 +31,12 @@ // Generated by CoffeeScript 1.8.0 | ||
/** | ||
Input language | ||
@property map_language | ||
@type String | ||
@default 'en' | ||
*/ | ||
_Class.prototype.map_language = 'en'; | ||
/** | ||
Full typed in text | ||
@@ -137,4 +147,10 @@ @property text | ||
} | ||
if (this.maps == null) { | ||
this.maps = { | ||
nokia: require('./MapNokia.js'), | ||
sonyericsson: require('./MapSonyericsson.js') | ||
}; | ||
} | ||
if (this.mapping == null) { | ||
this.SetMapping(this.map_name); | ||
this.SetMapping(this.map_name, this.map_language); | ||
} | ||
@@ -153,14 +169,18 @@ this["case"] = exports.Keypad.caselist[0]; | ||
_Class.prototype.SetMapping = function(name) { | ||
if (this.maps == null) { | ||
this.maps = { | ||
nokia: (require("./MapNokia.js")).KeyMap, | ||
sonyericsson: (require("./MapSonyericsson.js")).KeyMap | ||
}; | ||
_Class.prototype.SetMapping = function(name, language) { | ||
if (language == null) { | ||
language = this.map_language; | ||
} | ||
if (name == null) { | ||
throw new Error('Please specify target map name'); | ||
} | ||
if (this.maps[name] == null) { | ||
throw new Error('Specified map name does not exist'); | ||
} | ||
if (this.maps[name][language] == null) { | ||
throw new Error('Specified language does not exist in a mapping'); | ||
} | ||
this.map_name = name; | ||
return this.mapping = this.maps[this.map_name]; | ||
this.map_language = language; | ||
return this.mapping = this.maps[this.map_name][this.map_language]; | ||
}; | ||
@@ -224,7 +244,3 @@ | ||
this.InsertCharacter(this.character); | ||
if (this.timeout != null) { | ||
clearTimeout(this.timeout); | ||
} | ||
this.timeout = null; | ||
return; | ||
return this.ClearTimeout(); | ||
} | ||
@@ -279,3 +295,3 @@ return this.ResetTimeout(); | ||
if (this["case"][0] === 'A') { | ||
text = text.toUpperCase(); | ||
return text.toUpperCase(); | ||
} | ||
@@ -319,5 +335,3 @@ return text; | ||
this.character = null; | ||
if (this.timeout != null) { | ||
return clearTimeout(this.timeout); | ||
} | ||
return this.ClearTimeout(); | ||
}; | ||
@@ -332,5 +346,3 @@ | ||
_Class.prototype.ResetTimeout = function() { | ||
if (this.timeout != null) { | ||
clearTimeout(this.timeout); | ||
} | ||
this.ClearTimeout(); | ||
return this.timeout = setTimeout((function(_this) { | ||
@@ -344,2 +356,15 @@ return function() { | ||
/** | ||
Clear current keys timeout | ||
@method ClearTimeout | ||
*/ | ||
_Class.prototype.ClearTimeout = function() { | ||
if (this.timeout != null) { | ||
clearTimeout(this.timeout); | ||
return this.timeout = null; | ||
} | ||
}; | ||
return _Class; | ||
@@ -346,0 +371,0 @@ |
@@ -10,3 +10,3 @@ // Generated by CoffeeScript 1.8.0 | ||
'use strict'; | ||
exports.KeyMap = { | ||
exports.en = { | ||
'1': ['.', ',', '?', '!', '\'', '"', '1', '-', '(', ')', '@', '/', ':', '_'], | ||
@@ -13,0 +13,0 @@ '2': ['a', 'b', 'c', '2', 'ä', 'æ', 'å', 'à', 'á', 'â', 'ã', 'ç'], |
@@ -10,3 +10,3 @@ // Generated by CoffeeScript 1.8.0 | ||
'use strict'; | ||
exports.KeyMap = { | ||
exports.en = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
@@ -20,3 +20,3 @@ '2': ['a', 'b', 'c', '2'], | ||
'8': ['t', 'u', 'v', '8'], | ||
'9': ['w', 'x', 'y', 'z'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
@@ -27,2 +27,92 @@ '0': ['+', '0'], | ||
exports.de = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'ä', 'á', 'à', '2'], | ||
'3': ['d', 'e', 'f', 'é', 'è', '3'], | ||
'4': ['g', 'h', 'i', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'ö', '6'], | ||
'7': ['p', 'q', 'r', 's', 'ß', '7'], | ||
'8': ['t', 'u', 'v', 'ü', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
exports.es = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'á', 'ã', 'ç', '2'], | ||
'3': ['d', 'e', 'f', 'é', '3'], | ||
'4': ['g', 'h', 'i', 'í', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'ó', 'ñ', '6'], | ||
'7': ['p', 'q', 'r', 's', '7'], | ||
'8': ['t', 'u', 'v', 'ú', 'ü', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
exports.fr = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'ç', 'à', 'â', 'á', 'ä', '2'], | ||
'3': ['d', 'e', 'f', 'é', 'è', 'ê', 'ë', '3'], | ||
'4': ['g', 'h', 'i', 'î', 'ï', 'í', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'ô', 'ó', 'ö', 'ñ', '6'], | ||
'7': ['p', 'q', 'r', 's', 'ß', '7'], | ||
'8': ['t', 'u', 'v', 'ù', 'û', 'ú', 'ü', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
exports.nl = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'ç', 'ä', 'á', 'à', 'â', '2'], | ||
'3': ['d', 'e', 'f', 'ë', 'é', 'è', 'ê', '3'], | ||
'4': ['g', 'h', 'i', 'ï', 'í', 'ì', 'î', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'ö', 'ó', 'ò', 'ô', '6'], | ||
'7': ['p', 'q', 'r', 's', 'ß', '7'], | ||
'8': ['t', 'u', 'v', 'ü', 'ú', 'û', 'ù', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
exports.pt = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'ç', 'ã', 'á', 'à', 'â', '2'], | ||
'3': ['d', 'e', 'f', 'é', 'ê', '3'], | ||
'4': ['g', 'h', 'i', 'í', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'õ', 'ó', 'ô', 'ñ', '6'], | ||
'7': ['p', 'q', 'r', 's', '7'], | ||
'8': ['t', 'u', 'v', 'ú', 'ü', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
exports.tr = { | ||
'1': ['.', ',', '-', '?', '!', '\'', '@', ':', ';', '/', '(', ')', '1'], | ||
'2': ['a', 'b', 'c', 'ç', 'â', 'ä', 'á', '2'], | ||
'3': ['d', 'e', 'f', 'é', '3'], | ||
'4': ['g', 'h', 'ı', 'i', 'ğ', 'î', '4'], | ||
'5': ['j', 'k', 'l', '5'], | ||
'6': ['m', 'n', 'o', 'ö', 'ó', 'ô', '6'], | ||
'7': ['p', 'q', 'r', 's', 'ş', '7'], | ||
'8': ['t', 'u', 'v', 'ü', 'û', 'ú', '8'], | ||
'9': ['w', 'x', 'y', 'z', '9'], | ||
'*': ['CASE'], | ||
'0': ['+', '0'], | ||
'#': [' ', '\n', '¶'] | ||
}; | ||
}).call(this); |
{ | ||
"name": "keypad", | ||
"description": "12-key keyboard layout emulation, similar to one that is used in mobile phones", | ||
"version": "0.5.2", | ||
"version": "0.6.0", | ||
"repository": "https://github.com/muchweb/keypad", | ||
@@ -6,0 +6,0 @@ "license": "GPL-3.0+", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73350
536
31