summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-11-08 12:37:03 -0500
committerJules Laplace <jules@okfoc.us>2016-11-08 12:37:03 -0500
commitef4f212fc1482136dba1e690ec589b315b4a377f (patch)
tree0b7e16d72567fafcfd3e08d7c5c591ad07a63458 /StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js
parent5fa81da81260d65113f57a293b6256d334fe8e2d (diff)
build 0.7.0
Diffstat (limited to 'StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js')
-rw-r--r--StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js b/StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js
new file mode 100644
index 00000000..125a5a29
--- /dev/null
+++ b/StoneIsland/plugins/ionic-plugin-keyboard/www/android/keyboard.js
@@ -0,0 +1,60 @@
+
+var argscheck = require('cordova/argscheck'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec'),
+ channel = require('cordova/channel');
+
+
+var Keyboard = function() {
+};
+
+Keyboard.hideKeyboardAccessoryBar = function(hide) {
+ exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]);
+};
+
+Keyboard.close = function() {
+ exec(null, null, "Keyboard", "close", []);
+};
+
+Keyboard.show = function() {
+ exec(null, null, "Keyboard", "show", []);
+};
+
+Keyboard.disableScroll = function(disable) {
+ exec(null, null, "Keyboard", "disableScroll", [disable]);
+};
+
+/*
+Keyboard.styleDark = function(dark) {
+ exec(null, null, "Keyboard", "styleDark", [dark]);
+};
+*/
+
+Keyboard.isVisible = false;
+
+channel.onCordovaReady.subscribe(function() {
+ exec(success, null, 'Keyboard', 'init', []);
+
+ function success(msg) {
+ var action = msg.charAt(0);
+ if ( action === 'S' ) {
+ var keyboardHeight = msg.substr(1);
+ cordova.plugins.Keyboard.isVisible = true;
+ cordova.fireWindowEvent('native.keyboardshow', { 'keyboardHeight': + keyboardHeight });
+
+ //deprecated
+ cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight': + keyboardHeight });
+ } else if ( action === 'H' ) {
+ cordova.plugins.Keyboard.isVisible = false;
+ cordova.fireWindowEvent('native.keyboardhide');
+
+ //deprecated
+ cordova.fireWindowEvent('native.hidekeyboard');
+ }
+ }
+});
+
+module.exports = Keyboard;
+
+
+