Skip to content

Commit ca592f3

Browse files
committed
Bump 3.4.0
1 parent 3c124cf commit ca592f3

28 files changed

+560
-422
lines changed

config.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget android-versionCode="33200" id="com.ecarriou.systemdesignerios" version="3.3.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget android-versionCode="34000" id="com.ecarriou.systemdesignerios" version="3.4.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>System Designer</name>
44
<description>
55
System Designer, an IDE for designing systems.
@@ -39,7 +39,4 @@
3939
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />
4040
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
4141
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
42-
<engine name="browser" spec="6.0.0" />
43-
<engine name="ios" spec="5.0.0" />
44-
<engine name="android" spec="7.1.4" />
4542
</widget>

merges/ios/scripts/mobile.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,30 @@
1919
*/
2020

2121
document.addEventListener('deviceready', onDeviceReady, false);
22+
2223
function onDeviceReady() {
2324
StatusBar.hide();
25+
26+
// fix an issue with iOS 12 (@see https://github.com/apache/cordova-ios/issues/417#issuecomment-466520675)
27+
function ios12NotchFix(is_ios, keyboard_plugin_exists) {
28+
if (!is_ios || device.model.indexOf("iPhone") === -1) return false;
29+
if (!keyboard_plugin_exists) throw new Error("This fix depends on 'cordova-plugin-keyboard'!");
30+
const iphone_number = Number(device.model.replace("iPhone", "").replace(",", "."));
31+
const /* viewport metatag */
32+
viewport_el = document.getElementsByName("viewport")[0],
33+
default_content = "user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1";
34+
35+
if (iphone_number >= 10.6 || iphone_number === 10.3) { /* devices with notch: X, XR, ... */
36+
setCover();
37+
38+
window.addEventListener('keyboardWillShow', setFix);
39+
window.addEventListener('keyboardWillHide', setCover);
40+
}
41+
function setCover() { viewport_el.content = default_content + ", viewport-fit=cover"; }
42+
function setFix() { viewport_el.content = default_content; }
43+
}
44+
45+
ios12NotchFix(device.platform === "iOS", typeof Keyboard !== "undefined");
2446
}
2547

2648
document.addEventListener('menubutton', onMenuButton, false);

0 commit comments

Comments
 (0)