@situm/cordova 3.0.0
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/CHANGELOG.md +3 -0
- package/CHANGELOG_UNRELEASED.md +28 -0
- package/Jenkinsfile +84 -0
- package/LICENSE +21 -0
- package/README.md +472 -0
- package/azure/common-steps.yaml +5 -0
- package/azure-pipelines.yml +336 -0
- package/docs/JSDoc/MapView.html +300 -0
- package/docs/JSDoc/MapViewControllerImpl.html +299 -0
- package/docs/JSDoc/Situm.html +5257 -0
- package/docs/JSDoc/android_Interfaces.js.html +825 -0
- package/docs/JSDoc/android_situm.js.html +380 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.eot +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.svg +288 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/docs/JSDoc/global.html +7538 -0
- package/docs/JSDoc/img/toast-ui.png +0 -0
- package/docs/JSDoc/index.html +90 -0
- package/docs/JSDoc/map-view-controller.js.html +307 -0
- package/docs/JSDoc/map-view.js.html +172 -0
- package/docs/JSDoc/scripts/jquery.min.js +2 -0
- package/docs/JSDoc/scripts/linenumber.js +30 -0
- package/docs/JSDoc/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/JSDoc/scripts/prettify/lang-css.js +2 -0
- package/docs/JSDoc/scripts/prettify/prettify.js +28 -0
- package/docs/JSDoc/scripts/tui-doc.js +200 -0
- package/docs/JSDoc/styles/bootstrap.min.css +6 -0
- package/docs/JSDoc/styles/custom.css +23 -0
- package/docs/JSDoc/styles/prettify-jsdoc.css +111 -0
- package/docs/JSDoc/styles/prettify-tomorrow.css +132 -0
- package/docs/JSDoc/styles/tui-doc.css +485 -0
- package/docs/conf.json +28 -0
- package/docs/getting-started.md +298 -0
- package/docs/imagotype-SITUM-transparent-90.png +0 -0
- package/docs/static/styles/custom.css +23 -0
- package/package.json +60 -0
- package/plugin.xml +102 -0
- package/scripts/update_changelog.sh +22 -0
- package/src/android/app/build.gradle +51 -0
- package/src/android/app/proguard-rules.pro +21 -0
- package/src/android/app/src/main/AndroidManifest.xml +11 -0
- package/src/android/app/src/main/java/es/situm/plugin/DateUtils.java +15 -0
- package/src/android/app/src/main/java/es/situm/plugin/PluginHelper.java +919 -0
- package/src/android/app/src/main/java/es/situm/plugin/SitumMapper.java +968 -0
- package/src/android/app/src/main/java/es/situm/plugin/SitumPlugin.java +109 -0
- package/src/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/src/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/values/colors.xml +6 -0
- package/src/android/app/src/main/res/values/strings.xml +3 -0
- package/src/android/app/src/main/res/values/styles.xml +11 -0
- package/src/android/app/src/test/java/es/situm/plugin/PluginHelperTest.java +27 -0
- package/src/android/app/src/test/java/es/situm/plugin/SitumMapperTest.java +1485 -0
- package/src/android/app/src/test/java/es/situm/plugin/angle/AngleCreator.java +46 -0
- package/src/android/app/src/test/java/es/situm/plugin/bounds/BoundsCreator.java +50 -0
- package/src/android/app/src/test/java/es/situm/plugin/building/BuildingCreator.java +76 -0
- package/src/android/app/src/test/java/es/situm/plugin/cartesianCoordinate/CartesianCoordinateCreator.java +31 -0
- package/src/android/app/src/test/java/es/situm/plugin/circle/CircleCreator.java +41 -0
- package/src/android/app/src/test/java/es/situm/plugin/coordinate/CoordinateCreator.java +32 -0
- package/src/android/app/src/test/java/es/situm/plugin/dimensions/DimensionsCreator.java +31 -0
- package/src/android/app/src/test/java/es/situm/plugin/directionsRequest/DirectionsRequestCreator.java +105 -0
- package/src/android/app/src/test/java/es/situm/plugin/event/EventCreator.java +108 -0
- package/src/android/app/src/test/java/es/situm/plugin/floor/FloorCreator.java +58 -0
- package/src/android/app/src/test/java/es/situm/plugin/indication/IndicationCreator.java +40 -0
- package/src/android/app/src/test/java/es/situm/plugin/location/LocationCreator.java +197 -0
- package/src/android/app/src/test/java/es/situm/plugin/locationRequest/LocationRequestCreator.java +45 -0
- package/src/android/app/src/test/java/es/situm/plugin/locationStatus/LocationStatusCreator.java +211 -0
- package/src/android/app/src/test/java/es/situm/plugin/navigationProgress/NavigationProgressCreator.java +154 -0
- package/src/android/app/src/test/java/es/situm/plugin/poi/PoiCreator.java +126 -0
- package/src/android/app/src/test/java/es/situm/plugin/poiCategory/PoiCategoryCreator.java +38 -0
- package/src/android/app/src/test/java/es/situm/plugin/point/PointCreator.java +200 -0
- package/src/android/app/src/test/java/es/situm/plugin/route/RouteCreator.java +142 -0
- package/src/android/app/src/test/java/es/situm/plugin/routeStep/RouteStepCreator.java +173 -0
- package/src/android/app/src/test/java/es/situm/plugin/situmConversionArea/SitumConversionAreaCreator.java +35 -0
- package/src/android/build.gradle +31 -0
- package/src/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/android/gradle.properties +16 -0
- package/src/android/gradlew +172 -0
- package/src/android/gradlew.bat +84 -0
- package/src/android/settings.gradle +3 -0
- package/src/android/situm.gradle +19 -0
- package/src/ios/Classes/Private/CDVDebug.h +25 -0
- package/src/ios/Classes/Private/CDVJSON_private.h +31 -0
- package/src/ios/Classes/Private/CDVJSON_private.m +99 -0
- package/src/ios/Classes/Private/CDVPlugin+Private.h +24 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.h +26 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.m +70 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.h +27 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.m +86 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h +34 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +153 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.h +50 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.m +487 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.h +26 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.m +37 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h +41 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +399 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h +27 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m +202 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h +29 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +153 -0
- package/src/ios/Classes/Public/CDV.h +32 -0
- package/src/ios/Classes/Public/CDVAppDelegate.h +28 -0
- package/src/ios/Classes/Public/CDVAppDelegate.m +118 -0
- package/src/ios/Classes/Public/CDVAvailability.h +111 -0
- package/src/ios/Classes/Public/CDVAvailabilityDeprecated.h +26 -0
- package/src/ios/Classes/Public/CDVCommandDelegate.h +51 -0
- package/src/ios/Classes/Public/CDVCommandDelegateImpl.h +36 -0
- package/src/ios/Classes/Public/CDVCommandDelegateImpl.m +186 -0
- package/src/ios/Classes/Public/CDVCommandQueue.h +39 -0
- package/src/ios/Classes/Public/CDVCommandQueue.m +194 -0
- package/src/ios/Classes/Public/CDVConfigParser.h +30 -0
- package/src/ios/Classes/Public/CDVConfigParser.m +81 -0
- package/src/ios/Classes/Public/CDVInvokedUrlCommand.h +52 -0
- package/src/ios/Classes/Public/CDVInvokedUrlCommand.m +116 -0
- package/src/ios/Classes/Public/CDVPlugin+Resources.h +39 -0
- package/src/ios/Classes/Public/CDVPlugin+Resources.m +38 -0
- package/src/ios/Classes/Public/CDVPlugin.h +85 -0
- package/src/ios/Classes/Public/CDVPlugin.m +202 -0
- package/src/ios/Classes/Public/CDVPluginResult.h +66 -0
- package/src/ios/Classes/Public/CDVPluginResult.m +186 -0
- package/src/ios/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
- package/src/ios/Classes/Public/CDVTimer.h +27 -0
- package/src/ios/Classes/Public/CDVTimer.m +123 -0
- package/src/ios/Classes/Public/CDVURLProtocol.h +27 -0
- package/src/ios/Classes/Public/CDVURLProtocol.m +113 -0
- package/src/ios/Classes/Public/CDVUserAgentUtil.h +27 -0
- package/src/ios/Classes/Public/CDVUserAgentUtil.m +124 -0
- package/src/ios/Classes/Public/CDVViewController.h +92 -0
- package/src/ios/Classes/Public/CDVViewController.m +821 -0
- package/src/ios/Classes/Public/CDVWebViewEngineProtocol.h +42 -0
- package/src/ios/Classes/Public/CDVWhitelist.h +34 -0
- package/src/ios/Classes/Public/CDVWhitelist.m +285 -0
- package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
- package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
- package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.h +29 -0
- package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.m +58 -0
- package/src/ios/Cordova/Cordova.h +51 -0
- package/src/ios/Cordova/Info.plist +24 -0
- package/src/ios/Podfile +5 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.pbxproj +1324 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/xcshareddata/xcschemes/CordovaLib.xcscheme +100 -0
- package/src/ios/SitumCordovaPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/src/ios/SitumCordovaPlugin_Prefix.pch +22 -0
- package/src/ios/VERSION +1 -0
- package/src/ios/cordova.js +2432 -0
- package/src/ios/situmcordovaplugin/AppDelegate.h +22 -0
- package/src/ios/situmcordovaplugin/AppDelegate.m +98 -0
- package/src/ios/situmcordovaplugin/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- package/src/ios/situmcordovaplugin/Base.lproj/LaunchScreen.storyboard +25 -0
- package/src/ios/situmcordovaplugin/Base.lproj/Main.storyboard +24 -0
- package/src/ios/situmcordovaplugin/Constants.h +14 -0
- package/src/ios/situmcordovaplugin/Constants.m +14 -0
- package/src/ios/situmcordovaplugin/Info.plist +45 -0
- package/src/ios/situmcordovaplugin/SITUtils.h +7 -0
- package/src/ios/situmcordovaplugin/SITUtils.m +13 -0
- package/src/ios/situmcordovaplugin/SitumLocationWrapper.h +109 -0
- package/src/ios/situmcordovaplugin/SitumLocationWrapper.m +983 -0
- package/src/ios/situmcordovaplugin/SitumPlugin.h +41 -0
- package/src/ios/situmcordovaplugin/SitumPlugin.m +752 -0
- package/src/ios/situmcordovaplugin/ViewController.h +15 -0
- package/src/ios/situmcordovaplugin/ViewController.m +29 -0
- package/src/ios/situmcordovaplugin/main.m +16 -0
- package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/.xccurrentversion +8 -0
- package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/situmcordovaplugin.xcdatamodel/contents +4 -0
- package/src/ios/situmcordovaplugintests/AngleTests.m +53 -0
- package/src/ios/situmcordovaplugintests/BoundTests.m +51 -0
- package/src/ios/situmcordovaplugintests/BuildingTests.m +41 -0
- package/src/ios/situmcordovaplugintests/CartesianCoordinateTests.m +42 -0
- package/src/ios/situmcordovaplugintests/ConversionAreaTests.m +43 -0
- package/src/ios/situmcordovaplugintests/CoordinateTests.m +42 -0
- package/src/ios/situmcordovaplugintests/DimensionTests.m +43 -0
- package/src/ios/situmcordovaplugintests/EventTests.m +42 -0
- package/src/ios/situmcordovaplugintests/FloorTests.m +52 -0
- package/src/ios/situmcordovaplugintests/Info.plist +38 -0
- package/src/ios/situmcordovaplugintests/InputTests/DirectionsRequestTest.m +108 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputCartesianCoordinateTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputCoordinateTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputFloorTests.m +59 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputIndicationTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputLocationTests.m +163 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputPoiCategoryTests.m +46 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputPointTests.m +137 -0
- package/src/ios/situmcordovaplugintests/InputTests/LocationRequestTest.m +79 -0
- package/src/ios/situmcordovaplugintests/LocationStatusTests.m +60 -0
- package/src/ios/situmcordovaplugintests/LocationTests.m +114 -0
- package/src/ios/situmcordovaplugintests/NavigationProgressTests.m +50 -0
- package/src/ios/situmcordovaplugintests/PoiCategoryIconTests.m +43 -0
- package/src/ios/situmcordovaplugintests/PoiCategoryTests.m +42 -0
- package/src/ios/situmcordovaplugintests/PoiTests.m +83 -0
- package/src/ios/situmcordovaplugintests/PointTests.m +107 -0
- package/src/ios/situmcordovaplugintests/RouteStepTests.m +78 -0
- package/src/ios/situmcordovaplugintests/RouteTests.m +42 -0
- package/src/ios/situmcordovaplugintests/SitumCreatorTests.h +91 -0
- package/src/ios/situmcordovaplugintests/SitumCreatorTests.m +928 -0
- package/src/ios/situmcordovaplugintests/TestingHelper.h +48 -0
- package/src/ios/situmcordovaplugintests/TestingHelper.m +342 -0
- package/src/ios/situmcordovaplugintests/indicationTests.m +43 -0
- package/tests/common-resources/angle/angle1.json +6 -0
- package/tests/common-resources/angle/angle2.json +6 -0
- package/tests/common-resources/bounds/bounds1.json +18 -0
- package/tests/common-resources/bounds/bounds2.json +18 -0
- package/tests/common-resources/building/building1.json +64 -0
- package/tests/common-resources/cartesianCoordinate/cartesianCoordinate1.json +4 -0
- package/tests/common-resources/circle/circle1.json +17 -0
- package/tests/common-resources/coordinate/coordinate1.json +4 -0
- package/tests/common-resources/dimensions/dimensions1.json +4 -0
- package/tests/common-resources/directionsRequest/directionsRequest1.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest2.json +167 -0
- package/tests/common-resources/directionsRequest/directionsRequest3.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest4.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest5.json +167 -0
- package/tests/common-resources/directionsRequest/directionsRequest6.json +153 -0
- package/tests/common-resources/events/event1.json +66 -0
- package/tests/common-resources/floor/floor1.json +13 -0
- package/tests/common-resources/floor/floor2.json +13 -0
- package/tests/common-resources/indication/indication1.json +10 -0
- package/tests/common-resources/location/location1.json +48 -0
- package/tests/common-resources/location/location10.json +48 -0
- package/tests/common-resources/location/location2.json +48 -0
- package/tests/common-resources/location/location3.json +48 -0
- package/tests/common-resources/location/location4.json +48 -0
- package/tests/common-resources/location/location5.json +48 -0
- package/tests/common-resources/location/location6.json +48 -0
- package/tests/common-resources/location/location7.json +48 -0
- package/tests/common-resources/location/location8.json +48 -0
- package/tests/common-resources/location/location9.json +48 -0
- package/tests/common-resources/locationRequest/locationRequest1.json +6 -0
- package/tests/common-resources/locationRequest/locationRequest2.json +32 -0
- package/tests/common-resources/locationRequest/locationRequest3.json +33 -0
- package/tests/common-resources/locationRequest/locationRequest4.json +31 -0
- package/tests/common-resources/locationStatus/locationStatus1.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus10.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus11.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus12.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus13.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus2.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus3.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus4.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus5.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus6.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus7.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus8.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus9.json +4 -0
- package/tests/common-resources/navigationProgress/navigationProgress1.json +77 -0
- package/tests/common-resources/navigationProgress/navigationProgress2.json +77 -0
- package/tests/common-resources/poi/poi1.json +35 -0
- package/tests/common-resources/poi/poi2.json +35 -0
- package/tests/common-resources/poi/poi3.json +35 -0
- package/tests/common-resources/poi/poi4.json +38 -0
- package/tests/common-resources/poi/poi5.json +35 -0
- package/tests/common-resources/poiCategory/poiCategory1.json +7 -0
- package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.json +1 -0
- package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.png +0 -0
- package/tests/common-resources/point/point1.json +14 -0
- package/tests/common-resources/point/point2.json +14 -0
- package/tests/common-resources/point/point3.json +14 -0
- package/tests/common-resources/point/point4.json +14 -0
- package/tests/common-resources/point/point5.json +14 -0
- package/tests/common-resources/point/point6.json +14 -0
- package/tests/common-resources/point/point7.json +14 -0
- package/tests/common-resources/point/point8.json +14 -0
- package/tests/common-resources/route/route1.json +530 -0
- package/tests/common-resources/routeStep/routeStep1.json +35 -0
- package/tests/common-resources/routeStep/routeStep2.json +35 -0
- package/tests/common-resources/routeStep/routeStep3.json +35 -0
- package/tests/common-resources/routeStep/routeStep4.json +35 -0
- package/tests/common-resources/routeStep/routeStep5.json +35 -0
- package/tests/common-resources/situmConversionArea/situmConversionArea1.json +19 -0
- package/tests/js/resources/fetchBuildings.json +176 -0
- package/tests/js/resources/fetchEventsFromBuilding.json +201 -0
- package/tests/js/resources/fetchFloorsFromBuilding.json +34 -0
- package/tests/js/resources/fetchIndoorPOIsFromBuilding.json +574 -0
- package/tests/js/resources/fetchMapFromFloor.json +3 -0
- package/tests/js/resources/fetchOutdoorPOIsFromBuilding.json +68 -0
- package/tests/js/resources/fetchPoiCategories.json +72 -0
- package/tests/js/resources/fetchPoiCategoryIconNormal.json +3 -0
- package/tests/js/resources/fetchPoiCategoryIconSelected.json +3 -0
- package/tests/js/resources/requestDirections.json +1167 -0
- package/tests/js/resources/startPositioning/0_starting.json +4 -0
- package/tests/js/resources/startPositioning/1_preparingPositioningModel.json +4 -0
- package/tests/js/resources/startPositioning/2_startingPositioning.json +4 -0
- package/tests/js/resources/startPositioning/3_calculating.json +4 -0
- package/tests/js/resources/startPositioning/4_position.json +48 -0
- package/tests/js/resources/startPositioning/5_position.json +48 -0
- package/tests/js/test.js +416 -0
- package/tests/scripts/clean_android_resources.sh +3 -0
- package/tests/scripts/clean_ios_resources.sh +3 -0
- package/tests/scripts/copy_android_resources.sh +3 -0
- package/tests/scripts/copy_ios_resources.sh +3 -0
- package/tests/scripts/self-destruct.sh +1 -0
- package/www/android/Interfaces.js +742 -0
- package/www/android/situm.js +296 -0
- package/www/ios/situm.js +99 -0
- package/www/map-view-controller.js +223 -0
- package/www/map-view.js +88 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <UIKit/UIKit.h>
|
|
21
|
+
|
|
22
|
+
#define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
|
|
23
|
+
#define kCDVWebViewEngineUIWebViewDelegate @"kCDVWebViewEngineUIWebViewDelegate"
|
|
24
|
+
#define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
|
|
25
|
+
#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
|
|
26
|
+
#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
|
|
27
|
+
|
|
28
|
+
@protocol CDVWebViewEngineProtocol <NSObject>
|
|
29
|
+
|
|
30
|
+
@property (nonatomic, strong, readonly) UIView* engineWebView;
|
|
31
|
+
|
|
32
|
+
- (id)loadRequest:(NSURLRequest*)request;
|
|
33
|
+
- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL;
|
|
34
|
+
- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler;
|
|
35
|
+
|
|
36
|
+
- (NSURL*)URL;
|
|
37
|
+
- (BOOL)canLoadRequest:(NSURLRequest*)request;
|
|
38
|
+
|
|
39
|
+
- (instancetype)initWithFrame:(CGRect)frame;
|
|
40
|
+
- (void)updateWithInfo:(NSDictionary*)info;
|
|
41
|
+
|
|
42
|
+
@end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <Foundation/Foundation.h>
|
|
21
|
+
|
|
22
|
+
extern NSString* const kCDVDefaultWhitelistRejectionString;
|
|
23
|
+
|
|
24
|
+
@interface CDVWhitelist : NSObject
|
|
25
|
+
|
|
26
|
+
@property (nonatomic, copy) NSString* whitelistRejectionFormatString;
|
|
27
|
+
|
|
28
|
+
- (id)initWithArray:(NSArray*)array;
|
|
29
|
+
- (BOOL)schemeIsAllowed:(NSString*)scheme;
|
|
30
|
+
- (BOOL)URLIsAllowed:(NSURL*)url;
|
|
31
|
+
- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure;
|
|
32
|
+
- (NSString*)errorStringForURL:(NSURL*)url;
|
|
33
|
+
|
|
34
|
+
@end
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "CDVWhitelist.h"
|
|
21
|
+
|
|
22
|
+
NSString* const kCDVDefaultWhitelistRejectionString = @"ERROR whitelist rejection: url='%@'";
|
|
23
|
+
NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
|
|
24
|
+
|
|
25
|
+
@interface CDVWhitelistPattern : NSObject {
|
|
26
|
+
@private
|
|
27
|
+
NSRegularExpression* _scheme;
|
|
28
|
+
NSRegularExpression* _host;
|
|
29
|
+
NSNumber* _port;
|
|
30
|
+
NSRegularExpression* _path;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards;
|
|
34
|
+
- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path;
|
|
35
|
+
- (bool)matches:(NSURL*)url;
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
@implementation CDVWhitelistPattern
|
|
40
|
+
|
|
41
|
+
+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards
|
|
42
|
+
{
|
|
43
|
+
NSString* regex = [NSRegularExpression escapedPatternForString:pattern];
|
|
44
|
+
|
|
45
|
+
if (allowWildcards) {
|
|
46
|
+
regex = [regex stringByReplacingOccurrencesOfString:@"\\*" withString:@".*"];
|
|
47
|
+
|
|
48
|
+
/* [NSURL path] has the peculiarity that a trailing slash at the end of a path
|
|
49
|
+
* will be omitted. This regex tweak compensates for that.
|
|
50
|
+
*/
|
|
51
|
+
if ([regex hasSuffix:@"\\/.*"]) {
|
|
52
|
+
regex = [NSString stringWithFormat:@"%@(\\/.*)?", [regex substringToIndex:([regex length] - 4)]];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return [NSString stringWithFormat:@"%@$", regex];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path
|
|
59
|
+
{
|
|
60
|
+
self = [super init]; // Potentially change "self"
|
|
61
|
+
if (self) {
|
|
62
|
+
if ((scheme == nil) || [scheme isEqualToString:@"*"]) {
|
|
63
|
+
_scheme = nil;
|
|
64
|
+
} else {
|
|
65
|
+
_scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
|
|
66
|
+
}
|
|
67
|
+
if ([host isEqualToString:@"*"] || host == nil) {
|
|
68
|
+
_host = nil;
|
|
69
|
+
} else if ([host hasPrefix:@"*."]) {
|
|
70
|
+
_host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil];
|
|
71
|
+
} else {
|
|
72
|
+
_host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
|
|
73
|
+
}
|
|
74
|
+
if ((port == nil) || [port isEqualToString:@"*"]) {
|
|
75
|
+
_port = nil;
|
|
76
|
+
} else {
|
|
77
|
+
_port = [[NSNumber alloc] initWithInteger:[port integerValue]];
|
|
78
|
+
}
|
|
79
|
+
if ((path == nil) || [path isEqualToString:@"/*"]) {
|
|
80
|
+
_path = nil;
|
|
81
|
+
} else {
|
|
82
|
+
_path = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return self;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
- (bool)matches:(NSURL*)url
|
|
89
|
+
{
|
|
90
|
+
return (_scheme == nil || [_scheme numberOfMatchesInString:[url scheme] options:NSMatchingAnchored range:NSMakeRange(0, [[url scheme] length])]) &&
|
|
91
|
+
(_host == nil || ([url host] != nil && [_host numberOfMatchesInString:[url host] options:NSMatchingAnchored range:NSMakeRange(0, [[url host] length])])) &&
|
|
92
|
+
(_port == nil || [[url port] isEqualToNumber:_port]) &&
|
|
93
|
+
(_path == nil || [_path numberOfMatchesInString:[url path] options:NSMatchingAnchored range:NSMakeRange(0, [[url path] length])])
|
|
94
|
+
;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@end
|
|
98
|
+
|
|
99
|
+
@interface CDVWhitelist ()
|
|
100
|
+
|
|
101
|
+
@property (nonatomic, readwrite, strong) NSMutableArray* whitelist;
|
|
102
|
+
@property (nonatomic, readwrite, strong) NSMutableSet* permittedSchemes;
|
|
103
|
+
|
|
104
|
+
- (void)addWhiteListEntry:(NSString*)pattern;
|
|
105
|
+
|
|
106
|
+
@end
|
|
107
|
+
|
|
108
|
+
@implementation CDVWhitelist
|
|
109
|
+
|
|
110
|
+
@synthesize whitelist, permittedSchemes, whitelistRejectionFormatString;
|
|
111
|
+
|
|
112
|
+
- (id)initWithArray:(NSArray*)array
|
|
113
|
+
{
|
|
114
|
+
self = [super init];
|
|
115
|
+
if (self) {
|
|
116
|
+
self.whitelist = [[NSMutableArray alloc] init];
|
|
117
|
+
self.permittedSchemes = [[NSMutableSet alloc] init];
|
|
118
|
+
self.whitelistRejectionFormatString = kCDVDefaultWhitelistRejectionString;
|
|
119
|
+
|
|
120
|
+
for (NSString* pattern in array) {
|
|
121
|
+
[self addWhiteListEntry:pattern];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return self;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
- (BOOL)isIPv4Address:(NSString*)externalHost
|
|
128
|
+
{
|
|
129
|
+
// an IPv4 address has 4 octets b.b.b.b where b is a number between 0 and 255.
|
|
130
|
+
// for our purposes, b can also be the wildcard character '*'
|
|
131
|
+
|
|
132
|
+
// we could use a regex to solve this problem but then I would have two problems
|
|
133
|
+
// anyways, this is much clearer and maintainable
|
|
134
|
+
NSArray* octets = [externalHost componentsSeparatedByString:@"."];
|
|
135
|
+
NSUInteger num_octets = [octets count];
|
|
136
|
+
|
|
137
|
+
// quick check
|
|
138
|
+
if (num_octets != 4) {
|
|
139
|
+
return NO;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// restrict number parsing to 0-255
|
|
143
|
+
NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
|
|
144
|
+
[numberFormatter setMinimum:[NSNumber numberWithUnsignedInteger:0]];
|
|
145
|
+
[numberFormatter setMaximum:[NSNumber numberWithUnsignedInteger:255]];
|
|
146
|
+
|
|
147
|
+
// iterate through each octet, and test for a number between 0-255 or if it equals '*'
|
|
148
|
+
for (NSUInteger i = 0; i < num_octets; ++i) {
|
|
149
|
+
NSString* octet = [octets objectAtIndex:i];
|
|
150
|
+
|
|
151
|
+
if ([octet isEqualToString:@"*"]) { // passes - check next octet
|
|
152
|
+
continue;
|
|
153
|
+
} else if ([numberFormatter numberFromString:octet] == nil) { // fails - not a number and not within our range, return
|
|
154
|
+
return NO;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return YES;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
- (void)addWhiteListEntry:(NSString*)origin
|
|
162
|
+
{
|
|
163
|
+
if (self.whitelist == nil) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if ([origin isEqualToString:@"*"]) {
|
|
168
|
+
NSLog(@"Unlimited access to network resources");
|
|
169
|
+
self.whitelist = nil;
|
|
170
|
+
self.permittedSchemes = nil;
|
|
171
|
+
} else { // specific access
|
|
172
|
+
NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[A-Za-z-]+):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil];
|
|
173
|
+
NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])];
|
|
174
|
+
if (m != nil) {
|
|
175
|
+
NSRange r;
|
|
176
|
+
NSString* scheme = nil;
|
|
177
|
+
r = [m rangeAtIndex:2];
|
|
178
|
+
if (r.location != NSNotFound) {
|
|
179
|
+
scheme = [origin substringWithRange:r];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
NSString* host = nil;
|
|
183
|
+
r = [m rangeAtIndex:3];
|
|
184
|
+
if (r.location != NSNotFound) {
|
|
185
|
+
host = [origin substringWithRange:r];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Special case for two urls which are allowed to have empty hosts
|
|
189
|
+
if (([scheme isEqualToString:@"file"] || [scheme isEqualToString:@"content"]) && (host == nil)) {
|
|
190
|
+
host = @"*";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
NSString* port = nil;
|
|
194
|
+
r = [m rangeAtIndex:7];
|
|
195
|
+
if (r.location != NSNotFound) {
|
|
196
|
+
port = [origin substringWithRange:r];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
NSString* path = nil;
|
|
200
|
+
r = [m rangeAtIndex:8];
|
|
201
|
+
if (r.location != NSNotFound) {
|
|
202
|
+
path = [origin substringWithRange:r];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (scheme == nil) {
|
|
206
|
+
// XXX making it stupid friendly for people who forget to include protocol/SSL
|
|
207
|
+
[self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"http" host:host port:port path:path]];
|
|
208
|
+
[self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"https" host:host port:port path:path]];
|
|
209
|
+
} else {
|
|
210
|
+
[self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:scheme host:host port:port path:path]];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (self.permittedSchemes != nil) {
|
|
214
|
+
if ([scheme isEqualToString:@"*"]) {
|
|
215
|
+
self.permittedSchemes = nil;
|
|
216
|
+
} else if (scheme != nil) {
|
|
217
|
+
[self.permittedSchemes addObject:scheme];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
- (BOOL)schemeIsAllowed:(NSString*)scheme
|
|
225
|
+
{
|
|
226
|
+
if ([scheme isEqualToString:@"http"] ||
|
|
227
|
+
[scheme isEqualToString:@"https"] ||
|
|
228
|
+
[scheme isEqualToString:@"ftp"] ||
|
|
229
|
+
[scheme isEqualToString:@"ftps"]) {
|
|
230
|
+
return YES;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return (self.permittedSchemes == nil) || [self.permittedSchemes containsObject:scheme];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
- (BOOL)URLIsAllowed:(NSURL*)url
|
|
237
|
+
{
|
|
238
|
+
return [self URLIsAllowed:url logFailure:YES];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure
|
|
242
|
+
{
|
|
243
|
+
// Shortcut acceptance: Are all urls whitelisted ("*" in whitelist)?
|
|
244
|
+
if (whitelist == nil) {
|
|
245
|
+
return YES;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Shortcut rejection: Check that the scheme is supported
|
|
249
|
+
NSString* scheme = [[url scheme] lowercaseString];
|
|
250
|
+
if (![self schemeIsAllowed:scheme]) {
|
|
251
|
+
if (logFailure) {
|
|
252
|
+
NSLog(@"%@", [self errorStringForURL:url]);
|
|
253
|
+
}
|
|
254
|
+
return NO;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list
|
|
258
|
+
if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) {
|
|
259
|
+
NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]];
|
|
260
|
+
// If it is allowed, we are done. If not, continue to check for the actual scheme-specific list
|
|
261
|
+
if ([self URLIsAllowed:newUrl logFailure:NO]) {
|
|
262
|
+
return YES;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Check the url against patterns in the whitelist
|
|
267
|
+
for (CDVWhitelistPattern* p in self.whitelist) {
|
|
268
|
+
if ([p matches:url]) {
|
|
269
|
+
return YES;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (logFailure) {
|
|
274
|
+
NSLog(@"%@", [self errorStringForURL:url]);
|
|
275
|
+
}
|
|
276
|
+
// if we got here, the url host is not in the white-list, do nothing
|
|
277
|
+
return NO;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
- (NSString*)errorStringForURL:(NSURL*)url
|
|
281
|
+
{
|
|
282
|
+
return [NSString stringWithFormat:self.whitelistRejectionFormatString, [url absoluteString]];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
@end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <Foundation/Foundation.h>
|
|
21
|
+
#import <UIKit/UIKit.h>
|
|
22
|
+
|
|
23
|
+
@interface NSDictionary (CordovaPreferences)
|
|
24
|
+
|
|
25
|
+
- (id)cordovaSettingForKey:(NSString*)key;
|
|
26
|
+
- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue;
|
|
27
|
+
- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@interface NSMutableDictionary (CordovaPreferences)
|
|
32
|
+
|
|
33
|
+
- (void)setCordovaSetting:(id)value forKey:(NSString*)key;
|
|
34
|
+
|
|
35
|
+
@end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "NSDictionary+CordovaPreferences.h"
|
|
21
|
+
#import <Foundation/Foundation.h>
|
|
22
|
+
|
|
23
|
+
@implementation NSDictionary (CordovaPreferences)
|
|
24
|
+
|
|
25
|
+
- (id)cordovaSettingForKey:(NSString*)key
|
|
26
|
+
{
|
|
27
|
+
return [self objectForKey:[key lowercaseString]];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue
|
|
31
|
+
{
|
|
32
|
+
BOOL value = defaultValue;
|
|
33
|
+
id prefObj = [self cordovaSettingForKey:key];
|
|
34
|
+
|
|
35
|
+
if (prefObj != nil) {
|
|
36
|
+
value = [(NSNumber*)prefObj boolValue];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue
|
|
43
|
+
{
|
|
44
|
+
CGFloat value = defaultValue;
|
|
45
|
+
id prefObj = [self cordovaSettingForKey:key];
|
|
46
|
+
|
|
47
|
+
if (prefObj != nil) {
|
|
48
|
+
value = [prefObj floatValue];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
@implementation NSMutableDictionary (CordovaPreferences)
|
|
57
|
+
|
|
58
|
+
- (void)setCordovaSetting:(id)value forKey:(NSString*)key
|
|
59
|
+
{
|
|
60
|
+
[self setObject:value forKey:[key lowercaseString]];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <Foundation/Foundation.h>
|
|
21
|
+
|
|
22
|
+
@interface NSMutableArray (QueueAdditions)
|
|
23
|
+
|
|
24
|
+
- (id)cdv_pop;
|
|
25
|
+
- (id)cdv_queueHead;
|
|
26
|
+
- (id)cdv_dequeue;
|
|
27
|
+
- (void)cdv_enqueue:(id)obj;
|
|
28
|
+
|
|
29
|
+
@end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "NSMutableArray+QueueAdditions.h"
|
|
21
|
+
|
|
22
|
+
@implementation NSMutableArray (QueueAdditions)
|
|
23
|
+
|
|
24
|
+
- (id)cdv_queueHead
|
|
25
|
+
{
|
|
26
|
+
if ([self count] == 0) {
|
|
27
|
+
return nil;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return [self objectAtIndex:0];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (__autoreleasing id)cdv_dequeue
|
|
34
|
+
{
|
|
35
|
+
if ([self count] == 0) {
|
|
36
|
+
return nil;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
id head = [self objectAtIndex:0];
|
|
40
|
+
if (head != nil) {
|
|
41
|
+
// [[head retain] autorelease]; ARC - the __autoreleasing on the return value should so the same thing
|
|
42
|
+
[self removeObjectAtIndex:0];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return head;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
- (id)cdv_pop
|
|
49
|
+
{
|
|
50
|
+
return [self cdv_dequeue];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- (void)cdv_enqueue:(id)object
|
|
54
|
+
{
|
|
55
|
+
[self addObject:object];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <UIKit/UIKit.h>
|
|
21
|
+
|
|
22
|
+
//! Project version number for Cordova.
|
|
23
|
+
FOUNDATION_EXPORT double CordovaVersionNumber;
|
|
24
|
+
|
|
25
|
+
//! Project version string for Cordova.
|
|
26
|
+
FOUNDATION_EXPORT const unsigned char CordovaVersionString[];
|
|
27
|
+
|
|
28
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Cordova/PublicHeader.h>
|
|
29
|
+
|
|
30
|
+
#import <Cordova/CDV.h>
|
|
31
|
+
#import <Cordova/CDVCommandDelegateImpl.h>
|
|
32
|
+
#import <Cordova/CDVAvailability.h>
|
|
33
|
+
#import <Cordova/CDVAvailabilityDeprecated.h>
|
|
34
|
+
#import <Cordova/CDVAppDelegate.h>
|
|
35
|
+
#import <Cordova/CDVPlugin.h>
|
|
36
|
+
#import <Cordova/CDVPluginResult.h>
|
|
37
|
+
#import <Cordova/CDVViewController.h>
|
|
38
|
+
#import <Cordova/CDVCommandDelegate.h>
|
|
39
|
+
#import <Cordova/CDVCommandQueue.h>
|
|
40
|
+
#import <Cordova/CDVConfigParser.h>
|
|
41
|
+
#import <Cordova/CDVURLProtocol.h>
|
|
42
|
+
#import <Cordova/CDVInvokedUrlCommand.h>
|
|
43
|
+
#import <Cordova/CDVPlugin+Resources.h>
|
|
44
|
+
#import <Cordova/CDVWebViewEngineProtocol.h>
|
|
45
|
+
#import <Cordova/NSDictionary+CordovaPreferences.h>
|
|
46
|
+
#import <Cordova/NSMutableArray+QueueAdditions.h>
|
|
47
|
+
#import <Cordova/CDVUIWebViewDelegate.h>
|
|
48
|
+
#import <Cordova/CDVWhitelist.h>
|
|
49
|
+
#import <Cordova/CDVScreenOrientationDelegate.h>
|
|
50
|
+
#import <Cordova/CDVTimer.h>
|
|
51
|
+
#import <Cordova/CDVUserAgentUtil.h>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|