From 4dd8d93a97cbeccc5cc972e31c44f73ed6c7393e Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Thu, 17 Sep 2015 16:44:48 -0400 Subject: more IOS9 compatibility patches --- www/external/ionRadio.js | 55 +++++++ www/external/radio.css | 17 +++ www/external/zmNinja-Info.plist.IOS9nonSSLPatch | 187 ++++++++++++++++++++++++ www/index.html | 2 + www/js/StateCtrl.js | 2 +- 5 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 www/external/ionRadio.js create mode 100644 www/external/radio.css create mode 100644 www/external/zmNinja-Info.plist.IOS9nonSSLPatch (limited to 'www') diff --git a/www/external/ionRadio.js b/www/external/ionRadio.js new file mode 100644 index 00000000..cb240b76 --- /dev/null +++ b/www/external/ionRadio.js @@ -0,0 +1,55 @@ +/** + * ionRadioFix - fixes a bug in iOS 9 UIWebView that breaks the tilde selector in CSS. To + * use this fix, include it after your Ionic bundle JS. + * + * Note: due to Angular directive override limitations, you'll need to change any reference + * to to to apply this patched radio button. + * + * Also, make sure to add the new CSS from the second part of this gist. + */ +angular.module('ionic').directive('ionRadioFix', function() { + return { + restrict: 'E', + replace: true, + require: '?ngModel', + transclude: true, + template: + '', + + compile: function(element, attr) { + if (attr.icon) { + var iconElm = element.find('i'); + iconElm.removeClass('ion-checkmark').addClass(attr.icon); + } + + var input = element.find('input'); + angular.forEach({ + 'name': attr.name, + 'value': attr.value, + 'disabled': attr.disabled, + 'ng-value': attr.ngValue, + 'ng-model': attr.ngModel, + 'ng-disabled': attr.ngDisabled, + 'ng-change': attr.ngChange, + 'ng-required': attr.ngRequired, + 'required': attr.required + }, function(value, name) { + if (angular.isDefined(value)) { + input.attr(name, value); + } + }); + + return function(scope, element, attr) { + scope.getValue = function() { + return scope.ngValue || attr.value; + }; + }; + } + }; +}); \ No newline at end of file diff --git a/www/external/radio.css b/www/external/radio.css new file mode 100644 index 00000000..1a25e826 --- /dev/null +++ b/www/external/radio.css @@ -0,0 +1,17 @@ +/** + * This CSS uses adjacent selectors instead of general sibling (~) selectors + * for ion radio that are broken in iOS 9 UIWebView. + * + * To apply the patch, include this CSS after your ionic.css include. + */ + .item-radio input:checked + .radio-content .item-content { + /* style the item content when its checked */ + background: #f7f7f7; + + } + + .item-radio input:checked + .radio-content .radio-icon { + /* show the checkmark icon when its checked */ + visibility: visible; + + } \ No newline at end of file diff --git a/www/external/zmNinja-Info.plist.IOS9nonSSLPatch b/www/external/zmNinja-Info.plist.IOS9nonSSLPatch new file mode 100644 index 00000000..11a24ca6 --- /dev/null +++ b/www/external/zmNinja-Info.plist.IOS9nonSSLPatch @@ -0,0 +1,187 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + icon.png + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + icon-40 + icon-small + icon-60 + icon.png + icon@2x + icon-72 + icon-72@2x + + UIPrerenderedIcon + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + icon-small + icon-40 + icon-50 + icon-76 + icon-60 + icon + icon@2x + icon-72 + icon-72@2x + + UIPrerenderedIcon + + + + CFBundleIdentifier + com.pliablepixels.zmninja + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.76 + CFBundleSignature + ???? + CFBundleVersion + 0.76 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSMainNibFile + + NSMainNibFile~ipad + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 480} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default + UILaunchImageOrientation + Landscape + UILaunchImageSize + {320, 480} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-568h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-568h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-667h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-667h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-736h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Landscape-736h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {414, 736} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Portrait + UILaunchImageOrientation + Portrait + UILaunchImageSize + {768, 1024} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Landscape + UILaunchImageOrientation + Landscape + UILaunchImageSize + {768, 1024} + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/www/index.html b/www/index.html index a3c92c79..098f717b 100644 --- a/www/index.html +++ b/www/index.html @@ -16,6 +16,7 @@ + @@ -31,6 +32,7 @@ + diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js index 988a658c..fbf48671 100644 --- a/www/js/StateCtrl.js +++ b/www/js/StateCtrl.js @@ -90,7 +90,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' ZMDataModel.zmLog("List of custom states: " + JSON.stringify($scope.allStateNames)); var getConfig = $ionicPopup.show({ scope: $scope, - template: ' {{item}} ', + template: ' {{item}} ', title: 'Select run state', -- cgit v1.2.3