From 22721a013bdd10d5eb395ba18453585f5f3f1f7f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 31 Aug 2020 23:07:20 +0200 Subject: rebuild the ios platform and the plugins --- .../www/android/keyboard.js | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 StoneIsland/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js (limited to 'StoneIsland/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js') diff --git a/StoneIsland/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js b/StoneIsland/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js new file mode 100755 index 00000000..ac68cfc6 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js @@ -0,0 +1,84 @@ +var argscheck = require('cordova/argscheck'), + utils = require('cordova/utils'), + exec = require('cordova/exec'), + channel = require('cordova/channel'); + +var Keyboard = function () {}; + +Keyboard.fireOnShow = function (height) { + Keyboard.isVisible = true; + cordova.fireWindowEvent('keyboardDidShow', { + 'keyboardHeight': height + }); + + // To support the keyboardAttach directive listening events + // inside Ionic's main bundle + cordova.fireWindowEvent('native.keyboardshow', { + 'keyboardHeight': height + }); +}; + +Keyboard.fireOnHide = function () { + Keyboard.isVisible = false; + cordova.fireWindowEvent('keyboardDidHide'); + + // To support the keyboardAttach directive listening events + // inside Ionic's main bundle + cordova.fireWindowEvent('native.keyboardhide'); +}; + +Keyboard.fireOnHiding = function () { + cordova.fireWindowEvent('keyboardWillHide'); +}; + +Keyboard.fireOnShowing = function (height) { + cordova.fireWindowEvent('keyboardWillShow', { + 'keyboardHeight': height + }); +}; + +Keyboard.hideFormAccessoryBar = Keyboard.hideKeyboardAccessoryBar = function (hide) { + console.warn("Keyboard.hideKeyboardAccessoryBar() not supported in Android"); +}; + +Keyboard.hide = function () { + exec(null, null, "CDVIonicKeyboard", "hide", []); +}; + +Keyboard.show = function () { + exec(null, null, "CDVIonicKeyboard", "show", []); +}; + +Keyboard.disableScroll = function (disable) { + console.warn("Keyboard.disableScroll() not supported in Android"); +}; + +Keyboard.setResizeMode = function (mode) { + console.warn("Keyboard.setResizeMode() not supported in Android"); +} + +Keyboard.setKeyboardStyle = function(style) { + console.warn("Keyboard.setKeyboardStyle() not supported in Android"); +}; + +channel.onCordovaReady.subscribe(function () { + exec(success, null, 'CDVIonicKeyboard', 'init', []); + + function success(msg) { + var action = msg.charAt(0); + if (action === 'S') { + var keyboardHeight = parseInt(msg.substr(1)); + Keyboard.fireOnShowing(keyboardHeight); + Keyboard.fireOnShow(keyboardHeight); + + } else if (action === 'H') { + Keyboard.fireOnHiding(); + Keyboard.fireOnHide(); + } + } +}); + + +Keyboard.isVisible = false; + +module.exports = Keyboard; -- cgit v1.2.3-70-g09d2