diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-17 16:44:48 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-17 16:44:48 -0400 |
| commit | 4dd8d93a97cbeccc5cc972e31c44f73ed6c7393e (patch) | |
| tree | a731727e6e7c892f67bfc99d08bb2b452f188048 | |
| parent | df19b39f1d8a4440b9c83fd297ea7d7748ca7cc9 (diff) | |
more IOS9 compatibility patches
| -rw-r--r-- | www/external/ionRadio.js | 55 | ||||
| -rw-r--r-- | www/external/radio.css | 17 | ||||
| -rw-r--r-- | www/external/zmNinja-Info.plist.IOS9nonSSLPatch | 187 | ||||
| -rw-r--r-- | www/index.html | 2 | ||||
| -rw-r--r-- | www/js/StateCtrl.js | 2 |
5 files changed, 262 insertions, 1 deletions
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 <ion-radio> to <ion-radio-fix> 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: + '<label class="item item-radio">' + + '<input type="radio" name="radio-group">' + + '<div class="radio-content">' + + '<div class="item-content disable-pointer-events" ng-transclude></div>' + + '<i class="radio-icon disable-pointer-events icon ion-checkmark"></i>' + + '</div>' + + '</label>', + + 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFile</key> + <string>icon.png</string> + <key>CFBundleIcons</key> + <dict> + <key>CFBundlePrimaryIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>icon-40</string> + <string>icon-small</string> + <string>icon-60</string> + <string>icon.png</string> + <string>icon@2x</string> + <string>icon-72</string> + <string>icon-72@2x</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + </dict> + <key>CFBundleIcons~ipad</key> + <dict> + <key>CFBundlePrimaryIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>icon-small</string> + <string>icon-40</string> + <string>icon-50</string> + <string>icon-76</string> + <string>icon-60</string> + <string>icon</string> + <string>icon@2x</string> + <string>icon-72</string> + <string>icon-72@2x</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + </dict> + <key>CFBundleIdentifier</key> + <string>com.pliablepixels.zmninja</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>0.76</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>0.76</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>NSAppTransportSecurity</key> + <dict> + <key>NSAllowsArbitraryLoads</key> + <true/> + </dict> + <key>NSMainNibFile</key> + <string></string> + <key>NSMainNibFile~ipad</key> + <string></string> + <key>UILaunchImages</key> + <array> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{320, 480}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{320, 480}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-568h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{320, 568}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-568h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{320, 568}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-667h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{375, 667}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-667h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{375, 667}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-736h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{414, 736}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Landscape-736h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{414, 736}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Portrait</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Landscape</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + </dict> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> +</dict> +</plist> 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 @@ <link rel="stylesheet" href="lib/angular-awesome-slider/dist/css/angular-awesome-slider.min.css"> <link rel="stylesheet" href="lib/vis/dist/vis.min.css"> <link rel="stylesheet" href="lib/ionic-content-banner/dist/ionic.content.banner.min.css"> + <link rel="stylesheet" href="external/radio.css"> @@ -31,6 +32,7 @@ <script src="lib/ionic/js/ionic.bundle.min.js"></script> <script src="external/angular-ios9-uiwebview.patch.js"></script> + <script src="external/ionRadio.js"></script> <script src="lib/ngCordova/dist/ng-cordova.min.js"></script> <script src="lib/filelogger/dist/filelogger.min.js"></script> 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: '<ion-radio ng-repeat="item in allStateNames" ng-value="item" ng-model="myopt.selectedState"> {{item}} </ion-radio>', + template: '<ion-radio-fix ng-repeat="item in allStateNames" ng-value="item" ng-model="myopt.selectedState"> {{item}} </ion-radio-fix>', title: 'Select run state', |
