Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

Commit

Permalink
use proper js module for each platform
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Sep 14, 2015
1 parent 0270e08 commit b460a72
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
36 changes: 19 additions & 17 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@
<repo>https://github.com/driftyco/ionic-plugin-keyboard.git</repo>
<issue>https://github.com/driftyco/ionic-plugin-keyboard/issues</issue>

<js-module src="www/keyboard.js" name="keyboard">
<runs/>
<clobbers target="cordova.plugins.Keyboard" />
</js-module>

<!-- android -->
<platform name="android">

<config-file target="res/xml/config.xml" parent="/*">
<feature name="Keyboard">
<param name="android-package" value="io.ionic.keyboard.IonicKeyboard" />
<param name="onload" value="true" />
</feature>
</config-file>
<!-- android -->
<platform name="android">
<js-module src="www/android/keyboard.js" name="keyboard">
<runs/>
<clobbers target="cordova.plugins.Keyboard" />
</js-module>
<config-file target="res/xml/config.xml" parent="/*">
<feature name="Keyboard">
<param name="android-package" value="io.ionic.keyboard.IonicKeyboard" />
<param name="onload" value="true" />
</feature>
</config-file>

<source-file src="src/android/IonicKeyboard.java" target-dir="src/io/ionic/keyboard" />
</platform>
<source-file src="src/android/IonicKeyboard.java" target-dir="src/io/ionic/keyboard" />
</platform>

<!-- ios -->
<platform name="ios">
<js-module src="www/ios/keyboard.js" name="keyboard">
<runs/>
<clobbers target="cordova.plugins.Keyboard" />
</js-module>
<config-file target="config.xml" parent="/*">
<feature name="Keyboard">
<param name="ios-package" value="IonicKeyboard" onload="true" />
Expand All @@ -48,8 +51,7 @@
<lib-file src="src/blackberry10/native/device/libKeyboard.so" arch="device"/>
<lib-file src="src/blackberry10/native/simulator/libKeyboard.so" arch="simulator"/>
<config-file target="www/config.xml" parent="/widget">
<feature name="Keyboard" value="io.ionic.keyboard"/>

<feature name="Keyboard" value="io.ionic.keyboard"/>
</config-file>
</platform>

Expand Down
File renamed without changes.
37 changes: 37 additions & 0 deletions www/ios/keyboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

var argscheck = require('cordova/argscheck'),
utils = require('cordova/utils'),
exec = require('cordova/exec');


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;

module.exports = Keyboard;



0 comments on commit b460a72

Please sign in to comment.