cordova-plugin-cronapp-decimal-keyboard 1.0.1 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/plugin.xml +7 -8
- package/src/ios/CDVDecimalKeyboard.m +13 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cordova-plugin-cronapp-decimal-keyboard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Plugin to display decimal keyboard on Cordova and Phonegap applications",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"cordova",
|
|
15
|
-
"decimal",
|
|
15
|
+
"decimal",
|
|
16
16
|
"cronapp",
|
|
17
17
|
"keypad"
|
|
18
18
|
],
|
package/plugin.xml
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
|
|
3
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-cronapp-decimal-keyboard" version="1.0.1">
|
|
2
|
+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-cronapp-decimal-keyboard" version="2.9.1">
|
|
4
3
|
<name>Decimal Keyboard</name>
|
|
5
4
|
<description>Cordova Decimal Keyboard Plugin</description>
|
|
6
5
|
<license>Apache 2.0</license>
|
|
7
6
|
<keywords>cordova,keyboard, decimal keyboard</keywords>
|
|
8
7
|
|
|
9
8
|
<engines>
|
|
10
|
-
<engine name="cordova" version="
|
|
9
|
+
<engine name="cordova" version=">=3.2.0"/>
|
|
11
10
|
</engines>
|
|
12
11
|
|
|
13
12
|
<js-module src="www/decimal-keyboard.js" name="decimalKeyboard">
|
|
14
|
-
<clobbers target="window.DecimalKeyboard"
|
|
13
|
+
<clobbers target="window.DecimalKeyboard"/>
|
|
15
14
|
</js-module>
|
|
16
15
|
|
|
17
16
|
<!-- ios -->
|
|
18
17
|
<platform name="ios">
|
|
19
18
|
<config-file target="config.xml" parent="/*">
|
|
20
19
|
<feature name="DecimalKeyboard">
|
|
21
|
-
<param name="ios-package" value="CDVDecimalKeyboard" onload="true"
|
|
20
|
+
<param name="ios-package" value="CDVDecimalKeyboard" onload="true"/>
|
|
22
21
|
</feature>
|
|
23
22
|
</config-file>
|
|
24
23
|
|
|
25
|
-
<header-file src="src/ios/CDVDecimalKeyboard.h"
|
|
26
|
-
<source-file src="src/ios/CDVDecimalKeyboard.m"
|
|
24
|
+
<header-file src="src/ios/CDVDecimalKeyboard.h"/>
|
|
25
|
+
<source-file src="src/ios/CDVDecimalKeyboard.m"/>
|
|
27
26
|
</platform>
|
|
28
|
-
</plugin>
|
|
27
|
+
</plugin>
|
|
@@ -63,7 +63,17 @@ BOOL isAppInBackground=NO;
|
|
|
63
63
|
}
|
|
64
64
|
decimalButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
65
65
|
[self setDecimalChar];
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
if (@available(iOS 13.0, *)) {
|
|
68
|
+
if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
|
69
|
+
[decimalButton setTitleColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0] forState:UIControlStateNormal];
|
|
70
|
+
} else {
|
|
71
|
+
[decimalButton setTitleColor:[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0] forState:UIControlStateNormal];
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
[decimalButton setTitleColor:[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0] forState:UIControlStateNormal];
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
decimalButton.titleLabel.font = [UIFont systemFontOfSize:40.0];
|
|
68
78
|
[decimalButton addTarget:self action:@selector(buttonPressed:)
|
|
69
79
|
forControlEvents:UIControlEventTouchUpInside];
|
|
@@ -74,8 +84,7 @@ BOOL isAppInBackground=NO;
|
|
|
74
84
|
|
|
75
85
|
|
|
76
86
|
decimalButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
|
|
77
|
-
[decimalButton setTitleEdgeInsets:UIEdgeInsetsMake(-
|
|
78
|
-
[decimalButton setBackgroundColor: [UIColor colorWithRed:210/255.0 green:213/255.0 blue:218/255.0 alpha:1.0]];
|
|
87
|
+
[decimalButton setTitleEdgeInsets:UIEdgeInsetsMake(-30.0f, 0.0f, 0.0f, 0.0f)];
|
|
79
88
|
|
|
80
89
|
// locate keyboard view
|
|
81
90
|
UIWindow* tempWindow = nil;
|
|
@@ -154,12 +163,10 @@ BOOL isDifferentKeyboardShown=NO;
|
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
- (void)buttonPressed:(UIButton *)button {
|
|
157
|
-
[decimalButton setBackgroundColor: [UIColor colorWithRed:210/255.0 green:213/255.0 blue:218/255.0 alpha:1.0]];
|
|
158
166
|
[self evaluateJavaScript:@"DecimalKeyboard.addDecimal();" completionHandler:nil];
|
|
159
167
|
}
|
|
160
168
|
|
|
161
169
|
- (void)buttonTapped:(UIButton *)button {
|
|
162
|
-
[decimalButton setBackgroundColor: [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0]];
|
|
163
170
|
}
|
|
164
171
|
- (void)buttonPressCancel:(UIButton *)button{
|
|
165
172
|
[decimalButton setBackgroundColor: [UIColor colorWithRed:210/255.0 green:213/255.0 blue:218/255.0 alpha:1.0]];
|
|
@@ -224,14 +231,7 @@ BOOL stopSearching=NO;
|
|
|
224
231
|
|
|
225
232
|
- (void) evaluateJavaScript:(NSString *)script
|
|
226
233
|
completionHandler:(void (^ _Nullable)(NSString * _Nullable response, NSError * _Nullable error))completionHandler {
|
|
227
|
-
|
|
228
|
-
if ([self.webView isKindOfClass:UIWebView.class]) {
|
|
229
|
-
UIWebView *webview = (UIWebView*)self.webView;
|
|
230
|
-
NSString *response = [webview stringByEvaluatingJavaScriptFromString:script];
|
|
231
|
-
if (completionHandler) completionHandler(response, nil);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
else if ([self.webView isKindOfClass:WKWebView.class]) {
|
|
234
|
+
if ([self.webView isKindOfClass:WKWebView.class]) {
|
|
235
235
|
WKWebView *webview = (WKWebView*)self.webView;
|
|
236
236
|
[webview evaluateJavaScript:script completionHandler:^(id result, NSError *error) {
|
|
237
237
|
if (completionHandler) {
|