From b5f4ee6bc3587b33dd2e6f288da7424b8d4f373e Mon Sep 17 00:00:00 2001 From: arnaucode Date: Sat, 18 Feb 2017 12:17:52 +0100 Subject: [PATCH] main added --- .gitignore | 2 +- .../cordova-plugin-console/CONTRIBUTING.md | 37 + plugins/cordova-plugin-console/LICENSE | 202 ++ plugins/cordova-plugin-console/NOTICE | 5 + plugins/cordova-plugin-console/README.md | 109 ++ .../cordova-plugin-console/RELEASENOTES.md | 207 ++ .../cordova-plugin-console/doc/de/README.md | 43 + .../cordova-plugin-console/doc/de/index.md | 41 + .../cordova-plugin-console/doc/es/README.md | 41 + .../cordova-plugin-console/doc/es/index.md | 39 + .../cordova-plugin-console/doc/fr/README.md | 41 + .../cordova-plugin-console/doc/fr/index.md | 39 + .../cordova-plugin-console/doc/it/README.md | 43 + .../cordova-plugin-console/doc/it/index.md | 41 + .../cordova-plugin-console/doc/ja/README.md | 43 + .../cordova-plugin-console/doc/ja/index.md | 41 + .../cordova-plugin-console/doc/ko/README.md | 43 + .../cordova-plugin-console/doc/ko/index.md | 41 + .../cordova-plugin-console/doc/pl/README.md | 43 + .../cordova-plugin-console/doc/pl/index.md | 41 + .../cordova-plugin-console/doc/ru/index.md | 31 + .../cordova-plugin-console/doc/zh/README.md | 43 + .../cordova-plugin-console/doc/zh/index.md | 41 + plugins/cordova-plugin-console/package.json | 47 + plugins/cordova-plugin-console/plugin.xml | 127 ++ .../src/ios/CDVLogger.h | 26 + .../src/ios/CDVLogger.m | 38 + .../src/ubuntu/console.cpp | 29 + .../src/ubuntu/console.h | 43 + .../src/wp/DebugConsole.cs | 47 + .../cordova-plugin-console/tests/plugin.xml | 31 + plugins/cordova-plugin-console/tests/tests.js | 43 + .../www/console-via-logger.js | 186 ++ plugins/cordova-plugin-console/www/logger.js | 354 ++++ plugins/cordova-plugin-device/CONTRIBUTING.md | 37 + plugins/cordova-plugin-device/LICENSE | 202 ++ plugins/cordova-plugin-device/NOTICE | 5 + plugins/cordova-plugin-device/README.md | 311 +++ plugins/cordova-plugin-device/RELEASENOTES.md | 333 ++++ .../cordova-plugin-device/doc/de/README.md | 203 ++ plugins/cordova-plugin-device/doc/de/index.md | 206 ++ .../cordova-plugin-device/doc/es/README.md | 216 +++ plugins/cordova-plugin-device/doc/es/index.md | 220 +++ .../cordova-plugin-device/doc/fr/README.md | 215 ++ plugins/cordova-plugin-device/doc/fr/index.md | 218 +++ .../cordova-plugin-device/doc/it/README.md | 203 ++ plugins/cordova-plugin-device/doc/it/index.md | 206 ++ .../cordova-plugin-device/doc/ja/README.md | 203 ++ plugins/cordova-plugin-device/doc/ja/index.md | 206 ++ .../cordova-plugin-device/doc/ko/README.md | 203 ++ plugins/cordova-plugin-device/doc/ko/index.md | 206 ++ .../cordova-plugin-device/doc/pl/README.md | 214 ++ plugins/cordova-plugin-device/doc/pl/index.md | 206 ++ plugins/cordova-plugin-device/doc/ru/index.md | 219 +++ .../cordova-plugin-device/doc/zh/README.md | 203 ++ plugins/cordova-plugin-device/doc/zh/index.md | 206 ++ plugins/cordova-plugin-device/package.json | 61 + plugins/cordova-plugin-device/plugin.xml | 174 ++ .../src/android/Device.java | 174 ++ .../src/blackberry10/index.js | 71 + .../src/browser/DeviceProxy.js | 82 + .../src/firefoxos/DeviceProxy.js | 77 + .../cordova-plugin-device/src/ios/CDVDevice.h | 30 + .../cordova-plugin-device/src/ios/CDVDevice.m | 112 ++ .../cordova-plugin-device/src/osx/CDVDevice.h | 28 + .../cordova-plugin-device/src/osx/CDVDevice.m | 113 ++ .../src/tizen/DeviceProxy.js | 38 + .../src/ubuntu/device.cpp | 64 + .../cordova-plugin-device/src/ubuntu/device.h | 47 + .../src/ubuntu/device.js | 33 + .../src/windows/DeviceProxy.js | 98 + .../cordova-plugin-device/src/wp/Device.cs | 87 + .../cordova-plugin-device/tests/plugin.xml | 31 + plugins/cordova-plugin-device/tests/tests.js | 113 ++ plugins/cordova-plugin-device/www/device.js | 83 + .../CONTRIBUTING.md | 37 + plugins/cordova-plugin-splashscreen/LICENSE | 202 ++ plugins/cordova-plugin-splashscreen/NOTICE | 5 + plugins/cordova-plugin-splashscreen/README.md | 526 +++++ .../RELEASENOTES.md | 206 ++ .../doc/de/README.md | 119 ++ .../doc/de/index.md | 78 + .../doc/es/README.md | 119 ++ .../doc/es/index.md | 76 + .../doc/fr/README.md | 119 ++ .../doc/fr/index.md | 78 + .../doc/it/README.md | 119 ++ .../doc/it/index.md | 78 + .../doc/ja/README.md | 119 ++ .../doc/ja/index.md | 78 + .../doc/ko/README.md | 119 ++ .../doc/ko/index.md | 78 + .../doc/pl/README.md | 119 ++ .../doc/pl/index.md | 78 + .../doc/ru/index.md | 75 + .../doc/zh/README.md | 119 ++ .../doc/zh/index.md | 78 + .../cordova-plugin-splashscreen/package.json | 60 + .../cordova-plugin-splashscreen/plugin.xml | 135 ++ .../src/android/SplashScreen.java | 385 ++++ .../src/blackberry10/index.js | 30 + .../src/browser/SplashScreenProxy.js | 138 ++ .../src/ios/CDVSplashScreen.h | 45 + .../src/ios/CDVSplashScreen.m | 506 +++++ .../src/ios/CDVViewController+SplashScreen.h | 28 + .../src/ios/CDVViewController+SplashScreen.m | 89 + .../src/tizen/SplashScreenProxy.js | 43 + .../src/ubuntu/splashscreen.cpp | 42 + .../src/ubuntu/splashscreen.h | 52 + .../src/wp/ResolutionHelper.cs | 39 + .../src/wp/SplashScreen.cs | 255 +++ .../contents.xcworkspacedata | 7 + .../CDVSplashScreenTest.xccheckout | 41 + .../xcschemes/CordovaLib.xcscheme | 77 + .../tests/ios/CDVSplashScreenTest/.npmignore | 1 + .../CDVSplashScreenLibTests/ImageNameTest.m | 702 +++++++ .../ImageNameTestDelegates.h | 57 + .../ImageNameTestDelegates.m | 200 ++ .../CDVSplashScreenLibTests/Info.plist | 44 + .../project.pbxproj | 505 +++++ .../contents.xcworkspacedata | 7 + .../CDVSplashScreenTest.xccheckout | 41 + .../xcschemes/CDVSplashScreenLib.xcscheme | 77 + .../CDVSplashScreenLibTests.xcscheme | 96 + .../tests/ios/README.md | 40 + .../tests/ios/doc/de/README.md | 39 + .../tests/ios/doc/es/README.md | 39 + .../tests/ios/doc/fr/README.md | 39 + .../tests/ios/doc/it/README.md | 39 + .../tests/ios/doc/ja/README.md | 39 + .../tests/ios/doc/ko/README.md | 39 + .../tests/ios/doc/pl/README.md | 39 + .../tests/ios/doc/zh/README.md | 39 + .../tests/ios/package.json | 13 + .../tests/plugin.xml | 29 + .../tests/tests.js | 64 + .../www/splashscreen.js | 33 + .../www/windows/SplashScreenProxy.js | 37 + .../cordova-plugin-statusbar/CONTRIBUTING.md | 37 + plugins/cordova-plugin-statusbar/LICENSE | 202 ++ plugins/cordova-plugin-statusbar/NOTICE | 5 + plugins/cordova-plugin-statusbar/README.md | 333 ++++ .../cordova-plugin-statusbar/RELEASENOTES.md | 140 ++ .../cordova-plugin-statusbar/doc/de/README.md | 276 +++ .../cordova-plugin-statusbar/doc/de/index.md | 262 +++ .../cordova-plugin-statusbar/doc/es/README.md | 276 +++ .../cordova-plugin-statusbar/doc/es/index.md | 252 +++ .../cordova-plugin-statusbar/doc/fr/README.md | 276 +++ .../cordova-plugin-statusbar/doc/fr/index.md | 262 +++ .../cordova-plugin-statusbar/doc/it/README.md | 276 +++ .../cordova-plugin-statusbar/doc/it/index.md | 262 +++ .../cordova-plugin-statusbar/doc/ja/README.md | 276 +++ .../cordova-plugin-statusbar/doc/ja/index.md | 262 +++ .../cordova-plugin-statusbar/doc/ko/README.md | 276 +++ .../cordova-plugin-statusbar/doc/ko/index.md | 262 +++ .../cordova-plugin-statusbar/doc/pl/README.md | 276 +++ .../cordova-plugin-statusbar/doc/pl/index.md | 262 +++ .../cordova-plugin-statusbar/doc/ru/index.md | 238 +++ .../cordova-plugin-statusbar/doc/zh/README.md | 276 +++ .../cordova-plugin-statusbar/doc/zh/index.md | 262 +++ plugins/cordova-plugin-statusbar/package.json | 48 + plugins/cordova-plugin-statusbar/plugin.xml | 99 + .../src/android/StatusBar.java | 167 ++ .../src/browser/StatusBarProxy.js | 48 + .../src/ios/CDVStatusBar.h | 49 + .../src/ios/CDVStatusBar.m | 508 +++++ .../src/windows/StatusBarProxy.js | 114 ++ .../src/wp/StatusBar.cs | 141 ++ .../cordova-plugin-statusbar/tests/plugin.xml | 31 + .../cordova-plugin-statusbar/tests/tests.js | 151 ++ .../cordova-plugin-statusbar/www/statusbar.js | 113 ++ .../cordova-plugin-whitelist/CONTRIBUTING.md | 37 + plugins/cordova-plugin-whitelist/LICENSE | 202 ++ plugins/cordova-plugin-whitelist/NOTICE | 5 + plugins/cordova-plugin-whitelist/README.md | 163 ++ .../cordova-plugin-whitelist/RELEASENOTES.md | 68 + .../cordova-plugin-whitelist/doc/de/README.md | 148 ++ .../cordova-plugin-whitelist/doc/es/README.md | 148 ++ .../cordova-plugin-whitelist/doc/fr/README.md | 148 ++ .../cordova-plugin-whitelist/doc/it/README.md | 148 ++ .../cordova-plugin-whitelist/doc/ja/README.md | 148 ++ .../cordova-plugin-whitelist/doc/ko/README.md | 148 ++ .../cordova-plugin-whitelist/doc/pl/README.md | 148 ++ .../cordova-plugin-whitelist/doc/zh/README.md | 148 ++ plugins/cordova-plugin-whitelist/package.json | 32 + plugins/cordova-plugin-whitelist/plugin.xml | 50 + .../src/android/WhitelistPlugin.java | 161 ++ plugins/fetch.json | 50 + plugins/ionic-plugin-keyboard/LICENSE | 202 ++ plugins/ionic-plugin-keyboard/README.md | 128 ++ plugins/ionic-plugin-keyboard/package.json | 30 + plugins/ionic-plugin-keyboard/plugin.xml | 71 + .../src/android/IonicKeyboard.java | 130 ++ .../src/blackberry10/index.js | 125 ++ .../src/blackberry10/native/.cproject | 222 +++ .../src/blackberry10/native/.project | 76 + .../blackberry10/native/device/libKeyboard.so | Bin 0 -> 289588 bytes .../native/device/public/json_reader.o | Bin 0 -> 81556 bytes .../native/device/public/json_value.o | Bin 0 -> 91652 bytes .../native/device/public/json_writer.o | Bin 0 -> 133040 bytes .../native/device/public/plugin.o | Bin 0 -> 50576 bytes .../native/device/public/tokenizer.o | Bin 0 -> 23640 bytes .../native/device/src/CallKeyboard.o | Bin 0 -> 5988 bytes .../blackberry10/native/device/src/Logger.o | Bin 0 -> 5192 bytes .../native/device/src/keyboard_js.o | Bin 0 -> 17352 bytes .../native/device/src/keyboard_ndk.o | Bin 0 -> 95672 bytes .../native/public/json/autolink.h | 19 + .../blackberry10/native/public/json/config.h | 43 + .../native/public/json/features.h | 42 + .../native/public/json/forwards.h | 39 + .../blackberry10/native/public/json/json.h | 10 + .../blackberry10/native/public/json/reader.h | 196 ++ .../blackberry10/native/public/json/value.h | 1069 ++++++++++ .../blackberry10/native/public/json/writer.h | 174 ++ .../native/public/json_batchallocator.h | 125 ++ .../native/public/json_internalarray.inl | 448 +++++ .../native/public/json_internalmap.inl | 607 ++++++ .../native/public/json_reader.cpp | 892 +++++++++ .../blackberry10/native/public/json_value.cpp | 1726 +++++++++++++++++ .../native/public/json_valueiterator.inl | 292 +++ .../native/public/json_writer.cpp | 829 ++++++++ .../src/blackberry10/native/public/plugin.cpp | 320 +++ .../src/blackberry10/native/public/plugin.h | 70 + .../blackberry10/native/public/tokenizer.cpp | 222 +++ .../blackberry10/native/public/tokenizer.h | 55 + .../native/simulator/libKeyboard.so | Bin 0 -> 1455634 bytes .../native/simulator/public/json_reader.o | Bin 0 -> 389836 bytes .../native/simulator/public/json_value.o | Bin 0 -> 526036 bytes .../native/simulator/public/json_writer.o | Bin 0 -> 471916 bytes .../native/simulator/public/plugin.o | Bin 0 -> 400112 bytes .../native/simulator/public/tokenizer.o | Bin 0 -> 145048 bytes .../native/simulator/src/CallKeyboard.o | Bin 0 -> 75616 bytes .../native/simulator/src/Logger.o | Bin 0 -> 55676 bytes .../native/simulator/src/keyboard_js.o | Bin 0 -> 95696 bytes .../native/simulator/src/keyboard_ndk.o | Bin 0 -> 373764 bytes .../src/blackberry10/native/src/Logger.cpp | 104 + .../src/blackberry10/native/src/Logger.hpp | 49 + .../blackberry10/native/src/keyboard_js.cpp | 117 ++ .../blackberry10/native/src/keyboard_js.hpp | 42 + .../blackberry10/native/src/keyboard_ndk.cpp | 155 ++ .../blackberry10/native/src/keyboard_ndk.hpp | 71 + .../src/ios/IonicKeyboard.h | 16 + .../src/ios/IonicKeyboard.m | 176 ++ .../src/windows/KeyboardProxy.js | 37 + .../www/android/keyboard.js | 60 + .../www/browser/keyboard.js | 34 + .../ionic-plugin-keyboard/www/ios/keyboard.js | 40 + www/css/colors.css | 253 +++ www/css/style.css | 12 + www/index.html | 2 + www/js/app.js | 15 +- www/js/main.js | 8 + www/templates/main.html | 29 + www/templates/menu.html | 33 +- 254 files changed, 33106 insertions(+), 19 deletions(-) create mode 100644 plugins/cordova-plugin-console/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-console/LICENSE create mode 100644 plugins/cordova-plugin-console/NOTICE create mode 100644 plugins/cordova-plugin-console/README.md create mode 100644 plugins/cordova-plugin-console/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-console/doc/de/README.md create mode 100644 plugins/cordova-plugin-console/doc/de/index.md create mode 100644 plugins/cordova-plugin-console/doc/es/README.md create mode 100644 plugins/cordova-plugin-console/doc/es/index.md create mode 100644 plugins/cordova-plugin-console/doc/fr/README.md create mode 100644 plugins/cordova-plugin-console/doc/fr/index.md create mode 100644 plugins/cordova-plugin-console/doc/it/README.md create mode 100644 plugins/cordova-plugin-console/doc/it/index.md create mode 100644 plugins/cordova-plugin-console/doc/ja/README.md create mode 100644 plugins/cordova-plugin-console/doc/ja/index.md create mode 100644 plugins/cordova-plugin-console/doc/ko/README.md create mode 100644 plugins/cordova-plugin-console/doc/ko/index.md create mode 100644 plugins/cordova-plugin-console/doc/pl/README.md create mode 100644 plugins/cordova-plugin-console/doc/pl/index.md create mode 100644 plugins/cordova-plugin-console/doc/ru/index.md create mode 100644 plugins/cordova-plugin-console/doc/zh/README.md create mode 100644 plugins/cordova-plugin-console/doc/zh/index.md create mode 100644 plugins/cordova-plugin-console/package.json create mode 100644 plugins/cordova-plugin-console/plugin.xml create mode 100644 plugins/cordova-plugin-console/src/ios/CDVLogger.h create mode 100644 plugins/cordova-plugin-console/src/ios/CDVLogger.m create mode 100644 plugins/cordova-plugin-console/src/ubuntu/console.cpp create mode 100644 plugins/cordova-plugin-console/src/ubuntu/console.h create mode 100644 plugins/cordova-plugin-console/src/wp/DebugConsole.cs create mode 100644 plugins/cordova-plugin-console/tests/plugin.xml create mode 100644 plugins/cordova-plugin-console/tests/tests.js create mode 100644 plugins/cordova-plugin-console/www/console-via-logger.js create mode 100644 plugins/cordova-plugin-console/www/logger.js create mode 100644 plugins/cordova-plugin-device/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-device/LICENSE create mode 100644 plugins/cordova-plugin-device/NOTICE create mode 100644 plugins/cordova-plugin-device/README.md create mode 100644 plugins/cordova-plugin-device/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-device/doc/de/README.md create mode 100644 plugins/cordova-plugin-device/doc/de/index.md create mode 100644 plugins/cordova-plugin-device/doc/es/README.md create mode 100644 plugins/cordova-plugin-device/doc/es/index.md create mode 100644 plugins/cordova-plugin-device/doc/fr/README.md create mode 100644 plugins/cordova-plugin-device/doc/fr/index.md create mode 100644 plugins/cordova-plugin-device/doc/it/README.md create mode 100644 plugins/cordova-plugin-device/doc/it/index.md create mode 100644 plugins/cordova-plugin-device/doc/ja/README.md create mode 100644 plugins/cordova-plugin-device/doc/ja/index.md create mode 100644 plugins/cordova-plugin-device/doc/ko/README.md create mode 100644 plugins/cordova-plugin-device/doc/ko/index.md create mode 100644 plugins/cordova-plugin-device/doc/pl/README.md create mode 100644 plugins/cordova-plugin-device/doc/pl/index.md create mode 100644 plugins/cordova-plugin-device/doc/ru/index.md create mode 100644 plugins/cordova-plugin-device/doc/zh/README.md create mode 100644 plugins/cordova-plugin-device/doc/zh/index.md create mode 100644 plugins/cordova-plugin-device/package.json create mode 100644 plugins/cordova-plugin-device/plugin.xml create mode 100644 plugins/cordova-plugin-device/src/android/Device.java create mode 100644 plugins/cordova-plugin-device/src/blackberry10/index.js create mode 100644 plugins/cordova-plugin-device/src/browser/DeviceProxy.js create mode 100644 plugins/cordova-plugin-device/src/firefoxos/DeviceProxy.js create mode 100644 plugins/cordova-plugin-device/src/ios/CDVDevice.h create mode 100644 plugins/cordova-plugin-device/src/ios/CDVDevice.m create mode 100644 plugins/cordova-plugin-device/src/osx/CDVDevice.h create mode 100644 plugins/cordova-plugin-device/src/osx/CDVDevice.m create mode 100644 plugins/cordova-plugin-device/src/tizen/DeviceProxy.js create mode 100644 plugins/cordova-plugin-device/src/ubuntu/device.cpp create mode 100644 plugins/cordova-plugin-device/src/ubuntu/device.h create mode 100644 plugins/cordova-plugin-device/src/ubuntu/device.js create mode 100644 plugins/cordova-plugin-device/src/windows/DeviceProxy.js create mode 100644 plugins/cordova-plugin-device/src/wp/Device.cs create mode 100644 plugins/cordova-plugin-device/tests/plugin.xml create mode 100644 plugins/cordova-plugin-device/tests/tests.js create mode 100644 plugins/cordova-plugin-device/www/device.js create mode 100644 plugins/cordova-plugin-splashscreen/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-splashscreen/LICENSE create mode 100644 plugins/cordova-plugin-splashscreen/NOTICE create mode 100644 plugins/cordova-plugin-splashscreen/README.md create mode 100644 plugins/cordova-plugin-splashscreen/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/de/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/de/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/es/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/es/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/fr/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/fr/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/it/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/it/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/ja/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/ja/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/ko/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/ko/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/pl/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/pl/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/ru/index.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/zh/README.md create mode 100644 plugins/cordova-plugin-splashscreen/doc/zh/index.md create mode 100644 plugins/cordova-plugin-splashscreen/package.json create mode 100644 plugins/cordova-plugin-splashscreen/plugin.xml create mode 100644 plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java create mode 100644 plugins/cordova-plugin-splashscreen/src/blackberry10/index.js create mode 100644 plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js create mode 100644 plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h create mode 100644 plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m create mode 100644 plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h create mode 100644 plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m create mode 100644 plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js create mode 100644 plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp create mode 100644 plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h create mode 100644 plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs create mode 100644 plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md create mode 100644 plugins/cordova-plugin-splashscreen/tests/ios/package.json create mode 100644 plugins/cordova-plugin-splashscreen/tests/plugin.xml create mode 100644 plugins/cordova-plugin-splashscreen/tests/tests.js create mode 100644 plugins/cordova-plugin-splashscreen/www/splashscreen.js create mode 100644 plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js create mode 100644 plugins/cordova-plugin-statusbar/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-statusbar/LICENSE create mode 100644 plugins/cordova-plugin-statusbar/NOTICE create mode 100644 plugins/cordova-plugin-statusbar/README.md create mode 100644 plugins/cordova-plugin-statusbar/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-statusbar/doc/de/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/de/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/es/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/es/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/fr/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/fr/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/it/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/it/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/ja/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/ja/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/ko/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/ko/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/pl/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/pl/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/ru/index.md create mode 100644 plugins/cordova-plugin-statusbar/doc/zh/README.md create mode 100644 plugins/cordova-plugin-statusbar/doc/zh/index.md create mode 100644 plugins/cordova-plugin-statusbar/package.json create mode 100644 plugins/cordova-plugin-statusbar/plugin.xml create mode 100644 plugins/cordova-plugin-statusbar/src/android/StatusBar.java create mode 100644 plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js create mode 100644 plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h create mode 100644 plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m create mode 100644 plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js create mode 100644 plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs create mode 100644 plugins/cordova-plugin-statusbar/tests/plugin.xml create mode 100644 plugins/cordova-plugin-statusbar/tests/tests.js create mode 100644 plugins/cordova-plugin-statusbar/www/statusbar.js create mode 100644 plugins/cordova-plugin-whitelist/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-whitelist/LICENSE create mode 100644 plugins/cordova-plugin-whitelist/NOTICE create mode 100644 plugins/cordova-plugin-whitelist/README.md create mode 100644 plugins/cordova-plugin-whitelist/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-whitelist/doc/de/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/es/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/fr/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/it/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/ja/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/ko/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/pl/README.md create mode 100644 plugins/cordova-plugin-whitelist/doc/zh/README.md create mode 100644 plugins/cordova-plugin-whitelist/package.json create mode 100644 plugins/cordova-plugin-whitelist/plugin.xml create mode 100644 plugins/cordova-plugin-whitelist/src/android/WhitelistPlugin.java create mode 100644 plugins/fetch.json create mode 100644 plugins/ionic-plugin-keyboard/LICENSE create mode 100644 plugins/ionic-plugin-keyboard/README.md create mode 100644 plugins/ionic-plugin-keyboard/package.json create mode 100644 plugins/ionic-plugin-keyboard/plugin.xml create mode 100644 plugins/ionic-plugin-keyboard/src/android/IonicKeyboard.java create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/index.js create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/.cproject create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/.project create mode 100755 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/libKeyboard.so create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/public/json_reader.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/public/json_value.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/public/json_writer.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/public/plugin.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/public/tokenizer.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/src/CallKeyboard.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/src/Logger.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/src/keyboard_js.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/device/src/keyboard_ndk.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/autolink.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/config.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/features.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/forwards.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/json.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/reader.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/value.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json/writer.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_batchallocator.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_internalarray.inl create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_internalmap.inl create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_reader.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_value.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_valueiterator.inl create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/json_writer.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/plugin.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/plugin.h create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/tokenizer.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/public/tokenizer.h create mode 100755 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/libKeyboard.so create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/public/json_reader.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/public/json_value.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/public/json_writer.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/public/plugin.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/public/tokenizer.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/src/CallKeyboard.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/src/Logger.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/src/keyboard_js.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/simulator/src/keyboard_ndk.o create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/Logger.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/Logger.hpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/keyboard_js.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/keyboard_js.hpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/keyboard_ndk.cpp create mode 100644 plugins/ionic-plugin-keyboard/src/blackberry10/native/src/keyboard_ndk.hpp create mode 100644 plugins/ionic-plugin-keyboard/src/ios/IonicKeyboard.h create mode 100644 plugins/ionic-plugin-keyboard/src/ios/IonicKeyboard.m create mode 100644 plugins/ionic-plugin-keyboard/src/windows/KeyboardProxy.js create mode 100644 plugins/ionic-plugin-keyboard/www/android/keyboard.js create mode 100644 plugins/ionic-plugin-keyboard/www/browser/keyboard.js create mode 100644 plugins/ionic-plugin-keyboard/www/ios/keyboard.js create mode 100644 www/css/colors.css create mode 100644 www/js/main.js create mode 100644 www/templates/main.html diff --git a/.gitignore b/.gitignore index e7a72b0..1ee312a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ node_modules/ platforms/ -plugins/ +#plugins/ npm-debug.log .idea/ www/lib/ diff --git a/plugins/cordova-plugin-console/CONTRIBUTING.md b/plugins/cordova-plugin-console/CONTRIBUTING.md new file mode 100644 index 0000000..4c8e6a5 --- /dev/null +++ b/plugins/cordova-plugin-console/CONTRIBUTING.md @@ -0,0 +1,37 @@ + + +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/contribute/). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/plugins/cordova-plugin-console/LICENSE b/plugins/cordova-plugin-console/LICENSE new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/plugins/cordova-plugin-console/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/NOTICE b/plugins/cordova-plugin-console/NOTICE new file mode 100644 index 0000000..8ec56a5 --- /dev/null +++ b/plugins/cordova-plugin-console/NOTICE @@ -0,0 +1,5 @@ +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/cordova-plugin-console/README.md b/plugins/cordova-plugin-console/README.md new file mode 100644 index 0000000..ebd0939 --- /dev/null +++ b/plugins/cordova-plugin-console/README.md @@ -0,0 +1,109 @@ +--- +title: Console +description: Get JavaScript logs in your native logs. +--- + + +|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI | +|:-:|:-:|:-:|:-:|:-:|:-:| +|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-console/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-console) + +# cordova-plugin-console + +This plugin is meant to ensure that console.log() is as useful as it can be. +It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows. If +you are happy with how console.log() works for you, then you probably +don't need this plugin. + +This plugin defines a global `console` object. + +Although the object is in the global scope, features provided by this plugin +are not available until after the `deviceready` event. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + +:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Console%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC) + + +## Installation + + cordova plugin add cordova-plugin-console + +### Android Quirks + +On some platforms other than Android, console.log() will act on multiple +arguments, such as console.log("1", "2", "3"). However, Android will act only +on the first argument. Subsequent arguments to console.log() will be ignored. +This plugin is not the cause of that, it is a limitation of Android itself. + +## Supported Methods + +The plugin support following methods of the `console` object: + +- `console.log` +- `console.error` +- `console.exception` +- `console.warn` +- `console.info` +- `console.debug` +- `console.assert` +- `console.dir` +- `console.dirxml` +- `console.time` +- `console.timeEnd` +- `console.table` + +## Partially supported Methods + +Methods of the `console` object which implemented, but behave different from browser implementation: + +- `console.group` +- `console.groupCollapsed` + +The grouping methods are just log name of the group and don't actually indicate grouping for later +calls to `console` object methods. + +## Not supported Methods + +Methods of the `console` object which are implemented, but do nothing: + +- `console.clear` +- `console.trace` +- `console.groupEnd` +- `console.timeStamp` +- `console.profile` +- `console.profileEnd` +- `console.count` + +## Supported formatting + +The following formatting options available: + +Format chars: + +* `%j` - format arg as JSON +* `%o` - format arg as JSON +* `%c` - format arg as `''`. No color formatting could be done. +* `%%` - replace with `'%'` + +Any other char following `%` will format its arg via `toString()`. diff --git a/plugins/cordova-plugin-console/RELEASENOTES.md b/plugins/cordova-plugin-console/RELEASENOTES.md new file mode 100644 index 0000000..582b739 --- /dev/null +++ b/plugins/cordova-plugin-console/RELEASENOTES.md @@ -0,0 +1,207 @@ + +# Release Notes + +### 1.0.5 (Dec 07, 2016) +* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…" +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version. +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Updated version and RELEASENOTES.md for release 1.0.4 +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies +* add JIRA issue tracker link +* Add badges for paramedic builds on Jenkins +* Add pull request template. +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md +* [CB-11091](https://issues.apache.org/jira/browse/CB-11091) Incremented plugin version. +* Updated version and RELEASENOTES.md for release 1.0.3 +* [CB-10720](https://issues.apache.org/jira/browse/CB-10720) Minor spelling/formatting changes. +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins +* chore: edit package.json license to match SPDX id +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Incremented plugin version. +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) linked issues in RELEASENOTES.md +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated version and RELEASENOTES.md for release 1.0.2 +* removed r prefix from tags +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated RELEASENOTES to be newest to oldest +* Actually fixing the contribute link. +* Fixing contribute link. +* Document formatting options for the console object +* [CB-5089](https://issues.apache.org/jira/browse/CB-5089) Document supported methods for console object +* reverted d58f218b9149d362ebb0b8ce697cf403569d14cd because logger is not needed on android +* remove travi-ci integration +* [CB-9192](https://issues.apache.org/jira/browse/CB-9192) Incremented plugin version. +* [CB-9202](https://issues.apache.org/jira/browse/CB-9202) updated repo url to github mirror in package.json +* [CB-9192](https://issues.apache.org/jira/browse/CB-9192) Updated version and RELEASENOTES.md for release 1.0.1 +* move logger.js and console-via-logger.js to common modules, instead of the numerous repeats that were there. +* clean up tests, info is below log level so it does not exist by default. +* add a couple tests +* [CB-9191](https://issues.apache.org/jira/browse/CB-9191) Add basic test +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-console documentation translation: cordova-plugin-console +* attempt to fix npm markdown issue +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Incremented plugin version. +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Updated version in package.json for release 1.0.0 +* Revert "CB-8858 Incremented plugin version." +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Incremented plugin version. +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Updated version and RELEASENOTES.md for release 1.0.0 +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* docs: renamed Windows8 to Windows +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* [CB-8560](https://issues.apache.org/jira/browse/CB-8560) Integrate TravisCI +* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-console documentation translation: cordova-plugin-console +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file +* [CB-8362](https://issues.apache.org/jira/browse/CB-8362) Add Windows platform section to Console plugin +* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Incremented plugin version. +* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Updated version and RELEASENOTES.md for release 0.2.13 +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use argumentForIndex rather than NSArray extension +* [CB-8110](https://issues.apache.org/jira/browse/CB-8110) Incremented plugin version. +* [CB-8110](https://issues.apache.org/jira/browse/CB-8110) Updated version and RELEASENOTES.md for release 0.2.12 +* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention deviceready in plugin docs +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-console documentation translation: cordova-plugin-console +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Incremented plugin version. +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Updated version and RELEASENOTES.md for release 0.2.11 +* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-console documentation translation: cordova-plugin-console +* [CB-7244](https://issues.apache.org/jira/browse/CB-7244) Incremented plugin version. +* [CB-7244](https://issues.apache.org/jira/browse/CB-7244) Updated version and RELEASENOTES.md for release 0.2.10 +* CB-7249cordova-plugin-console documentation translation: cordova-plugin-console +* CB-6127lisa6cordova-plugin-console documentation translation: cordova-plugin-console +* [CB-6877](https://issues.apache.org/jira/browse/CB-6877) Incremented plugin version. +* [CB-6877](https://issues.apache.org/jira/browse/CB-6877) Updated version and RELEASENOTES.md for release 0.2.9 +* [CB-6848](https://issues.apache.org/jira/browse/CB-6848) Add Android quirk, list applicable platforms +* [CB-6796](https://issues.apache.org/jira/browse/CB-6796) Add license +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md +* [CB-6452](https://issues.apache.org/jira/browse/CB-6452) Incremented plugin version on dev branch. +* [CB-6452](https://issues.apache.org/jira/browse/CB-6452) Updated version and RELEASENOTES.md for release 0.2.8 +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460) Update license headers +* Add NOTICE file +* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Incremented plugin version on dev branch. +* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Updated version and RELEASENOTES.md for release 0.2.7 +* Native console needs to be called DebugConsole to avoid ambiguous reference. This commit requires the 3.4.0 version of the native class factory +* [CB-4718](https://issues.apache.org/jira/browse/CB-4718) fixed Console plugin not work on wp +* [CB-5719](https://issues.apache.org/jira/browse/CB-5719) Incremented plugin version on dev branch. +* [CB-5719](https://issues.apache.org/jira/browse/CB-5719) Updated version and RELEASENOTES.md for release 0.2.6 +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Update license comment formatting of doc/index.md +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Console plugin +* [CB-5565](https://issues.apache.org/jira/browse/CB-5565) Incremented plugin version on dev branch. +* [CB-5565](https://issues.apache.org/jira/browse/CB-5565) Updated version and RELEASENOTES.md for release 0.2.5 +* add ubuntu platform +* [CB-5188](https://issues.apache.org/jira/browse/CB-5188) +* [CB-5188](https://issues.apache.org/jira/browse/CB-5188) Updated version and RELEASENOTES.md for release 0.2.4 +* [CB-5154](https://issues.apache.org/jira/browse/CB-5154) log formatting incorrectly to native +* [CB-5128](https://issues.apache.org/jira/browse/CB-5128) added repo + issue tag to plugin.xml for console plugin +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Updated version and RELEASENOTES.md for release 0.2.3 +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.console to org.apache.cordova.console +* Rename CHANGELOG.md -> RELEASENOTES.md +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. +* Add empty CHANGELOG.md +* [CB-4595](https://issues.apache.org/jira/browse/CB-4595) updated version +* reverted name element to be human readable +* updated name tag, namespace and readme +* [plugin.xml] standardizing license + meta +* [license] adding apache license file +* [Windows8] added support for windows8 [CB-4436](https://issues.apache.org/jira/browse/CB-4436) +* updating plugin.xml with registry data + +### 1.0.4 (Sep 08, 2016) +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to `cordovaDependencies` +* add `JIRA` issue tracker link +* Add badges for paramedic builds on Jenkins +* Add pull request template. +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md + +### 1.0.3 (Apr 15, 2016) +* [CB-10720](https://issues.apache.org/jira/browse/CB-10720) Minor spelling/formatting changes. +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins + +### 1.0.2 (Nov 18, 2015) +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest +* Fixing contribute link. +* Document formatting options for the console object +* [CB-5089](https://issues.apache.org/jira/browse/CB-5089) Document supported methods for console object +* reverted `d58f218b9149d362ebb0b8ce697cf403569d14cd` because `logger` is not needed on **Android** + +### 1.0.1 (Jun 17, 2015) +* move logger.js and console-via-logger.js to common modules, instead of the numerous repeats that were there. +* clean up tests, info is below log level so it does not exist by default. +* add a couple tests +* [CB-9191](https://issues.apache.org/jira/browse/CB-9191) Add basic test +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-console documentation translation: cordova-plugin-console +* attempt to fix npm markdown issue + +### 1.0.0 (Apr 15, 2015) +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* docs: renamed Windows8 to Windows +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* [CB-8560](https://issues.apache.org/jira/browse/CB-8560) Integrate TravisCI +* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-console documentation translation: cordova-plugin-console +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file +* [CB-8362](https://issues.apache.org/jira/browse/CB-8362) Add Windows platform section to Console plugin + +### 0.2.13 (Feb 04, 2015) +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension + +### 0.2.12 (Dec 02, 2014) +* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-console documentation translation: cordova-plugin-console + +### 0.2.11 (Sep 17, 2014) +* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-console documentation translation + +### 0.2.10 (Aug 06, 2014) +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs + +### 0.2.9 (Jun 05, 2014) +* [CB-6848](https://issues.apache.org/jira/browse/CB-6848) Add Android quirk, list applicable platforms +* [CB-6796](https://issues.apache.org/jira/browse/CB-6796) Add license +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md + +### 0.2.8 (Apr 17, 2014) +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers +* Add NOTICE file + +### 0.2.7 (Feb 05, 2014) +* Native console needs to be called DebugConsole to avoid ambiguous reference. This commit requires the 3.4.0 version of the native class factory +* [CB-4718](https://issues.apache.org/jira/browse/CB-4718) fixed Console plugin not working on wp + +### 0.2.6 (Jan 02, 2014) +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Console plugin + +### 0.2.5 (Dec 4, 2013) +* add ubuntu platform + +### 0.2.4 (Oct 28, 2013) +* [CB-5154](https://issues.apache.org/jira/browse/CB-5154) log formatting incorrectly to native +* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for console plugin +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. + +### 0.2.3 (Sept 25, 2013) +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.console to org.apache.cordova.console +* Rename CHANGELOG.md -> RELEASENOTES.md +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. + + diff --git a/plugins/cordova-plugin-console/doc/de/README.md b/plugins/cordova-plugin-console/doc/de/README.md new file mode 100644 index 0000000..933c1b7 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/de/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +Dieses Plugin stellt sicher, dass der Befehl console.log() so hilfreich ist, wie er sein kann. Es fĂĽgt zusätzliche Funktion fĂĽr iOS, Ubuntu, Windows Phone 8 und Windows. Teilweise kann es vorkommen, dass der Befehl console.log() nicht korrekt erkannt wird, und es zu Fehlern bzw. zu nicht angezeigten Logs in der Console kommt. Wenn Sie mit der derzeitigen Funktionsweise zufrieden sind, kann es sein, dass Sie dieses Plugin nicht benötigen. + +Dieses Plugin wird ein global-`console`-Objekt definiert. + +Obwohl das Objekt im globalen GĂĽltigkeitsbereich ist, stehen Features von diesem Plugin nicht bis nach dem `deviceready`-Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Installation + + cordova plugin add cordova-plugin-console + + +### Android Eigenarten + +Auf einigen Plattformen als Android fungieren console.log() auf mehrere Argumente wie console.log ("1", "2", "3"). Android wird jedoch nur auf das erste Argument fungieren. Nachfolgende Argumente zu console.log() werden ignoriert. Dieses Plugin ist nicht die Verantwortung dafĂĽr, es ist eine Einschränkung von Android selbst. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/de/index.md b/plugins/cordova-plugin-console/doc/de/index.md new file mode 100644 index 0000000..9551782 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/de/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +Dieses Plugin stellt sicher, dass der Befehl console.log() so hilfreich ist, wie er sein kann. Es fĂĽgt zusätzliche Funktion fĂĽr iOS, Ubuntu, Windows Phone 8 und Windows 8 hinzu. Teilweise kann es vorkommen, dass der Befehl console.log() nicht korrekt erkannt wird, und es zu Fehlern bzw. zu nicht angezeigten Logs in der Console kommt. Wenn Sie mit der derzeitigen Funktionsweise zufrieden sind, kann es sein, dass Sie dieses Plugin nicht benötigen. + +Dieses Plugin wird ein global-`console`-Objekt definiert. + +Obwohl das Objekt im globalen GĂĽltigkeitsbereich ist, stehen Features von diesem Plugin nicht bis nach dem `deviceready`-Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Installation + + cordova plugin add cordova-plugin-console + + +### Android Eigenarten + +Auf einigen Plattformen als Android fungieren console.log() auf mehrere Argumente wie console.log ("1", "2", "3"). Android wird jedoch nur auf das erste Argument fungieren. Nachfolgende Argumente zu console.log() werden ignoriert. Dieses Plugin ist nicht die Verantwortung dafĂĽr, es ist eine Einschränkung von Android selbst. diff --git a/plugins/cordova-plugin-console/doc/es/README.md b/plugins/cordova-plugin-console/doc/es/README.md new file mode 100644 index 0000000..b089d63 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/es/README.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +Este plugin es para asegurarse de que console.log() es tan Ăştil como puede ser. Agrega la funciĂłn adicional para iOS, Ubuntu, Windows Phone 8 y Windows. Si estás contento con cĂłmo funciona console.log() para ti, entonces probablemente no necesitas este plugin. + +Este plugin define un global `console` objeto. + +Aunque el objeto está en el ámbito global, caracterĂ­sticas proporcionadas por este plugin no están disponibles hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener ("deviceready", onDeviceReady, false); + function onDeviceReady() {console.log ("console.log funciona bien");} + + +## InstalaciĂłn + + cordova plugin add cordova-plugin-console + + +### Rarezas Android + +En algunas plataformas que no sean Android, console.log() actuará en varios argumentos, como console.log ("1", "2", "3"). Sin embargo, Android actuará sĂłlo en el primer argumento. Se omitirá posteriores argumentos para console.log(). Este plugin no es la causa de eso, es una limitaciĂłn propia de Android. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/es/index.md b/plugins/cordova-plugin-console/doc/es/index.md new file mode 100644 index 0000000..e6b8e68 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/es/index.md @@ -0,0 +1,39 @@ + + +# cordova-plugin-console + +Este plugin es para asegurarse de que console.log() es tan Ăştil como puede ser. Añade funciĂłn adicional para iOS, Windows Phone 8, Ubuntu y Windows 8. Si estás contento con cĂłmo funciona console.log() para ti, entonces probablemente no necesitas este plugin. + +Este plugin define un global `console` objeto. + +Aunque el objeto está en el ámbito global, caracterĂ­sticas proporcionadas por este plugin no están disponibles hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener ("deviceready", onDeviceReady, false); + function onDeviceReady() {console.log ("console.log funciona bien");} + + +## InstalaciĂłn + + Cordova plugin agregar cordova-plugin-console + + +### Rarezas Android + +En algunas plataformas que no sean Android, console.log() actuará en varios argumentos, como console.log ("1", "2", "3"). Sin embargo, Android actuará sĂłlo en el primer argumento. Se omitirá posteriores argumentos para console.log(). Este plugin no es la causa de eso, es una limitaciĂłn propia de Android. diff --git a/plugins/cordova-plugin-console/doc/fr/README.md b/plugins/cordova-plugin-console/doc/fr/README.md new file mode 100644 index 0000000..74207ac --- /dev/null +++ b/plugins/cordova-plugin-console/doc/fr/README.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +Ce plugin est destinĂ© Ă  faire en sorte que console.log() est aussi utile que possible. Il ajoute une fonction supplĂ©mentaire pour iOS, Ubuntu, Windows Phone 8 et Windows. Si vous ĂŞtes satisfait du fonctionnement de console.log() pour vous, alors vous avez probablement pas besoin ce plugin. + +Ce plugin dĂ©finit un global `console` objet. + +Bien que l'objet est dans la portĂ©e globale, les fonctions offertes par ce plugin ne sont pas disponibles jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener (« deviceready », onDeviceReady, false) ; + function onDeviceReady() {console.log ("console.log fonctionne bien");} + + +## Installation + + cordova plugin add cordova-plugin-console + + +### Quirks Android + +Sur certaines plateformes autres que Android, console.log() va agir sur plusieurs arguments, tels que console.log ("1", "2", "3"). Toutefois, Android doit agir uniquement sur le premier argument. Les arguments suivants Ă  console.log() seront ignorĂ©es. Ce plugin n'est pas la cause de cela, il s'agit d'une limitation d'Android lui-mĂŞme. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/fr/index.md b/plugins/cordova-plugin-console/doc/fr/index.md new file mode 100644 index 0000000..d0dbba5 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/fr/index.md @@ -0,0 +1,39 @@ + + +# cordova-plugin-console + +Ce plugin est destinĂ© Ă  faire en sorte que console.log() est aussi utile que possible. Il ajoute une fonction supplĂ©mentaire pour iOS, Ubuntu, Windows Phone 8 et Windows 8. Si vous ĂŞtes satisfait du fonctionnement de console.log() pour vous, alors vous avez probablement pas besoin ce plugin. + +Ce plugin dĂ©finit un global `console` objet. + +Bien que l'objet est dans la portĂ©e globale, les fonctions offertes par ce plugin ne sont pas disponibles jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener (« deviceready », onDeviceReady, false) ; + function onDeviceReady() {console.log ("console.log fonctionne bien");} + + +## Installation + + Cordova plugin ajouter cordova-plugin-console + + +### Quirks Android + +Sur certaines plateformes autres que Android, console.log() va agir sur plusieurs arguments, tels que console.log ("1", "2", "3"). Toutefois, Android doit agir uniquement sur le premier argument. Les arguments suivants Ă  console.log() seront ignorĂ©es. Ce plugin n'est pas la cause de cela, il s'agit d'une limitation d'Android lui-mĂŞme. diff --git a/plugins/cordova-plugin-console/doc/it/README.md b/plugins/cordova-plugin-console/doc/it/README.md new file mode 100644 index 0000000..5394d55 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/it/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +Questo plugin è intesa a garantire che console.log() è tanto utile quanto può essere. Aggiunge una funzione aggiuntiva per iOS, Ubuntu, Windows Phone 8 e Windows. Se sei soddisfatto di come console.log() funziona per voi, quindi probabilmente non è necessario questo plugin. + +Questo plugin definisce un oggetto globale `console`. + +Sebbene l'oggetto sia in ambito globale, funzionalitĂ  fornite da questo plugin non sono disponibili fino a dopo l'evento `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Installazione + + cordova plugin add cordova-plugin-console + + +### Stranezze Android + +Su alcune piattaforme diverse da Android, console.log() agirĂ  su piĂą argomenti, come ad esempio console ("1", "2", "3"). Tuttavia, Android agirĂ  solo sul primo argomento. Argomenti successivi a console.log() verranno ignorati. Questo plugin non è la causa di ciò, è una limitazione di Android stesso. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/it/index.md b/plugins/cordova-plugin-console/doc/it/index.md new file mode 100644 index 0000000..f0625b3 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/it/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +Questo plugin è intesa a garantire che console.log() è tanto utile quanto può essere. Aggiunge una funzione aggiuntiva per iOS, Ubuntu, Windows 8 e Windows Phone 8. Se sei soddisfatto di come console.log() funziona per voi, quindi probabilmente non è necessario questo plugin. + +Questo plugin definisce un oggetto globale `console`. + +Sebbene l'oggetto sia in ambito globale, funzionalitĂ  fornite da questo plugin non sono disponibili fino a dopo l'evento `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Installazione + + cordova plugin add cordova-plugin-console + + +### Stranezze Android + +Su alcune piattaforme diverse da Android, console.log() agirĂ  su piĂą argomenti, come ad esempio console ("1", "2", "3"). Tuttavia, Android agirĂ  solo sul primo argomento. Argomenti successivi a console.log() verranno ignorati. Questo plugin non è la causa di ciò, è una limitazione di Android stesso. diff --git a/plugins/cordova-plugin-console/doc/ja/README.md b/plugins/cordova-plugin-console/doc/ja/README.md new file mode 100644 index 0000000..059c373 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/ja/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +ă“ă®ă—ă©ă‚°ă‚¤ăłăŻă€ăťă® console.log() ăŚă™ă‚‹ă“ă¨ăŚă§ăŤăľă™äľżĺ©ăŞă“ă¨ă‚’確認ă™ă‚‹ă‚‚ă®ă§ă™ă€‚ ăťă‚ŚăŻ iOSă€Ubuntuă€Windows Phone 8 ăŻă€Windows ă«čż˝ĺŠ ă®é–˘ć•°ă‚’追加ă—ăľă™ă€‚ ĺ ´ĺăŻă‚ăŞăźă®ăźă‚ă® console.log() ă®ä˝śĺ“ă«ćş€č¶łă—ă¦ă„ă‚‹ă—ă€ăŠăťă‚‰ăŹĺż…č¦ăŻă‚ă‚Šăľă›ă‚“ă“ă®ă—ă©ă‚°ă‚¤ăłă€‚ + +ă“ă®ă—ă©ă‚°ă‚¤ăłă§ăŻă€ă‚°ă­ăĽăă« ă» `console` ă‚Şă–ジェクăを定義ă—ăľă™ă€‚ + +ă‚Şă–ジェクăăŻă€ă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ă§ă™ăŚă€ă“ă®ă—ă©ă‚°ă‚¤ăłă«ă‚ăŁă¦ćŹäľ›ă•ă‚Śă‚‹ć©źč˝ăŻă€`deviceready` イă™ăłăă®ĺľŚăľă§ä˝żç”¨ă§ăŤăľă›ă‚“。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-console + + +### Android ă®ç™– + +アăłă‰ă­ă‚¤ă‰ä»Ąĺ¤–ă®ă„ăŹă¤ă‹ă®ă—ă©ăăă•ă‚©ăĽă ă§ console.log() 㯠console.log (「1」ă€ă€Ś2」ă€ă€Ś3」) ăŞă©ă€č¤‡ć•°ă®ĺĽ•ć•°ă«ĺ‹•ä˝śă—ăľă™ă€‚ ă—ă‹ă—ă€ă‚˘ăłă‰ă­ă‚¤ă‰ăŻă€ćś€ĺťă®ĺĽ•ć•°ă§ă®ăżĺ‹•ä˝śă—ăľă™ă€‚ console.log() ă«ĺľŚç¶šă®ĺĽ•ć•°ăŻç„ˇč¦–ă•ă‚Śăľă™ă€‚ ă“ă®ă—ă©ă‚°ă‚¤ăłăŚĺŽźĺ› ă§ăŻăŞă„ă€ăťă‚ŚăŻ Android ă®č‡Şä˝“ă®ĺ¶é™ă§ă™ă€‚ \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/ja/index.md b/plugins/cordova-plugin-console/doc/ja/index.md new file mode 100644 index 0000000..413593c --- /dev/null +++ b/plugins/cordova-plugin-console/doc/ja/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +ă“ă®ă—ă©ă‚°ă‚¤ăłăŻă€ăťă® console.log() ăŚă™ă‚‹ă“ă¨ăŚă§ăŤăľă™äľżĺ©ăŞă“ă¨ă‚’確認ă™ă‚‹ă‚‚ă®ă§ă™ă€‚ ăťă‚ŚăŻă€iOSă€Ubuntuă€Windows Phone 8 ăŠă‚ăł Windows 8 ă®čż˝ĺŠ é–˘ć•°ă‚’追加ă—ăľă™ă€‚ ĺ ´ĺăŻă‚ăŞăźă®ăźă‚ă® console.log() ă®ä˝śĺ“ă«ćş€č¶łă—ă¦ă„ă‚‹ă—ă€ăŠăťă‚‰ăŹĺż…č¦ăŻă‚ă‚Šăľă›ă‚“ă“ă®ă—ă©ă‚°ă‚¤ăłă€‚ + +ă“ă®ă—ă©ă‚°ă‚¤ăłă§ăŻă€ă‚°ă­ăĽăă« ă» `console` ă‚Şă–ジェクăを定義ă—ăľă™ă€‚ + +ă‚Şă–ジェクăăŻă€ă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ă§ă™ăŚă€ă“ă®ă—ă©ă‚°ă‚¤ăłă«ă‚ăŁă¦ćŹäľ›ă•ă‚Śă‚‹ć©źč˝ăŻă€`deviceready` イă™ăłăă®ĺľŚăľă§ä˝żç”¨ă§ăŤăľă›ă‚“。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-console + + +### Android ă®ç™– + +アăłă‰ă­ă‚¤ă‰ä»Ąĺ¤–ă®ă„ăŹă¤ă‹ă®ă—ă©ăăă•ă‚©ăĽă ă§ console.log() 㯠console.log (「1」ă€ă€Ś2」ă€ă€Ś3」) ăŞă©ă€č¤‡ć•°ă®ĺĽ•ć•°ă«ĺ‹•ä˝śă—ăľă™ă€‚ ă—ă‹ă—ă€ă‚˘ăłă‰ă­ă‚¤ă‰ăŻă€ćś€ĺťă®ĺĽ•ć•°ă§ă®ăżĺ‹•ä˝śă—ăľă™ă€‚ console.log() ă«ĺľŚç¶šă®ĺĽ•ć•°ăŻç„ˇč¦–ă•ă‚Śăľă™ă€‚ ă“ă®ă—ă©ă‚°ă‚¤ăłăŚĺŽźĺ› ă§ăŻăŞă„ă€ăťă‚ŚăŻ Android ă®č‡Şä˝“ă®ĺ¶é™ă§ă™ă€‚ diff --git a/plugins/cordova-plugin-console/doc/ko/README.md b/plugins/cordova-plugin-console/doc/ko/README.md new file mode 100644 index 0000000..d03ee5a --- /dev/null +++ b/plugins/cordova-plugin-console/doc/ko/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +ěť´ 플러그인을 console.log()로 ě ěś ěš© ë도록 ěťëŻ¸ěž…ë‹ë‹¤. ę·¸ę˛ěť€ iOS, 우분í¬, Windows Phone 8, ë°Ź ě°˝ě— ëŚ€ í•ś 추가 기능을 추가합ë‹ë‹¤. Console.log() ë‹ąě‹ ěť„ ěś„í•´ 작동 í•ëŠ” 어떻게 행복 í•ś 경우ě—, 그때 당신은 ě•„ë§ í•„ěš” í•ě§€ 않습ë‹ë‹¤ěť´ 플러그인. + +ěť´ 플러그인 글로벌 `console` 개체를 ě •ěťí•©ë‹ë‹¤. + +개체가 ě „ě—­ ë˛”ěś„ě— ěžě§€ë§Ś,ěť´ í”Śëź¬ę·¸ěť¸ě— ěťí•´ ě śęłµ ë는 기능 í•ě§€ 사용할 ě ěžěŠµë‹ë‹¤ęąŚě§€ `deviceready` 이벤트 후. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## ě„¤ěą + + cordova plugin add cordova-plugin-console + + +### ě• ë“ś 로이드 ë‹¨ě  + +ě• ë“ś 로이드 ěť´ě™¸ěť ěťĽë¶€ 플랫폼ě—ě„ś console.log() console.log ("1", "2", "3")와 같이 여러 인ěě— ěž‘ëŹ™í•  ę˛ ěť´ë‹¤. 그러ë‚, ě• ë“ś 로이드는 첫 ë˛ě§¸ 인ěě—만 작동할 ę˛ ěť´ë‹¤. Console.log() 후속 인ě는 무시 ë©ë‹ë‹¤. ěť´ í”Śëź¬ę·¸ěť¸ěť ě›ěť¸ěť´ ë지 않습ë‹ë‹¤, 그리고 ę·¸ę˛ěť€ ě• ë“ś 로이드 ěžě˛´ěť í•śęł„ěž…ë‹ë‹¤. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/ko/index.md b/plugins/cordova-plugin-console/doc/ko/index.md new file mode 100644 index 0000000..ca631e4 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/ko/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +ěť´ 플러그인을 console.log()로 ě ěś ěš© ë도록 ěťëŻ¸ěž…ë‹ë‹¤. IOS, 우분í¬, Windows Phone 8 ë°Ź ěśëŹ„ěš° 8ě— ëŚ€ í•ś 추가 기능을 추가 í• ęł  í•©ë‹ë‹¤. Console.log() ë‹ąě‹ ěť„ ěś„í•´ 작동 í•ëŠ” 어떻게 행복 í•ś 경우ě—, 그때 당신은 ě•„ë§ í•„ěš” í•ě§€ 않습ë‹ë‹¤ěť´ 플러그인. + +ěť´ 플러그인 글로벌 `console` 개체를 ě •ěťí•©ë‹ë‹¤. + +개체가 ě „ě—­ ë˛”ěś„ě— ěžě§€ë§Ś,ěť´ í”Śëź¬ę·¸ěť¸ě— ěťí•´ ě śęłµ ë는 기능 í•ě§€ 사용할 ě ěžěŠµë‹ë‹¤ęąŚě§€ `deviceready` 이벤트 후. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## ě„¤ěą + + cordova plugin add cordova-plugin-console + + +### ě• ë“ś 로이드 ë‹¨ě  + +ě• ë“ś 로이드 ěť´ě™¸ěť ěťĽë¶€ 플랫폼ě—ě„ś console.log() console.log ("1", "2", "3")와 같이 여러 인ěě— ěž‘ëŹ™í•  ę˛ ěť´ë‹¤. 그러ë‚, ě• ë“ś 로이드는 첫 ë˛ě§¸ 인ěě—만 작동할 ę˛ ěť´ë‹¤. Console.log() 후속 인ě는 무시 ë©ë‹ë‹¤. ěť´ í”Śëź¬ę·¸ěť¸ěť ě›ěť¸ěť´ ë지 않습ë‹ë‹¤, 그리고 ę·¸ę˛ěť€ ě• ë“ś 로이드 ěžě˛´ěť í•śęł„ěž…ë‹ë‹¤. diff --git a/plugins/cordova-plugin-console/doc/pl/README.md b/plugins/cordova-plugin-console/doc/pl/README.md new file mode 100644 index 0000000..78ab9d2 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/pl/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +Ten plugin jest przeznaczona do zapewnienia, ĹĽe console.log() jest tak przydatne, jak to moĹĽe być. To dodaje dodatkowÄ… funkcjÄ™ dla iOS, Ubuntu, Windows Phone 8 i Windows. JeĹ›li jesteĹ› zadowolony z jak console.log() pracuje dla Ciebie, wtedy prawdopodobnie nie potrzebujÄ… tej wtyczki. + +Ten plugin definiuje obiekt globalny `console`. + +Mimo, ĹĽe obiekt jest w globalnym zasiÄ™gu, funkcji oferowanych przez ten plugin nie sÄ… dostÄ™pne dopiero po turnieju `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Instalacja + + cordova plugin add cordova-plugin-console + + +### Dziwactwa Androida + +Na niektĂłrych platformach innych niĹĽ Android console.log() bÄ™dzie dziaĹ‚ać na wielu argumentĂłw, takich jak console.log ("1", "2", "3"). Jednak Android bÄ™dzie dziaĹ‚ać tylko na pierwszy argument. Kolejne argumenty do console.log() bÄ™dÄ… ignorowane. Ten plugin nie jest przyczynÄ…, ĹĽe, jest to ograniczenie Androida, sam. \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/pl/index.md b/plugins/cordova-plugin-console/doc/pl/index.md new file mode 100644 index 0000000..922b577 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/pl/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +Ten plugin jest przeznaczona do zapewnienia, ĹĽe console.log() jest tak przydatne, jak to moĹĽe być. To dodaje dodatkowÄ… funkcjÄ™ dla iOS, Ubuntu, Windows Phone 8 i Windows 8. JeĹ›li jesteĹ› zadowolony z jak console.log() pracuje dla Ciebie, wtedy prawdopodobnie nie potrzebujÄ… tej wtyczki. + +Ten plugin definiuje obiekt globalny `console`. + +Mimo, ĹĽe obiekt jest w globalnym zasiÄ™gu, funkcji oferowanych przez ten plugin nie sÄ… dostÄ™pne dopiero po turnieju `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## Instalacja + + cordova plugin add cordova-plugin-console + + +### Dziwactwa Androida + +Na niektĂłrych platformach innych niĹĽ Android console.log() bÄ™dzie dziaĹ‚ać na wielu argumentĂłw, takich jak console.log ("1", "2", "3"). Jednak Android bÄ™dzie dziaĹ‚ać tylko na pierwszy argument. Kolejne argumenty do console.log() bÄ™dÄ… ignorowane. Ten plugin nie jest przyczynÄ…, ĹĽe, jest to ograniczenie Androida, sam. diff --git a/plugins/cordova-plugin-console/doc/ru/index.md b/plugins/cordova-plugin-console/doc/ru/index.md new file mode 100644 index 0000000..3cfe15d --- /dev/null +++ b/plugins/cordova-plugin-console/doc/ru/index.md @@ -0,0 +1,31 @@ + + +# cordova-plugin-console + +Этот плагин предназначен для обеŃпечения как полезным, поŃĐşĐľĐ»ŃŚĐşŃ ŃŤŃ‚Đľ может быть что console.log(). Он добавляет дополнительные Ń„Ńнкции для iOS, Ubuntu, Windows Phone 8 и Windows 8. Đ•Ńли вы не довольны как console.log() работает для ваŃ, Ń‚Đľ вы вероятно не Đ˝Ńжен этот плагин. + +## ĐŁŃтановка + + cordova plugin add cordova-plugin-console + + +### ĐžŃобенноŃти Android + +На некоторых платформах, отличных от Android console.log() бŃдет дейŃтвовать на неŃкольких аргŃментов, например console.log («1», «2», «3»). Тем не менее Android бŃдет дейŃтвовать только на первого аргŃмента. ПоŃледŃющие аргŃменты для console.log() бŃдет игнорироватьŃŃŹ. Этот плагин не являетŃŃŹ причиной этого, ŃŤŃ‚Đľ ограничение Android ŃĐ°ĐĽ. diff --git a/plugins/cordova-plugin-console/doc/zh/README.md b/plugins/cordova-plugin-console/doc/zh/README.md new file mode 100644 index 0000000..ce27c3e --- /dev/null +++ b/plugins/cordova-plugin-console/doc/zh/README.md @@ -0,0 +1,43 @@ + + +# cordova-plugin-console + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console) + +這個外掛程式ćŻç‚şäş†ç˘şäżťč©˛ console.log() ćŻä¸€ć¨Łćś‰ç”¨ďĽŚĺ®ĺŹŻä»ĄćŻă€‚ ĺ®ĺ°‡ć·»ĺŠ é™„加功č˝çš„ iOS,Ubuntu,Windows Phone 8 和視窗。 如果你ćŻĺż«ć¨‚č‡ console.log() ćŻĺ¦‚何為你工作,那麼可č˝ä¸Ťéś€č¦é€™ĺ€‹ĺ¤–掛程式。 + +這個外掛程式定義了一個全域 `console` 物件。 + +ĺ„管物件ćŻĺś¨ĺ…¨ç範圍內,ćŹäľ›é€™ĺ€‹ĺ¤–掛程式的功č˝ä¸ŤĺŹŻç”¨ç›´ĺ° `deviceready` 事件之後。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## 安裝 + + cordova plugin add cordova-plugin-console + + +### Android 的怪癖 + +在一些平臺上除了 Android,console.log() 亦ćść ąć“šĺ¤šĺ€‹ĺŹć•¸ďĽŚĺ¦‚ console.log ("1"ă€"2"ă€"3")。 然而,安卓系統只亦ćść ąć“šç¬¬ä¸€ĺ€‹ĺŹć•¸ă€‚ ĺ°Ť console.log() 的後續ĺŹć•¸ĺ°‡č˘«ĺż˝ç•Ąă€‚ 這個外掛程式不ćŻçš„原因,ĺ®ćŻä¸€ĺ€‹ android 作業系統本身的é™ĺ¶ă€‚ \ No newline at end of file diff --git a/plugins/cordova-plugin-console/doc/zh/index.md b/plugins/cordova-plugin-console/doc/zh/index.md new file mode 100644 index 0000000..e18a141 --- /dev/null +++ b/plugins/cordova-plugin-console/doc/zh/index.md @@ -0,0 +1,41 @@ + + +# cordova-plugin-console + +這個外掛程式ćŻç‚şäş†ç˘şäżťč©˛ console.log() ćŻä¸€ć¨Łćś‰ç”¨ďĽŚĺ®ĺŹŻä»ĄćŻă€‚ ĺ®ĺ°‡ć·»ĺŠ é™„加功č˝çš„ iOS〠Ubuntu,Windows Phone 8 ĺ’Ś Windows 8。 如果你ćŻĺż«ć¨‚č‡ console.log() ćŻĺ¦‚何為你工作,那麼可č˝ä¸Ťéś€č¦é€™ĺ€‹ĺ¤–掛程式。 + +這個外掛程式定義了一個全域 `console` 物件。 + +ĺ„管物件ćŻĺś¨ĺ…¨ç範圍內,ćŹäľ›é€™ĺ€‹ĺ¤–掛程式的功č˝ä¸ŤĺŹŻç”¨ç›´ĺ° `deviceready` 事件之後。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log("console.log works well"); + } + + +## 安裝 + + cordova plugin add cordova-plugin-console + + +### Android 的怪癖 + +在一些平臺上除了 Android,console.log() 亦ćść ąć“šĺ¤šĺ€‹ĺŹć•¸ďĽŚĺ¦‚ console.log ("1"ă€"2"ă€"3")。 然而,安卓系統只亦ćść ąć“šç¬¬ä¸€ĺ€‹ĺŹć•¸ă€‚ ĺ°Ť console.log() 的後續ĺŹć•¸ĺ°‡č˘«ĺż˝ç•Ąă€‚ 這個外掛程式不ćŻçš„原因,ĺ®ćŻä¸€ĺ€‹ android 作業系統本身的é™ĺ¶ă€‚ diff --git a/plugins/cordova-plugin-console/package.json b/plugins/cordova-plugin-console/package.json new file mode 100644 index 0000000..91ccc7c --- /dev/null +++ b/plugins/cordova-plugin-console/package.json @@ -0,0 +1,47 @@ +{ + "name": "cordova-plugin-console", + "version": "1.0.5", + "description": "Cordova Console Plugin", + "cordova": { + "id": "cordova-plugin-console", + "platforms": [ + "ios", + "ubuntu", + "wp7", + "wp8", + "windows8", + "windows" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/apache/cordova-plugin-console" + }, + "keywords": [ + "cordova", + "console", + "ecosystem:cordova", + "cordova-ios", + "cordova-ubuntu", + "cordova-wp7", + "cordova-wp8", + "cordova-windows8", + "cordova-windows" + ], + "scripts": { + "test": "npm run jshint", + "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests" + }, + "author": "Apache Software Foundation", + "license": "Apache-2.0", + "engines": { + "cordovaDependencies": { + "2.0.0": { + "cordova": ">100" + } + } + }, + "devDependencies": { + "jshint": "^2.6.0" + } +} diff --git a/plugins/cordova-plugin-console/plugin.xml b/plugins/cordova-plugin-console/plugin.xml new file mode 100644 index 0000000..114c665 --- /dev/null +++ b/plugins/cordova-plugin-console/plugin.xml @@ -0,0 +1,127 @@ + + + + + + Console + Cordova Console Plugin + Apache 2.0 + cordova,console + https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git + https://issues.apache.org/jira/browse/CB/component/12320644 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-console/src/ios/CDVLogger.h b/plugins/cordova-plugin-console/src/ios/CDVLogger.h new file mode 100644 index 0000000..7cfb306 --- /dev/null +++ b/plugins/cordova-plugin-console/src/ios/CDVLogger.h @@ -0,0 +1,26 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import + +@interface CDVLogger : CDVPlugin + +- (void)logLevel:(CDVInvokedUrlCommand*)command; + +@end diff --git a/plugins/cordova-plugin-console/src/ios/CDVLogger.m b/plugins/cordova-plugin-console/src/ios/CDVLogger.m new file mode 100644 index 0000000..ccfa3a5 --- /dev/null +++ b/plugins/cordova-plugin-console/src/ios/CDVLogger.m @@ -0,0 +1,38 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import "CDVLogger.h" +#import + +@implementation CDVLogger + +/* log a message */ +- (void)logLevel:(CDVInvokedUrlCommand*)command +{ + id level = [command argumentAtIndex:0]; + id message = [command argumentAtIndex:1]; + + if ([level isEqualToString:@"LOG"]) { + NSLog(@"%@", message); + } else { + NSLog(@"%@: %@", level, message); + } +} + +@end diff --git a/plugins/cordova-plugin-console/src/ubuntu/console.cpp b/plugins/cordova-plugin-console/src/ubuntu/console.cpp new file mode 100644 index 0000000..9de09f4 --- /dev/null +++ b/plugins/cordova-plugin-console/src/ubuntu/console.cpp @@ -0,0 +1,29 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "console.h" + +#include + +Console::Console(Cordova *cordova) : CPlugin(cordova) { +} + +void Console::logLevel(int scId, int ecId, QString level, QString message) { + Q_UNUSED(scId) + Q_UNUSED(ecId) + + if (level != "LOG") + std::cout << "[" << level.toStdString() << "] "; + std::cout << message.toStdString() << std::endl; +} diff --git a/plugins/cordova-plugin-console/src/ubuntu/console.h b/plugins/cordova-plugin-console/src/ubuntu/console.h new file mode 100644 index 0000000..3f3d163 --- /dev/null +++ b/plugins/cordova-plugin-console/src/ubuntu/console.h @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONSOLE_H_FDSVCXGFRS +#define CONSOLE_H_FDSVCXGFRS + +#include + +#include + +class Console : public CPlugin { + Q_OBJECT +public: + explicit Console(Cordova *cordova); + + virtual const QString fullName() override { + return Console::fullID(); + } + + virtual const QString shortName() override { + return "Console"; + } + + static const QString fullID() { + return "Console"; + } + +public slots: + void logLevel(int scId, int ecId, QString level, QString message); +}; + +#endif diff --git a/plugins/cordova-plugin-console/src/wp/DebugConsole.cs b/plugins/cordova-plugin-console/src/wp/DebugConsole.cs new file mode 100644 index 0000000..9bb5476 --- /dev/null +++ b/plugins/cordova-plugin-console/src/wp/DebugConsole.cs @@ -0,0 +1,47 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using System.Diagnostics; + +namespace WPCordovaClassLib.Cordova.Commands +{ + public class DebugConsole : BaseCommand + { + public void logLevel(string options) + { + string[] args = JSON.JsonHelper.Deserialize(options); + string level = args[0]; + string msg = args[1]; + + if (level.Equals("LOG")) + { + Debug.WriteLine(msg); + } + else + { + Debug.WriteLine(level + ": " + msg); + } + } + } +} diff --git a/plugins/cordova-plugin-console/tests/plugin.xml b/plugins/cordova-plugin-console/tests/plugin.xml new file mode 100644 index 0000000..da47af4 --- /dev/null +++ b/plugins/cordova-plugin-console/tests/plugin.xml @@ -0,0 +1,31 @@ + + + + + Cordova Console Plugin Tests + Apache 2.0 + + + + diff --git a/plugins/cordova-plugin-console/tests/tests.js b/plugins/cordova-plugin-console/tests/tests.js new file mode 100644 index 0000000..74765d9 --- /dev/null +++ b/plugins/cordova-plugin-console/tests/tests.js @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function () { + describe("Console", function () { + it("console.spec.1 should exist", function() { + expect(window.console).toBeDefined(); + }); + + it("console.spec.2 has required methods log|warn|error", function(){ + expect(window.console.log).toBeDefined(); + expect(typeof window.console.log).toBe('function'); + + expect(window.console.warn).toBeDefined(); + expect(typeof window.console.warn).toBe('function'); + + expect(window.console.error).toBeDefined(); + expect(typeof window.console.error).toBe('function'); + }); + }); +}; + +exports.defineManualTests = function (contentEl, createActionButton) {}; diff --git a/plugins/cordova-plugin-console/www/console-via-logger.js b/plugins/cordova-plugin-console/www/console-via-logger.js new file mode 100644 index 0000000..ffee326 --- /dev/null +++ b/plugins/cordova-plugin-console/www/console-via-logger.js @@ -0,0 +1,186 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +//------------------------------------------------------------------------------ + +var logger = require("./logger"); + +//------------------------------------------------------------------------------ +// object that we're exporting +//------------------------------------------------------------------------------ +var console = module.exports; + +//------------------------------------------------------------------------------ +// copy of the original console object +//------------------------------------------------------------------------------ +var WinConsole = window.console; + +//------------------------------------------------------------------------------ +// whether to use the logger +//------------------------------------------------------------------------------ +var UseLogger = false; + +//------------------------------------------------------------------------------ +// Timers +//------------------------------------------------------------------------------ +var Timers = {}; + +//------------------------------------------------------------------------------ +// used for unimplemented methods +//------------------------------------------------------------------------------ +function noop() {} + +//------------------------------------------------------------------------------ +// used for unimplemented methods +//------------------------------------------------------------------------------ +console.useLogger = function (value) { + if (arguments.length) UseLogger = !!value; + + if (UseLogger) { + if (logger.useConsole()) { + throw new Error("console and logger are too intertwingly"); + } + } + + return UseLogger; +}; + +//------------------------------------------------------------------------------ +console.log = function() { + if (logger.useConsole()) return; + logger.log.apply(logger, [].slice.call(arguments)); +}; + +//------------------------------------------------------------------------------ +console.error = function() { + if (logger.useConsole()) return; + logger.error.apply(logger, [].slice.call(arguments)); +}; + +//------------------------------------------------------------------------------ +console.warn = function() { + if (logger.useConsole()) return; + logger.warn.apply(logger, [].slice.call(arguments)); +}; + +//------------------------------------------------------------------------------ +console.info = function() { + if (logger.useConsole()) return; + logger.info.apply(logger, [].slice.call(arguments)); +}; + +//------------------------------------------------------------------------------ +console.debug = function() { + if (logger.useConsole()) return; + logger.debug.apply(logger, [].slice.call(arguments)); +}; + +//------------------------------------------------------------------------------ +console.assert = function(expression) { + if (expression) return; + + var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); + console.log("ASSERT: " + message); +}; + +//------------------------------------------------------------------------------ +console.clear = function() {}; + +//------------------------------------------------------------------------------ +console.dir = function(object) { + console.log("%o", object); +}; + +//------------------------------------------------------------------------------ +console.dirxml = function(node) { + console.log(node.innerHTML); +}; + +//------------------------------------------------------------------------------ +console.trace = noop; + +//------------------------------------------------------------------------------ +console.group = console.log; + +//------------------------------------------------------------------------------ +console.groupCollapsed = console.log; + +//------------------------------------------------------------------------------ +console.groupEnd = noop; + +//------------------------------------------------------------------------------ +console.time = function(name) { + Timers[name] = new Date().valueOf(); +}; + +//------------------------------------------------------------------------------ +console.timeEnd = function(name) { + var timeStart = Timers[name]; + if (!timeStart) { + console.warn("unknown timer: " + name); + return; + } + + var timeElapsed = new Date().valueOf() - timeStart; + console.log(name + ": " + timeElapsed + "ms"); +}; + +//------------------------------------------------------------------------------ +console.timeStamp = noop; + +//------------------------------------------------------------------------------ +console.profile = noop; + +//------------------------------------------------------------------------------ +console.profileEnd = noop; + +//------------------------------------------------------------------------------ +console.count = noop; + +//------------------------------------------------------------------------------ +console.exception = console.log; + +//------------------------------------------------------------------------------ +console.table = function(data, columns) { + console.log("%o", data); +}; + +//------------------------------------------------------------------------------ +// return a new function that calls both functions passed as args +//------------------------------------------------------------------------------ +function wrappedOrigCall(orgFunc, newFunc) { + return function() { + var args = [].slice.call(arguments); + try { orgFunc.apply(WinConsole, args); } catch (e) {} + try { newFunc.apply(console, args); } catch (e) {} + }; +} + +//------------------------------------------------------------------------------ +// For every function that exists in the original console object, that +// also exists in the new console object, wrap the new console method +// with one that calls both +//------------------------------------------------------------------------------ +for (var key in console) { + if (typeof WinConsole[key] == "function") { + console[key] = wrappedOrigCall(WinConsole[key], console[key]); + } +} diff --git a/plugins/cordova-plugin-console/www/logger.js b/plugins/cordova-plugin-console/www/logger.js new file mode 100644 index 0000000..430d887 --- /dev/null +++ b/plugins/cordova-plugin-console/www/logger.js @@ -0,0 +1,354 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +//------------------------------------------------------------------------------ +// The logger module exports the following properties/functions: +// +// LOG - constant for the level LOG +// ERROR - constant for the level ERROR +// WARN - constant for the level WARN +// INFO - constant for the level INFO +// DEBUG - constant for the level DEBUG +// logLevel() - returns current log level +// logLevel(value) - sets and returns a new log level +// useConsole() - returns whether logger is using console +// useConsole(value) - sets and returns whether logger is using console +// log(message,...) - logs a message at level LOG +// error(message,...) - logs a message at level ERROR +// warn(message,...) - logs a message at level WARN +// info(message,...) - logs a message at level INFO +// debug(message,...) - logs a message at level DEBUG +// logLevel(level,message,...) - logs a message specified level +// +//------------------------------------------------------------------------------ + +var logger = exports; + +var exec = require('cordova/exec'); + +var UseConsole = false; +var UseLogger = true; +var Queued = []; +var DeviceReady = false; +var CurrentLevel; + +var originalConsole = console; + +/** + * Logging levels + */ + +var Levels = [ + "LOG", + "ERROR", + "WARN", + "INFO", + "DEBUG" +]; + +/* + * add the logging levels to the logger object and + * to a separate levelsMap object for testing + */ + +var LevelsMap = {}; +for (var i=0; i 0){ + formatArgs.unshift(fmtString); // add formatString + } + + var message = logger.format.apply(logger.format, formatArgs); + + if (LevelsMap[level] === null) { + throw new Error("invalid logging level: " + level); + } + + if (LevelsMap[level] > CurrentLevel) return; + + // queue the message if not yet at deviceready + if (!DeviceReady && !UseConsole) { + Queued.push([level, message]); + return; + } + + // Log using the native logger if that is enabled + if (UseLogger) { + exec(null, null, "Console", "logLevel", [level, message]); + } + + // Log using the console if that is enabled + if (UseConsole) { + // make sure console is not using logger + if (console.useLogger()) { + throw new Error("console and logger are too intertwingly"); + } + + // log to the console + switch (level) { + case logger.LOG: originalConsole.log(message); break; + case logger.ERROR: originalConsole.log("ERROR: " + message); break; + case logger.WARN: originalConsole.log("WARN: " + message); break; + case logger.INFO: originalConsole.log("INFO: " + message); break; + case logger.DEBUG: originalConsole.log("DEBUG: " + message); break; + } + } +}; + + +/** + * Formats a string and arguments following it ala console.log() + * + * Any remaining arguments will be appended to the formatted string. + * + * for rationale, see FireBug's Console API: + * http://getfirebug.com/wiki/index.php/Console_API + */ +logger.format = function(formatString, args) { + return __format(arguments[0], [].slice.call(arguments,1)).join(' '); +}; + + +//------------------------------------------------------------------------------ +/** + * Formats a string and arguments following it ala vsprintf() + * + * format chars: + * %j - format arg as JSON + * %o - format arg as JSON + * %c - format arg as '' + * %% - replace with '%' + * any other char following % will format it's + * arg via toString(). + * + * Returns an array containing the formatted string and any remaining + * arguments. + */ +function __format(formatString, args) { + if (formatString === null || formatString === undefined) return [""]; + if (arguments.length == 1) return [formatString.toString()]; + + if (typeof formatString != "string") + formatString = formatString.toString(); + + var pattern = /(.*?)%(.)(.*)/; + var rest = formatString; + var result = []; + + while (args.length) { + var match = pattern.exec(rest); + if (!match) break; + + var arg = args.shift(); + rest = match[3]; + result.push(match[1]); + + if (match[2] == '%') { + result.push('%'); + args.unshift(arg); + continue; + } + + result.push(__formatted(arg, match[2])); + } + + result.push(rest); + + var remainingArgs = [].slice.call(args); + remainingArgs.unshift(result.join('')); + return remainingArgs; +} + +function __formatted(object, formatChar) { + + try { + switch(formatChar) { + case 'j': + case 'o': return JSON.stringify(object); + case 'c': return ''; + } + } + catch (e) { + return "error JSON.stringify()ing argument: " + e; + } + + if ((object === null) || (object === undefined)) { + return Object.prototype.toString.call(object); + } + + return object.toString(); +} + + +//------------------------------------------------------------------------------ +// when deviceready fires, log queued messages +logger.__onDeviceReady = function() { + if (DeviceReady) return; + + DeviceReady = true; + + for (var i=0; i + +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/contribute/). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/plugins/cordova-plugin-device/LICENSE b/plugins/cordova-plugin-device/LICENSE new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/plugins/cordova-plugin-device/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/plugins/cordova-plugin-device/NOTICE b/plugins/cordova-plugin-device/NOTICE new file mode 100644 index 0000000..8ec56a5 --- /dev/null +++ b/plugins/cordova-plugin-device/NOTICE @@ -0,0 +1,5 @@ +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/cordova-plugin-device/README.md b/plugins/cordova-plugin-device/README.md new file mode 100644 index 0000000..10b8016 --- /dev/null +++ b/plugins/cordova-plugin-device/README.md @@ -0,0 +1,311 @@ +--- +title: Device +description: Get device information. +--- + + +|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI | +|:-:|:-:|:-:|:-:|:-:|:-:| +|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-device)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-device/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-device)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-device/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-device)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-device/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-device)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-device/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-device)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-device/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device)| + +# cordova-plugin-device + +This plugin defines a global `device` object, which describes the device's hardware and software. +Although the object is in the global scope, it is not available until after the `deviceready` event. + +```js +document.addEventListener("deviceready", onDeviceReady, false); +function onDeviceReady() { + console.log(device.cordova); +} +``` + +Report issues with this plugin on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Device%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC) + + +## Installation + + cordova plugin add cordova-plugin-device + +## Properties + +- device.cordova +- device.model +- device.platform +- device.uuid +- device.version +- device.manufacturer +- device.isVirtual +- device.serial + +## device.cordova + +Get the version of Cordova running on the device. + +### Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- Browser +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows +- OSX + +## device.model + +The `device.model` returns the name of the device's model or +product. The value is set by the device manufacturer and may be +different across versions of the same product. + +### Supported Platforms + +- Android +- BlackBerry 10 +- Browser +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows +- OSX + +### Quick Example + +```js +// Android: Nexus One returns "Passion" (Nexus One code name) +// Motorola Droid returns "voles" +// BlackBerry: Torch 9800 returns "9800" +// Browser: Google Chrome returns "Chrome" +// Safari returns "Safari" +// iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models +// OSX: returns "x86_64" +// +var model = device.model; +``` + +### Android Quirks + +- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`. + +### Tizen Quirks + +- Returns the device model assigned by the vendor, for example, `TIZEN` + +### Windows Phone 7 and 8 Quirks + +- Returns the device model specified by the manufacturer. For example, the Samsung Focus returns `SGH-i917`. + +## device.platform + +Get the device's operating system name. + +```js +var string = device.platform; +``` +### Supported Platforms + +- Android +- BlackBerry 10 +- Browser +- Firefox OS +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows +- OSX + +### Quick Example + +```js +// Depending on the device, a few examples are: +// - "Android" +// - "BlackBerry 10" +// - "browser" +// - "iOS" +// - "WinCE" +// - "Tizen" +// - "Mac OS X" +var devicePlatform = device.platform; +``` + +### Windows Phone 7 Quirks + +Windows Phone 7 devices report the platform as `WinCE`. + +### Windows Phone 8 Quirks + +Windows Phone 8 devices report the platform as `Win32NT`. + +## device.uuid + +Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + +```js +var string = device.uuid; +``` + +### Description + +The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model. + +### Supported Platforms + +- Android +- BlackBerry 10 +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows +- OSX + +### Quick Example + +```js +// Android: Returns a random 64-bit integer (as a string, again!) +// The integer is generated on the device's first boot +// +// BlackBerry: Returns the PIN number of the device +// This is a nine-digit unique integer (as a string, though!) +// +// iPhone: (Paraphrased from the UIDevice Class documentation) +// Returns the [UIDevice identifierForVendor] UUID which is unique and the same for all apps installed by the same vendor. However the UUID can be different if the user deletes all apps from the vendor and then reinstalls it. +// Windows Phone 7 : Returns a hash of device+current user, +// if the user is not defined, a guid is generated and will persist until the app is uninstalled +// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number +// unique to every GSM and UMTS mobile phone. +var deviceID = device.uuid; +``` + +### iOS Quirk + +The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled. +Refer [here](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor) for details. +The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences. + +### OSX Quirk + +The `uuid` on OSX is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property. + +### Windows Phone 7 and 8 Quirks + +The `uuid` for Windows Phone 7 requires the permission +`ID_CAP_IDENTITY_DEVICE`. Microsoft will likely deprecate this +property soon. If the capability is not available, the application +generates a persistent guid that is maintained for the duration of the +application's installation on the device. + +## device.version + +Get the operating system version. + + var string = device.version; + +### Supported Platforms + +- Android 2.1+ +- BlackBerry 10 +- Browser +- iOS +- Tizen +- Windows Phone 7 and 8 +- Windows +- OSX + +### Quick Example + +```js +// Android: Froyo OS would return "2.2" +// Eclair OS would return "2.1", "2.0.1", or "2.0" +// Version can also return update level "2.1-update1" +// +// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" +// +// Browser: Returns version number for the browser +// +// iPhone: iOS 3.2 returns "3.2" +// +// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 +// Windows 8: return the current OS version, ex on Windows 8.1 returns 6.3.9600.16384 +// Tizen: returns "TIZEN_20120425_2" +// OSX: El Capitan would return "10.11.2" +// +var deviceVersion = device.version; +``` + +## device.manufacturer + +Get the device's manufacturer. + + var string = device.manufacturer; + +### Supported Platforms + +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows + +### Quick Example + +```js +// Android: Motorola XT1032 would return "motorola" +// BlackBerry: returns "BlackBerry" +// iPhone: returns "Apple" +// +var deviceManufacturer = device.manufacturer; +``` + +## device.isVirtual + +whether the device is running on a simulator. + +```js +var isSim = device.isVirtual; +``` + +### Supported Platforms + +- Android 2.1+ +- iOS +- Windows Phone 8 +- Windows +- OSX + +### OSX Quirk + +The `isVirtual` property on OS X always returns false. + +## device.serial + +Get the device hardware serial number ([SERIAL](http://developer.android.com/reference/android/os/Build.html#SERIAL)). + +```js +var string = device.serial; +``` + +### Supported Platforms + +- Android +- OSX + diff --git a/plugins/cordova-plugin-device/RELEASENOTES.md b/plugins/cordova-plugin-device/RELEASENOTES.md new file mode 100644 index 0000000..c06a44c --- /dev/null +++ b/plugins/cordova-plugin-device/RELEASENOTES.md @@ -0,0 +1,333 @@ + +# Release Notes + +### 1.1.4 (Dec 07, 2016) +* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…" +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version. +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Updated version and RELEASENOTES.md for release 1.1.3 +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies +* Add badges for paramedic builds on Jenkins +* Add pull request template. +* Readme: Add fenced code blocks with langauage hints +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md +* [CB-11091](https://issues.apache.org/jira/browse/CB-11091) Incremented plugin version. +* Updated version and RELEASENOTES.md for release 1.1.2 +* Close #49 +* Use passed device, follow create policy forf CFUUIDCreate +* [CB-10631](https://issues.apache.org/jira/browse/CB-10631) ios: Fix for device.uuid in iOS 5.1.1 +* Updating the comment to exclude URL +* Minor changes to readme +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins +* chore: edit package.json license to match SPDX id +* Refactored deviceInfo on iOS for better readability. +* [CB-10368](https://issues.apache.org/jira/browse/CB-10368) Incremented plugin version. +* [CB-10368](https://issues.apache.org/jira/browse/CB-10368) Updated version and RELEASENOTES.md for release 1.1.1 +* Property manufacturer documented +* fix typo +* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) Move device-plugin out from cordovalib to the plugin repository +* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) Move device-plugin out from cordovalib to the plugin repository +* [CB-9923](https://issues.apache.org/jira/browse/CB-9923) Update `device.platform` documentation for browser platform +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Incremented plugin version. +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) linked issues in RELEASENOTES.md +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated version and RELEASENOTES.md for release 1.1.0 +* removed r prefix from tags +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated RELEASENOTES to be newest to oldest +* fix whitespace tab to spaces +* Add `isVirtual` for Windows 8.x (Phone) platforms +* [CB-9847](https://issues.apache.org/jira/browse/CB-9847) Fixed merge error of 408c3a20be976ca5b814c9f161c31d4edf1c00fc +* Added basic Android support for hardware serial number +* Cleanup PRs. This closes #27. This closes #17. +* [CB-9865](https://issues.apache.org/jira/browse/CB-9865) Better simulator detection for iOS +* Actually fixing the contribute link. +* Fixing contribute link. +* fix merge conflict, for reals +* add JIRA issue tracker link +* updated docs +* Cleanup wp8 code +* WP8 implementation +* update to use TARGET_OS_SIMULATOR as TARGET_IPHONE_SIMULATOR is deprecated. +* update code to use 'isVirtual' +* create test to verify existence and type of new property 'isVirtual' +* add isSimulator for iOS & Android device +* Fixed typo +* Updated documentation to mention backwards compatibility +* Updated README to reflect new behaviour and quirks on iOS +* Check user defaults first to maintain backwards compatibility +* Revert "Check user defaults first to maintain backwards compatibility" +* Check user defaults first to maintain backwards compatibility +* Remove line incorrectly committed +* Changed UUID to use [UIDevice identifierForVendor] +* remove travis-ci +* [CB-9192](https://issues.apache.org/jira/browse/CB-9192) Incremented plugin version. +* [CB-9202](https://issues.apache.org/jira/browse/CB-9202) updated repo url to github mirror in package.json +* [CB-9192](https://issues.apache.org/jira/browse/CB-9192) Updated version and RELEASENOTES.md for release 1.0.1 +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device documentation translation: cordova-plugin-device +* Attempts to corrent npm markdown issue +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Incremented plugin version. +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Updated version in package.json for release 1.0.0 +* Revert "CB-8858 Incremented plugin version." +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Incremented plugin version. +* [CB-8858](https://issues.apache.org/jira/browse/CB-8858) Updated version and RELEASENOTES.md for release 1.0.0 +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* remove defunct windows8 version +* add travis badge +* update plugin path +* Add cross-plugin ios paramedic test running for TravisCI +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file +* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Incremented plugin version. +* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Updated version and RELEASENOTES.md for release 0.3.0 +* Fixes a syntax error introduced in 1a13ee0 +* [CB7285][Windows] add manufacturer property for windows, and cleanup +* [CB-7285](https://issues.apache.org/jira/browse/CB-7285) Add test for manufacturer property +* [CB-7285][WP8] add manufacturer info +* update of manufacturer name +* added device.manufacturer property for Android, iOS (Apple duh), Blackberry (RIM duh) +* Support for Windows Phone 8 ANID2 ANID is only supported up to Windows Phone 7.5 +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use a local copy of uniqueAppInstanceIdentifier rather than CordovaLib's version +* - Fixed a bug that caused an "cannot call method of undefined" error if the browser's user agent wasn't recognized - Added support for Internet Explorer user agent strings - NOTE: IE 11's user agent string does not include "MSIE", so "Trident" is searched for instead +* [CB-8110](https://issues.apache.org/jira/browse/CB-8110) Incremented plugin version. +* [CB-8110](https://issues.apache.org/jira/browse/CB-8110) Updated version and RELEASENOTES.md for release 0.2.13 +* Changing device.platform to always report the platform as "browser". +* [CB-5892](https://issues.apache.org/jira/browse/CB-5892) - Remove deprecated window.Settings +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device documentation translation: cordova-plugin-device +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Incremented plugin version. +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Updated version and RELEASENOTES.md for release 0.2.12 +* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device documentation translation: cordova-plugin-device +* [CB-7552](https://issues.apache.org/jira/browse/CB-7552) - device.name docs have not been removed +* [fxos] Fix cordova version +* added status box and documentation to manual tests +* [fxos] Fix cordova version +* added status box and documentation to manual tests +* Added plugin support for the browser +* [CB-7262](https://issues.apache.org/jira/browse/CB-7262) Adds support for universal windows apps. +* [CB-7244](https://issues.apache.org/jira/browse/CB-7244) Incremented plugin version. +* [CB-7244](https://issues.apache.org/jira/browse/CB-7244) Updated version and RELEASENOTES.md for release 0.2.11 +* update DeviceProxy.js +* [CB-7168](https://issues.apache.org/jira/browse/CB-7168) Moving Device autotests to plugin (aka new-style tests) +* CB-6127lisa7cordova-plugin-consolecordova-plugin-device documentation translation: cordova-plugin-device +* Use Windows system calls to get better info +* [CB-6877](https://issues.apache.org/jira/browse/CB-6877) Incremented plugin version. +* [CB-6877](https://issues.apache.org/jira/browse/CB-6877) Updated version and RELEASENOTES.md for release 0.2.10 +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #12 +* Changing 1.5 to 2.0 +* added firefoxos version - conversion +* added firefoxos version +* [CB-6800](https://issues.apache.org/jira/browse/CB-6800) Add license +* documentation translation: cordova-plugin-device +* Lisa testing pulling in plugins for plugin: cordova-plugin-device +* Lisa testing pulling in plugins for plugin: cordova-plugin-device +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md +* [CB-6452](https://issues.apache.org/jira/browse/CB-6452) Incremented plugin version on dev branch. +* [CB-6452](https://issues.apache.org/jira/browse/CB-6452) Updated version and RELEASENOTES.md for release 0.2.9 +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460) Update license headers +* [CB-6422](https://issues.apache.org/jira/browse/CB-6422) [windows8] use cordova/exec/proxy +* [CB-5105](https://issues.apache.org/jira/browse/CB-5105) Removed dead code for device.version +* Add NOTICE file +* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Incremented plugin version on dev branch. +* Lisa testing pulling in plugins for plugin: cordova-plugin-device +* Lisa testing pulling in plugins for plugin: cordova-plugin-device +* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Updated version and RELEASENOTES.md for release 0.2.8 +* src/tizen: Adding DeviceProxy. +* plugin.xml: Adding platform tizen. +* supported platforms updated +* Delete stale test/ directory +* Incremented plugin version on dev branch. +* Updated version and RELEASENOTES.md for release 0.2.7 +* [CB-5737](https://issues.apache.org/jira/browse/CB-5737) Fix exception on close caused by left over telephony code from [CB-5504](https://issues.apache.org/jira/browse/CB-5504) +* [CB-5719](https://issues.apache.org/jira/browse/CB-5719) Incremented plugin version on dev branch. +* [CB-5719](https://issues.apache.org/jira/browse/CB-5719) Updated version and RELEASENOTES.md for release 0.2.6 +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Update license comment formatting of doc/index.md +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc.index.md for Device plugin +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Delete stale snapshot of plugin docs +* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Moving Telephony Logic out of Device +* [CB-5565](https://issues.apache.org/jira/browse/CB-5565) Incremented plugin version on dev branch. +* [CB-5565](https://issues.apache.org/jira/browse/CB-5565) Updated version and RELEASENOTES.md for release 0.2.5 +* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script +* [ubuntu] use cordova/exec/proxy +* add ubuntu platform +* Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices +* 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos' +* [CB-5188](https://issues.apache.org/jira/browse/CB-5188) +* [CB-5188](https://issues.apache.org/jira/browse/CB-5188) Updated version and RELEASENOTES.md for release 0.2.4 +* [CB-5128](https://issues.apache.org/jira/browse/CB-5128) added repo + issue tag in plugin.xml for device plugin +* [CB-5085](https://issues.apache.org/jira/browse/CB-5085) device.cordova returning wrong value +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Updated version and RELEASENOTES.md for release 0.2.3 +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version +* [windows8] commandProxy has moved +* [BlackBerry10] removed uneeded permission tags in plugin.xml +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.device to org.apache.cordova.device +* Rename CHANGELOG.md -> RELEASENOTES.md +* updated to use commandProxy for ffos +* add firefoxos support +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. +* [BlackBerry10] removed uneeded permission tags in plugin.xml +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Updated version and changelog +* removed extraneous print statement +* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change +* removed extraneous print statement +* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change +* [CB-4595](https://issues.apache.org/jira/browse/CB-4595) updated version +* reverted name element to be user readable +* [CB-4417](https://issues.apache.org/jira/browse/CB-4417) Move cordova-plugin-device to its own Java package. +* updated namespace +* updated readme, namespace and name tag +* [plugin.xml] adding rim namespace +* [plugin.xml] adding android namespace +* [plugin.xml] standardizing license + meta +* [license] adding apache license file +* updating plugin.xml with registry data +* [Windows8] Windows8 is now supported +* added basic Device support for Windows8 + +### 1.1.3 (Sep 08, 2016) +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies +* Add badges for paramedic builds on Jenkins +* Add pull request template. +* Readme: Add fenced code blocks with langauage hints +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md` + +### 1.1.2 (Apr 15, 2016) +* Use passed device, follow create policy forf `CFUUIDCreate` +* [CB-10631](https://issues.apache.org/jira/browse/CB-10631) Fix for `device.uuid` in **iOS 5.1.1** +* Updating the comment to exclude URL +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins +* Refactored `deviceInfo` on **iOS** for better readability. + +### 1.1.1 (Jan 15, 2016) +* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) **OSX** Move `device-plugin` out from `cordovalib` to the plugin repository +* [CB-9923](https://issues.apache.org/jira/browse/CB-9923) Update `device.platform` documentation for **Browser** platform + +### 1.1.0 (Nov 18, 2015) +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest +* Add `isVirtual` for **Windows Phone 8.x** +* Added basic **Android** support for hardware serial number +* [CB-9865](https://issues.apache.org/jira/browse/CB-9865) Better simulator detection for **iOS** +* Fixing contribute link. +* Added **WP8** implementation +* update to use `TARGET_OS_SIMULATOR` as `TARGET_IPHONE_SIMULATOR` is deprecated. +* update code to use 'isVirtual' +* create test to verify existence and type of new property 'isVirtual' +* add `isSimulator` for **iOS** & **Android** device +* Updated documentation to mention backwards compatibility +* Updated **README** to reflect new behaviour and quirks on **iOS** +* Check user defaults first to maintain backwards compatibility +* Changed `UUID` to use `[UIDevice identifierForVendor]` + +### 1.0.1 (Jun 17, 2015) +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device documentation translation: cordova-plugin-device +* Attempts to corrent npm markdown issue + +### 1.0.0 (Apr 15, 2015) +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* remove defunct windows8 version +* add travis badge +* Add cross-plugin ios paramedic test running for TravisCI +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file + +### 0.3.0 (Feb 04, 2015) +* Added device.manufacturer property for Android, iOS, Blackberry, WP8 +* Support for Windows Phone 8 ANID2 ANID is only supported up to Windows Phone 7.5 +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use a local copy of uniqueAppInstanceIdentifier rather than CordovaLib's version +* browser: Fixed a bug that caused an "cannot call method of undefined" error if the browser's user agent wasn't recognized + +### 0.2.13 (Dec 02, 2014) +* Changing `device.platform` to always report the platform as "browser". +* [CB-5892](https://issues.apache.org/jira/browse/CB-5892) - Remove deprecated `window.Settings` +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device documentation translation: cordova-plugin-device +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin + +### 0.2.12 (Sep 17, 2014) +* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device documentation translation +* [CB-7552](https://issues.apache.org/jira/browse/CB-7552) device.name docs have not been removed +* [fxos] Fix cordova version +* added status box and documentation to manual tests +* [fxos] Fix cordova version +* added status box and documentation to manual tests +* Added plugin support for the browser +* [CB-7262](https://issues.apache.org/jira/browse/CB-7262) Adds support for universal windows apps. + +### 0.2.11 (Aug 06, 2014) +* [FFOS] update DeviceProxy.js +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs +* Use Windows system calls to get better info + +### 0.2.10 (Jun 05, 2014) +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #12 +* Changing 1.5 to 2.0 +* added firefoxos version - conversion +* added firefoxos version +* [CB-6800](https://issues.apache.org/jira/browse/CB-6800) Add license +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md + +### 0.2.9 (Apr 17, 2014) +* [CB-5105](https://issues.apache.org/jira/browse/CB-5105): [Android, windows8, WP, BlackBerry10] Removed dead code for device.version +* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers +* Add NOTICE file + +### 0.2.8 (Feb 05, 2014) +* Tizen support added + +### 0.2.7 (Jan 07, 2014) +* [CB-5737](https://issues.apache.org/jira/browse/CB-5737) Fix exception on close caused by left over telephony code from [CB-5504](https://issues.apache.org/jira/browse/CB-5504) + +### 0.2.6 (Jan 02, 2014) +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Device plugin +* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Moving Telephony Logic out of Device + +### 0.2.5 (Dec 4, 2013) +* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script +* [ubuntu] use cordova/exec/proxy +* add ubuntu platform +* Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices +* 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos' + +### 0.2.4 (Oct 28, 2013) +* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag in plugin.xml for device plugin +* [CB-5085](https://issues.apache.org/jira/browse/CB-5085) device.cordova returning wrong value +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. + +### 0.2.3 (Sept 25, 2013) +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version +* [windows8] commandProxy has moved +* [BlackBerry10] removed uneeded permission tags in plugin.xml +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.device to org.apache.cordova.device +* Rename CHANGELOG.md -> RELEASENOTES.md +* updated to use commandProxy for ffos +* add firefoxos support +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. + +### 0.2.1 (Sept 5, 2013) +* removed extraneous print statement +* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change diff --git a/plugins/cordova-plugin-device/doc/de/README.md b/plugins/cordova-plugin-device/doc/de/README.md new file mode 100644 index 0000000..81f89e9 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/de/README.md @@ -0,0 +1,203 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +Dieses Plugin definiert eine globale `device` -Objekt, das des Geräts Hard- und Software beschreibt. Das Objekt im globalen GĂĽltigkeitsbereich ist es zwar nicht verfĂĽgbar bis nach dem `deviceready` Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installation + + cordova plugin add cordova-plugin-device + + +## Eigenschaften + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +Rufen Sie die Version von Cordova, die auf dem Gerät ausgefĂĽhrt. + +### UnterstĂĽtzte Plattformen + + * Amazon Fire OS + * Android + * BlackBerry 10 + * Browser + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 und 8 + * Windows 8 + +## device.model + +Die `device.model` gibt den Namen der Modell- oder des Geräts zurĂĽck. Der Wert wird vom Gerätehersteller festgelegt und kann zwischen den Versionen des gleichen Produkts unterschiedlich sein. + +### UnterstĂĽtzte Plattformen + + * Android + * BlackBerry 10 + * Browser + * iOS + * Tizen + * Windows Phone 7 und 8 + * Windows 8 + +### Kurzes Beispiel + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Finden Sie unter http://theiphonewiki.com/wiki/index.php?title=Models / / Var-Modell = device.model; + + +### Android Eigenarten + + * Ruft den [Produktname](http://developer.android.com/reference/android/os/Build.html#PRODUCT) anstelle des [Modellnamens](http://developer.android.com/reference/android/os/Build.html#MODEL), das ist oft der Codename fĂĽr die Produktion. Beispielsweise das Nexus One gibt `Passion` , und Motorola Droid gibt`voles`. + +### Tizen Macken + + * Gibt z. B. das Gerätemodell von dem Kreditor zugeordnet,`TIZEN` + +### Windows Phone 7 und 8 Eigenarten + + * Gibt das vom Hersteller angegebenen Gerätemodell zurĂĽck. Beispielsweise gibt der Samsung-Fokus`SGH-i917`. + +## device.platform + +Name des Betriebssystems des Geräts zu erhalten. + + var string = device.platform; + + +### UnterstĂĽtzte Plattformen + + * Android + * BlackBerry 10 + * Browser4 + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 und 8 + * Windows 8 + +### Kurzes Beispiel + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 Macken + +Windows Phone 7 Geräte melden die Plattform als`WinCE`. + +### Windows Phone 8 Macken + +Windows Phone 8 Geräte melden die Plattform als`Win32NT`. + +## device.uuid + +Des Geräts Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier) zu erhalten). + + var string = device.uuid; + + +### Beschreibung + +Die Details wie eine UUID generiert wird werden vom Gerätehersteller und beziehen sich auf die Plattform oder das Modell des Geräts. + +### UnterstĂĽtzte Plattformen + + * Android + * BlackBerry 10 + * iOS + * Tizen + * Windows Phone 7 und 8 + * Windows 8 + +### Kurzes Beispiel + + / / Android: wird eine zufällige 64-Bit-Ganzzahl (als Zeichenfolge, wieder!) / / die ganze Zahl wird beim ersten Start des Geräts erzeugt / / / / BlackBerry: gibt die PIN-Nummer des Gerätes / / Dies ist eine neunstellige eindeutige Ganzzahl (als String, obwohl!) / / / / iPhone: (paraphrasiert aus der Dokumentation zur UIDevice-Klasse) / / liefert eine Reihe von Hash-Werte, die aus mehreren Hardware erstellt identifiziert. + / / Es ist gewährleistet, dass fĂĽr jedes Gerät eindeutig sein und kann nicht gebunden werden / / an den Benutzer weitergeleitet. + / / Windows Phone 7: gibt einen Hash des Gerät + aktueller Benutzer, / / wenn der Benutzer nicht definiert ist, eine Guid generiert und wird weiter bestehen, bis die app deinstalliert wird / / Tizen: gibt das Gerät IMEI (International Mobile Equipment Identity oder IMEI ist eine Zahl / / einzigartig fĂĽr jedes GSM- und UMTS-Handy. + var deviceID = device.uuid; + + +### iOS Quirk + +Die `uuid` auf iOS ist nicht eindeutig zu einem Gerät, aber fĂĽr jede Anwendung, fĂĽr jede Installation variiert. Es ändert sich, wenn Sie löschen und neu die app installieren, und möglicherweise auch beim iOS zu aktualisieren, oder auch ein Upgrade möglich die app pro Version (scheinbaren in iOS 5.1). Die `uuid` ist kein zuverlässiger Wert. + +### Windows Phone 7 und 8 Eigenarten + +Die `uuid` fĂĽr Windows Phone 7 die Berechtigung erfordert `ID_CAP_IDENTITY_DEVICE` . Microsoft wird diese Eigenschaft wahrscheinlich bald abzuschaffen. Wenn die Funktion nicht verfĂĽgbar ist, generiert die Anwendung eine persistente Guid, die fĂĽr die Dauer der Installation der Anwendung auf dem Gerät gewährleistet ist. + +## device.version + +Version des Betriebssystems zu erhalten. + + var string = device.version; + + +### UnterstĂĽtzte Plattformen + + * Android 2.1 + + * BlackBerry 10 + * Browser + * iOS + * Tizen + * Windows Phone 7 und 8 + * Windows 8 + +### Kurzes Beispiel + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/de/index.md b/plugins/cordova-plugin-device/doc/de/index.md new file mode 100644 index 0000000..e3a537e --- /dev/null +++ b/plugins/cordova-plugin-device/doc/de/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +Dieses Plugin definiert eine globale `device` -Objekt, das des Geräts Hard- und Software beschreibt. Das Objekt im globalen GĂĽltigkeitsbereich ist es zwar nicht verfĂĽgbar bis nach dem `deviceready` Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installation + + cordova plugin add cordova-plugin-device + + +## Eigenschaften + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Rufen Sie die Version von Cordova, die auf dem Gerät ausgefĂĽhrt. + +### UnterstĂĽtzte Plattformen + +* Amazon Fire OS +* Android +* BlackBerry 10 +* Browser +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 und 8 +* Windows 8 + +## device.model + +Die `device.model` gibt den Namen der Modell- oder des Geräts zurĂĽck. Der Wert wird vom Gerätehersteller festgelegt und kann zwischen den Versionen des gleichen Produkts unterschiedlich sein. + +### UnterstĂĽtzte Plattformen + +* Android +* BlackBerry 10 +* Browser +* iOS +* Tizen +* Windows Phone 7 und 8 +* Windows 8 + +### Kurzes Beispiel + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Finden Sie unter http://theiphonewiki.com/wiki/index.php?title=Models / / Var-Modell = device.model; + + +### Android Eigenarten + +* Ruft den [Produktname][1] anstelle des [Modellnamens][2], das ist oft der Codename fĂĽr die Produktion. Beispielsweise das Nexus One gibt `Passion` , und Motorola Droid gibt`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Tizen Macken + +* Gibt z. B. das Gerätemodell von dem Kreditor zugeordnet,`TIZEN` + +### Windows Phone 7 und 8 Eigenarten + +* Gibt das vom Hersteller angegebenen Gerätemodell zurĂĽck. Beispielsweise gibt der Samsung-Fokus`SGH-i917`. + +## device.platform + +Name des Betriebssystems des Geräts zu erhalten. + + var string = device.platform; + + +### UnterstĂĽtzte Plattformen + +* Android +* BlackBerry 10 +* Browser4 +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 und 8 +* Windows 8 + +### Kurzes Beispiel + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 Macken + +Windows Phone 7 Geräte melden die Plattform als`WinCE`. + +### Windows Phone 8 Macken + +Windows Phone 8 Geräte melden die Plattform als`Win32NT`. + +## device.uuid + +Des Geräts Universally Unique Identifier ([UUID][3] zu erhalten). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### Beschreibung + +Die Details wie eine UUID generiert wird werden vom Gerätehersteller und beziehen sich auf die Plattform oder das Modell des Geräts. + +### UnterstĂĽtzte Plattformen + +* Android +* BlackBerry 10 +* iOS +* Tizen +* Windows Phone 7 und 8 +* Windows 8 + +### Kurzes Beispiel + + / / Android: wird eine zufällige 64-Bit-Ganzzahl (als Zeichenfolge, wieder!) / / die ganze Zahl wird beim ersten Start des Geräts erzeugt / / / / BlackBerry: gibt die PIN-Nummer des Gerätes / / Dies ist eine neunstellige eindeutige Ganzzahl (als String, obwohl!) / / / / iPhone: (paraphrasiert aus der Dokumentation zur UIDevice-Klasse) / / liefert eine Reihe von Hash-Werte, die aus mehreren Hardware erstellt identifiziert. + / / Es ist gewährleistet, dass fĂĽr jedes Gerät eindeutig sein und kann nicht gebunden werden / / an den Benutzer weitergeleitet. + / / Windows Phone 7: gibt einen Hash des Gerät + aktueller Benutzer, / / wenn der Benutzer nicht definiert ist, eine Guid generiert und wird weiter bestehen, bis die app deinstalliert wird / / Tizen: gibt das Gerät IMEI (International Mobile Equipment Identity oder IMEI ist eine Zahl / / einzigartig fĂĽr jedes GSM- und UMTS-Handy. + var deviceID = device.uuid; + + +### iOS Quirk + +Die `uuid` auf iOS ist nicht eindeutig zu einem Gerät, aber fĂĽr jede Anwendung, fĂĽr jede Installation variiert. Es ändert sich, wenn Sie löschen und neu die app installieren, und möglicherweise auch beim iOS zu aktualisieren, oder auch ein Upgrade möglich die app pro Version (scheinbaren in iOS 5.1). Die `uuid` ist kein zuverlässiger Wert. + +### Windows Phone 7 und 8 Eigenarten + +Die `uuid` fĂĽr Windows Phone 7 die Berechtigung erfordert `ID_CAP_IDENTITY_DEVICE` . Microsoft wird diese Eigenschaft wahrscheinlich bald abzuschaffen. Wenn die Funktion nicht verfĂĽgbar ist, generiert die Anwendung eine persistente Guid, die fĂĽr die Dauer der Installation der Anwendung auf dem Gerät gewährleistet ist. + +## device.version + +Version des Betriebssystems zu erhalten. + + var string = device.version; + + +### UnterstĂĽtzte Plattformen + +* Android 2.1 + +* BlackBerry 10 +* Browser +* iOS +* Tizen +* Windows Phone 7 und 8 +* Windows 8 + +### Kurzes Beispiel + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/es/README.md b/plugins/cordova-plugin-device/doc/es/README.md new file mode 100644 index 0000000..a27abfb --- /dev/null +++ b/plugins/cordova-plugin-device/doc/es/README.md @@ -0,0 +1,216 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +Este plugin define un global `device` objeto que describe del dispositivo hardware y software. Aunque el objeto está en el ámbito global, no está disponible hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## InstalaciĂłn + + cordova plugin add cordova-plugin-device + + +## Propiedades + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +Obtener la versiĂłn de Cordova que se ejecuta en el dispositivo. + +### Plataformas soportadas + + * Amazon fire OS + * Android + * BlackBerry 10 + * Explorador + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 y 8 + * Windows 8 + +## device.model + +El `device.model` devuelve el nombre de modelo del dispositivo o producto. El valor es fijado por el fabricante del dispositivo y puede ser diferente a travĂ©s de versiones del mismo producto. + +### Plataformas soportadas + + * Android + * BlackBerry 10 + * Explorador + * iOS + * Tizen + * Windows Phone 7 y 8 + * Windows 8 + +### Ejemplo rápido + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models + // + var model = device.model; + + +### Rarezas Android + + * Obtiene el [nombre del producto](http://developer.android.com/reference/android/os/Build.html#PRODUCT) en lugar del [nombre de la modelo](http://developer.android.com/reference/android/os/Build.html#MODEL), que es a menudo el nombre de cĂłdigo de producciĂłn. Por ejemplo, el Nexus One devuelve `Passion` y Motorola Droid devuelve `voles`. + +### Rarezas Tizen + + * Devuelve que el modelo de dispositivo asignado por el proveedor, por ejemplo, `TIZEN` + +### Windows Phone 7 y 8 rarezas + + * Devuelve el modelo de dispositivo especificado por el fabricante. Por ejemplo, el Samsung Focus devuelve `SGH-i917`. + +## device.platform + +Obtener el nombre del sistema operativo del dispositivo. + + var string = device.platform; + + +### Plataformas soportadas + + * Android + * BlackBerry 10 + * Browser4 + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 y 8 + * Windows 8 + +### Ejemplo rápido + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 rarezas + +Dispositivos Windows Phone 7 informe de la plataforma como `WinCE`. + +### Windows Phone 8 rarezas + +Dispositivos Windows Phone 8 Informe la plataforma como `Win32NT`. + +## device.uuid + +Obtener identificador universalmente Ăşnica del dispositivo ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + + +### DescripciĂłn + +Los detalles de cĂłmo se genera un UUID son determinados por el fabricante del dispositivo y son especĂ­ficos a la plataforma del dispositivo o modelo. + +### Plataformas soportadas + + * Android + * BlackBerry 10 + * iOS + * Tizen + * Windows Phone 7 y 8 + * Windows 8 + +### Ejemplo rápido + + // Android: Returns a random 64-bit integer (as a string, again!) + // The integer is generated on the device's first boot + // + // BlackBerry: Returns the PIN number of the device + // This is a nine-digit unique integer (as a string, though!) + // + // iPhone: (Paraphrased from the UIDevice Class documentation) + // Returns a string of hash values created from multiple hardware identifies. + // It is guaranteed to be unique for every device and can't be tied + // to the user account. + // Windows Phone 7 : Returns a hash of device+current user, + // if the user is not defined, a guid is generated and will persist until the app is uninstalled + // Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number + // unique to every GSM and UMTS mobile phone. + var deviceID = device.uuid; + + +### Rarezas de iOS + +El `uuid` en iOS no es exclusiva de un dispositivo, pero varĂ­a para cada aplicaciĂłn, para cada instalaciĂłn. Cambia si puedes borrar y volver a instalar la aplicaciĂłn, y posiblemente tambiĂ©n cuándo actualizar iOS, o incluso mejorar la aplicaciĂłn por la versiĂłn (evidente en iOS 5.1). El `uuid` no es un valor confiable. + +### Windows Phone 7 y 8 rarezas + +El `uuid` para Windows Phone 7 requiere el permiso `ID_CAP_IDENTITY_DEVICE`. Microsoft pronto probablemente desaprueban esta propiedad. Si la capacidad no está disponible, la aplicaciĂłn genera un guid persistente que se mantiene durante la duraciĂłn de la instalaciĂłn de la aplicaciĂłn en el dispositivo. + +## device.version + +Obtener la versiĂłn del sistema operativo. + + var string = device.version; + + +### Plataformas soportadas + + * Android 2.1 + + * BlackBerry 10 + * Explorador + * iOS + * Tizen + * Windows Phone 7 y 8 + * Windows 8 + +### Ejemplo rápido + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/es/index.md b/plugins/cordova-plugin-device/doc/es/index.md new file mode 100644 index 0000000..f4a5897 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/es/index.md @@ -0,0 +1,220 @@ + + +# cordova-plugin-device + +Este plugin define un global `device` objeto que describe del dispositivo hardware y software. Aunque el objeto está en el ámbito global, no está disponible hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## InstalaciĂłn + + cordova plugin add cordova-plugin-device + + +## Propiedades + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Obtener la versiĂłn de Cordova que se ejecuta en el dispositivo. + +### Plataformas soportadas + +* Amazon fire OS +* Android +* BlackBerry 10 +* Explorador +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 y 8 +* Windows 8 + +## device.model + +El `device.model` devuelve el nombre de modelo del dispositivo o producto. El valor es fijado por el fabricante del dispositivo y puede ser diferente a travĂ©s de versiones del mismo producto. + +### Plataformas soportadas + +* Android +* BlackBerry 10 +* Explorador +* iOS +* Tizen +* Windows Phone 7 y 8 +* Windows 8 + +### Ejemplo rápido + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models + // + var model = device.model; + + +### Rarezas Android + +* Obtiene el [nombre del producto][1] en lugar del [nombre de la modelo][2], que es a menudo el nombre de cĂłdigo de producciĂłn. Por ejemplo, el Nexus One devuelve `Passion` y Motorola Droid devuelve `voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Rarezas Tizen + +* Devuelve que el modelo de dispositivo asignado por el proveedor, por ejemplo, `TIZEN` + +### Windows Phone 7 y 8 rarezas + +* Devuelve el modelo de dispositivo especificado por el fabricante. Por ejemplo, el Samsung Focus devuelve `SGH-i917`. + +## device.platform + +Obtener el nombre del sistema operativo del dispositivo. + + var string = device.platform; + + +### Plataformas soportadas + +* Android +* BlackBerry 10 +* Browser4 +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 y 8 +* Windows 8 + +### Ejemplo rápido + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 rarezas + +Dispositivos Windows Phone 7 informe de la plataforma como `WinCE`. + +### Windows Phone 8 rarezas + +Dispositivos Windows Phone 8 Informe la plataforma como `Win32NT`. + +## device.uuid + +Obtener identificador universalmente Ăşnica del dispositivo ([UUID][3]). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### DescripciĂłn + +Los detalles de cĂłmo se genera un UUID son determinados por el fabricante del dispositivo y son especĂ­ficos a la plataforma del dispositivo o modelo. + +### Plataformas soportadas + +* Android +* BlackBerry 10 +* iOS +* Tizen +* Windows Phone 7 y 8 +* Windows 8 + +### Ejemplo rápido + + // Android: devuelve un entero de 64 bits al azar (como una cadena, otra vez!) + // el entero es generado en el primer arranque del dispositivo + // + // BlackBerry: devuelve el nĂşmero PIN del dispositivo + // este es un entero Ăşnico de nueve dĂ­gitos (como una cadena, aunque!) + // + // iPhone: (parafraseado de la documentaciĂłn de la clase UIDevice) + // devuelve una cadena de valores hash creado a partir + // de mĂşltiples hardware identifica. + / / Está garantizado para ser Ăşnico para cada dispositivo y no puede ser atado / / a la cuenta de usuario. + // Windows Phone 7: devuelve un hash de dispositivo + usuario actual, + // si el usuario no está definido, un guid generado y persistirá hasta que se desinstala la aplicaciĂłn + // + // Tizen: devuelve el dispositivo IMEI (identidad de equipo mĂłvil internacional o IMEI es un nĂşmero + // Ăşnico para cada telĂ©fono mĂłvil GSM y UMTS. + var deviceID = device.uuid; + + +### iOS chanfle + +El `uuid` en iOS no es exclusiva de un dispositivo, pero varĂ­a para cada aplicaciĂłn, para cada instalaciĂłn. Cambia si puedes borrar y volver a instalar la aplicaciĂłn, y posiblemente tambiĂ©n cuándo actualizar iOS, o incluso mejorar la aplicaciĂłn por la versiĂłn (evidente en iOS 5.1). El `uuid` no es un valor confiable. + +### Windows Phone 7 y 8 rarezas + +El `uuid` para Windows Phone 7 requiere el permiso `ID_CAP_IDENTITY_DEVICE`. Microsoft pronto probablemente desaprueban esta propiedad. Si la capacidad no está disponible, la aplicaciĂłn genera un guid persistente que se mantiene durante la duraciĂłn de la instalaciĂłn de la aplicaciĂłn en el dispositivo. + +## device.version + +Obtener la versiĂłn del sistema operativo. + + var string = device.version; + + +### Plataformas soportadas + +* Android 2.1 + +* BlackBerry 10 +* Explorador +* iOS +* Tizen +* Windows Phone 7 y 8 +* Windows 8 + +### Ejemplo rápido + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. el Mango se vuelve 7.10.7720 + // Tizen: devuelve "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/fr/README.md b/plugins/cordova-plugin-device/doc/fr/README.md new file mode 100644 index 0000000..4101fd9 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/fr/README.md @@ -0,0 +1,215 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +Ce plugin dĂ©finit un global `device` objet qui dĂ©crit le matĂ©riel et les logiciels de l'appareil. Bien que l'objet est dans la portĂ©e globale, il n'est pas disponible jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installation + + cordova plugin add cordova-plugin-device + + +## PropriĂ©tĂ©s + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +Retourne la version de Cordova en cours d'exĂ©cution sur l'appareil. + +### Plates-formes supportĂ©es + + * Amazon Fire OS + * Android + * BlackBerry 10 + * Navigateur + * Firefox OS + * iOS + * Paciarelli + * Windows Phone 7 et 8 + * Windows 8 + +## device.model + +L'objet `device.model` retourne le nom du modèle de l'appareil/produit. Cette valeur est dĂ©finie par le fabricant du pĂ©riphĂ©rique et peut varier entre les diffĂ©rentes versions d'un mĂŞme produit. + +### Plates-formes supportĂ©es + + * Android + * BlackBerry 10 + * Navigateur + * iOS + * Paciarelli + * Windows Phone 7 et 8 + * Windows 8 + +### Exemple court + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Voir http://theiphonewiki.com/wiki/index.php?title=Models + // + var model = device.model; + + +### Quirks Android + + * Retourne le [nom du produit](http://developer.android.com/reference/android/os/Build.html#PRODUCT) au lieu du [nom du modèle](http://developer.android.com/reference/android/os/Build.html#MODEL), ce qui Ă©quivaut souvent au nom de code de production. Par exemple, `Passion` pour le Nexus One et `voles` pour le Motorola Droid. + +### Bizarreries de paciarelli + + * Retourne le modèle du dispositif, assignĂ© par le vendeur, par exemple `TIZEN` + +### Notes au sujet de Windows Phone 7 et 8 + + * Retourne le modèle de l'appareil spĂ©cifiĂ© par le fabricant. Par exemple `SGH-i917` pour le Samsung Focus. + +## device.platform + +Obtenir le nom de système d'exploitation de l'appareil. + + var string = device.platform; + + +### Plates-formes supportĂ©es + + * Android + * BlackBerry 10 + * Browser4 + * Firefox OS + * iOS + * Paciarelli + * Windows Phone 7 et 8 + * Windows 8 + +### Exemple court + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 Quirks + +Appareils Windows Phone 7 rapport de la plate-forme comme`WinCE`. + +### Notes au sujet de Windows Phone 8 + +Appareils Windows Phone 8 rapport de la plate-forme comme`Win32NT`. + +## device.uuid + +Obtenir Universally Unique Identifier de l'appareil ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + + +### Description + +Les dĂ©tails de comment un UUID gĂ©nĂ©rĂ© sont dĂ©terminĂ©es par le fabricant du pĂ©riphĂ©rique et sont spĂ©cifiques Ă  la plate-forme ou le modèle de l'appareil. + +### Plates-formes supportĂ©es + + * Android + * BlackBerry 10 + * iOS + * Paciarelli + * Windows Phone 7 et 8 + * Windows 8 + +### Exemple court + + // Android : retourne un nombre entier 64-bit alĂ©atoire (sous la forme d'une chaĂ®ne de caractères, encore !) + // Ce nombre entier est gĂ©nĂ©rĂ© lors du premier dĂ©marrage de l'appareil + // + // BlackBerry : retourne le numĂ©ro PIN de l'appareil + // Il s'agit d'un nombre entier unique Ă  neuf chiffres (sous la forme d'une chaĂ®ne de caractères cependant !) + // + // iPhone : (copiĂ© depuis la documentation de la classe UIDevice) + // Retourne une chaĂ®ne de caractères gĂ©nĂ©rĂ©e Ă  partir de plusieurs caractĂ©ristiques matĂ©rielles. + / / Il est garanti pour ĂŞtre unique pour chaque appareil et ne peut pas ĂŞtre liĂ© / / pour le compte d'utilisateur. + // Windows Phone 7 : retourne un hashage gĂ©nĂ©rĂ© Ă  partir de appareil+utilisateur actuel, + // si aucun utilisateur n'est dĂ©fini, un guid est gĂ©nĂ©rĂ© persistera jusqu'Ă  ce que l'application soit dĂ©sinstallĂ©e + // Tizen : retourne le numĂ©ro IMEI (International Mobile Equipment Identity) de l'appareil, ce numĂ©ro est + // unique pour chaque tĂ©lĂ©phone GSM et UMTS. + var deviceID = device.uuid; + + +### SpĂ©cificitĂ©s iOS + +Le `uuid` sur iOS n'est pas propre Ă  un pĂ©riphĂ©rique, mais varie pour chaque application, pour chaque installation. Elle change si vous supprimez, puis rĂ©installez l'application, et Ă©ventuellement aussi quand vous mettre Ă  jour d'iOS, ou mĂŞme mettre Ă  jour le soft par version (apparent dans iOS 5.1). Le `uuid` n'est pas une valeur fiable. + +### Notes au sujet de Windows Phone 7 et 8 + +Le `uuid` pour Windows Phone 7 requiert l'autorisation `ID_CAP_IDENTITY_DEVICE` . Microsoft va probablement bientĂ´t obsolète de cette propriĂ©tĂ©. Si la capacitĂ© n'est pas disponible, l'application gĂ©nère un guid persistant qui est maintenu pendant toute la durĂ©e de l'installation de l'application sur le pĂ©riphĂ©rique. + +## device.version + +TĂ©lĂ©chargez la version de système d'exploitation. + + var string = device.version; + + +### Plates-formes supportĂ©es + + * Android 2.1+ + * BlackBerry 10 + * Navigateur + * iOS + * Paciarelli + * Windows Phone 7 et 8 + * Windows 8 + +### Exemple court + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/fr/index.md b/plugins/cordova-plugin-device/doc/fr/index.md new file mode 100644 index 0000000..163e498 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/fr/index.md @@ -0,0 +1,218 @@ + + +# cordova-plugin-device + +Ce plugin dĂ©finit un global `device` objet qui dĂ©crit le matĂ©riel et les logiciels de l'appareil. Bien que l'objet est dans la portĂ©e globale, il n'est pas disponible jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installation + + cordova plugin add cordova-plugin-device + + +## PropriĂ©tĂ©s + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Retourne la version de Cordova en cours d'exĂ©cution sur l'appareil. + +### Plates-formes prises en charge + +* Amazon Fire OS +* Android +* BlackBerry 10 +* Navigateur +* Firefox OS +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +## device.model + +L'objet `device.model` retourne le nom du modèle de l'appareil/produit. Cette valeur est dĂ©finie par le fabricant du pĂ©riphĂ©rique et peut varier entre les diffĂ©rentes versions d'un mĂŞme produit. + +### Plates-formes prises en charge + +* Android +* BlackBerry 10 +* Navigateur +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +### Petit exemple + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Voir http://theiphonewiki.com/wiki/index.php?title=Models + // + var model = device.model; + + +### Quirks Android + +* Retourne le [nom du produit][1] au lieu du [nom du modèle][2], ce qui Ă©quivaut souvent au nom de code de production. Par exemple, `Passion` pour le Nexus One et `voles` pour le Motorola Droid. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Bizarreries de paciarelli + +* Retourne le modèle du dispositif, assignĂ© par le vendeur, par exemple `TIZEN` + +### Windows Phone 7 et 8 Quirks + +* Retourne le modèle de l'appareil spĂ©cifiĂ© par le fabricant. Par exemple `SGH-i917` pour le Samsung Focus. + +## device.platform + +Obtenir le nom de système d'exploitation de l'appareil. + + var string = device.platform; + + +### Plates-formes prises en charge + +* Android +* BlackBerry 10 +* Browser4 +* Firefox OS +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +### Petit exemple + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 Quirks + +Appareils Windows Phone 7 rapport de la plate-forme comme`WinCE`. + +### Notes au sujet de Windows Phone 8 + +Appareils Windows Phone 8 rapport de la plate-forme comme`Win32NT`. + +## device.uuid + +Obtenir Universally Unique Identifier de l'appareil ([UUID][3]). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### Description + +Les dĂ©tails de comment un UUID gĂ©nĂ©rĂ© sont dĂ©terminĂ©es par le fabricant du pĂ©riphĂ©rique et sont spĂ©cifiques Ă  la plate-forme ou le modèle de l'appareil. + +### Plates-formes prises en charge + +* Android +* BlackBerry 10 +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +### Petit exemple + + // Android : retourne un nombre entier 64-bit alĂ©atoire (sous la forme d'une chaĂ®ne de caractères, encore !) + // Ce nombre entier est gĂ©nĂ©rĂ© lors du premier dĂ©marrage de l'appareil + // + // BlackBerry : retourne le numĂ©ro PIN de l'appareil + // Il s'agit d'un nombre entier unique Ă  neuf chiffres (sous la forme d'une chaĂ®ne de caractères cependant !) + // + // iPhone : (copiĂ© depuis la documentation de la classe UIDevice) + // Retourne une chaĂ®ne de caractères gĂ©nĂ©rĂ©e Ă  partir de plusieurs caractĂ©ristiques matĂ©rielles. + / / Il est garanti pour ĂŞtre unique pour chaque appareil et ne peut pas ĂŞtre liĂ© / / pour le compte d'utilisateur. + // Windows Phone 7 : retourne un hashage gĂ©nĂ©rĂ© Ă  partir de appareil+utilisateur actuel, + // si aucun utilisateur n'est dĂ©fini, un guid est gĂ©nĂ©rĂ© persistera jusqu'Ă  ce que l'application soit dĂ©sinstallĂ©e + // Tizen : retourne le numĂ©ro IMEI (International Mobile Equipment Identity) de l'appareil, ce numĂ©ro est + // unique pour chaque tĂ©lĂ©phone GSM et UMTS. + var deviceID = device.uuid; + + +### SpĂ©cificitĂ©s iOS + +Le `uuid` sur iOS n'est pas propre Ă  un pĂ©riphĂ©rique, mais varie pour chaque application, pour chaque installation. Elle change si vous supprimez, puis rĂ©installez l'application, et Ă©ventuellement aussi quand vous mettre Ă  jour d'iOS, ou mĂŞme mettre Ă  jour le soft par version (apparent dans iOS 5.1). Le `uuid` n'est pas une valeur fiable. + +### Windows Phone 7 et 8 Quirks + +Le `uuid` pour Windows Phone 7 requiert l'autorisation `ID_CAP_IDENTITY_DEVICE` . Microsoft va probablement bientĂ´t obsolète de cette propriĂ©tĂ©. Si la capacitĂ© n'est pas disponible, l'application gĂ©nère un guid persistant qui est maintenu pendant toute la durĂ©e de l'installation de l'application sur le pĂ©riphĂ©rique. + +## device.version + +TĂ©lĂ©chargez la version de système d'exploitation. + + var string = device.version; + + +### Plates-formes prises en charge + +* Android 2.1+ +* BlackBerry 10 +* Navigateur +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +### Petit exemple + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/it/README.md b/plugins/cordova-plugin-device/doc/it/README.md new file mode 100644 index 0000000..7974962 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/it/README.md @@ -0,0 +1,203 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +Questo plugin definisce un global `device` oggetto che descrive il dispositivo hardware e software. Sebbene l'oggetto sia in ambito globale, non è disponibile fino a dopo il `deviceready` evento. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installazione + + cordova plugin add cordova-plugin-device + + +## ProprietĂ  + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +Ottenere la versione di Cordova in esecuzione nel dispositivo. + +### Piattaforme supportate + + * Amazon fuoco OS + * Android + * BlackBerry 10 + * Browser + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 e 8 + * Windows 8 + +## device.model + +Il `device.model` restituisce il nome del modello del dispositivo o del prodotto. Il valore viene impostato dal produttore del dispositivo e può essere differente tra le versioni dello stesso prodotto. + +### Piattaforme supportate + + * Android + * BlackBerry 10 + * Browser + * iOS + * Tizen + * Windows Phone 7 e 8 + * Windows 8 + +### Esempio rapido + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Vedi http://theiphonewiki.com/wiki/index.php?title=Models / / modello var = device.model; + + +### Stranezze Android + + * Ottiene il [nome del prodotto](http://developer.android.com/reference/android/os/Build.html#PRODUCT) anzichĂ© il [nome del modello](http://developer.android.com/reference/android/os/Build.html#MODEL), che è spesso il nome di codice di produzione. Ad esempio, restituisce il Nexus One `Passion` , e Motorola Droid restituisce`voles`. + +### Tizen stranezze + + * Restituisce il modello di dispositivo assegnato dal fornitore, ad esempio,`TIZEN` + +### Windows Phone 7 e 8 stranezze + + * Restituisce il modello di dispositivo specificato dal produttore. Ad esempio, restituisce il Samsung Focus`SGH-i917`. + +## device.platform + +Ottenere il nome del sistema operativo del dispositivo. + + var string = device.platform; + + +### Piattaforme supportate + + * Android + * BlackBerry 10 + * Browser4 + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 e 8 + * Windows 8 + +### Esempio rapido + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 capricci + +Windows Phone 7 dispositivi segnalano la piattaforma come`WinCE`. + +### Windows Phone 8 stranezze + +Dispositivi Windows Phone 8 segnalano la piattaforma come`Win32NT`. + +## device.uuid + +Ottenere identificatore del dispositivo univoco universale ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + + +### Descrizione + +I dettagli di come viene generato un UUID sono determinati dal produttore del dispositivo e sono specifici per la piattaforma o il modello del dispositivo. + +### Piattaforme supportate + + * Android + * BlackBerry 10 + * iOS + * Tizen + * Windows Phone 7 e 8 + * Windows 8 + +### Esempio rapido + + / / Android: restituisce un intero casuale di 64 bit (come stringa, ancora una volta!) / / il numero intero è generato al primo avvio del dispositivo / / / / BlackBerry: restituisce il numero PIN del dispositivo / / questo è un valore integer univoco a nove cifre (come stringa, benchè!) / / / / iPhone: (parafrasato dalla documentazione della classe UIDevice) / / restituisce una stringa di valori hash creata dall'hardware piĂą identifica. + / / Ă garantito per essere unica per ogni dispositivo e non può essere legato / / per l'account utente. + / / Windows Phone 7: restituisce un hash dell'utente corrente, + dispositivo / / se l'utente non è definito, un guid generato e persisterĂ  fino a quando l'applicazione viene disinstallata / / Tizen: restituisce il dispositivo IMEI (International Mobile Equipment Identity o IMEI è un numero / / unico per ogni cellulare GSM e UMTS. + var deviceID = device.uuid; + + +### iOS Quirk + +Il `uuid` su iOS non è univoco per un dispositivo, ma varia per ogni applicazione, per ogni installazione. Cambia se si elimina e re-installare l'app, e possibilmente anche quando aggiornare iOS o anche aggiornare l'app per ogni versione (apparente in iOS 5.1). Il `uuid` non è un valore affidabile. + +### Windows Phone 7 e 8 stranezze + +Il `uuid` per Windows Phone 7 richiede l'autorizzazione `ID_CAP_IDENTITY_DEVICE` . Microsoft probabilmente sarĂ  presto deprecare questa proprietĂ . Se la funzionalitĂ  non è disponibile, l'applicazione genera un guid persistente che viene mantenuto per la durata dell'installazione dell'applicazione sul dispositivo. + +## device.version + +Ottenere la versione del sistema operativo. + + var string = device.version; + + +### Piattaforme supportate + + * Android 2.1 + + * BlackBerry 10 + * Browser + * iOS + * Tizen + * Windows Phone 7 e 8 + * Windows 8 + +### Esempio rapido + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/it/index.md b/plugins/cordova-plugin-device/doc/it/index.md new file mode 100644 index 0000000..98c6200 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/it/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +Questo plugin definisce un global `device` oggetto che descrive il dispositivo hardware e software. Sebbene l'oggetto sia in ambito globale, non è disponibile fino a dopo il `deviceready` evento. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Installazione + + cordova plugin add cordova-plugin-device + + +## ProprietĂ  + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Ottenere la versione di Cordova in esecuzione nel dispositivo. + +### Piattaforme supportate + +* Amazon fuoco OS +* Android +* BlackBerry 10 +* Browser +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 e 8 +* Windows 8 + +## device.model + +Il `device.model` restituisce il nome del modello del dispositivo o del prodotto. Il valore viene impostato dal produttore del dispositivo e può essere differente tra le versioni dello stesso prodotto. + +### Piattaforme supportate + +* Android +* BlackBerry 10 +* Browser +* iOS +* Tizen +* Windows Phone 7 e 8 +* Windows 8 + +### Esempio rapido + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Vedi http://theiphonewiki.com/wiki/index.php?title=Models / / modello var = device.model; + + +### Stranezze Android + +* Ottiene il [nome del prodotto][1] anzichĂ© il [nome del modello][2], che è spesso il nome di codice di produzione. Ad esempio, restituisce il Nexus One `Passion` , e Motorola Droid restituisce`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Tizen stranezze + +* Restituisce il modello di dispositivo assegnato dal fornitore, ad esempio,`TIZEN` + +### Windows Phone 7 e 8 stranezze + +* Restituisce il modello di dispositivo specificato dal produttore. Ad esempio, restituisce il Samsung Focus`SGH-i917`. + +## device.platform + +Ottenere il nome del sistema operativo del dispositivo. + + var string = device.platform; + + +### Piattaforme supportate + +* Android +* BlackBerry 10 +* Browser4 +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 e 8 +* Windows 8 + +### Esempio rapido + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 capricci + +Windows Phone 7 dispositivi segnalano la piattaforma come`WinCE`. + +### Windows Phone 8 stranezze + +Dispositivi Windows Phone 8 segnalano la piattaforma come`Win32NT`. + +## device.uuid + +Ottenere identificatore del dispositivo univoco universale ([UUID][3]). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### Descrizione + +I dettagli di come viene generato un UUID sono determinati dal produttore del dispositivo e sono specifici per la piattaforma o il modello del dispositivo. + +### Piattaforme supportate + +* Android +* BlackBerry 10 +* iOS +* Tizen +* Windows Phone 7 e 8 +* Windows 8 + +### Esempio rapido + + / / Android: restituisce un intero casuale di 64 bit (come stringa, ancora una volta!) / / il numero intero è generato al primo avvio del dispositivo / / / / BlackBerry: restituisce il numero PIN del dispositivo / / questo è un valore integer univoco a nove cifre (come stringa, benchè!) / / / / iPhone: (parafrasato dalla documentazione della classe UIDevice) / / restituisce una stringa di valori hash creata dall'hardware piĂą identifica. + / / Ă garantito per essere unica per ogni dispositivo e non può essere legato / / per l'account utente. + / / Windows Phone 7: restituisce un hash dell'utente corrente, + dispositivo / / se l'utente non è definito, un guid generato e persisterĂ  fino a quando l'applicazione viene disinstallata / / Tizen: restituisce il dispositivo IMEI (International Mobile Equipment Identity o IMEI è un numero / / unico per ogni cellulare GSM e UMTS. + var deviceID = device.uuid; + + +### iOS Quirk + +Il `uuid` su iOS non è univoco per un dispositivo, ma varia per ogni applicazione, per ogni installazione. Cambia se si elimina e re-installare l'app, e possibilmente anche quando aggiornare iOS o anche aggiornare l'app per ogni versione (apparente in iOS 5.1). Il `uuid` non è un valore affidabile. + +### Windows Phone 7 e 8 stranezze + +Il `uuid` per Windows Phone 7 richiede l'autorizzazione `ID_CAP_IDENTITY_DEVICE` . Microsoft probabilmente sarĂ  presto deprecare questa proprietĂ . Se la funzionalitĂ  non è disponibile, l'applicazione genera un guid persistente che viene mantenuto per la durata dell'installazione dell'applicazione sul dispositivo. + +## device.version + +Ottenere la versione del sistema operativo. + + var string = device.version; + + +### Piattaforme supportate + +* Android 2.1 + +* BlackBerry 10 +* Browser +* iOS +* Tizen +* Windows Phone 7 e 8 +* Windows 8 + +### Esempio rapido + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/ja/README.md b/plugins/cordova-plugin-device/doc/ja/README.md new file mode 100644 index 0000000..5a345f8 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/ja/README.md @@ -0,0 +1,203 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +ă“ă®ă—ă©ă‚°ă‚¤ăłă‚’ă‚°ă­ăĽăă«ĺ®šçľ©ă—ăľă™ `device` ă‚Şă–ジェクăăŻă€ă‡ăイスă®ăŹăĽă‰ă‚¦ă‚§ă‚˘ă¨ă‚˝ă•ăウェアă«ă¤ă„ă¦čެćŽă—ăľă™ă€‚ ăťă‚ŚăŻĺľŚăľă§ĺ©ç”¨ĺŹŻč˝ăŞă‚Şă–ジェクăăŚă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ăŻă€ `deviceready` イă™ăłă。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-device + + +## ă—ă­ă‘ă†ă‚Ł + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +ă‡ăイスă§ĺ®źčˇŚă•ă‚Śă¦ă„ă‚‹ă‚łă«ă‰ăă®ăăĽă‚¸ă§ăłă‚’取得ă—ăľă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăžă‚ľăłç« OS + * アăłă‰ă­ă‚¤ă‰ + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * ă–ă©ă‚¦ă‚¶ăĽ + * Firefox ă® OS + * iOS + * Tizen + * Windows Phone 7 㨠8 + * Windows 8 + +## device.model + +`device.model`ă€ă‡ăイスă®ă˘ă‡ă«ăľăźăŻčŁ˝ĺ“ă®ĺŤĺ‰Ťă‚’čż”ă—ăľă™ă€‚値ăŻă€ă‡ăイスă®čŁ˝é€ ĺ…ă«ă‚ăŁă¦č¨­ĺ®šă•ă‚Śă€ĺŚă製ĺ“ă®ăăĽă‚¸ă§ăłé–“ă§ç•°ăŞă‚‹ĺŹŻč˝ć€§ăŚă‚ă‚Šăľă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăłă‰ă­ă‚¤ă‰ + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * ă–ă©ă‚¦ă‚¶ăĽ + * iOS + * Tizen + * Windows Phone 7 㨠8 + * Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models を参照ă—ă¦ăŹă ă•ă„//var ă˘ă‡ă« = device.model; + + +### Android ă®ç™– + + * 生産コăĽă‰ĺŤăŻ[ă˘ă‡ă«ĺŤ](http://developer.android.com/reference/android/os/Build.html#MODEL)ă®ä»Łă‚Źă‚Šă«[製ĺ“ĺŤ](http://developer.android.com/reference/android/os/Build.html#PRODUCT)を取得ă—ăľă™ă€‚ ăźă¨ăă°ă€ăŤă‚Żă‚µă‚ą 1 ă¤ă‚’čż”ă—ăľă™ `Passion` ă€Motorola ă®ă‰ă­ă‚¤ă‰ă‚’čż”ă—ăľă™`voles`. + +### Tizen ă®ç™– + + * ăźă¨ăă°ă€ă™ăłă€ăĽă«ă‚ăŁă¦ĺ‰˛ă‚Šĺ˝“ă¦ă‚‰ă‚Śă¦ă„ă‚‹ă‡ăイスă®ă˘ă‡ă«ă‚’čż”ă—ăľă™`TIZEN` + +### Windows Phone 7 㨠8 ç™– + + * 製造ĺ…ă«ă‚ăŁă¦ćŚ‡ĺ®šă•ă‚Śăźă‡ăイスă®ă˘ă‡ă«ă‚’čż”ă—ăľă™ă€‚ăźă¨ăă°ă€ä¸‰ćźă•ă‚©ăĽă‚«ă‚ąă‚’čż”ă—ăľă™`SGH-i917`. + +## device.platform + +ă‡ăイスă®ă‚Şăšă¬ăĽă†ă‚Łăłă‚° ă‚·ă‚ąă†ă ĺŤă‚’取得ă—ăľă™ă€‚ + + var string = device.platform; + + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăłă‰ă­ă‚¤ă‰ + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * Browser4 + * Firefox ă® OS + * iOS + * Tizen + * Windows Phone 7 㨠8 + * Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 ă®ç™– + +Windows Phone 7 ă‡ăイスă¨ă—ă©ăăă•ă‚©ăĽă ă‚’報告ă—ăľă™ă€‚`WinCE`. + +### Windows Phone 8 ç™– + +Windows Phone 8 ă‡ăイスă¨ă—ă©ăăă•ă‚©ăĽă ă‚’報告ă—ăľă™ă€‚`Win32NT`. + +## device.uuid + +ă‡ăイスă®ă¦ă‹ăăĽă‚µă« ă» ă¦ă‹ăĽă‚Żč­ĺĄĺ­ ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)を取得ă—ăľă™ă€‚). + + var string = device.uuid; + + +### 解説 + +UUID を生ćă™ă‚‹ć–ąćł•ă®č©łç´°ăŻă€ă‡ăイスă®čŁ˝é€ ĺ…ă«ă‚ăŁă¦ć±şĺ®šă•ă‚Śă€ă‡ăイスă®ă—ă©ăăă•ă‚©ăĽă ă‚„ă˘ă‡ă«ă«ĺ›şćś‰ă§ă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăłă‰ă­ă‚¤ă‰ + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * iOS + * Tizen + * Windows Phone 7 㨠8 + * Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + //アăłă‰ă­ă‚¤ă‰: ă©ăłă€ă ăŞ 64 ă“ăăă®ć•´ć•° (を文字ĺ—ă¨ă—ă¦čż”ă—ăľă™ă€ĺ†Ťăł ďĽďĽ‰/ă‡ăイスă®ćś€ĺťă®čµ·ĺ‹•ć™‚ă«ç”źćă•ă‚Śă‚‹ć•´ć•°/////ă–ă©ăă‚Żă™ăŞăĽ: ă‡ăイスă®ă”ăłç•ŞĺŹ·ă‚’čż”ă—ăľă™//ă“れ㯠9 ćˇă®ä¸€ć„ŹăŞć•´ć•° (を文字ĺ—ă¨ă—ă¦ă‚‚ ďĽ)////iPhone: (UIDevice ă‚Żă©ă‚ąă®ă‰ă‚­ăĄăˇăłăă‹ă‚‰č¨€ă„換ă)//č­ĺĄč¤‡ć•°ă®ăŹăĽă‰ă‚¦ă‚§ă‚˘ă‹ă‚‰ä˝śćă•ă‚ŚăźăŹăă‚·ăĄĺ€¤ă®ć–‡ĺ­—ĺ—ă‚’čż”ă—ăľă™ă€‚。 + //ăťă‚ŚăŻă™ăąă¦ă®ă‡ăイスă«ĺŻľă—ă¦ä¸€ć„Źă§ă‚ă‚‹ă“ă¨ăŚäżťč¨Ľă•ă‚Śă€ćŽĄç¶šă™ă‚‹ă“ă¨ăŻă§ăŤăľă›ă‚“//ă¦ăĽă‚¶ăĽ アカウăłă。 + //Windows Phone 7: ă‡ăイス + 現在ă®ă¦ăĽă‚¶ăĽă®ăŹăă‚·ăĄă‚’čż”ă—ăľă™//ă¦ăĽă‚¶ăĽăŚĺ®šçľ©ă•ă‚Śă¦ă„ăŞă„ĺ ´ĺ guid ăŚç”źćă•ă‚Śă€ă‚˘ă—ăŞăŚă‚˘ăłă‚¤ăłă‚ąăăĽă«ă•ă‚Śă‚‹ăľă§äżťćŚă•ă‚Śăľă™//Tizen: ă‡ăイス㮠IMEI ă‚’čż”ă—ăľă™ ďĽĺ›˝éš›ă˘ăイă«ć©źĺ™¨ă‚˘ă‚¤ă‡ăłă†ă‚Łă†ă‚ŁăľăźăŻ IMEI ăŻç•ŞĺŹ·ă§ă™//ă™ăąă¦ă® GSM ăŠă‚ăł UMTS ă®ćşĺ¸Żé›»č©±ă«ĺ›şćś‰ă§ă™ă€‚ + var deviceID = device.uuid; + + +### iOS ă®ć°—ăľăă‚Ś + +`uuid`IOS ă§ă€ă‡ăイスă«ĺ›şćś‰ă§ăŻăŞă„イăłă‚ąăăĽă«ă”ă¨ă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă”ă¨ă«ç•°ăŞă‚Šăľă™ă€‚ 削除ă€ă‚˘ă—ăŞă‚’再イăłă‚ąăăĽă«ă—ăźĺ ´ĺă«ĺ¤‰ć›´ă¨ĺ¤šĺ†ăľăźă¨ăŤă‚˘ăă—ă‚°ă¬ăĽă‰ iOS ă®, ăľăźăŻă‚‚アăă—ă‚°ă¬ăĽă‰ă™ă‚‹ă‚˘ă—㪠(iOS ă® 5.1 ă§ćŽă‚‰ă‹ă«ďĽ‰ ăăĽă‚¸ă§ăłă”ă¨ă€‚ `uuid`ăŻäżˇé Ľć€§ă®é«ă„値ă§ăŻă‚ă‚Šăľă›ă‚“。 + +### Windows Phone 7 㨠8 ç™– + +`uuid`ă®ăźă‚ă« Windows Phone 7 ă«ăŻă€ć¨©é™ăŚĺż…č¦ă§ă™ `ID_CAP_IDENTITY_DEVICE` 。 Microsoft ăŻă™ăă«ă“ă®ă—ă­ă‘ă†ă‚Łă‚’ĺ»ć­˘ă—ă¦ĺŹŻč˝ć€§ăŚă‚ă‚Šăľă™ă€‚ ć©źč˝ăŚĺ©ç”¨ă§ăŤăŞă„ĺ ´ĺă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłăŻă‡ăイスă¸ă®ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă®ă‚¤ăłă‚ąăăĽă«ă®ćŚç¶šćśźé–“ă®ăźă‚ă«äżťćŚă•ă‚Śă¦ă„る永続的㪠guid を生ćă—ăľă™ă€‚ + +## device.version + +ă‚Şăšă¬ăĽă†ă‚Łăłă‚° ă‚·ă‚ąă†ă ă®ăăĽă‚¸ă§ăłă‚’取得ă—ăľă™ă€‚ + + var string = device.version; + + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăłă‰ă­ă‚¤ă‰ 2.1 + + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * ă–ă©ă‚¦ă‚¶ăĽ + * iOS + * Tizen + * Windows Phone 7 㨠8 + * Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/ja/index.md b/plugins/cordova-plugin-device/doc/ja/index.md new file mode 100644 index 0000000..b4030fd --- /dev/null +++ b/plugins/cordova-plugin-device/doc/ja/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +ă“ă®ă—ă©ă‚°ă‚¤ăłă‚’ă‚°ă­ăĽăă«ĺ®šçľ©ă—ăľă™ `device` ă‚Şă–ジェクăăŻă€ă‡ăイスă®ăŹăĽă‰ă‚¦ă‚§ă‚˘ă¨ă‚˝ă•ăウェアă«ă¤ă„ă¦čެćŽă—ăľă™ă€‚ ăťă‚ŚăŻĺľŚăľă§ĺ©ç”¨ĺŹŻč˝ăŞă‚Şă–ジェクăăŚă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ăŻă€ `deviceready` イă™ăłă。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-device + + +## ă—ă­ă‘ă†ă‚Ł + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +ă‡ăイスă§ĺ®źčˇŚă•ă‚Śă¦ă„ă‚‹ă‚łă«ă‰ăă®ăăĽă‚¸ă§ăłă‚’取得ă—ăľă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăžă‚ľăłç« OS +* アăłă‰ă­ă‚¤ă‰ +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* ă–ă©ă‚¦ă‚¶ăĽ +* Firefox ă® OS +* iOS +* Tizen +* Windows Phone 7 㨠8 +* Windows 8 + +## device.model + +`device.model`ă€ă‡ăイスă®ă˘ă‡ă«ăľăźăŻčŁ˝ĺ“ă®ĺŤĺ‰Ťă‚’čż”ă—ăľă™ă€‚値ăŻă€ă‡ăイスă®čŁ˝é€ ĺ…ă«ă‚ăŁă¦č¨­ĺ®šă•ă‚Śă€ĺŚă製ĺ“ă®ăăĽă‚¸ă§ăłé–“ă§ç•°ăŞă‚‹ĺŹŻč˝ć€§ăŚă‚ă‚Šăľă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăłă‰ă­ă‚¤ă‰ +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* ă–ă©ă‚¦ă‚¶ăĽ +* iOS +* Tizen +* Windows Phone 7 㨠8 +* Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models を参照ă—ă¦ăŹă ă•ă„//var ă˘ă‡ă« = device.model; + + +### Android ă®ç™– + +* 生産コăĽă‰ĺŤăŻ[ă˘ă‡ă«ĺŤ][1]ă®ä»Łă‚Źă‚Šă«[製ĺ“ĺŤ][2]を取得ă—ăľă™ă€‚ ăźă¨ăă°ă€ăŤă‚Żă‚µă‚ą 1 ă¤ă‚’čż”ă—ăľă™ `Passion` ă€Motorola ă®ă‰ă­ă‚¤ă‰ă‚’čż”ă—ăľă™`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#MODEL + [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + +### Tizen ă®ç™– + +* ăźă¨ăă°ă€ă™ăłă€ăĽă«ă‚ăŁă¦ĺ‰˛ă‚Šĺ˝“ă¦ă‚‰ă‚Śă¦ă„ă‚‹ă‡ăイスă®ă˘ă‡ă«ă‚’čż”ă—ăľă™`TIZEN` + +### Windows Phone 7 㨠8 ç™– + +* 製造ĺ…ă«ă‚ăŁă¦ćŚ‡ĺ®šă•ă‚Śăźă‡ăイスă®ă˘ă‡ă«ă‚’čż”ă—ăľă™ă€‚ăźă¨ăă°ă€ä¸‰ćźă•ă‚©ăĽă‚«ă‚ąă‚’čż”ă—ăľă™`SGH-i917`. + +## device.platform + +ă‡ăイスă®ă‚Şăšă¬ăĽă†ă‚Łăłă‚° ă‚·ă‚ąă†ă ĺŤă‚’取得ă—ăľă™ă€‚ + + var string = device.platform; + + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăłă‰ă­ă‚¤ă‰ +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* Browser4 +* Firefox ă® OS +* iOS +* Tizen +* Windows Phone 7 㨠8 +* Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 ă®ç™– + +Windows Phone 7 ă‡ăイスă¨ă—ă©ăăă•ă‚©ăĽă ă‚’報告ă—ăľă™ă€‚`WinCE`. + +### Windows Phone 8 ç™– + +Windows Phone 8 ă‡ăイスă¨ă—ă©ăăă•ă‚©ăĽă ă‚’報告ă—ăľă™ă€‚`Win32NT`. + +## device.uuid + +ă‡ăイスă®ă¦ă‹ăăĽă‚µă« ă» ă¦ă‹ăĽă‚Żč­ĺĄĺ­ ([UUID][3]を取得ă—ăľă™ă€‚). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### čŞ¬ćŽ + +UUID を生ćă™ă‚‹ć–ąćł•ă®č©łç´°ăŻă€ă‡ăイスă®čŁ˝é€ ĺ…ă«ă‚ăŁă¦ć±şĺ®šă•ă‚Śă€ă‡ăイスă®ă—ă©ăăă•ă‚©ăĽă ă‚„ă˘ă‡ă«ă«ĺ›şćś‰ă§ă™ă€‚ + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăłă‰ă­ă‚¤ă‰ +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* iOS +* Tizen +* Windows Phone 7 㨠8 +* Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + //アăłă‰ă­ă‚¤ă‰: ă©ăłă€ă ăŞ 64 ă“ăăă®ć•´ć•° (を文字ĺ—ă¨ă—ă¦čż”ă—ăľă™ă€ĺ†Ťăł ďĽďĽ‰/ă‡ăイスă®ćś€ĺťă®čµ·ĺ‹•ć™‚ă«ç”źćă•ă‚Śă‚‹ć•´ć•°/////ă–ă©ăă‚Żă™ăŞăĽ: ă‡ăイスă®ă”ăłç•ŞĺŹ·ă‚’čż”ă—ăľă™//ă“れ㯠9 ćˇă®ä¸€ć„ŹăŞć•´ć•° (を文字ĺ—ă¨ă—ă¦ă‚‚ ďĽ)////iPhone: (UIDevice ă‚Żă©ă‚ąă®ă‰ă‚­ăĄăˇăłăă‹ă‚‰č¨€ă„換ă)//č­ĺĄč¤‡ć•°ă®ăŹăĽă‰ă‚¦ă‚§ă‚˘ă‹ă‚‰ä˝śćă•ă‚ŚăźăŹăă‚·ăĄĺ€¤ă®ć–‡ĺ­—ĺ—ă‚’čż”ă—ăľă™ă€‚。 + //ăťă‚ŚăŻă™ăąă¦ă®ă‡ăイスă«ĺŻľă—ă¦ä¸€ć„Źă§ă‚ă‚‹ă“ă¨ăŚäżťč¨Ľă•ă‚Śă€ćŽĄç¶šă™ă‚‹ă“ă¨ăŻă§ăŤăľă›ă‚“//ă¦ăĽă‚¶ăĽ アカウăłă。 + //Windows Phone 7: ă‡ăイス + 現在ă®ă¦ăĽă‚¶ăĽă®ăŹăă‚·ăĄă‚’čż”ă—ăľă™//ă¦ăĽă‚¶ăĽăŚĺ®šçľ©ă•ă‚Śă¦ă„ăŞă„ĺ ´ĺ guid ăŚç”źćă•ă‚Śă€ă‚˘ă—ăŞăŚă‚˘ăłă‚¤ăłă‚ąăăĽă«ă•ă‚Śă‚‹ăľă§äżťćŚă•ă‚Śăľă™//Tizen: ă‡ăイス㮠IMEI ă‚’čż”ă—ăľă™ ďĽĺ›˝éš›ă˘ăイă«ć©źĺ™¨ă‚˘ă‚¤ă‡ăłă†ă‚Łă†ă‚ŁăľăźăŻ IMEI ăŻç•ŞĺŹ·ă§ă™//ă™ăąă¦ă® GSM ăŠă‚ăł UMTS ă®ćşĺ¸Żé›»č©±ă«ĺ›şćś‰ă§ă™ă€‚ + var deviceID = device.uuid; + + +### iOS ă®ć°—ăľăă‚Ś + +`uuid`IOS ă§ă€ă‡ăイスă«ĺ›şćś‰ă§ăŻăŞă„イăłă‚ąăăĽă«ă”ă¨ă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă”ă¨ă«ç•°ăŞă‚Šăľă™ă€‚ 削除ă€ă‚˘ă—ăŞă‚’再イăłă‚ąăăĽă«ă—ăźĺ ´ĺă«ĺ¤‰ć›´ă¨ĺ¤šĺ†ăľăźă¨ăŤă‚˘ăă—ă‚°ă¬ăĽă‰ iOS ă®, ăľăźăŻă‚‚アăă—ă‚°ă¬ăĽă‰ă™ă‚‹ă‚˘ă—㪠(iOS ă® 5.1 ă§ćŽă‚‰ă‹ă«ďĽ‰ ăăĽă‚¸ă§ăłă”ă¨ă€‚ `uuid`ăŻäżˇé Ľć€§ă®é«ă„値ă§ăŻă‚ă‚Šăľă›ă‚“。 + +### Windows Phone 7 㨠8 ç™– + +`uuid`ă®ăźă‚ă« Windows Phone 7 ă«ăŻă€ć¨©é™ăŚĺż…č¦ă§ă™ `ID_CAP_IDENTITY_DEVICE` 。 Microsoft ăŻă™ăă«ă“ă®ă—ă­ă‘ă†ă‚Łă‚’ĺ»ć­˘ă—ă¦ĺŹŻč˝ć€§ăŚă‚ă‚Šăľă™ă€‚ ć©źč˝ăŚĺ©ç”¨ă§ăŤăŞă„ĺ ´ĺă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłăŻă‡ăイスă¸ă®ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă®ă‚¤ăłă‚ąăăĽă«ă®ćŚç¶šćśźé–“ă®ăźă‚ă«äżťćŚă•ă‚Śă¦ă„る永続的㪠guid を生ćă—ăľă™ă€‚ + +## device.version + +ă‚Şăšă¬ăĽă†ă‚Łăłă‚° ă‚·ă‚ąă†ă ă®ăăĽă‚¸ă§ăłă‚’取得ă—ăľă™ă€‚ + + var string = device.version; + + +### サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăłă‰ă­ă‚¤ă‰ 2.1 + +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* ă–ă©ă‚¦ă‚¶ăĽ +* iOS +* Tizen +* Windows Phone 7 㨠8 +* Windows 8 + +### ç°ˇĺŤăŞäľ‹ + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/ko/README.md b/plugins/cordova-plugin-device/doc/ko/README.md new file mode 100644 index 0000000..a818aac --- /dev/null +++ b/plugins/cordova-plugin-device/doc/ko/README.md @@ -0,0 +1,203 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +ěť´ 플러그인 ě •ěť ě „ě—­ `device` 개체, ë””ë°”ěť´ěŠ¤ěť í•ë“śě›¨ě–´ ë°Ź ě†Śí”„íŠ¸ě›¨ě–´ě— ě„¤ëŞ… í•©ë‹ë‹¤. 개체는 ě „ě—­ 범위ě—ě„ś 비록 ę·¸ę˛ěť€ 후까지 사용할 ě ěžëŠ” `deviceready` 이벤트. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## ě„¤ěą + + cordova plugin add cordova-plugin-device + + +## 속성 + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +코르도바는 장ěąě—ě„ś 실행 중인 버전을 얻을. + +### ě§€ě› ë는 플랫폼 + + * ě•„ë§ěˇ´ 화재 ěš´ě 체제 + * ě• ë“ś 로이드 + * 블랙베리 10 + * 브라우저 + * Firefox ěš´ě 체제 + * iOS + * Tizen + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + +## device.model + +`device.model`소ěžěť 모델 ë는 ě śí’ěť ěť´ë¦„ěť„ ë°í™ í•©ë‹ë‹¤. ę°’ ěžĄěą ě śěˇ°ě—…ě˛´ě—ě„ś 설정 ë ęł  동일 ě śí’ěť ë˛„ě „ ę°„ě— ë‹¤ëĄĽ ě ěžěŠµë‹ë‹¤. + +### ě§€ě› ë는 플랫폼 + + * ě• ë“ś 로이드 + * 블랙베리 10 + * 브라우저 + * iOS + * Tizen + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models 참조 / / var 모델 = device.model; + + +### ě• ë“ś 로이드 ë‹¨ě  + + * 어떤은 종종 í”„ëˇśëŤ•ě… ě˝”ë“ś 이름 대신 [ě śí’ ëŞ¨ëŤ¸ 이름](http://developer.android.com/reference/android/os/Build.html#MODEL), [ě śí’ ěť´ë¦„](http://developer.android.com/reference/android/os/Build.html#PRODUCT) ěť„ 가져ěµë‹ë‹¤. ě를 들어 넥서스 í•ë‚ ë°í™ í•©ë‹ë‹¤ `Passion` , 모토로라 Droid를 ë°í™ í•©ë‹ë‹¤`voles`. + +### Tizen 특ě + + * ě를 들어, 공급 ě—…ě˛´ě— ěťí•´ í• ë‹ą ëś ë””ë°”ěť´ěŠ¤ 모델을 ë°í™ í•©ë‹ë‹¤.`TIZEN` + +### Windows Phone 7, 8 특ě + + * 제조업체ě—ě„ś 지정 í•ëŠ” ěžĄěą ëŞ¨ëŤ¸ěť„ ë°í™ í•©ë‹ë‹¤. ě를 들어 삼성 포커스를 ë°í™ í•©ë‹ë‹¤.`SGH-i917`. + +## device.platform + +장ěąěť ěš´ě 체제 이름을 얻을. + + var string = device.platform; + + +### ě§€ě› ë는 플랫폼 + + * ě• ë“ś 로이드 + * 블랙베리 10 + * Browser4 + * Firefox ěš´ě 체제 + * iOS + * Tizen + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 ë‹¨ě  + +Windows Phone 7 ěžĄěą ëł´ęł  플랫폼으로`WinCE`. + +### Windows Phone 8 ë‹¨ě  + +Windows Phone 8 ěžĄěą ëł´ęł  플랫폼으로`Win32NT`. + +## device.uuid + +소ěžěť 보편ě ěśĽëˇś ęł ěś  ě‹ťëł„ěž ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier) 를 얻을합ë‹ë‹¤). + + var string = device.uuid; + + +### 설명 + +UUID ěťě„± ë°©ë˛•ěť ěžě„¸í•ś 내용은 ěžĄěą ě śěˇ°ě—…ě˛´ě— ěťí•´ 결정 ë©ë‹ë‹¤ ë°Ź 소ěžěť 플랫폼 ěť´ë‚ ëŞ¨ëŤ¸. + +### ě§€ě› ë는 플랫폼 + + * ě• ë“ś 로이드 + * 블랙베리 10 + * iOS + * Tizen + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + / / ě• ë“ś 로이드: (문ěžě—´ëˇś 다시!) ěž„ěťěť 64 비트 ě •ě를 ë°í™ í•©ë‹ë‹¤ / / ě •ě 장ěąěť 첫 ë˛ě§¸ 부팅ě—ě„ś ěťě„± / / / / 블랙베리: ë””ë°”ěť´ěŠ¤ěť í•€ ë˛í¸ëĄĽ ë°í™ í•©ë‹ë‹¤ / / ěť´ę˛ěť€ 9 ěžë¦¬ ęł ěś  ě •ě (문ěžě—´ëˇś 비록!) / / / / 아이폰: (UIDevice í´ëžěŠ¤ 설명서ě—ě„ś 읊 ě—) / / 문ěžě—´ 여러 í•ë“śě›¨ě–´ě—ě„ś ěťě„± í•ëŠ” í•´ě‹ś ę°’ěť„ ě‹ťëł„ í•ëŠ” ë°í™ í•©ë‹ë‹¤. + / ę·¸ę˛ěť€ 모든 장ěąě— 대 í•ś ęł ěś  í•´ě•Ľ 보장 ë ęł  묶일 ě 없습ë‹ë‹¤ / / / ě‚¬ěš©ěž ęł„ě •ě—. + / / Windows Phone 7: ěžĄěą + í„재 사용ěžěť 해시를 ë°í™ í•©ë‹ë‹¤ / / ě‚¬ěš©ěž ě •ěť ë지 않은 경우 guid ěťě„± ë ęł  ěť‘ěš© 프로그램을 ě śę±°í•  때까지 유지 ë©ë‹ë‹¤ / / Tizen: ë°í™ ěžĄěą IMEI (ęµ­ě ś 모바일 기기 ě‹ťëł„ ë는 IMEI ě«ěžěž…ë‹ë‹¤ / / 모든 GSM와 UMTS 휴대 ě „í™” ęł ěś . + var deviceID = device.uuid; + + +### iOS íŠąě§ + +`uuid`ios 장ěąě— ęł ěś  í•ě§€ 않습ë‹ë‹¤ í•ě§€ë§Ś ę° ě„¤ěąě— 대 í•ś ěť‘ěš© 프로그램 ë§ë‹¤ 다릅ë‹ë‹¤. ě‚­ě ś í• ęł  다시 애플 리 케이 ě…ěť„ ě„¤ěą í•ëŠ” 경우 변경 가능 í• ę˛Ś ëí•ś iOS를 ě—…ę·¸ë ěť´ë“ś í•ę±°ë‚ ë•Ś 버전 (iOS 5.1ě—ě—ě„ś 명백한) ë‹ą ěť‘ěš© 프로그램 ě—…ę·¸ë ěť´ë“śëŹ„ í• ęł . `uuid`은 신뢰할 ě ěžëŠ” ę°’ěť´ ě•„ë‹™ë‹ë‹¤. + +### Windows Phone 7, 8 특ě + +`uuid`Windows Phone 7 í•„ěš” í—ę°€ `ID_CAP_IDENTITY_DEVICE` . Microsoft는 곧이 속성을 세ě›ë‹ë‹¤ 가능성이 ę˛ěž…ë‹ë‹¤. 기능을 사용할 ě 없는 경우 ěť‘ěš© 프로그램 장ěąě— ěť‘ěš© í”„ëˇśę·¸ëž¨ěť ě„¤ěą í•ëŠ” ëŹ™ě• ěś ě§€ í•ëŠ” ě구 guid를 ěťě„± í•©ë‹ë‹¤. + +## device.version + +ěš´ě 체제 버전을 얻을. + + var string = device.version; + + +### ě§€ě› ë는 플랫폼 + + * ě• ë“ś 로이드 2.1 + + * 블랙베리 10 + * 브라우저 + * iOS + * Tizen + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/ko/index.md b/plugins/cordova-plugin-device/doc/ko/index.md new file mode 100644 index 0000000..0fe38a7 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/ko/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +ěť´ 플러그인 ě •ěť ě „ě—­ `device` 개체, ë””ë°”ěť´ěŠ¤ěť í•ë“śě›¨ě–´ ë°Ź ě†Śí”„íŠ¸ě›¨ě–´ě— ě„¤ëŞ… í•©ë‹ë‹¤. 개체는 ě „ě—­ 범위ě—ě„ś 비록 ę·¸ę˛ěť€ 후까지 사용할 ě ěžëŠ” `deviceready` 이벤트. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## ě„¤ěą + + cordova plugin add cordova-plugin-device + + +## 속성 + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +코르도바는 장ěąě—ě„ś 실행 중인 버전을 얻을. + +### ě§€ě› ë는 플랫폼 + +* ě•„ë§ěˇ´ 화재 ěš´ě 체제 +* ě• ë“ś 로이드 +* 블랙베리 10 +* 브라우저 +* Firefox ěš´ě 체제 +* iOS +* Tizen +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +## device.model + +`device.model`소ěžěť 모델 ë는 ě śí’ěť ěť´ë¦„ěť„ ë°í™ í•©ë‹ë‹¤. ę°’ ěžĄěą ě śěˇ°ě—…ě˛´ě—ě„ś 설정 ë ęł  동일 ě śí’ěť ë˛„ě „ ę°„ě— ë‹¤ëĄĽ ě ěžěŠµë‹ë‹¤. + +### ě§€ě› ë는 플랫폼 + +* ě• ë“ś 로이드 +* 블랙베리 10 +* 브라우저 +* iOS +* Tizen +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models 참조 / / var 모델 = device.model; + + +### ě• ë“ś 로이드 ë‹¨ě  + +* 어떤은 종종 í”„ëˇśëŤ•ě… ě˝”ë“ś 이름 대신 [ě śí’ ëŞ¨ëŤ¸ 이름][1], [ě śí’ ěť´ë¦„][2] ěť„ 가져ěµë‹ë‹¤. ě를 들어 넥서스 í•ë‚ ë°í™ í•©ë‹ë‹¤ `Passion` , 모토로라 Droid를 ë°í™ í•©ë‹ë‹¤`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#MODEL + [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + +### Tizen 특ě + +* ě를 들어, 공급 ě—…ě˛´ě— ěťí•´ í• ë‹ą ëś ë””ë°”ěť´ěŠ¤ 모델을 ë°í™ í•©ë‹ë‹¤.`TIZEN` + +### Windows Phone 7, 8 특ě + +* 제조업체ě—ě„ś 지정 í•ëŠ” ěžĄěą ëŞ¨ëŤ¸ěť„ ë°í™ í•©ë‹ë‹¤. ě를 들어 삼성 포커스를 ë°í™ í•©ë‹ë‹¤.`SGH-i917`. + +## device.platform + +장ěąěť ěš´ě 체제 이름을 얻을. + + var string = device.platform; + + +### ě§€ě› ë는 플랫폼 + +* ě• ë“ś 로이드 +* 블랙베리 10 +* Browser4 +* Firefox ěš´ě 체제 +* iOS +* Tizen +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 ë‹¨ě  + +Windows Phone 7 ěžĄěą ëł´ęł  플랫폼으로`WinCE`. + +### Windows Phone 8 ë‹¨ě  + +Windows Phone 8 ěžĄěą ëł´ęł  플랫폼으로`Win32NT`. + +## device.uuid + +소ěžěť 보편ě ěśĽëˇś ęł ěś  ě‹ťëł„ěž ([UUID][3] 를 얻을합ë‹ë‹¤). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### 설명 + +UUID ěťě„± ë°©ë˛•ěť ěžě„¸í•ś 내용은 ěžĄěą ě śěˇ°ě—…ě˛´ě— ěťí•´ 결정 ë©ë‹ë‹¤ ë°Ź 소ěžěť 플랫폼 ěť´ë‚ ëŞ¨ëŤ¸. + +### ě§€ě› ë는 플랫폼 + +* ě• ë“ś 로이드 +* 블랙베리 10 +* iOS +* Tizen +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + / / ě• ë“ś 로이드: (문ěžě—´ëˇś 다시!) ěž„ěťěť 64 비트 ě •ě를 ë°í™ í•©ë‹ë‹¤ / / ě •ě 장ěąěť 첫 ë˛ě§¸ 부팅ě—ě„ś ěťě„± / / / / 블랙베리: ë””ë°”ěť´ěŠ¤ěť í•€ ë˛í¸ëĄĽ ë°í™ í•©ë‹ë‹¤ / / ěť´ę˛ěť€ 9 ěžë¦¬ ęł ěś  ě •ě (문ěžě—´ëˇś 비록!) / / / / 아이폰: (UIDevice í´ëžěŠ¤ 설명서ě—ě„ś 읊 ě—) / / 문ěžě—´ 여러 í•ë“śě›¨ě–´ě—ě„ś ěťě„± í•ëŠ” í•´ě‹ś ę°’ěť„ ě‹ťëł„ í•ëŠ” ë°í™ í•©ë‹ë‹¤. + / ę·¸ę˛ěť€ 모든 장ěąě— 대 í•ś ęł ěś  í•´ě•Ľ 보장 ë ęł  묶일 ě 없습ë‹ë‹¤ / / / ě‚¬ěš©ěž ęł„ě •ě—. + / / Windows Phone 7: ěžĄěą + í„재 사용ěžěť 해시를 ë°í™ í•©ë‹ë‹¤ / / ě‚¬ěš©ěž ě •ěť ë지 않은 경우 guid ěťě„± ë ęł  ěť‘ěš© 프로그램을 ě śę±°í•  때까지 유지 ë©ë‹ë‹¤ / / Tizen: ë°í™ ěžĄěą IMEI (ęµ­ě ś 모바일 기기 ě‹ťëł„ ë는 IMEI ě«ěžěž…ë‹ë‹¤ / / 모든 GSM와 UMTS 휴대 ě „í™” ęł ěś . + var deviceID = device.uuid; + + +### iOS íŠąě§ + +`uuid`ios 장ěąě— ęł ěś  í•ě§€ 않습ë‹ë‹¤ í•ě§€ë§Ś ę° ě„¤ěąě— 대 í•ś ěť‘ěš© 프로그램 ë§ë‹¤ 다릅ë‹ë‹¤. ě‚­ě ś í• ęł  다시 애플 리 케이 ě…ěť„ ě„¤ěą í•ëŠ” 경우 변경 가능 í• ę˛Ś ëí•ś iOS를 ě—…ę·¸ë ěť´ë“ś í•ę±°ë‚ ë•Ś 버전 (iOS 5.1ě—ě—ě„ś 명백한) ë‹ą ěť‘ěš© 프로그램 ě—…ę·¸ë ěť´ë“śëŹ„ í• ęł . `uuid`은 신뢰할 ě ěžëŠ” ę°’ěť´ ě•„ë‹™ë‹ë‹¤. + +### Windows Phone 7, 8 특ě + +`uuid`Windows Phone 7 í•„ěš” í—ę°€ `ID_CAP_IDENTITY_DEVICE` . Microsoft는 곧이 속성을 세ě›ë‹ë‹¤ 가능성이 ę˛ěž…ë‹ë‹¤. 기능을 사용할 ě 없는 경우 ěť‘ěš© 프로그램 장ěąě— ěť‘ěš© í”„ëˇśę·¸ëž¨ěť ě„¤ěą í•ëŠ” ëŹ™ě• ěś ě§€ í•ëŠ” ě구 guid를 ěťě„± í•©ë‹ë‹¤. + +## device.version + +ěš´ě 체제 버전을 얻을. + + var string = device.version; + + +### ě§€ě› ë는 플랫폼 + +* ě• ë“ś 로이드 2.1 + +* 블랙베리 10 +* 브라우저 +* iOS +* Tizen +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +### 빠른 ěě ś + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/pl/README.md b/plugins/cordova-plugin-device/doc/pl/README.md new file mode 100644 index 0000000..c38832d --- /dev/null +++ b/plugins/cordova-plugin-device/doc/pl/README.md @@ -0,0 +1,214 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +Ten plugin okreĹ›la globalne `device` obiekt, ktĂłry opisuje urzÄ…dzenia sprzÄ™towe i programowe. Mimo, ĹĽe obiekt jest w globalnym zasiÄ™gu, nie jest dostÄ™pne dopiero po `deviceready` zdarzenie. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Instalacja + + cordova plugin add cordova-plugin-device + + +## WĹ‚aĹ›ciwoĹ›ci + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +Pobierz wersjÄ™ Cordova dziaĹ‚a na urzÄ…dzeniu. + +### ObsĹ‚ugiwane platformy + + * Amazon Fire OS + * Android + * BlackBerry 10 + * PrzeglÄ…darka + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 i 8 + * Windows 8 + +## device.model + +`device.model`Zwraca nazwÄ™ modelu lub produktu. Wartość jest zestaw przez producenta urzÄ…dzenia i mogÄ… siÄ™ różnić miÄ™dzy wersjami tego samego produktu. + +### ObsĹ‚ugiwane platformy + + * Android + * BlackBerry 10 + * PrzeglÄ…darka + * iOS + * Tizen + * Windows Phone 7 i 8 + * Windows 8 + +### Szybki przykĹ‚ad + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Zobacz http://theiphonewiki.com/wiki/index.php?title=Models / / modelu var = device.model; + + +### Dziwactwa Androida + + * Pobiera [nazwÄ™ produktu](http://developer.android.com/reference/android/os/Build.html#PRODUCT) zamiast [nazwy modelu](http://developer.android.com/reference/android/os/Build.html#MODEL), ktĂłry czÄ™sto jest nazwÄ… kod produkcji. Na przykĹ‚ad, Nexus One zwraca `Passion` , i zwraca Motorola Droid`voles`. + +### Dziwactwa Tizen + + * Zwraca modelu urzÄ…dzenia przypisane przez dostawcÄ™, na przykĹ‚ad,`TIZEN` + +### Windows Phone 7 i 8 dziwactwa + + * Zwraca modelu urzÄ…dzenia, okreĹ›lonej przez producenta. Na przykĹ‚ad Samsung ostroĹ›ci zwraca`SGH-i917`. + +## device.platform + +Uzyskać nazwÄ™ systemu operacyjnego urzÄ…dzenia. + + var string = device.platform; + + +### ObsĹ‚ugiwane platformy + + * Android + * BlackBerry 10 + * Browser4 + * Firefox OS + * iOS + * Tizen + * Windows Phone 7 i 8 + * Windows 8 + +### Szybki przykĹ‚ad + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Dziwactwa Windows Phone 7 + +UrzÄ…dzenia Windows Phone 7 raport platformy jako`WinCE`. + +### Windows Phone 8 dziwactwa + +UrzÄ…dzenia Windows Phone 8 raport platformy jako`Win32NT`. + +## device.uuid + +SiÄ™ urzÄ…dzenia uniwersalnie unikatowy identyfikator ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + + +### Opis + +Szczegóły jak UUID jest generowane sÄ… okreĹ›lane przez producenta urzÄ…dzenia i sÄ… specyficzne dla platformy lub modelu urzÄ…dzenia. + +### ObsĹ‚ugiwane platformy + + * Android + * BlackBerry 10 + * iOS + * Tizen + * Windows Phone 7 i 8 + * Windows 8 + +### Szybki przykĹ‚ad + + // Android: Returns a random 64-bit integer (as a string, again!) + // The integer is generated on the device's first boot + // + // BlackBerry: Returns the PIN number of the device + // This is a nine-digit unique integer (as a string, though!) + // + // iPhone: (Paraphrased from the UIDevice Class documentation) + // Returns a string of hash values created from multiple hardware identifies. + // It is guaranteed to be unique for every device and can't be tied + // to the user account. + // Windows Phone 7 : Returns a hash of device+current user, + // if the user is not defined, a guid is generated and will persist until the app is uninstalled + // Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number + // unique to every GSM and UMTS mobile phone. + var deviceID = device.uuid; + + +### iOS dziwactwo + +`uuid`Na iOS nie jest przypisany do urzÄ…dzenia, ale różni siÄ™ dla kaĹĽdej aplikacji, dla kaĹĽdej instalacji. Zmienia siÄ™ jeĹ›li moĹĽesz usunąć i ponownie zainstalować aplikacjÄ™, a ewentualnie takĹĽe po aktualizacji iOS czy nawet uaktualnienia aplikacji dla wersji (widoczny w iOS 5.1). `uuid`Jest nie wiarygodne wartoĹ›ci. + +### Windows Phone 7 i 8 dziwactwa + +`uuid`Dla Windows Phone 7 wymaga uprawnieĹ„ `ID_CAP_IDENTITY_DEVICE` . Microsoft bÄ™dzie prawdopodobnie potÄ™piać ten wkrĂłtce. JeĹ›li funkcja nie jest dostÄ™pna, aplikacja generuje trwaĹ‚e identyfikator guid, ktĂłry jest utrzymywany przez czas trwania instalacji aplikacji na urzÄ…dzeniu. + +## device.version + +Pobierz wersjÄ™ systemu operacyjnego. + + var string = device.version; + + +### ObsĹ‚ugiwane platformy + + * Android 2.1 + + * BlackBerry 10 + * PrzeglÄ…darka + * iOS + * Tizen + * Windows Phone 7 i 8 + * Windows 8 + +### Szybki przykĹ‚ad + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/pl/index.md b/plugins/cordova-plugin-device/doc/pl/index.md new file mode 100644 index 0000000..acc8f9c --- /dev/null +++ b/plugins/cordova-plugin-device/doc/pl/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +Ten plugin okreĹ›la globalne `device` obiekt, ktĂłry opisuje urzÄ…dzenia sprzÄ™towe i programowe. Mimo, ĹĽe obiekt jest w globalnym zasiÄ™gu, nie jest dostÄ™pne dopiero po `deviceready` zdarzenie. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## Instalacja + + cordova plugin add cordova-plugin-device + + +## WĹ‚aĹ›ciwoĹ›ci + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Pobierz wersjÄ™ Cordova dziaĹ‚a na urzÄ…dzeniu. + +### ObsĹ‚ugiwane platformy + +* Amazon Fire OS +* Android +* BlackBerry 10 +* PrzeglÄ…darka +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 i 8 +* Windows 8 + +## device.model + +`device.model`Zwraca nazwÄ™ modelu lub produktu. Wartość jest zestaw przez producenta urzÄ…dzenia i mogÄ… siÄ™ różnić miÄ™dzy wersjami tego samego produktu. + +### ObsĹ‚ugiwane platformy + +* Android +* BlackBerry 10 +* PrzeglÄ…darka +* iOS +* Tizen +* Windows Phone 7 i 8 +* Windows 8 + +### Szybki przykĹ‚ad + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Zobacz http://theiphonewiki.com/wiki/index.php?title=Models / / modelu var = device.model; + + +### Dziwactwa Androida + +* Pobiera [nazwÄ™ produktu][1] zamiast [nazwy modelu][2], ktĂłry czÄ™sto jest nazwÄ… kod produkcji. Na przykĹ‚ad, Nexus One zwraca `Passion` , i zwraca Motorola Droid`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Dziwactwa Tizen + +* Zwraca modelu urzÄ…dzenia przypisane przez dostawcÄ™, na przykĹ‚ad,`TIZEN` + +### Windows Phone 7 i 8 dziwactwa + +* Zwraca modelu urzÄ…dzenia, okreĹ›lonej przez producenta. Na przykĹ‚ad Samsung ostroĹ›ci zwraca`SGH-i917`. + +## device.platform + +Uzyskać nazwÄ™ systemu operacyjnego urzÄ…dzenia. + + var string = device.platform; + + +### ObsĹ‚ugiwane platformy + +* Android +* BlackBerry 10 +* Browser4 +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 i 8 +* Windows 8 + +### Szybki przykĹ‚ad + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Dziwactwa Windows Phone 7 + +UrzÄ…dzenia Windows Phone 7 raport platformy jako`WinCE`. + +### Windows Phone 8 dziwactwa + +UrzÄ…dzenia Windows Phone 8 raport platformy jako`Win32NT`. + +## device.uuid + +SiÄ™ urzÄ…dzenia uniwersalnie unikatowy identyfikator ([UUID][3]). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### Opis + +Szczegóły jak UUID jest generowane sÄ… okreĹ›lane przez producenta urzÄ…dzenia i sÄ… specyficzne dla platformy lub modelu urzÄ…dzenia. + +### ObsĹ‚ugiwane platformy + +* Android +* BlackBerry 10 +* iOS +* Tizen +* Windows Phone 7 i 8 +* Windows 8 + +### Szybki przykĹ‚ad + + / / Android: zwraca losowe 64-bitowa liczba caĹ‚kowita (jako ciÄ…g, znowu!) / / liczba caĹ‚kowita jest generowany na pierwszego uruchomienia urzÄ…dzenia / / / / BlackBerry: zwraca numer PIN urzÄ…dzenia / / to jest unikatowÄ… liczbÄ… caĹ‚kowitÄ… dziewiÄ™ciu cyfr (jako ciÄ…g, choć!) / / / / iPhone: (zacytowana w dokumentacji klasy UIDevice) / / zwraca ciÄ…g wartoĹ›ci mieszania utworzone z wielu sprzÄ™tu identyfikuje. + Zapewniona jest unikatowy dla kaĹĽdego urzÄ…dzenia i nie moĹĽe być zwiÄ…zane z / do konta uĹĽytkownika. + / / Windows Phone 7: zwraca wartość mieszania urzÄ…dzenia + bieĹĽÄ…cy uĹĽytkownik, / / jeĹ›li nie zdefiniowane przez uĹĽytkownika, identyfikator guid jest generowany i bÄ™dzie trwać do czasu odinstalowania aplikacji / / Tizen: zwraca urzÄ…dzenia IMEI (International Mobile Equipment Identity lub IMEI jest liczbÄ… / / unikatowe dla kaĹĽdego telefonu komĂłrkowego GSM i UMTS. + var deviceID = device.uuid; + + +### iOS dziwactwo + +`uuid`Na iOS nie jest przypisany do urzÄ…dzenia, ale różni siÄ™ dla kaĹĽdej aplikacji, dla kaĹĽdej instalacji. Zmienia siÄ™ jeĹ›li moĹĽesz usunąć i ponownie zainstalować aplikacjÄ™, a ewentualnie takĹĽe po aktualizacji iOS czy nawet uaktualnienia aplikacji dla wersji (widoczny w iOS 5.1). `uuid`Jest nie wiarygodne wartoĹ›ci. + +### Windows Phone 7 i 8 dziwactwa + +`uuid`Dla Windows Phone 7 wymaga uprawnieĹ„ `ID_CAP_IDENTITY_DEVICE` . Microsoft bÄ™dzie prawdopodobnie potÄ™piać ten wkrĂłtce. JeĹ›li funkcja nie jest dostÄ™pna, aplikacja generuje trwaĹ‚e identyfikator guid, ktĂłry jest utrzymywany przez czas trwania instalacji aplikacji na urzÄ…dzeniu. + +## device.version + +Pobierz wersjÄ™ systemu operacyjnego. + + var string = device.version; + + +### ObsĹ‚ugiwane platformy + +* Android 2.1 + +* BlackBerry 10 +* PrzeglÄ…darka +* iOS +* Tizen +* Windows Phone 7 i 8 +* Windows 8 + +### Szybki przykĹ‚ad + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/ru/index.md b/plugins/cordova-plugin-device/doc/ru/index.md new file mode 100644 index 0000000..263b1cd --- /dev/null +++ b/plugins/cordova-plugin-device/doc/ru/index.md @@ -0,0 +1,219 @@ + + +# cordova-plugin-device + +Этот плагин определяет глобальный объект `device`, который опиŃывает оборŃдование и программное обеŃпечение ŃŃтройŃтва. НеŃмотря на Ń‚Đľ что объект в глобальной облаŃти видимоŃти, он не Đ´ĐľŃŃ‚Ńпен Đ´Đľ того момента пока не произойдет Ńобытие `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## ĐŁŃтановка + + cordova plugin add cordova-plugin-device + + +## Параметры + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +Возвращает верŃию Cordova, работающŃŃŽ на ŃŃтройŃтве. + +### Поддерживаемые платформы + +* Amazon Fire OS +* Android +* BlackBerry 10 +* Обозреватель +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 и 8 +* Windows 8 + +## device.model + +СвойŃтво `device.model` возвращает имя ŃŃтройŃтва модели или продŃкта. Значение ŃŃтанавливаетŃŃŹ производителем ŃŃтройŃтва и могŃŃ‚ отличатьŃŃŹ в разных верŃиях одного и того же продŃкта. + +### Поддерживаемые платформы + +* Android +* BlackBerry 10 +* Обозреватель +* iOS +* Tizen +* Windows Phone 7 и 8 +* Windows 8 + +### Краткий пример + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models + // + var model = device.model; + + +### ĐžŃобенноŃти Android + +* Возвращает [имя продŃкта][1] , Đ° не [имя модели][2], которое чаŃŃ‚Đľ являетŃŃŹ производŃтвенным кодом. Например, Nexus One из них возвращает `Passion` , и Motorola Droid возвращает `voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### ĐžŃобенноŃти Tizen + +* Возвращает модель ŃŃтройŃтва, назначенного вендором, например,`TIZEN` + +### ĐžŃобенноŃти Windows Phone 7 и 8 + +* Возвращает модель ŃŃтройŃтва, Ńказанной заводом-изготовителем. Например Samsung Focus возвращает `SGH-i917`. + +## device.platform + +ПолŃчите имя операционной ŃиŃтемы ŃŃтройŃтва. + + var string = device.platform; + + +### Поддерживаемые платформы + +* Android +* BlackBerry 10 +* БраŃзером4 +* Firefox OS +* iOS +* Tizen +* Windows Phone 7 и 8 +* Windows 8 + +### Краткий пример + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### ĐžŃобенноŃти Windows Phone 7 + +Windows Phone 7 ŃŃтройŃтва Ńообщают ĐżĐ»Đ°Ń‚Ń„ĐľŃ€ĐĽŃ ĐşĐ°Đş `WinCE`. + +### ĐžŃобенноŃти Windows Phone 8 + +ĐŁŃтройŃтва Windows Phone 8 Ńообщают ĐżĐ»Đ°Ń‚Ń„ĐľŃ€ĐĽŃ ĐşĐ°Đş `Win32NT`. + +## device.uuid + +Возвращает ŃниверŃальный Ńникального идентификатора ([UUID][3] ŃŃтройŃтва). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### ОпиŃание + +Подробная информация Đľ том как UUID генерирŃетŃŃŹ, определяютŃŃŹ изготовителем ŃŃтройŃтва и являютŃŃŹ ŃпецифичеŃкими для платформы или модели ŃŃтройŃтва. + +### Поддерживаемые платформы + +* Android +* BlackBerry 10 +* iOS +* Tizen +* Windows Phone 7 и 8 +* Windows 8 + +### Краткий пример + + // Android: Возвращает ŃĐ»Ńчайное 64-разрядное целое чиŃло (в виде Ńтроки, опять!) + // целое чиŃло генерирŃетŃŃŹ при первой загрŃзке ŃŃтройŃтва + // + // BlackBerry: Возвращает номер PIN ŃŃтройŃтва + // ŃŤŃ‚Đľ 9 значный Ńникальный целочиŃленный (как Ńтрока, хотя!) + // + // iPhone: (Перефразировано из докŃментации клаŃŃĐ° UIDevice) + // возвращает ŃŃ‚Ń€ĐľĐşŃ Ń…ŃŤŃ-значения, Ńозданные из неŃкольких аппаратных определяет. + // Đ­Ń‚Đľ значение гарантированно являетŃŃŹ Ńникальным для каждого ŃŃтройŃтва и не может быть привязано + // Đş Ńчетной запиŃи пользователя. + // Windows Phone 7: Возвращает Ń…ŃŤŃ ŃŃтройŃтво + текŃщего пользователя, + // еŃли пользователь не определен, формирŃетŃŃŹ guid который и бŃдет ŃохранятьŃŃŹ Đ´Đľ тех пор, пока приложение не ŃдалитьŃŃŹ + // Tizen: возвращает IMEI ŃŃтройŃтва (МеждŃнародный идентификатор мобильного оборŃдования или IMEI ŃŤŃ‚Đľ чиŃло + // Ńникальное для каждого мобильного телефона GSM и UMTS. + var deviceID = device.uuid; + + +### ĐžŃобенноŃти iOS + +На iOS `uuid` не являетŃŃŹ Ńникальным для ŃŃтройŃтва, но варьирŃетŃŃŹ для каждого приложения, и для каждой ŃŃтановки. Значение меняетŃŃŹ, еŃли Ńдалить и повторно ŃŃтановить приложение, и возможно также когда вы обновите iOS, или даже обновить приложение Đ´Đľ ŃледŃющей верŃии (очевидно в iOS 5.1). Значение `uuid` не являетŃŃŹ надежным. + +### ĐžŃобенноŃти Windows Phone 7 и 8 + +Для Windows Phone 7 `uuid` требŃет разреŃения `ID_CAP_IDENTITY_DEVICE` . Microsoft Ńкорее вŃего Ńкоро Ńделает ŃŤŃ‚Đľ ŃвойŃтво ŃŃтаревŃим. Đ•Ńли возможноŃŃ‚ŃŚ недоŃŃ‚Ńпна, приложение Ńоздает поŃтоянные guid, который ŃохраняетŃŃŹ на вŃе время ŃŃтановки приложения на ŃŃтройŃтве. + +## device.version + +Возвращает верŃию операционной ŃиŃтемы. + + var string = device.version; + + +### Поддерживаемые платформы + +* Android 2.1 + +* BlackBerry 10 +* Обозреватель +* iOS +* Tizen +* Windows Phone 7 и 8 +* Windows 8 + +### Краткий пример + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/doc/zh/README.md b/plugins/cordova-plugin-device/doc/zh/README.md new file mode 100644 index 0000000..9a18a55 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/zh/README.md @@ -0,0 +1,203 @@ + + +# cordova-plugin-device + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device) + +這個外掛程式定義全ç `device` 物件,描述該設備的硬體和軟體。 雖然物件ćŻĺś¨ĺ…¨ç範圍內,但不ćŻĺŹŻç”¨ďĽŚç›´ĺ°ĺľŚ `deviceready` 事件。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## 安裝 + + cordova plugin add cordova-plugin-device + + +## 屬性 + + * device.cordova + * device.model + * device.platform + * device.uuid + * device.version + +## device.cordova + +獲取科çľĺ¤šç“¦ĺś¨č¨­ĺ‚™ä¸Šé‹čˇŚçš„ç‰ćś¬ă€‚ + +### 支援的平臺 + + * 亞馬éśç« OS + * Android 系統 + * 黑莓 10 + * 瀏覽器 + * ç«ç‹ç€Źč¦˝ĺ™¨ä˝śćĄ­çł»çµ± + * iOS + * Tizen + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + +## device.model + +`device.model`返回設備的模型ć–產ĺ“çš„ĺŤç¨±ă€‚值由設備製造商設置和ĺŚä¸€ç”˘ĺ“的不ĺŚç‰ćś¬ĺŹŻč˝ä¸ŤĺŚă€‚ + +### 支援的平臺 + + * Android 系統 + * 黑莓 10 + * 瀏覽器 + * iOS + * Tizen + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + +### 快速的示例 + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. č«‹ĺŹé–± HTTP://theiphonewiki.com/wiki/index.php?title=Models / / var 模型 = device.model ; + + +### Android 的怪癖 + + * 獲取[產ĺ“ĺŤç¨±](http://developer.android.com/reference/android/os/Build.html#PRODUCT)而不ćŻ[產ĺ“型號ĺŤç¨±](http://developer.android.com/reference/android/os/Build.html#MODEL),這往往ćŻç”źç”˘ä»Łç˘ĽĺŤç¨±ă€‚ 例如,Nexus One 返回 `Passion` ,和摩ć‰çľ…拉 Droid 返回`voles`. + +### Tizen 怪癖 + + * 例如,返回č‡äľ›ć‡‰ĺ•†ćŚ‡ć´ľçš„設備模型`TIZEN` + +### Windows Phone 7 ĺ’Ś 8 怪癖 + + * 返回由製造商指定的設備模型。例如,三ćźç„¦é»žčż”回`SGH-i917`. + +## device.platform + +獲取設備的作業系統ĺŤç¨±ă€‚ + + var string = device.platform; + + +### 支援的平臺 + + * Android 系統 + * 黑莓 10 + * Browser4 + * ç«ç‹ç€Źč¦˝ĺ™¨ä˝śćĄ­çł»çµ± + * iOS + * Tizen + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + +### 快速的示例 + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 的怪癖 + +Windows Phone 7 設備報告作為平臺`WinCE`. + +### Windows Phone 8 怪癖 + +Windows Phone 8 設備報告作為平臺`Win32NT`. + +## device.uuid + +獲取設備的通用唯一č­ĺĄç˘Ľ ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)). + + var string = device.uuid; + + +### čŞŞćŽ + +如何生ć一個 UUID 的細節由設備製造商和特定于設備的平臺ć–模型。 + +### 支援的平臺 + + * Android 系統 + * 黑莓 10 + * iOS + * Tizen + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + +### 快速的示例 + + / / Android: 一個隨機的 64 位整數 ďĽä˝śç‚şĺ­—串返回,再次!) / / 上設備的第一次啟動生ć的整數 / / / / 黑莓手機: 返回設備的 PIN 號碼 / / 這ćŻäąťĺ€‹ć•¸ĺ­—的唯一整數 ďĽä˝śç‚şĺ­—串,雖然!) / / / / iPhone: ďĽĺľž UIDevice 類文檔解釋) / / 返回一個字串的雜湊值創建的多個硬體標č­ă€‚ + / / ĺ®äżťč­‰ćŻĺ”Żä¸€çš„每個設備並不č˝ç¶ / / ĺ°ä˝żç”¨č€…帳ć¶ă€‚ + / / Windows Phone 7: 返回的雜湊代碼的設備 + 當前使用者,/ / 如果未定義使用者,則一個 guid 生ć的並且將ćśäżťç•™ç›´ĺ°ĺŤ¸čĽ‰č©˛ć‡‰ç”¨ç¨‹ĺĽŹ / / Tizen: 返回設備 IMEI ďĽĺś‹éš›čˇŚĺ‹•čŁťç˝®čş«ä»˝ć– IMEI ćŻä¸€ĺ€‹ć•¸ä˝Ť / / 獨有的每一個 UMTS ĺ’Ś GSM 行動電話。 + var deviceID = device.uuid; + + +### iOS 怪癖 + +`uuid`在 iOS 不ćŻĺ”Żä¸€çš„一種裝置,但對於每個應用程式,為每個安裝而異。 如果您ĺŞé™¤ä¸¦é‡Ťć–°ĺ®‰čŁťč©˛ć‡‰ç”¨ç¨‹ĺĽŹďĽŚĺ®ć›´ć”ąĺ’ŚĺŹŻč˝é‚„當你升級 iOS,ć–甚至升級每個ç‰ćś¬ ďĽiOS 5.1 中ĺ­ĺś¨ćŽéˇŻçš„) 的應用程式。 `uuid`不ćŻä¸€ĺ€‹ĺŹŻéť çš„值。 + +### Windows Phone 7 ĺ’Ś 8 怪癖 + +`uuid`ç‚ş Windows Phone 7 é ç¶“許可 `ID_CAP_IDENTITY_DEVICE` 。 Microsoft 可č˝ćśĺľĺż«ćŁ„用此屬性。 如果沒有可用的č˝ĺŠ›ďĽŚć‡‰ç”¨ç¨‹ĺĽŹĺ°‡ç”źć設備上應用程式的安裝éŽç¨‹ä¸­äżťćŚćŚçşŚçš„ guid。 + +## device.version + +獲取作業系統ç‰ćś¬ă€‚ + + var string = device.version; + + +### 支援的平臺 + + * Android 2.1 + + * 黑莓 10 + * 瀏覽器 + * iOS + * Tizen + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + +### 快速的示例 + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; \ No newline at end of file diff --git a/plugins/cordova-plugin-device/doc/zh/index.md b/plugins/cordova-plugin-device/doc/zh/index.md new file mode 100644 index 0000000..5626d69 --- /dev/null +++ b/plugins/cordova-plugin-device/doc/zh/index.md @@ -0,0 +1,206 @@ + + +# cordova-plugin-device + +這個外掛程式定義全ç `device` 物件,描述該設備的硬體和軟體。 雖然物件ćŻĺś¨ĺ…¨ç範圍內,但不ćŻĺŹŻç”¨ďĽŚç›´ĺ°ĺľŚ `deviceready` 事件。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(device.cordova); + } + + +## 安裝 + + cordova plugin add cordova-plugin-device + + +## 屬性 + +* device.cordova +* device.model +* device.platform +* device.uuid +* device.version + +## device.cordova + +獲取科çľĺ¤šç“¦ĺś¨č¨­ĺ‚™ä¸Šé‹čˇŚçš„ç‰ćś¬ă€‚ + +### 支援的平臺 + +* 亞馬éśç« OS +* Android 系統 +* 黑莓 10 +* 瀏覽器 +* ç«ç‹ç€Źč¦˝ĺ™¨çš„作業系統 +* iOS +* ćł° +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +## device.model + +`device.model`返回設備的模型ć–產ĺ“çš„ĺŤç¨±ă€‚值由設備製造商設置和ĺŚä¸€ç”˘ĺ“的不ĺŚç‰ćś¬ĺŹŻč˝ä¸ŤĺŚă€‚ + +### 支援的平臺 + +* Android 系統 +* 黑莓 10 +* 瀏覽器 +* iOS +* ćł° +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +### 快速的示例 + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // Browser: Google Chrome returns "Chrome" + // Safari returns "Safari" + // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. č«‹ĺŹé–± HTTP://theiphonewiki.com/wiki/index.php?title=Models / / var 模型 = device.model ; + + +### Android 的怪癖 + +* 獲取[產ĺ“ĺŤç¨±][1]而不ćŻ[產ĺ“型號ĺŤç¨±][2],這往往ćŻç”źç”˘ä»Łç˘ĽĺŤç¨±ă€‚ 例如,Nexus One 返回 `Passion` ,和摩ć‰çľ…拉 Droid 返回`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +### Tizen 怪癖 + +* 例如,返回č‡äľ›ć‡‰ĺ•†ćŚ‡ć´ľçš„設備模型`TIZEN` + +### Windows Phone 7 ĺ’Ś 8 怪癖 + +* 返回由製造商指定的設備模型。例如,三ćźç„¦é»žčż”回`SGH-i917`. + +## device.platform + +獲取設備的作業系統ĺŤç¨±ă€‚ + + var string = device.platform; + + +### 支援的平臺 + +* Android 系統 +* 黑莓 10 +* Browser4 +* ç«ç‹ç€Źč¦˝ĺ™¨çš„作業系統 +* iOS +* ćł° +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +### 快速的示例 + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry 10" + // - Browser: returns "MacIntel" on Mac + // returns "Win32" on Windows + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +### Windows Phone 7 的怪癖 + +Windows Phone 7 設備報告作為平臺`WinCE`. + +### Windows Phone 8 怪癖 + +Windows Phone 8 設備報告作為平臺`Win32NT`. + +## device.uuid + +獲取設備的通用唯一č­ĺĄç˘Ľ ([UUID][3]). + + [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +### čŞŞćŽ + +如何生ć一個 UUID 的細節由設備製造商和特定于設備的平臺ć–模型。 + +### 支援的平臺 + +* Android 系統 +* 黑莓 10 +* iOS +* Tizen +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +### 快速的示例 + + / / Android: 一個隨機的 64 位整數 ďĽä˝śç‚şĺ­—串返回,再次!) / / 上設備的第一次啟動生ć的整數 / / / / 黑莓手機: 返回設備的 PIN 號碼 / / 這ćŻäąťĺ€‹ć•¸ĺ­—的唯一整數 ďĽä˝śç‚şĺ­—串,雖然!) / / / / iPhone: ďĽĺľž UIDevice 類文檔解釋) / / 返回一個字串的雜湊值創建的多個硬體標č­ă€‚ + / / ĺ®äżťč­‰ćŻĺ”Żä¸€çš„每個設備並不č˝ç¶ / / ĺ°ä˝żç”¨č€…帳ć¶ă€‚ + / / Windows Phone 7: 返回的雜湊代碼的設備 + 當前使用者,/ / 如果未定義使用者,則一個 guid 生ć的並且將ćśäżťç•™ç›´ĺ°ĺŤ¸čĽ‰č©˛ć‡‰ç”¨ç¨‹ĺĽŹ / / Tizen: 返回設備 IMEI ďĽĺś‹éš›čˇŚĺ‹•čŁťç˝®čş«ä»˝ć– IMEI ćŻä¸€ĺ€‹ć•¸ä˝Ť / / 獨有的每一個 UMTS ĺ’Ś GSM 行動電話。 + var deviceID = device.uuid; + + +### iOS 怪癖 + +`uuid`在 iOS 不ćŻĺ”Żä¸€çš„一種裝置,但對於每個應用程式,為每個安裝而異。 如果您ĺŞé™¤ä¸¦é‡Ťć–°ĺ®‰čŁťč©˛ć‡‰ç”¨ç¨‹ĺĽŹďĽŚĺ®ć›´ć”ąĺ’ŚĺŹŻč˝é‚„當你升級 iOS,ć–甚至升級每個ç‰ćś¬ ďĽiOS 5.1 中ĺ­ĺś¨ćŽéˇŻçš„) 的應用程式。 `uuid`不ćŻä¸€ĺ€‹ĺŹŻéť çš„值。 + +### Windows Phone 7 ĺ’Ś 8 怪癖 + +`uuid`ç‚ş Windows Phone 7 é ç¶“許可 `ID_CAP_IDENTITY_DEVICE` 。 Microsoft 可č˝ćśĺľĺż«ćŁ„用此屬性。 如果沒有可用的č˝ĺŠ›ďĽŚć‡‰ç”¨ç¨‹ĺĽŹĺ°‡ç”źć設備上應用程式的安裝éŽç¨‹ä¸­äżťćŚćŚçşŚçš„ guid。 + +## device.version + +獲取作業系統ç‰ćś¬ă€‚ + + var string = device.version; + + +### 支援的平臺 + +* Android 2.1 + +* 黑莓 10 +* 瀏覽器 +* iOS +* ćł° +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +### 快速的示例 + + // Android: Froyo OS would return "2.2" + // Eclair OS would return "2.1", "2.0.1", or "2.0" + // Version can also return update level "2.1-update1" + // + // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" + // + // Browser: Returns version number for the browser + // + // iPhone: iOS 3.2 returns "3.2" + // + // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; diff --git a/plugins/cordova-plugin-device/package.json b/plugins/cordova-plugin-device/package.json new file mode 100644 index 0000000..12c2d1e --- /dev/null +++ b/plugins/cordova-plugin-device/package.json @@ -0,0 +1,61 @@ +{ + "name": "cordova-plugin-device", + "version": "1.1.4", + "description": "Cordova Device Plugin", + "cordova": { + "id": "cordova-plugin-device", + "platforms": [ + "firefoxos", + "tizen", + "android", + "amazon-fireos", + "ubuntu", + "ios", + "blackberry10", + "wp7", + "wp8", + "windows8", + "windows", + "browser", + "osx" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/apache/cordova-plugin-device" + }, + "keywords": [ + "cordova", + "device", + "ecosystem:cordova", + "cordova-firefoxos", + "cordova-tizen", + "cordova-android", + "cordova-amazon-fireos", + "cordova-ubuntu", + "cordova-ios", + "cordova-blackberry10", + "cordova-wp7", + "cordova-wp8", + "cordova-windows8", + "cordova-windows", + "cordova-browser", + "cordova-osx" + ], + "scripts": { + "test": "npm run jshint", + "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests" + }, + "author": "Apache Software Foundation", + "license": "Apache-2.0", + "engines": { + "cordovaDependencies": { + "2.0.0": { + "cordova": ">100" + } + } + }, + "devDependencies": { + "jshint": "^2.6.0" + } +} diff --git a/plugins/cordova-plugin-device/plugin.xml b/plugins/cordova-plugin-device/plugin.xml new file mode 100644 index 0000000..ae956f8 --- /dev/null +++ b/plugins/cordova-plugin-device/plugin.xml @@ -0,0 +1,174 @@ + + + + + Device + Cordova Device Plugin + Apache 2.0 + cordova,device + https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git + https://issues.apache.org/jira/browse/CB/component/12320648 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + read_device_identifying_information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-device/src/android/Device.java b/plugins/cordova-plugin-device/src/android/Device.java new file mode 100644 index 0000000..e9efcb4 --- /dev/null +++ b/plugins/cordova-plugin-device/src/android/Device.java @@ -0,0 +1,174 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.device; + +import java.util.TimeZone; + +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaInterface; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import android.provider.Settings; + +public class Device extends CordovaPlugin { + public static final String TAG = "Device"; + + public static String platform; // Device OS + public static String uuid; // Device UUID + + private static final String ANDROID_PLATFORM = "Android"; + private static final String AMAZON_PLATFORM = "amazon-fireos"; + private static final String AMAZON_DEVICE = "Amazon"; + + /** + * Constructor. + */ + public Device() { + } + + /** + * Sets the context of the Command. This can then be used to do things like + * get file paths associated with the Activity. + * + * @param cordova The context of the main Activity. + * @param webView The CordovaWebView Cordova is running in. + */ + public void initialize(CordovaInterface cordova, CordovaWebView webView) { + super.initialize(cordova, webView); + Device.uuid = getUuid(); + } + + /** + * Executes the request and returns PluginResult. + * + * @param action The action to execute. + * @param args JSONArry of arguments for the plugin. + * @param callbackContext The callback id used when calling back into JavaScript. + * @return True if the action was valid, false if not. + */ + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if ("getDeviceInfo".equals(action)) { + JSONObject r = new JSONObject(); + r.put("uuid", Device.uuid); + r.put("version", this.getOSVersion()); + r.put("platform", this.getPlatform()); + r.put("model", this.getModel()); + r.put("manufacturer", this.getManufacturer()); + r.put("isVirtual", this.isVirtual()); + r.put("serial", this.getSerialNumber()); + callbackContext.success(r); + } + else { + return false; + } + return true; + } + + //-------------------------------------------------------------------------- + // LOCAL METHODS + //-------------------------------------------------------------------------- + + /** + * Get the OS name. + * + * @return + */ + public String getPlatform() { + String platform; + if (isAmazonDevice()) { + platform = AMAZON_PLATFORM; + } else { + platform = ANDROID_PLATFORM; + } + return platform; + } + + /** + * Get the device's Universally Unique Identifier (UUID). + * + * @return + */ + public String getUuid() { + String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); + return uuid; + } + + public String getModel() { + String model = android.os.Build.MODEL; + return model; + } + + public String getProductName() { + String productname = android.os.Build.PRODUCT; + return productname; + } + + public String getManufacturer() { + String manufacturer = android.os.Build.MANUFACTURER; + return manufacturer; + } + + public String getSerialNumber() { + String serial = android.os.Build.SERIAL; + return serial; + } + + /** + * Get the OS version. + * + * @return + */ + public String getOSVersion() { + String osversion = android.os.Build.VERSION.RELEASE; + return osversion; + } + + public String getSDKVersion() { + @SuppressWarnings("deprecation") + String sdkversion = android.os.Build.VERSION.SDK; + return sdkversion; + } + + public String getTimeZoneID() { + TimeZone tz = TimeZone.getDefault(); + return (tz.getID()); + } + + /** + * Function to check if the device is manufactured by Amazon + * + * @return + */ + public boolean isAmazonDevice() { + if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) { + return true; + } + return false; + } + + public boolean isVirtual() { + return android.os.Build.FINGERPRINT.contains("generic") || + android.os.Build.PRODUCT.contains("sdk"); + } + +} diff --git a/plugins/cordova-plugin-device/src/blackberry10/index.js b/plugins/cordova-plugin-device/src/blackberry10/index.js new file mode 100644 index 0000000..ef0543b --- /dev/null +++ b/plugins/cordova-plugin-device/src/blackberry10/index.js @@ -0,0 +1,71 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* global PluginResult */ + +function getModelName () { + var modelName = window.qnx.webplatform.device.modelName; + //Pre 10.2 (meaning Z10 or Q10) + if (typeof modelName === "undefined") { + if (window.screen.height === 720 && window.screen.width === 720) { + if ( window.matchMedia("(-blackberry-display-technology: -blackberry-display-oled)").matches) { + modelName = "Q10"; + } else { + modelName = "Q5"; + } + } else if ((window.screen.height === 1280 && window.screen.width === 768) || + (window.screen.height === 768 && window.screen.width === 1280)) { + modelName = "Z10"; + } else { + modelName = window.qnx.webplatform.deviceName; + } + } + + return modelName; +} + +function getUUID () { + var uuid = ""; + try { + //Must surround by try catch because this will throw if the app is missing permissions + uuid = window.qnx.webplatform.device.devicePin; + } catch (e) { + //DO Nothing + } + return uuid; +} + +module.exports = { + getDeviceInfo: function (success, fail, args, env) { + var result = new PluginResult(args, env), + modelName = getModelName(), + uuid = getUUID(), + info = { + manufacturer: 'BlackBerry', + platform: "blackberry10", + version: window.qnx.webplatform.device.scmBundle, + model: modelName, + uuid: uuid + }; + + result.ok(info); + } +}; diff --git a/plugins/cordova-plugin-device/src/browser/DeviceProxy.js b/plugins/cordova-plugin-device/src/browser/DeviceProxy.js new file mode 100644 index 0000000..a863201 --- /dev/null +++ b/plugins/cordova-plugin-device/src/browser/DeviceProxy.js @@ -0,0 +1,82 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +var browser = require('cordova/platform'); + +function getPlatform() { + return "browser"; +} + +function getModel() { + return getBrowserInfo(true); +} + +function getVersion() { + return getBrowserInfo(false); +} + +function getBrowserInfo(getModel) { + var userAgent = navigator.userAgent; + var returnVal = ''; + var offset; + + if ((offset = userAgent.indexOf('Chrome')) !== -1) { + returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7); + } else if ((offset = userAgent.indexOf('Safari')) !== -1) { + if (getModel) { + returnVal = 'Safari'; + } else { + returnVal = userAgent.substring(offset + 7); + + if ((offset = userAgent.indexOf('Version')) !== -1) { + returnVal = userAgent.substring(offset + 8); + } + } + } else if ((offset = userAgent.indexOf('Firefox')) !== -1) { + returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8); + } else if ((offset = userAgent.indexOf('MSIE')) !== -1) { + returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5); + } else if ((offset = userAgent.indexOf('Trident')) !== -1) { + returnVal = (getModel) ? 'MSIE' : '11'; + } + + if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) { + returnVal = returnVal.substring(0, offset); + } + + return returnVal; +} + + +module.exports = { + getDeviceInfo: function (success, error) { + setTimeout(function () { + success({ + cordova: browser.cordovaVersion, + platform: getPlatform(), + model: getModel(), + version: getVersion(), + uuid: null + }); + }, 0); + } +}; + +require("cordova/exec/proxy").add("Device", module.exports); diff --git a/plugins/cordova-plugin-device/src/firefoxos/DeviceProxy.js b/plugins/cordova-plugin-device/src/firefoxos/DeviceProxy.js new file mode 100644 index 0000000..a05d7ca --- /dev/null +++ b/plugins/cordova-plugin-device/src/firefoxos/DeviceProxy.js @@ -0,0 +1,77 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +//example UA String for Firefox OS +//Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0 + +//UA parsing not recommended but currently this is the only way to get the Firefox OS version +//https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference + +//Should be replaced when better conversion to Firefox OS Version is available +function convertVersionNumber(ver) { + var hashVersion = { + '18.0': '1.0.1', + '18.1': '1.1', + '26.0': '1.2', + '28.0': '1.3', + '30.0': '1.4', + '32.0': '2.0' + }; + var rver = ver; + var sStr = ver.substring(0, 4); + if (hashVersion[sStr]) { + rver = hashVersion[sStr]; + } + return (rver); + +} +function getVersion() { + if (navigator.userAgent.match(/(mobile|tablet)/i)) { + var ffVersionArray = (navigator.userAgent.match(/Firefox\/([\d]+\.[\w]?\.?[\w]+)/)); + if (ffVersionArray.length === 2) { + return (convertVersionNumber(ffVersionArray[1])); + } + } + return (null); +} + +function getModel() { + var uaArray = navigator.userAgent.split(/\s*[;)(]\s*/); + if (navigator.userAgent.match(/(mobile|tablet)/i)) { + if (uaArray.length === 5) { + return (uaArray[2]); + } + } + return (null); +} +module.exports = { + getDeviceInfo: function (success, error) { + setTimeout(function () { + success({ + platform: 'firefoxos', + model: getModel(), + version: getVersion(), + uuid: null + }); + }, 0); + } +}; + +require("cordova/exec/proxy").add("Device", module.exports); diff --git a/plugins/cordova-plugin-device/src/ios/CDVDevice.h b/plugins/cordova-plugin-device/src/ios/CDVDevice.h new file mode 100644 index 0000000..a146d88 --- /dev/null +++ b/plugins/cordova-plugin-device/src/ios/CDVDevice.h @@ -0,0 +1,30 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import + +@interface CDVDevice : CDVPlugin +{} + ++ (NSString*)cordovaVersion; + +- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command; + +@end diff --git a/plugins/cordova-plugin-device/src/ios/CDVDevice.m b/plugins/cordova-plugin-device/src/ios/CDVDevice.m new file mode 100644 index 0000000..4d75a57 --- /dev/null +++ b/plugins/cordova-plugin-device/src/ios/CDVDevice.m @@ -0,0 +1,112 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#include +#include +#include "TargetConditionals.h" + +#import +#import "CDVDevice.h" + +@implementation UIDevice (ModelVersion) + +- (NSString*)modelVersion +{ + size_t size; + + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char* machine = malloc(size); + sysctlbyname("hw.machine", machine, &size, NULL, 0); + NSString* platform = [NSString stringWithUTF8String:machine]; + free(machine); + + return platform; +} + +@end + +@interface CDVDevice () {} +@end + +@implementation CDVDevice + +- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device +{ + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; + static NSString* UUID_KEY = @"CDVUUID"; + + // Check user defaults first to maintain backwards compaitibility with previous versions + // which didn't user identifierForVendor + NSString* app_uuid = [userDefaults stringForKey:UUID_KEY]; + if (app_uuid == nil) { + if ([device respondsToSelector:@selector(identifierForVendor)]) { + app_uuid = [[device identifierForVendor] UUIDString]; + } else { + CFUUIDRef uuid = CFUUIDCreate(NULL); + app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid); + CFRelease(uuid); + } + + [userDefaults setObject:app_uuid forKey:UUID_KEY]; + [userDefaults synchronize]; + } + + return app_uuid; +} + +- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command +{ + NSDictionary* deviceProperties = [self deviceProperties]; + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties]; + + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; +} + +- (NSDictionary*)deviceProperties +{ + UIDevice* device = [UIDevice currentDevice]; + + return @{ + @"manufacturer": @"Apple", + @"model": [device modelVersion], + @"platform": @"iOS", + @"version": [device systemVersion], + @"uuid": [self uniqueAppInstanceIdentifier:device], + @"cordova": [[self class] cordovaVersion], + @"isVirtual": @([self isVirtual]) + }; +} + ++ (NSString*)cordovaVersion +{ + return CDV_VERSION; +} + +- (BOOL)isVirtual +{ + #if TARGET_OS_SIMULATOR + return true; + #elif TARGET_IPHONE_SIMULATOR + return true; + #else + return false; + #endif +} + +@end diff --git a/plugins/cordova-plugin-device/src/osx/CDVDevice.h b/plugins/cordova-plugin-device/src/osx/CDVDevice.h new file mode 100644 index 0000000..9def254 --- /dev/null +++ b/plugins/cordova-plugin-device/src/osx/CDVDevice.h @@ -0,0 +1,28 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import + +@interface CDVDevice : CDVPlugin + ++ (NSString*) cordovaVersion; + +- (void) getDeviceInfo:(CDVInvokedUrlCommand*)command; + +@end diff --git a/plugins/cordova-plugin-device/src/osx/CDVDevice.m b/plugins/cordova-plugin-device/src/osx/CDVDevice.m new file mode 100644 index 0000000..3a63588 --- /dev/null +++ b/plugins/cordova-plugin-device/src/osx/CDVDevice.m @@ -0,0 +1,113 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#include + +#import "CDVDevice.h" + +#define SYSTEM_VERSION_PLIST @"/System/Library/CoreServices/SystemVersion.plist" + +@implementation CDVDevice + +- (NSString*) modelVersion { + size_t size; + + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char* machine = malloc(size); + sysctlbyname("hw.machine", machine, &size, NULL, 0); + NSString* modelVersion = [NSString stringWithUTF8String:machine]; + free(machine); + + return modelVersion; +} + + +- (NSString*) getSerialNr { + NSString* serialNr; + io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); + if (platformExpert) { + CFTypeRef serialNumberAsCFString = + IORegistryEntryCreateCFProperty(platformExpert, + CFSTR(kIOPlatformSerialNumberKey), + kCFAllocatorDefault, 0); + if (serialNumberAsCFString) { + serialNr = (__bridge NSString*) serialNumberAsCFString; + } + IOObjectRelease(platformExpert); + } + return serialNr; +} + +- (NSString*) uniqueAppInstanceIdentifier { + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; + static NSString* UUID_KEY = @"CDVUUID"; + + NSString* app_uuid = [userDefaults stringForKey:UUID_KEY]; + + if (app_uuid == nil) { + CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); + CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef); + + app_uuid = [NSString stringWithString:(__bridge NSString*) uuidString]; + [userDefaults setObject:app_uuid forKey:UUID_KEY]; + [userDefaults synchronize]; + + CFRelease(uuidString); + CFRelease(uuidRef); + } + + return app_uuid; +} + +- (NSString*) platform { + return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductName"]; +} + +- (NSString*) systemVersion { + return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductVersion"]; +} + +- (void) getDeviceInfo:(CDVInvokedUrlCommand*) command { + NSDictionary* deviceProperties = [self deviceProperties]; + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties]; + + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; +} + +- (NSDictionary*) deviceProperties { + NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4]; + + devProps[@"manufacturer"] = @"Apple"; + devProps[@"model"] = [self modelVersion]; + devProps[@"platform"] = [self platform]; + devProps[@"version"] = [self systemVersion]; + devProps[@"uuid"] = [self uniqueAppInstanceIdentifier]; + devProps[@"cordova"] = [[self class] cordovaVersion]; + devProps[@"serial"] = [self getSerialNr]; + devProps[@"isVirtual"] = @NO; + + NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps]; + return devReturn; +} + ++ (NSString*) cordovaVersion { + return CDV_VERSION; +} + +@end diff --git a/plugins/cordova-plugin-device/src/tizen/DeviceProxy.js b/plugins/cordova-plugin-device/src/tizen/DeviceProxy.js new file mode 100644 index 0000000..973b716 --- /dev/null +++ b/plugins/cordova-plugin-device/src/tizen/DeviceProxy.js @@ -0,0 +1,38 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var tizen = require('cordova/platform'); + +module.exports = { + getDeviceInfo: function(success, error) { + setTimeout(function () { + success({ + cordova: tizen.cordovaVersion, + platform: 'tizen', + model: null, + version: null, + uuid: null + }); + }, 0); + } +}; + +require("cordova/tizen/commandProxy").add("Device", module.exports); diff --git a/plugins/cordova-plugin-device/src/ubuntu/device.cpp b/plugins/cordova-plugin-device/src/ubuntu/device.cpp new file mode 100644 index 0000000..eb5a012 --- /dev/null +++ b/plugins/cordova-plugin-device/src/ubuntu/device.cpp @@ -0,0 +1,64 @@ +/* + * Copyright 2011 Wolfgang Koller - http://www.gofg.at/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include"device.h" + +#define CORDOVA "3.0.0" + +Device::Device(Cordova *cordova) : CPlugin(cordova) { +} + +static QString getOSName() { +#ifdef Q_OS_SYMBIAN + QString platform = "Symbian"; +#endif +#ifdef Q_OS_WIN + QString platform = "Windows"; +#endif +#ifdef Q_OS_WINCE + QString platform = "Windows CE"; +#endif +#ifdef Q_OS_LINUX + QString platform = "Linux"; +#endif + return platform; +} + +void Device::getInfo(int scId, int ecId) { + Q_UNUSED(ecId) + + QDeviceInfo systemDeviceInfo; + QDeviceInfo systemInfo; + + QString platform = getOSName(); + + QString uuid = systemDeviceInfo.uniqueDeviceID(); + if (uuid.isEmpty()) { + QString deviceDescription = systemInfo.imei(0) + ";" + systemInfo.manufacturer() + ";" + systemInfo.model() + ";" + systemInfo.productName() + ";" + platform; + QString user = qgetenv("USER"); + if (user.isEmpty()) { + user = qgetenv("USERNAME"); + if (user.isEmpty()) + user = QDir::homePath(); + } + uuid = QString(QCryptographicHash::hash((deviceDescription + ";" + user).toUtf8(), QCryptographicHash::Md5).toHex()); + } + + this->cb(scId, systemDeviceInfo.model(), CORDOVA, platform, uuid, systemInfo.version(QDeviceInfo::Os)); +} diff --git a/plugins/cordova-plugin-device/src/ubuntu/device.h b/plugins/cordova-plugin-device/src/ubuntu/device.h new file mode 100644 index 0000000..91cb937 --- /dev/null +++ b/plugins/cordova-plugin-device/src/ubuntu/device.h @@ -0,0 +1,47 @@ +/* + * Copyright 2011 Wolfgang Koller - http://www.gofg.at/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DEVICE_H_FDSAFAS +#define DEVICE_H_FDSAFAS + +#include + +#include + +class Device: public CPlugin { + Q_OBJECT +public: + explicit Device(Cordova *cordova); + + virtual const QString fullName() override { + return Device::fullID(); + } + + virtual const QString shortName() override { + return "Device"; + } + + static const QString fullID() { + return "com.cordova.Device"; + } + +signals: + +public slots: + void getInfo(int scId, int ecId); +}; + +#endif diff --git a/plugins/cordova-plugin-device/src/ubuntu/device.js b/plugins/cordova-plugin-device/src/ubuntu/device.js new file mode 100644 index 0000000..838586c --- /dev/null +++ b/plugins/cordova-plugin-device/src/ubuntu/device.js @@ -0,0 +1,33 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* global Cordova */ + +module.exports = { + getInfo:function(win,fail,args) { + Cordova.exec(function (model, cordova, platform, uuid, version) { + win({name: name, model: model, cordova: cordova, + platform: platform, uuid: uuid, version: version}); + }, null, "com.cordova.Device", "getInfo", []); + } +}; + +require("cordova/exec/proxy").add("Device", module.exports); diff --git a/plugins/cordova-plugin-device/src/windows/DeviceProxy.js b/plugins/cordova-plugin-device/src/windows/DeviceProxy.js new file mode 100644 index 0000000..f338ad3 --- /dev/null +++ b/plugins/cordova-plugin-device/src/windows/DeviceProxy.js @@ -0,0 +1,98 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* global Windows, createUUID */ + +var ROOT_CONTAINER = "{00000000-0000-0000-FFFF-FFFFFFFFFFFF}"; +var DEVICE_CLASS_KEY = "{A45C254E-DF1C-4EFD-8020-67D146A850E0},10"; +var DEVICE_CLASS_KEY_NO_SEMICOLON = "{A45C254E-DF1C-4EFD-8020-67D146A850E0}10"; +var ROOT_CONTAINER_QUERY = "System.Devices.ContainerId:=\"" + ROOT_CONTAINER + "\""; +var HAL_DEVICE_CLASS = "4d36e966-e325-11ce-bfc1-08002be10318"; +var DEVICE_DRIVER_VERSION_KEY = "{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"; + +module.exports = { + + getDeviceInfo:function(win, fail, args) { + + // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId + var deviceId; + // get deviceId, or create and store one + var localSettings = Windows.Storage.ApplicationData.current.localSettings; + if (localSettings.values.deviceId) { + deviceId = localSettings.values.deviceId; + } + else { + // App-specific hardware id could be used as uuid, but it changes if the hardware changes... + try { + var ASHWID = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null).id; + deviceId = Windows.Storage.Streams.DataReader.fromBuffer(ASHWID).readGuid(); + } catch (e) { + // Couldn't get the hardware UUID + deviceId = createUUID(); + } + //...so cache it per-install + localSettings.values.deviceId = deviceId; + } + + + var userAgent = window.clientInformation.userAgent; + // this will report "windows" in windows8.1 and windows phone 8.1 apps + // and "windows8" in windows 8.0 apps similar to cordova.js + // See https://github.com/apache/cordova-js/blob/master/src/windows/platform.js#L25 + var devicePlatform = userAgent.indexOf("MSAppHost/1.0") == -1 ? "windows" : "windows8"; + var versionString = userAgent.match(/Windows (?:Phone |NT )?([0-9.]+)/)[1]; + + var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation(); + // Running in the Windows Simulator is a remote session. + // Running in the Windows Phone Emulator has the systemProductName set to "Virtual" + var isVirtual = Windows.System.RemoteDesktop.InteractiveSession.isRemote || deviceInfo.systemProductName == "Virtual"; + var manufacturer = deviceInfo.systemManufacturer; + var model = deviceInfo.systemProductName; + + var Pnp = Windows.Devices.Enumeration.Pnp; + + Pnp.PnpObject.findAllAsync(Pnp.PnpObjectType.device, + [DEVICE_DRIVER_VERSION_KEY, DEVICE_CLASS_KEY], + ROOT_CONTAINER_QUERY) + .then(function (rootDevices) { + for (var i = 0; i < rootDevices.length; i++) { + var rootDevice = rootDevices[i]; + if (!rootDevice.properties) continue; + if (rootDevice.properties[DEVICE_CLASS_KEY_NO_SEMICOLON] == HAL_DEVICE_CLASS) { + versionString = rootDevice.properties[DEVICE_DRIVER_VERSION_KEY]; + break; + } + } + + setTimeout(function () { + win({ platform: devicePlatform, + version: versionString, + uuid: deviceId, + isVirtual: isVirtual, + model: model, + manufacturer:manufacturer}); + }, 0); + }); + } + +}; // exports + +require("cordova/exec/proxy").add("Device", module.exports); diff --git a/plugins/cordova-plugin-device/src/wp/Device.cs b/plugins/cordova-plugin-device/src/wp/Device.cs new file mode 100644 index 0000000..76fe8cf --- /dev/null +++ b/plugins/cordova-plugin-device/src/wp/Device.cs @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using Microsoft.Phone.Info; +using System; +using System.IO; +using System.IO.IsolatedStorage; + +namespace WPCordovaClassLib.Cordova.Commands +{ + public class Device : BaseCommand + { + public void getDeviceInfo(string notused) + { + string res = String.Format("\"name\":\"{0}\",\"platform\":\"{1}\",\"uuid\":\"{2}\",\"version\":\"{3}\",\"model\":\"{4}\",\"manufacturer\":\"{5}\",\"isVirtual\":{6}", + DeviceStatus.DeviceName, + Environment.OSVersion.Platform.ToString(), + UUID, + Environment.OSVersion.Version.ToString(), + DeviceStatus.DeviceName, + DeviceStatus.DeviceManufacturer, + IsVirtual ? "true" : "false"); + DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "{" + res + "}")); + } + + + public bool IsVirtual + { + get + { + return (Microsoft.Devices.Environment.DeviceType == Microsoft.Devices.DeviceType.Emulator); + } + } + + public string UUID + { + get + { + object id; + + UserExtendedProperties.TryGetValue("ANID", out id); + if (id != null) + { + return id.ToString().Substring(2, 32); + } + + UserExtendedProperties.TryGetValue("ANID2", out id); + if (id != null) + { + return id.ToString(); + } + + string returnVal = "???unknown???"; + + using (IsolatedStorageFile appStorage = IsolatedStorageFile.GetUserStoreForApplication()) + { + try + { + IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("DeviceID.txt", FileMode.Open, FileAccess.Read, appStorage); + + using (StreamReader reader = new StreamReader(fileStream)) + { + returnVal = reader.ReadLine(); + } + } + catch (Exception /*ex*/) + { + + } + } + + return returnVal; + } + } + } +} diff --git a/plugins/cordova-plugin-device/tests/plugin.xml b/plugins/cordova-plugin-device/tests/plugin.xml new file mode 100644 index 0000000..4efeaf6 --- /dev/null +++ b/plugins/cordova-plugin-device/tests/plugin.xml @@ -0,0 +1,31 @@ + + + + + Cordova Device Plugin Tests + Apache 2.0 + + + + diff --git a/plugins/cordova-plugin-device/tests/tests.js b/plugins/cordova-plugin-device/tests/tests.js new file mode 100644 index 0000000..ac9a281 --- /dev/null +++ b/plugins/cordova-plugin-device/tests/tests.js @@ -0,0 +1,113 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function() { + describe('Device Information (window.device)', function () { + it("should exist", function() { + expect(window.device).toBeDefined(); + }); + + it("should contain a platform specification that is a string", function() { + expect(window.device.platform).toBeDefined(); + expect((String(window.device.platform)).length > 0).toBe(true); + }); + + it("should contain a version specification that is a string", function() { + expect(window.device.version).toBeDefined(); + expect((String(window.device.version)).length > 0).toBe(true); + }); + + it("should contain a UUID specification that is a string or a number", function() { + expect(window.device.uuid).toBeDefined(); + if (typeof window.device.uuid == 'string' || typeof window.device.uuid == 'object') { + expect((String(window.device.uuid)).length > 0).toBe(true); + } else { + expect(window.device.uuid > 0).toBe(true); + } + }); + + it("should contain a cordova specification that is a string", function() { + expect(window.device.cordova).toBeDefined(); + expect((String(window.device.cordova)).length > 0).toBe(true); + }); + + it("should depend on the presence of cordova.version string", function() { + expect(window.cordova.version).toBeDefined(); + expect((String(window.cordova.version)).length > 0).toBe(true); + }); + + it("should contain device.cordova equal to cordova.version", function() { + expect(window.device.cordova).toBe(window.cordova.version); + }); + + it("should contain a model specification that is a string", function() { + expect(window.device.model).toBeDefined(); + expect((String(window.device.model)).length > 0).toBe(true); + }); + + it("should contain a manufacturer property that is a string", function() { + expect(window.device.manufacturer).toBeDefined(); + expect((String(window.device.manufacturer)).length > 0).toBe(true); + }); + + it("should contain an isVirtual property that is a boolean", function() { + expect(window.device.isVirtual).toBeDefined(); + expect(typeof window.device.isVirtual).toBe("boolean"); + }); + + it("should contain a serial number specification that is a string", function() { + expect(window.device.serial).toBeDefined(); + expect((String(window.device.serial)).length > 0).toBe(true); + + }); + + }); +}; + +exports.defineManualTests = function(contentEl, createActionButton) { + var logMessage = function (message, color) { + var log = document.getElementById('info'); + var logLine = document.createElement('div'); + if (color) { + logLine.style.color = color; + } + logLine.innerHTML = message; + log.appendChild(logLine); + }; + + var clearLog = function () { + var log = document.getElementById('info'); + log.innerHTML = ''; + }; + + var device_tests = '

Press Dump Device button to get device information

' + + '
' + + 'Expected result: Status box will get updated with device info. (i.e. platform, version, uuid, model, etc)'; + + contentEl.innerHTML = '
' + device_tests; + + createActionButton('Dump device', function() { + clearLog(); + logMessage(JSON.stringify(window.device, null, '\t')); + }, "dump_device"); +}; diff --git a/plugins/cordova-plugin-device/www/device.js b/plugins/cordova-plugin-device/www/device.js new file mode 100644 index 0000000..f7ed19f --- /dev/null +++ b/plugins/cordova-plugin-device/www/device.js @@ -0,0 +1,83 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var argscheck = require('cordova/argscheck'), + channel = require('cordova/channel'), + utils = require('cordova/utils'), + exec = require('cordova/exec'), + cordova = require('cordova'); + +channel.createSticky('onCordovaInfoReady'); +// Tell cordova channel to wait on the CordovaInfoReady event +channel.waitForInitialization('onCordovaInfoReady'); + +/** + * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the + * phone, etc. + * @constructor + */ +function Device() { + this.available = false; + this.platform = null; + this.version = null; + this.uuid = null; + this.cordova = null; + this.model = null; + this.manufacturer = null; + this.isVirtual = null; + this.serial = null; + + var me = this; + + channel.onCordovaReady.subscribe(function() { + me.getInfo(function(info) { + //ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js + //TODO: CB-5105 native implementations should not return info.cordova + var buildLabel = cordova.version; + me.available = true; + me.platform = info.platform; + me.version = info.version; + me.uuid = info.uuid; + me.cordova = buildLabel; + me.model = info.model; + me.isVirtual = info.isVirtual; + me.manufacturer = info.manufacturer || 'unknown'; + me.serial = info.serial || 'unknown'; + channel.onCordovaInfoReady.fire(); + },function(e) { + me.available = false; + utils.alert("[ERROR] Error initializing Cordova: " + e); + }); + }); +} + +/** + * Get device info + * + * @param {Function} successCallback The function to call when the heading data is available + * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) + */ +Device.prototype.getInfo = function(successCallback, errorCallback) { + argscheck.checkArgs('fF', 'Device.getInfo', arguments); + exec(successCallback, errorCallback, "Device", "getDeviceInfo", []); +}; + +module.exports = new Device(); diff --git a/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md new file mode 100644 index 0000000..4c8e6a5 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md @@ -0,0 +1,37 @@ + + +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/contribute/). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/plugins/cordova-plugin-splashscreen/LICENSE b/plugins/cordova-plugin-splashscreen/LICENSE new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/NOTICE b/plugins/cordova-plugin-splashscreen/NOTICE new file mode 100644 index 0000000..8ec56a5 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/NOTICE @@ -0,0 +1,5 @@ +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/cordova-plugin-splashscreen/README.md b/plugins/cordova-plugin-splashscreen/README.md new file mode 100644 index 0000000..aa2aa64 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/README.md @@ -0,0 +1,526 @@ +--- +title: Splashscreen +description: Control the splash screen for your app. +--- + + +|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI | +|:-:|:-:|:-:|:-:|:-:|:-:| +|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-splashscreen)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-splashscreen/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-splashscreen)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-splashscreen/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-splashscreen)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-splashscreen/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-splashscreen)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-splashscreen/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-splashscreen)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-splashscreen/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-splashscreen)| + +# cordova-plugin-splashscreen + +This plugin is required to work with splash screens. This plugin displays and hides a splash screen during application launch. + +Report issues with this plugin on the [Apache Cordova issue tracker][Apache Cordova issue tracker]. + +## Installation + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + +## Supported Platforms + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows (`cordova-windows` version >= 4.4.0 is required) +- Browser + +__Note__: Extended splashscreen does not require the plugin on Windows (as opposed to Android and iOS) in case you don't use the plugin API, i.e. programmatic hide/show. + +### iOS-specific information + +There are two mechanisms for displaying a launch screen on iOS: + +1. Legacy launch images: images are sized exactly for the device's screen size. Does not support the iPad Pro 12.9's native resolution or split-screen/slide-over multitasking. + +2. Launch storyboard images: Images are sized based on scale, idiom, and size classes. Supports all devices, and can be used with split-screen/slide-over multitasking. + +Apple is moving away from legacy launch images. There is no official support for providing a native-resolution launch image for the iPad Pro 12.9 or for providing launch images that work with split-screen multitasking or slide-over. If your app doesn't need to support these contexts, then you can continue to use legacy launch images for as long as you like. + +The preferred method of providing launch images is to use a launch storyboard. For native app developers, the ideal launch storyboard is an unpopulated version of the app's user interface at launch. For non-native app developers who don't wish to learn Interface Builder, however, this plugin simulates the legacy launch image method as much as is feasible. + +#### Legacy launch images + +If you choose to use legacy launch images, you will use the following syntax in `config.xml`: + +``` + + + + + + + + + +``` + +Technically the filename for the `src` attribute can be anything you want; the filenames are used because they match what will be used when your project is compiled. The width and height attributes determine which launch images are displayed on which devices as follows: + +| width | height | device (orientation) | +|:-----------:|:------------:|:-------------------------:| +| 320 | 480 | All non-retina iPhones and iPods | +| 640 | 960 | iPhone 4/4s/5/5s (portrait) | +| 750 | 1334 | iPhone 6/6s/7 (portrait) | +| 1242 | 2208 | iPhone 6+/6s+/7+ (portrait) | +| 2208 | 1242 | iPhone 6+/6s+/7+ (landscape) | +| 768 | 1024 | All non-retina iPads (portrait) | +| 1024 | 768 | All non-retina iPads (landscape) | +| 1536 | 2048 | All retina iPads (portrait) | +| 2048 | 1536 | All retina iPads (landscape) | + +Note: It is vitally important that the source image actually matches the size specified in the `width` and `height` attributes. If it does not, the device may fail to render it properly, if at all. + +#### Launch storyboard images + +In order to support newer form factors and split-screen/slide-over multitasking, you should use launch storyboard images. These are similar to the legacy launch images above, but there are crucial differences: + + - images are not specific to a given device. + + - images are scaled to fill the available viewport (while maintaining the aspect ratio). + + - the outer edges of the images will be cropped, and the amount will vary based on device an viewport. + + - there is no need to provide an image for each possible device, viewport, and orientation; iOS will choose the best image for the situation automatically. + +##### Designing launch storyboard images + +The key to designing a launch storyboard image is understanding that the edges of the image will almost certainly be cropped. Therefore, one should not place any important information near the edges of any images provided to the launch storyboard. Only the center is a safe area, and this all but guarantees that following Apple's advice of presenting an unpopulated user interface will not work well. + +Instead, the following tips should enable you to create a launch image that works across a multitude of form factors, viewports, and orientations: + + - Important graphics (logos, icons, titles) should be centered. The safe bounding region will vary, so you will need to test to ensure that the important graphics are never cropped. Better yet, don't supply any important graphics in the first place. + + - You _can_ fine-tune the placement and size of these graphics, but you don't have the same fine-grained control as you did with legacy launch images. + + - Use a simple color wash. If you use two colors, you'll want one color to fill the top half of the image, and the second to fill the bottom half. If you use a gradient, you'll probably want to ensure that the middle of the gradient lines up with the center of the image. + + - Don't worry about pixel perfection -- because the images are scaled, there's almost no chance the images will be perfectly fit to the pixel grid. Since all supported iOS devices use retina screens, users will be hard pressed to notice it anyway. + +It is important to understand the concept of scale, idiom, and size class traits in order to use launch storyboard images effectively. Of the images supplied to the launch storyboard, iOS will choose the image that best matches the device and viewport and render that image. It is possible to supply only one launch image if so desired, but it is also possible to fine-tune the displayed launch image based on traits. When fine-tuning, one can ignore traits that aren't targeted or supported by the app. + +> Note: If you are using launch storyboard images, there is no need to include legacy images. If you do, the legacy images will be copied, but not used. + +##### Scale + +| scale | devices | +|:-----------:|:----------------------:| +| 1x | All non-retina devices | +| 2x | Most retina devices | +| 3x | iPhone 6+/6s+,7s+ | + +In general, you'll want to supply 2x and 3x images. Cordova only supports retina devices now, so there's no point in supplying 1x images. + +##### Idioms + +| idiom | devices | +|:-----------:|:-------------:| +| ipad | All iPads | +| iphone | All iPhones and iPod Touches | +| universal | All devices | + +You only need to provide universal images unless you need to fine-tune for a specific device idiom. + +##### Size classes + +There are two size classes applies to both screen axes. Narrow viewports are considered to be the "compact" size class, and remaining viewports are considered "regular". When supplying images to Xcode, however, one must choose between "any & compact" and "any & regular". To stay consistent with the native terminology, this feature will match based on "any" and "compact". `any` will match regular-sized viewports. + +Note: this feature uses `com` as an abbreviation for "compact" classes. + +The following classes are supported by this feature: + +| width | height | orientation | +|:-----------:|:------------:|:-----------------:| +| any | any | any | +| com | any | portrait | +| any | com | landscape (wide) | +| com | com | landscape (narrow)| + +To see the complete list of size classes associated with devices and viewports, see . + +##### Single-image launch screen + +If your launch image is simple, you may be able to avoid creating a lot of different launch images and supply only one. The launch image needs to meet the following requirements: + + - the image should be square + + - the image should be large enough to fit on an iPad Pro 12.9": 2732x2732 + + - anything important should fit within the center + + Keep in mind that the image will be cropped, possibly quite severely, depending upon the viewport. + +Once the image is created, you can include it in your project by adding the following to `config.xml`: + +``` + +``` + +Because only one image is provided, iOS will utilize it in every context. + +##### Multi-image launch screen + +If a single launch image won't meet your needs, you will probably need to supply at least six images, if not more. Furthermore, keep in mind that it will not be possible to fine tune the image to a specific device, but only to a device class, display factor, and viewport size. + +If you don't need to target images to a specific idiom, you should create six images, as follows: + +| scale | idiom | width | height | size | filename | +|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:| +| 2x* | universal | any | any | 2732x2732 | `Default@2x~universal~anyany.png` | +| 2x | universal | com | any | 1278x2732 | `Default@2x~universal~comany.png` | +| 2x | universal | com | com | 1334x750 | `Default@2x~universal~comcom.png` | +| 3x* | universal | any | any | 2208x2208 | `Default@3x~universal~anyany.png` | +| 3x | universal | any | com | 2208x1242 | `Default@3x~universal~anycom.png` | +| 3x | universal | com | any | 1242x2208 | `Default@3x~universal~comany.png` | + +\* this image is required in order for iOS utilize the other images within this scale and idiom. + +> Note: If the 3x sizes look small too you, that's because there's only one device class that currently has a 3x density: the iPhone 6+/6s+/7+. + +The above looks like the following snippet when present in `config.xml`: + +``` + + + + + + +``` + +Should one need to further fine tune based upon device idiom, one can do so. This might look like so: + +| scale | idiom | width | height | size | filename | +|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:| +| 2x* | iphone | any | any | 1334x1334 | `Default@2x~iphone~anyany.png` | +| 2x | iphone | com | any | 750x1334 | `Default@2x~iphone~comany.png` | +| 2x | iphone | com | com | 1334x750 | `Default@2x~iphone~comcom.png` | +| 3x* | iphone | any | any | 2208x2208 | `Default@3x~iphone~anyany.png` | +| 3x | iphone | any | com | 2208x1242 | `Default@3x~iphone~anycom.png` | +| 3x | iphone | com | any | 1242x2208 | `Default@3x~iphone~comany.png` | +| 2x* | ipad | any | any | 2732x2732 | `Default@2x~ipad~anyany.png` | +| 2x | ipad | com | any | 1278x2732 | `Default@2x~ipad~comany.png` | + +\* this image is required in order for iOS utilize the other images within this scale and idiom. + +The above looks like the following in `config.xml`: + +``` + + + + + + + + +``` + +##### Quirks and Known Issues + +1. **App on target may not reflect changes to images** + Once you run the app on a target, iOS caches the launch image. Unfortunately, when you chance the images, iOS does _not_ invalidate the cache, which means you'll still see the old launch image. You should either: delete the app, or reset content & settings (simulator). + +2. **Simulator may not show expected images when launched from CLI** + When Xcode deploys to a specific simulator, it only copies the assets that match the simulator's characteristics. For example, if you try to run an app on the iPhone 6s Plus simulator, only @3x launch images are copied. When compiling from the CLI, however, the default is to assume an iPhone 5s, which means only @2x launch images are copied. Unless your launch images are markedly different, chances are good the difference would go unnoticed, but this does mean that the only accurate method of testing is to test on a physical device. + +3. **`anyany` must be provided for other variations to be used** + If you don't provide an `anyany` version of the launch image for a specific scale and idiom, the other variations (like `anycom`, `comany`, and `comcom`) will ignored. + +## Windows-specific information + +Splash screen images can be defined using the [MRT](https://cordova.apache.org/docs/en/dev/config_ref/images.html#windows) concept. +If you specify src="res/windows/splashscreen.png" the following files will be copied into the application's images folder: +`res/windows/splashscreen.png` | `res/windows/splashscreen.scale-100.png`, `res/windows/splashscreen.scale-125.png`, etc. +The following are supported: + +| Scale, % | Project | Width | Height | Filename | +|:------------:|:-------------------:|:-----------:|:------------:|:---------------------------------:| +| 100 | Windows 10/8.1 | 620 | 300 | `splashscreen.png` \| `splashscreen.scale-100.png` | +| 125 | Windows 10 | 775 | 375 | `splashscreen.scale-125.png` | +| 150 | Windows 10 | 930 | 450 | `splashscreen.scale-150.png` | +| 200 | Windows 10 | 1240 | 600 | `splashscreen.scale-200.png` | +| 400 | Windows 10 | 2480 | 1200 | `splashscreen.scale-400.png` | +| 140 | Windows 8.1 | 868 | 420 | `splashscreen.scale-140.png` | +| 180 | Windows 8.1 | 1116 | 540 | `splashscreen.scale-180.png` | +| 100 | Windows Phone 8.1 | 480 | 800 | `splashscreenphone.png` \| `splashscreenphone.scale-100.png` | +| 140 | Windows Phone 8.1 | 672 | 1120 | `splashscreenphone.scale-140.png` | +| 240 | Windows Phone 8.1 | 1152 | 1920 | `splashscreenphone.scale-240.png` | + +__Note__: SplashScreens size for Windows 10 project should not exceed 200 KBytes. +__Note__: Supported formats are `.png`, `.jpg`, `.jpeg`. Mixing of the extensions within a target is not supported. I.e. you can have `splashscreen.jpg` and `splashscreenphone.png` but not `splashscreen.scale-100.png`, `splashscreen.scale-400.jpg`. +__Note__: You may need to reopen Visual Studio solution after changing the images and doing a `cordova prepare` for the changes to take effect. + +## Example Configuration +In the top-level `config.xml` file (not the one in `platforms`), add configuration elements like those specified here. + +Please notice that the value of the "src" attribute is relative to the project root directory and not to the www directory (see `Directory structure` below). You can name the source image whatever you like. The internal name in the app is determined by Cordova. + +Directory structure: + +``` +projectRoot + hooks + platforms + plugins + www + css + img + js + res + screen + android + ios + windows +``` + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +## Preferences + +#### config.xml + +- `AutoHideSplashScreen` (boolean, default to `true`). Indicates whether to hide splash screen automatically or not. Splash screen hidden after amount of time specified in the `SplashScreenDelay` preference. + +```xml + +``` + +- `SplashScreenDelay` (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen. + +```xml + +``` + +Note also that this value used to be seconds, and not milliseconds, so values less than 30 will still be treated as seconds. ( Consider this a deprecated patch that will disapear in some future version. ) + +To disable the splashscreen add the following preference to `config.xml`: +```xml + +``` + +**Windows Quirk**: You should disable the splashscreen in case you are updating the entire document body dynamically (f.e. with a SPA router) to avoid affecting UI/controls. +Note that you should also directly reference `WinJS/base.js` in the page HTML in this case to avoid the issues with activation context ([CB-11658](https://issues.apache.org/jira/browse/CB-11658)). + +**iOS Quirk**: to disable the splashscreen on `ios` platform you should also add `` to `config.xml`. + +- `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to + prevent the splash screen from fading in and out when its display + state changes. + +```xml + +``` + +- `FadeSplashScreenDuration` (float, defaults to `500`): Specifies the + number of milliseconds for the splash screen fade effect to execute. + +```xml + +``` + +_Note_: `FadeSplashScreenDuration` is included into `SplashScreenDelay`, for example if you have `` and `` defined in `config.xml`: + +- 00:00 - splashscreen is shown +- 00:02 - fading has started +- 00:03 - splashscreen is hidden + +Turning the fading off via `` technically means fading duration to be `0` so that in this example the overall splash delay will still be 3 seconds. + +_Note_: This only applies to the app startup - you need to take the fading timeout into account when manually showing/hiding the splashscreen in the code: + +```javascript +navigator.splashscreen.show(); +window.setTimeout(function () { + navigator.splashscreen.hide(); +}, splashDuration - fadeDuration); +``` + +- `ShowSplashScreenSpinner` (boolean, defaults to `true`): Set to `false` + to hide the splash-screen spinner. + +```xml + +``` + +### Android Quirks + +In your `config.xml`, you can add the following preferences: + +```xml + + +``` + +"SplashMaintainAspectRatio" preference is optional. If set to true, splash screen drawable is not stretched to fit screen, but instead simply "covers" the screen, like CSS "background-size:cover". This is very useful when splash screen images cannot be distorted in any way, for example when they contain scenery or text. This setting works best with images that have large margins (safe areas) that can be safely cropped on screens with different aspect ratios. + +The plugin reloads splash drawable whenever orientation changes, so you can specify different drawables for portrait and landscape orientations. + +"SplashShowOnlyFirstTime" preference is also optional and defaults to `true`. When set to `true` splash screen will only appear on application launch. However, if you plan to use `navigator.app.exitApp()` to close application and force splash screen appear on next launch, you should set this property to `false` (this also applies to closing the App with Back button). + +### Browser Quirks + +You can use the following preferences in your `config.xml`: + +```xml + + + + + + + + +``` + +__Note__: `SplashScreen` value should be absolute in order to work in a sub-page. The `SplashScreen` value is used only for the browser platform. The value will be ignored for other platforms. + +### iOS Quirks + +- In iOS, the splashscreen images are called launch images. These images are mandatory on iOS. + +### Windows Quirks + +- `SplashScreenSpinnerColor` (string, defaults to system accent color): hash, rgb notation or CSS color name. + +```xml + + + +``` + +- `SplashScreenBackgroundColor` (string, defaults to #464646): hex notation. + +```xml + +``` + +## Methods + +- splashscreen.show +- splashscreen.hide + +## splashscreen.hide + +Dismiss the splash screen. + +```js +navigator.splashscreen.hide(); +``` + + +### BlackBerry 10, WP8, iOS Quirk + +The `config.xml` file's `AutoHideSplashScreen` setting must be +`false`. To delay hiding the splash screen for two seconds, add a +timer such as the following in the `deviceready` event handler: + +```js +setTimeout(function() { + navigator.splashscreen.hide(); +}, 2000); +``` + +## splashscreen.show + +Displays the splash screen. + +```js +navigator.splashscreen.show(); +``` + +Your application cannot call `navigator.splashscreen.show()` until the app has +started and the `deviceready` event has fired. But since typically the splash +screen is meant to be visible before your app has started, that would seem to +defeat the purpose of the splash screen. Providing some configuration in +`config.xml` will automatically `show` the splash screen immediately after your +app launch and before it has fully started and received the `deviceready` +event. For this reason, it is unlikely you need to call `navigator.splashscreen.show()` to make the splash +screen visible for app startup. + +[Apache Cordova issue tracker]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Splashscreen%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC diff --git a/plugins/cordova-plugin-splashscreen/RELEASENOTES.md b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md new file mode 100644 index 0000000..29a116a --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md @@ -0,0 +1,206 @@ + +# Release Notes + +### 4.0.1 (Dec 07, 2016) +* [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined Document that splashscreen needs to be disabled on Windows in case of updating entire document body +* [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for Windows 8.1 and Windows Phone 8.1 +* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…" +* [CB-11830](https://issues.apache.org/jira/browse/CB-11830) (iOS) Fix doc typos in PR#114 +* [CB-11829](https://issues.apache.org/jira/browse/CB-11829) (iOS) Support for CB-9762; docs (CB-11830) +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version. + +### 4.0.0 (Sep 08, 2016) +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies +* [CB-11326](https://issues.apache.org/jira/browse/CB-11326) Prevent crash when initializing plugin after navigating to another URL +* Fix crash on **iOS** when reloading page from remote **Safari** +* Add badges for paramedic builds on Jenkins +* Add pull request template. +* [CB-11179](https://issues.apache.org/jira/browse/CB-11179) Extend the windows-splashscreen docs +* [CB-11159](https://issues.apache.org/jira/browse/CB-11159) Fix flaky splashscreen native tests +* [CB-11156](https://issues.apache.org/jira/browse/CB-11156) Change default `FadeSplashScreenDuration` value +* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Updated the dependency version, added it to the docs +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md +* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Implement splashscreen for **Windows** platform +* [CB-6498](https://issues.apache.org/jira/browse/CB-6498) Misleading documentation in **Android** Quirks + +### 3.2.2 (Apr 15, 2016) +* [CB-10979](https://issues.apache.org/jira/browse/CB-10979) Fix splashscreen **iOS** native tests. Added `jshintignore` for tests/ios +* [CB-10895](https://issues.apache.org/jira/browse/CB-10895) Transparent Splashscreen view sometimes remains +* [CB-10562](https://issues.apache.org/jira/browse/CB-10562) `hide()` not working in latest splashscreen plug in 3.1.0 in **iOS** +* [CB-10688](https://issues.apache.org/jira/browse/CB-10688) Plugin Splashscreen Readme must have examples. +* [CB-10864](https://issues.apache.org/jira/browse/CB-10864) Run **iOS** native tests on Travis + +### 3.2.1 (Mar 09, 2016) +* [CB-10764](https://issues.apache.org/jira/browse/CB-10764) Remove emoji in cordova-plugin-splashscreen +* [CB-10650](https://issues.apache.org/jira/browse/CB-10650) Non-index content.src causes Splashscreen to be not displayed on **Browser** +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins +* [CB-10606](https://issues.apache.org/jira/browse/CB-10606) fix deprecation warning for interfaceOrientation on **iOS** +* chore: edit package.json license to match SPDX id + +### 3.2.0 (Feb 09, 2016) +* [CB-10422](https://issues.apache.org/jira/browse/CB-10422) Splashscreen displays black screen with no image on Android +* [CB-10412](https://issues.apache.org/jira/browse/CB-10412) AutoHideSplashScreen "false" isn't taken in account on iOS +* [CB-9516](https://issues.apache.org/jira/browse/CB-9516) Android SplashScreen - Spinner Does Not Display +* [CB-9094](https://issues.apache.org/jira/browse/CB-9094) Smarter autohide logic on Android +* [CB-8396](https://issues.apache.org/jira/browse/CB-8396) Add AutoHideSplashScreen logic to Android's Splashscreen + +### 3.1.0 (Jan 15, 2016) +* [CB-9538](https://issues.apache.org/jira/browse/CB-9538) Implementing `FadeSplashScreen` feature for **Android** +* [CB-9240](https://issues.apache.org/jira/browse/CB-9240) Cordova splash screen plugin **iPad** landscape mode issue +* [CB-10263](https://issues.apache.org/jira/browse/CB-10263) Fix splashscreen plugin filenames for Asset Catalog +* [CB-9374](https://issues.apache.org/jira/browse/CB-9374) **Android** add `SplashShowOnlyFirstTime` as preference +* [CB-10244](https://issues.apache.org/jira/browse/CB-10244) Don't rotate the **iPhone 6 Plus** splash +* [CB-9043](https://issues.apache.org/jira/browse/CB-9043) Fix the **ios** splashscreen being deformed on orientation change +* [CB-10079](https://issues.apache.org/jira/browse/CB-10079) Splashscreen plugin does not honor `SplashScreenDelay` on **iOS** +* [CB-10231](https://issues.apache.org/jira/browse/CB-10231) Fix `FadeSplashScreen` to default to true on **iOS** + +### 3.0.0 (Nov 18, 2015) +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest +* Fixing contribute link. +* [CB-9750](https://issues.apache.org/jira/browse/CB-9750) `FadeSplashDuration` is now in `msecs` +* [CB-8875](https://issues.apache.org/jira/browse/CB-8875) `FadeSplashScreen` was not fading +* [CB-9467](https://issues.apache.org/jira/browse/CB-9467) SplashScreen does not show any image in hosted app on **Windows 10** +* [CB-7282](https://issues.apache.org/jira/browse/CB-7282) Document `AutoHideSplashScreenpreference` +* [CB-9327](https://issues.apache.org/jira/browse/CB-9327) - Splashscreen not receiving `CDVPageLoadNotification` +* WP8: Avoid config `value` of a wrong element. + +### 2.1.0 (Jun 17, 2015) +* added missing license headers +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen +* fix npm md issue +* Fixed iOS unit tests. +* [CB-3562](https://issues.apache.org/jira/browse/CB-3562): Disable screen rotation for iPhone when splash screen is shown. (closes #47) +* [CB-8988](https://issues.apache.org/jira/browse/CB-8988): Fix rotation on iOS/iPad (closes #46) +* [CB-8904](https://issues.apache.org/jira/browse/CB-8904): Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable +* Removed wp7 from plugin.xml and package.json +* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Rewrite resoultion helper +* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Allow resolution-specific splashscreen images +* [CB-8758](https://issues.apache.org/jira/browse/CB-8758) [wp8]: UnauthorizedAccessException on hide() + +### 2.0.0 (Apr 15, 2015) +* give users a way to install the bleeding edge. +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8797](https://issues.apache.org/jira/browse/CB-8797) - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing +* [CB-8836](https://issues.apache.org/jira/browse/CB-8836) - Crashes after animating splashscreen +* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Fix missing import in previous commit +* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Adds `SplashMaintainAspectRatio` preference (close #43) +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) Make default for splashscreen resource "screen" (which is what template and CLI assume it to be) +* Revert "CB-8345 android: Make "splash" the default resource ID instead of null" +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) android: Make "splash" the default resource ID instead of null +* docs: added Windows to supported platforms +* [CB-7964](https://issues.apache.org/jira/browse/CB-7964) Add cordova-plugin-splashscreen support for browser platform +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* [wp8] oops, Added back config parse result checks +* [WP8] code cleanup, minor refactors, comments to clarify some stuff. +* Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file +* [CB-8574](https://issues.apache.org/jira/browse/CB-8574) Integrate TravisCI +* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file +* [CB-8397](https://issues.apache.org/jira/browse/CB-8397) Add support to 'windows' for showing the Windows Phone splashscreen + +### 1.0.0 (Feb 04, 2015) +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using deprecated IsIpad macro +* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Add engine tag for Android >= 3.6.0 due to use of `preferences` +* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Make SplashScreen plugin compatible with cordova-android@4.0.x + +### 0.3.5 (Dec 02, 2014) +* [CB-7204](https://issues.apache.org/jira/browse/CB-7204) - Race condition when hiding and showing spinner (closes #21) +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen + +### 0.3.4 (Oct 03, 2014) +* Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus). +* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - (Re-fix based on updated unit tests) iPhone 6 Plus support +* Updated iOS tests for locked orientations +* Added more iOS splash screen tests. +* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - Add support for iPhone 6/6+ +* Added failing iPhone 6/6 Plus tests. +* Added 'npm test' +* [CB-7663](https://issues.apache.org/jira/browse/CB-7663) - iOS unit tests for splash screen +* Properly formatted splashscreen preference docs. + +### 0.3.3 (Sep 17, 2014) +* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-splashscreen documentation translation +* Renamed test dir, added nested plugin.xml +* added documentation for manual tests +* [CB-7196](https://issues.apache.org/jira/browse/CB-7196) port splashscreen tests to framework + +### 0.3.2 (Aug 06, 2014) +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs +* [CB-7041](https://issues.apache.org/jira/browse/CB-7041) ios: Fix image filename logic when setting the iPad splash screen +* fixes Splashscreen crash on WP8 +* Remove outdated doc + +### 0.3.1 (Jun 05, 2014) +* documentation translation: cordova-plugin-splashscreen +* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen +* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen +* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen +* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen +* [CB-6810](https://issues.apache.org/jira/browse/CB-6810) Add license to CONTRIBUTING.md +* [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same +* [wp] implemented OnInit so splash screen can be shown before cordova page is loaded +* [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work +* [CB-6483](https://issues.apache.org/jira/browse/CB-6483) Use splash screen image from manifest on Windows8 +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md +* Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen" + +### 0.3.0 (Apr 17, 2014) +* Add Tizen support to plugin +* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy +* [CB-4051](https://issues.apache.org/jira/browse/CB-4051): [ios] - Re-fix - Splashscreen rotation problem (closes #13) +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers +* [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code +* Add NOTICE file + +### 0.2.7 (Feb 05, 2014) +* [CB-3562](https://issues.apache.org/jira/browse/CB-3562) Fix aspect ratio on landscape-only iPhone applications +* [CB-4051](https://issues.apache.org/jira/browse/CB-4051) fix for splashscreen rotation problem + +### 0.2.6 (Jan 02, 2014) +* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Splashscreen plugin +* Handle error when splash image is missing. + +### 0.2.5 (Dec 4, 2013) +* add ubuntu platform +* Added amazon-fireos platform. Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos' +* [CB-5124](https://issues.apache.org/jira/browse/CB-5124) - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs + +### 0.2.4 (Oct 28, 2013) +* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to plugin.xml for splashscreen plugin +* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch. + +### 0.2.3 (Oct 9, 2013) +* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Re-fix Update splashscreen image bounds for iOS 7 +* [CB-4934](https://issues.apache.org/jira/browse/CB-4934) plugin-splashscreen should not show by default on Windows8 +* [CB-4929](https://issues.apache.org/jira/browse/CB-4929) plugin-splashscreen not loading proxy windows8 +* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. + +### 0.2.2 (Sept 25, 2013) +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version +* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen +* Rename CHANGELOG.md -> RELEASENOTES.md +* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Update splashscreen image bounds for iOS 7 +* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. diff --git a/plugins/cordova-plugin-splashscreen/doc/de/README.md b/plugins/cordova-plugin-splashscreen/doc/de/README.md new file mode 100644 index 0000000..f876eff --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/de/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung. + +## Installation + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## UnterstĂĽtzte Plattformen + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 und 8 + * Windows 8 + * Windows + * Browser + +## Methoden + + * SplashScreen.Show + * SplashScreen.Hide + +### Android Eigenarten + +Sie mĂĽssen in Ihrem `"config.xml"`fĂĽgen Sie die folgenden Einstellungen: + + + + + + +Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Stellen Sie sicher, Splashcreen Dateien zu Ihrem res/xml-Verzeichnis unter den entsprechenden Ordnern hinzuzufĂĽgen. Der zweite Parameter stellt dar, wie lange das Splashscreen in Millisekunden angezeigt werden. Es wird standardmäßig auf 3000 ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" Präferenz ist optional. Wenn wahr, Splash-Screen zeichenbaren nicht gestreckt wird, um den Bildschirm passen, sondern stattdessen einfach "" den Bildschirm, wie CSS abdeckt "Hintergrund-Größe: Schutz vor". Dies ist sehr nĂĽtzlich, wenn Splash-Bildschirm Bilder können nicht, in keiner Weise, zum Beispiel verzerrt werden wenn sie Landschaft oder Text enthalten. Diese Einstellung funktioniert am besten mit Bildern, die groĂźe Margen (sichere Bereiche) haben, die sicher auf Bildschirme mit unterschiedlichen Seitenverhältnissen zugeschnitten werden können. + +Das Plugin lädt platsch zeichenbaren wenn Ausrichtung ändert, sodass Sie verschiedene Drawables fĂĽr hoch- und Querformat Ausrichtungen angeben können. + +### Browser-Eigenheiten + +In Ihrem `"config.xml"`können Sie die folgenden Einstellungen: + + + + + + + + + + + +### iOS Macken + + * `FadeSplashScreen` (Boolean, standardmäßig auf `true festgelegt`): um zu verhindern, dass den BegrĂĽĂźungsbildschirm ein-und ausblenden bei ihrer Anzeige Statusänderungen auf `false` festgelegt. + + + + + * `FadeSplashScreenDuration` (float, Standardwert ist `2`): gibt die Anzahl der Sekunden fĂĽr den BegrĂĽĂźungsbildschirm fade Effekt ausgefĂĽhrt. + + + + + * `ShowSplashScreenSpinner` (Boolean, standardmäßig auf `true festgelegt`): auf `false` festgelegt wird, um den BegrĂĽĂźungsbildschirm Spinner auszublenden. + + + + +## SplashScreen.Hide + +SchlieĂźen Sie den Splash-Screen. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Eigenarten + +Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. Verstecken des BegrĂĽĂźungsbildschirms fĂĽr zwei Sekunden Verzögerung, fĂĽgen Sie einen Timer wie die folgende in der `deviceready`-Ereignishandler: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## SplashScreen.Show + +Zeigt den BegrĂĽĂźungsbildschirm. + + navigator.splashscreen.show(); + + +Ihre Anwendung kann nicht `navigator.splashscreen.show()` aufrufen, bis die app begonnen hat und das `deviceready`-Ereignis ausgelöst hat. Aber da in der Regel der Splash-Screen soll sichtbar sein, bevor die Anwendung gestartet wurde, scheint die Niederlage der Zweck des BegrĂĽĂźungsbildschirms. Somit einige Konfiguration in der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist fĂĽr app-Start aufrufen mĂĽssen. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/de/index.md b/plugins/cordova-plugin-splashscreen/doc/de/index.md new file mode 100644 index 0000000..b9fc40d --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/de/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung. + +## Installation + + cordova plugin add cordova-plugin-splashscreen + + +## UnterstĂĽtzte Plattformen + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 und 8 +* Windows 8 + +## Methoden + +* SplashScreen.Show +* SplashScreen.Hide + +### Android Eigenarten + +Sie mĂĽssen in der config.xml folgende Einstellungen vornehmen: + + + + + +Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Stellen Sie sicher, Splashcreen Dateien zu Ihrem res/xml-Verzeichnis unter den entsprechenden Ordnern hinzuzufĂĽgen. Der zweite Parameter stellt dar, wie lange das Splashscreen in Millisekunden angezeigt werden. Es wird standardmäßig auf 3000 ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens][1]. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## SplashScreen.Hide + +SchlieĂźen Sie den Splash-Screen. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Eigenarten + +Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. Verstecken des BegrĂĽĂźungsbildschirms fĂĽr zwei Sekunden Verzögerung, fĂĽgen Sie einen Timer wie die folgende in der `deviceready`-Ereignishandler: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## SplashScreen.Show + +Zeigt den BegrĂĽĂźungsbildschirm. + + navigator.splashscreen.show(); + + +Ihre Anwendung kann nicht `navigator.splashscreen.show()` aufrufen, bis die app begonnen hat und das `deviceready`-Ereignis ausgelöst hat. Aber da in der Regel der Splash-Screen soll sichtbar sein, bevor die Anwendung gestartet wurde, scheint die Niederlage der Zweck des BegrĂĽĂźungsbildschirms. Somit einige Konfiguration in der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens][1]. Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist fĂĽr app-Start aufrufen mĂĽssen. diff --git a/plugins/cordova-plugin-splashscreen/doc/es/README.md b/plugins/cordova-plugin-splashscreen/doc/es/README.md new file mode 100644 index 0000000..1a94161 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/es/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicaciĂłn. + +## InstalaciĂłn + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## Plataformas soportadas + + * Amazon fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 y 8 + * Windows 8 + * Windows + * Explorador + +## MĂ©todos + + * splashscreen.show + * splashscreen.hide + +### Rarezas Android + +En el `archivo config.xml`, es necesario agregar las siguientes preferencias: + + + + + + +Donde foo es el nombre del archivo splashscreen, preferiblemente un archivo de 9 parche. AsegĂşrese de agregar tus archivos splashcreen en tu directorio res/xml bajo las carpetas apropiadas. El segundo parámetro representa cuánto aparecerán el splashscreen en milisegundos. Valor predeterminado es ms 3000. Ver [los iconos y salpicadura pantallas](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) para obtener más informaciĂłn. + +Preferencia "SplashMaintainAspectRatio" es opcional. Si establece en true, pantalla dibujable no es estirado para caber la pantalla, pero en su lugar simplemente "cover" la pantalla, como CSS "background-size: cover". Esto es muy Ăştil cuando las imágenes de pantallas splash no distorsionadas de cualquier manera, por ejemplo cuando contienen texto o paisaje. Esta opciĂłn funciona mejor con imágenes que tienen bordes grandes (zonas seguras) que pueden ser recortadas con seguridad en pantallas con diferentes relaciones de aspecto. + +El plugin recarga splash dibujable cuando cambia de orientaciĂłn, por lo que puede especificar diferente dibujo para orientaciones vertical y horizontal. + +### Navegador rarezas + +Puede utilizar las siguientes preferencias en el `archivo config.xml`: + + + + + + + + + + + +### iOS rarezas + + * `FadeSplashScreen` (booleano, por defecto `true`): establecida en `false` para evitar que la pantalla de bienvenida de descolorarse adentro y hacia fuera cuando cambia su estado de presentaciĂłn. + + + + + * `FadeSplashScreenDuration` (float, por defecto es `2`): especifica el nĂşmero de segundos para que la pantalla se descolora efecto para ejecutar. + + + + + * `ShowSplashScreenSpinner` (booleano, por defecto `true`): establecida en `false` para ocultar la ruleta de la pantalla de bienvenida. + + + + +## splashscreen.hide + +Despedir a la pantalla de bienvenida. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +El `config.xml` del archivo `AutoHideSplashScreen` la configuraciĂłn debe ser `false` . Para retrasar oculta la pantalla splash durante dos segundos, agregue un temporizador como la siguiente en el `deviceready` controlador de eventos: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +Muestra la pantalla de bienvenida. + + navigator.splashscreen.show(); + + +La aplicaciĂłn no se puede llamar `navigator.splashscreen.show()` hasta que haya iniciado la aplicaciĂłn y el `deviceready` evento ha despedido. Pero puesto que normalmente la pantalla está destinada a ser visible antes de que comience su aplicaciĂłn, que parecerĂ­a que el propĂłsito de la pantalla de bienvenida. Proporcionar cierta configuraciĂłn en `config.xml` automáticamente `show` la pantalla de presentaciĂłn inmediatamente despuĂ©s de su lanzamiento de la aplicaciĂłn y antes de ser completamente ha iniciado y recibiĂł el `deviceready` evento. Ver [los iconos y salpicadura pantallas](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) para obtener más informaciĂłn sobre haciendo esta configuraciĂłn. Por esta razĂłn, es poco probable que necesitas llamar a `navigator.splashscreen.show()` para hacer la pantalla visible para el inicio de la aplicaciĂłn. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/es/index.md b/plugins/cordova-plugin-splashscreen/doc/es/index.md new file mode 100644 index 0000000..3295c27 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/es/index.md @@ -0,0 +1,76 @@ + + +# cordova-plugin-splashscreen + +Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicaciĂłn. + +## InstalaciĂłn + + cordova plugin add cordova-plugin-splashscreen + + +## Plataformas soportadas + +* Amazon fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 y 8 +* Windows 8 + +## MĂ©todos + +* splashscreen.show +* splashscreen.hide + +### Rarezas Android + +En el archivo config.xml, tienes que añadir las siguientes preferencias: + + < nombre de preferencia = "SplashScreen" value = "foo" / >< nombre de preferencia = "SplashScreenDelay" value = "10000" / > + + +Donde foo es el nombre del archivo splashscreen, preferiblemente un archivo de 9 parche. AsegĂşrese de agregar tus archivos splashcreen en tu directorio res/xml bajo las carpetas apropiadas. El segundo parámetro representa cuánto aparecerán el splashscreen en milisegundos. Valor predeterminado es ms 3000. Ver [los iconos y salpicadura pantallas][1] para obtener más informaciĂłn. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.hide + +Despedir a la pantalla de bienvenida. + + Navigator.SplashScreen.Hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +El `config.xml` del archivo `AutoHideSplashScreen` la configuraciĂłn debe ser `false` . Para retrasar oculta la pantalla splash durante dos segundos, agregue un temporizador como la siguiente en el `deviceready` controlador de eventos: + + setTimeout(function() {navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +Muestra la pantalla de bienvenida. + + Navigator.SplashScreen.Show(); + + +La aplicaciĂłn no se puede llamar `navigator.splashscreen.show()` hasta que haya iniciado la aplicaciĂłn y el `deviceready` evento ha despedido. Pero puesto que normalmente la pantalla está destinada a ser visible antes de que comience su aplicaciĂłn, que parecerĂ­a que el propĂłsito de la pantalla de bienvenida. Proporcionar cierta configuraciĂłn en `config.xml` automáticamente `show` la pantalla de presentaciĂłn inmediatamente despuĂ©s de su lanzamiento de la aplicaciĂłn y antes de ser completamente ha iniciado y recibiĂł el `deviceready` evento. Ver [los iconos y salpicadura pantallas][1] para obtener más informaciĂłn sobre haciendo esta configuraciĂłn. Por esta razĂłn, es poco probable que necesitas llamar a `navigator.splashscreen.show()` para hacer la pantalla visible para el inicio de la aplicaciĂłn. diff --git a/plugins/cordova-plugin-splashscreen/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/doc/fr/README.md new file mode 100644 index 0000000..65f5880 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/fr/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Ce plugin affiche et masque un Ă©cran de dĂ©marrage lors du lancement de l'application. + +## Installation + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## Plates-formes supportĂ©es + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 et 8 + * Windows 8 + * Windows + * Navigateur + +## MĂ©thodes + + * splashscreen.Show + * splashscreen.Hide + +### Quirks Android + +Dans votre `fichier config.xml`, vous devez ajouter les prĂ©fĂ©rences suivantes : + + + + + + +OĂą foo est le nom du fichier splashscreen, prĂ©fĂ©rablement un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre rĂ©pertoire res/xml dans les dossiers appropriĂ©s. Le deuxième paramètre reprĂ©sente combien de temps le splashscreen apparaĂ®tra en millisecondes. Il est par dĂ©faut Ă  3000 ms. Pour plus d'informations, consultez [icĂ´nes et Ă©crans de dĂ©marrage](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +PrĂ©fĂ©rence de « SplashMaintainAspectRatio » est facultative. Si dĂ©fini Ă  true, Ă©cran de dĂ©marrage drawable n'est pas Ă©tirĂ©e pour s'adapter Ă©cran, mais plutĂ´t simplement « couvre » l'Ă©cran, comme CSS "fond-taille : couverture". Ceci est très utile lorsque images Ă©cran de dĂ©marrage ne peut pas ĂŞtre dĂ©formĂ©es en quelque sorte, par exemple lorsqu'ils contiennent des dĂ©cors ou texte. Ce paramètre fonctionne mieux avec des images qui ont des marges importantes (zones de sĂ©curitĂ©) qui peuvent ĂŞtre recadrĂ©es en toute sĂ©curitĂ© sur les Ă©crans avec des proportions diffĂ©rentes. + +Le plugin recharge splash drawable chaque fois que l'orientation change, donc vous pouvez spĂ©cifier diffĂ©rents drawables pour les orientations portrait et paysage. + +### Bizarreries navigateur + +Vous pouvez utiliser les prĂ©fĂ©rences suivantes dans votre `fichier config.xml`: + + + + + + + + + + + +### Notes au sujet d'iOS + + * `FadeSplashScreen` (boolean, par dĂ©faut est `true`): la valeur `false` pour empĂŞcher l'Ă©cran de dĂ©marrage de fading in et out lorsque son Ă©tat d'affichage est modifiĂ©. + + + + + * `FadeSplashScreenDuration` (float, la valeur par dĂ©faut `2`): spĂ©cifie le nombre de secondes que l'Ă©cran de dĂ©marrage s'estomper l'effet d'exĂ©cuter. + + + + + * `ShowSplashScreenSpinner` (boolean, par dĂ©faut est `true`): la valeur `false` pour masquer le cĂ´ne de l'Ă©cran de dĂ©marrage. + + + + +## splashscreen.Hide + +Faire disparaĂ®tre de l'Ă©cran de dĂ©marrage. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'Ă©cran de dĂ©marrage pendant deux secondes, ajouter un minuteur semblable Ă  la suivante dans le gestionnaire d'Ă©vĂ©nements `deviceready` : + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.Show + +Affiche l'Ă©cran de dĂ©marrage. + + navigator.splashscreen.show(); + + +Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'Ă  ce que l'application a commencĂ© et l'Ă©vĂ©nement `deviceready` est dĂ©clenchĂ©. Mais puisqu'en gĂ©nĂ©ral, l'Ă©cran de dĂ©marrage est destinĂ© Ă  ĂŞtre visible avant que votre application a commencĂ©, qui semblerait Ă  l'encontre des objectifs de l'Ă©cran de dĂ©marrage. Fournir une configuration dans le fichier `config.xml` automatiquement `show` le splash projettera immĂ©diatement après votre lancement de l'app et avant qu'il a complètement dĂ©marrĂ© et a reçu l'Ă©vĂ©nement `deviceready`. Voir les [icĂ´nes et les Ă©crans de dĂ©marrage](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'Ă©cran de dĂ©marrage visible pour le dĂ©marrage de l'application. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/fr/index.md b/plugins/cordova-plugin-splashscreen/doc/fr/index.md new file mode 100644 index 0000000..6d2fd08 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/fr/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +Ce plugin affiche et masque un Ă©cran de dĂ©marrage lors du lancement de l'application. + +## Installation + + cordova plugin add cordova-plugin-splashscreen + + +## Plates-formes prises en charge + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 et 8 +* Windows 8 + +## MĂ©thodes + +* splashscreen.Show +* splashscreen.Hide + +### Quirks Android + +Dans votre fichier config.xml, vous devez ajouter les prĂ©fĂ©rences suivantes : + + + + + +OĂą foo est le nom du fichier splashscreen, prĂ©fĂ©rablement un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre rĂ©pertoire res/xml dans les dossiers appropriĂ©s. Le deuxième paramètre reprĂ©sente combien de temps le splashscreen apparaĂ®tra en millisecondes. Il est par dĂ©faut Ă  3000 ms. Pour plus d'informations, consultez [icĂ´nes et Ă©crans de dĂ©marrage][1]. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.Hide + +Faire disparaĂ®tre de l'Ă©cran de dĂ©marrage. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'Ă©cran de dĂ©marrage pendant deux secondes, ajouter un minuteur semblable Ă  la suivante dans le gestionnaire d'Ă©vĂ©nements `deviceready` : + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.Show + +Affiche l'Ă©cran de dĂ©marrage. + + navigator.splashscreen.show(); + + +Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'Ă  ce que l'application a commencĂ© et l'Ă©vĂ©nement `deviceready` est dĂ©clenchĂ©. Mais puisqu'en gĂ©nĂ©ral, l'Ă©cran de dĂ©marrage est destinĂ© Ă  ĂŞtre visible avant que votre application a commencĂ©, qui semblerait Ă  l'encontre des objectifs de l'Ă©cran de dĂ©marrage. Fournir une configuration dans le fichier `config.xml` automatiquement `show` le splash projettera immĂ©diatement après votre lancement de l'app et avant qu'il a complètement dĂ©marrĂ© et a reçu l'Ă©vĂ©nement `deviceready`. Voir les [icĂ´nes et les Ă©crans de dĂ©marrage][1] pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'Ă©cran de dĂ©marrage visible pour le dĂ©marrage de l'application. diff --git a/plugins/cordova-plugin-splashscreen/doc/it/README.md b/plugins/cordova-plugin-splashscreen/doc/it/README.md new file mode 100644 index 0000000..2a6c6ba --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/it/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione. + +## Installazione + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## Piattaforme supportate + + * Amazon fuoco OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 e 8 + * Windows 8 + * Windows + * Browser + +## Metodi + + * splashscreen + * splashscreen.Hide + +### Stranezze Android + +Nel vostro `config. XML`, è necessario aggiungere le seguenti preferenze: + + + + + + +Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assicurati di aggiungere i tuoi file splashcreen res/xml nella directory sotto cartelle appropriate. Il secondo parametro rappresenta quanto tempo lo splashscreen apparirĂ  in millisecondi. Il valore predefinito è 3000 ms. Per ulteriori informazioni, vedere [icone e schermate iniziali](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" preferenza è facoltativo. Se impostato su true, schermata iniziale drawable non viene adattata per misura lo schermo, ma invece semplicemente "copre" lo schermo, come CSS "sfondo-dimensione: copertina". Questo è molto utile quando immagini schermata iniziale non possono essere distorta in qualche modo, per esempio quando contengono testo o scenario. Questa impostazione funziona meglio con immagini che hanno grandi margini (zone sicure) che possono essere ritagliati in modo sicuro su schermi con proporzioni diverse. + +Il plugin viene ricaricata splash drawable ogni volta che cambia orientamento, è possibile specificare diversi parte per orientamento verticale e orizzontale. + +### Stranezze browser + +Nel vostro `config. XML`, è possibile utilizzare le seguenti preferenze: + + + + + + + + + + + +### iOS stranezze + + * `FadeSplashScreen` (boolean, impostazioni predefinite a `true`): impostare su `false` per impedire che la schermata iniziale e scompaiono quando cambia il relativo stato di visualizzazione. + + + + + * `FadeSplashScreenDuration` (float, il valore predefinito è `2`): specifica il numero di secondi per la schermata iniziale dissolvenza effetto da eseguire. + + + + + * `ShowSplashScreenSpinner` (boolean, impostazioni predefinite a `true`): impostare su `false` per nascondere la filatrice schermata iniziale. + + + + +## splashscreen.Hide + +Respingere la schermata iniziale. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen + +Visualizza la schermata iniziale. + + navigator.splashscreen.show(); + + +L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando l'app ha iniziato e ha generato l'evento `deviceready`. Ma poichĂ© in genere la schermata iniziale è destinata ad essere visibile prima app ha iniziato, che sembrerebbe per sconfiggere lo scopo della schermata iniziale. Fornendo qualche configurazione nel `file config.xml` sarĂ  automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/it/index.md b/plugins/cordova-plugin-splashscreen/doc/it/index.md new file mode 100644 index 0000000..7043541 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/it/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione. + +## Installazione + + cordova plugin add cordova-plugin-splashscreen + + +## Piattaforme supportate + +* Amazon fuoco OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 e 8 +* Windows 8 + +## Metodi + +* splashscreen +* splashscreen.Hide + +### Stranezze Android + +Nel vostro config. xml, è necessario aggiungere le seguenti preferenze: + + + + + +Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assicurati di aggiungere i tuoi file splashcreen res/xml nella directory sotto cartelle appropriate. Il secondo parametro rappresenta quanto tempo lo splashscreen apparirĂ  in millisecondi. Il valore predefinito è 3000 ms. Per ulteriori informazioni, vedere [icone e schermate iniziali][1]. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.Hide + +Respingere la schermata iniziale. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen + +Visualizza la schermata iniziale. + + navigator.splashscreen.show(); + + +L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando l'app ha iniziato e ha generato l'evento `deviceready`. Ma poichĂ© in genere la schermata iniziale è destinata ad essere visibile prima app ha iniziato, che sembrerebbe per sconfiggere lo scopo della schermata iniziale. Fornendo qualche configurazione nel `file config.xml` sarĂ  automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali][1]. Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app. diff --git a/plugins/cordova-plugin-splashscreen/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/doc/ja/README.md new file mode 100644 index 0000000..a688b27 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ja/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +ă“ă®ă—ă©ă‚°ă‚¤ăłăŚčˇ¨ç¤şă•ă‚Śă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă®čµ·ĺ‹•ä¸­ă«ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’非表示ă«ă—ăľă™ă€‚ + +## イăłă‚ąăăĽă« + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * アăžă‚ľăłç« OS + * アăłă‰ă­ă‚¤ă‰ + * ă–ă©ăă‚Żă™ăŞăĽ 10 + * iOS + * Windows Phone 7 㨠8 + * Windows 8 + * Windows + * ă–ă©ă‚¦ă‚¶ăĽ + +## ăˇă‚˝ă㉠+ + * splashscreen.show + * splashscreen.hide + +### Android ă®ç™– + +ă‚ăŞăźă®`config.xml`内ă®ć¬ˇă®č¨­ĺ®šă‚’追加ă™ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ + + + + + + +Foo ăŚă§ăŤă‚Śă° 9 ă‘ăăă•ă‚ˇă‚¤ă« splashscreen ă•ă‚ˇă‚¤ă«ă®ĺŤĺ‰Ťă§ă™ă€‚ 解ĺŹĺş¦/xml ă‡ă‚Łă¬ă‚ŻăăŞă®é©ĺ‡ăŞă•ă‚©ă«ă€ăĽă®ä¸‹ă« splashcreen ă•ă‚ˇă‚¤ă«ă‚’追加ă™ă‚‹ă“ă¨ă‚’確認ă—ăľă™ă€‚ 2 ç•Şç›®ă®ă‘ă©ăˇăĽă‚żăĽăŻă€ă‚ąă—ă©ăシ㥠㻠スクăŞăĽăłăŚă®čˇ¨ç¤şć™‚é–“ (ăźăŞç§’ĺŤä˝Ť) を表ă—ăľă™ă€‚ ă‡ă•ă‚©ă«ăă§ăŻ 3000 ăźăŞç§’ă§ă™ă€‚ č©łç´°ă«ă¤ă„ă¦ăŻă€[アイコăłă¨ă‚ąă—ă©ăă‚·ăĄç”»éť˘](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照ă—ă¦ăŹă ă•ă„。 + +"SplashMaintainAspectRatio"ă®č¨­ĺ®šăŻă‚Şă—ă‚·ă§ăłă§ă™ă€‚ True ă®ĺ ´ĺă€ă‚ąă—ă©ăă‚·ăĄç”»éť˘ćŹŹç”»ă«č¨­ĺ®šç”»éť˘ă‚’ĺź‹ă‚ă‚‹ăźă‚ă«ć‹ˇĺ¤§ă•ă‚Śăľă›ă‚“ăŚă€ä»Łă‚Źă‚Šă«ĺŤă«ă€Śă‚«ăăĽă€Ťç”»éť˘ă§ăŻă€CSS ă®ă‚ă†ăŞĺ ´ĺ「čŚć™Ż-サイズ: ă‚«ăăĽă€Ť. ă“ă‚ŚăŻă€ăźă¨ăă°é˘¨ć™ŻăľăźăŻă†ă‚­ă‚ąăăŚĺ«ăľă‚Śă¦ă„ă‚‹ĺ ´ĺă€ä»»ć„Źă®ć–ąćł•ă§ă‚ąă—ă©ăă‚·ăĄç”»éť˘ç”»ĺŹăŚć­Şă‚€ă“ă¨ăŚă§ăŤăŞă„非常ă«äľżĺ©ă§ă™ă€‚ ă“ă®č¨­ĺ®šăŻă€ç”»éť˘ă¨ç•°ăŞă‚‹ç¸¦ć¨ŞćŻ”ă§ĺ®‰ĺ…¨ă«ăăŞăźăłă‚°ă™ă‚‹ă“ă¨ăŚă§ăŤăľă™ĺ¤§č¦Źć¨ˇăŞăžăĽă‚¸ăł (安全ăŞĺś°ĺźź) ă®ç”»ĺŹă«é©ă—ă¦ă„ăľă™ă€‚ + +縦長ă¨ć¨Şé•·ă®ç•°ăŞă‚‹ă‰ă­ă‚¦ă‚˘ă–ă«ă‚’指定ă§ăŤă‚‹ă‚ă†ă«ă€ă—ă©ă‚°ă‚¤ăłăŻĺ‘ăŤă‚’変更ă™ă‚‹ăźăłă«ă‚ąă—ă©ăシ㥠ă‰ă­ă‚¦ă‚˘ă–ă«ă‚’ăŞă­ăĽă‰ă—ăľă™ă€‚ + +### ă–ă©ă‚¦ă‚¶ăĽă®ç™– + +ă‚ăŞăźă®`config.xml`ă§ć¬ˇă®č¨­ĺ®šă‚’使用ă§ăŤăľă™ă€‚ + + + + + + + + + + + +### iOS ă®ç™– + + * `FadeSplashScreen`(ă–ăĽă«ĺ€¤ă€ć—˘ĺ®šă§ [ `true`): ă‚ąă—ă©ăă‚·ăĄç”»éť˘ăŚă•ă‚§ăĽă‰ă‚¤ăłă¨ă•ă‚§ăĽă‰ă‚˘ă‚¦ăă®čˇ¨ç¤şçŠ¶ć…‹ăŚĺ¤‰ć›´ă•ă‚Śăźă¨ăŤă™ă‚‹ă“ă¨ă‚’é˛ăăźă‚ă«`false`ă«č¨­ĺ®šă—ăľă™ă€‚ + + + + + * `FadeSplashScreenDuration`(float, ă‡ă•ă‚©ă«ăăŻ`2`): ă‚ąă—ă©ăă‚·ăĄç”»éť˘ă®ç§’ć•°ă®ă•ă‚§ăĽă‰ă‚’実行ă™ă‚‹ĺŠąćžśă‚’指定ă—ăľă™ă€‚ + + + + + * `ShowSplashScreenSpinner`(ă–ăĽă«ĺ€¤ă€ć—˘ĺ®šă§ [ `true`): ă‚ąă—ă©ăシ㥠スクăŞăĽăł ă‚ąă”ăŠăĽă‚’非表示ă«ă™ă‚‹ă‚’`false`ă«č¨­ĺ®šă—ăľă™ă€‚ + + + + +## splashscreen.hide + +ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’é–‰ăăľă™ă€‚ + + navigator.splashscreen.hide(); + + +### ă–ă©ăă‚Żă™ăŞăĽ 10ă€WP8ă€iOS ă®ć°—ăľăă‚Ś + +`config.xml` ă•ă‚ˇă‚¤ă«ă® `AutoHideSplashScreen` ă®č¨­ĺ®šăŻ `false` ă§ă‚ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ é…延を 2 秒間スă—ă©ăシ㥠スクăŞăĽăłă‚’非表示㫠`deviceready` イă™ăłă ăŹăłă‰ă©ăĽă§ă€ć¬ˇă®ă‚ă†ă‚żă‚¤ăžăĽă‚’追加ă—ăľă™ă€‚ + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +ă‚ąă—ă©ăă‚·ăĄç”»éť˘ăŚčˇ¨ç¤şă•ă‚Śăľă™ă€‚ + + navigator.splashscreen.show(); + + +アă—ăŞăŚé–‹ĺ§‹ă•ă‚Śă€`deviceready` イă™ăłăăŚç™şç”źă™ă‚‹ăľă§ă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłăŻ `navigator.splashscreen.show()` ă‚’ĺ‘Ľăłĺ‡şă™ă“ă¨ăŻă§ăŤăľă›ă‚“。 ă—ă‹ă—ă€ä»ĄćťĄă€é€šĺ¸¸ă‚ąă—ă©ăă‚·ăĄç”»éť˘ă‚˘ă—ăŞé–‹ĺ§‹ĺ‰Ťă«čˇ¨ç¤şă™ă‚‹ă‚‚ă®ă§ă™ă¨ć€ťă‚Źă‚Śă‚‹ă€ă‚ąă—ă©ăシ㥠スクăŞăĽăłă®ç›®çš„ă®ć•—北ă—ăľă™ă€‚ `config.xml` ă«ă„ăŹă¤ă‹ă®ć§‹ćă‚’ćŹäľ›ă™ă‚‹ăŻč‡Şĺ‹•çš„ă« `表示` ă‚ąă—ă©ăă‚·ăĄç”»éť˘ă€ă‚˘ă—ăŞă‚’起動後ă™ăă«ă€ăťă‚ŚăŚĺ®Śĺ…¨ă«čµ·ĺ‹•ă—ă€`deviceready` イă™ăłăを受信ă™ă‚‹ĺ‰Ťă«ă€‚ č©łç´°ă«ă¤ă„ă¦ăŻă“ă®ć§‹ćを行ă†ă«ăŻă€[アイコăłă¨ă‚ąă—ă©ăă‚·ăĄç”»éť˘](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照ă—ă¦ăŹă ă•ă„。 ă“ă®ç†ç”±ă®ăźă‚ă«ă‚˘ă—ăŞčµ·ĺ‹•ć™‚ă®ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’確認 `navigator.splashscreen.show()` ă‚’ă‚łăĽă«ă™ă‚‹ĺż…č¦ăŚă‚る可č˝ć€§ăŚé«ă„ă§ă™ă€‚ \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/ja/index.md b/plugins/cordova-plugin-splashscreen/doc/ja/index.md new file mode 100644 index 0000000..24e72e5 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ja/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +ă“ă®ă—ă©ă‚°ă‚¤ăłăŚčˇ¨ç¤şă•ă‚Śă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłă®čµ·ĺ‹•ä¸­ă«ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’非表示ă«ă—ăľă™ă€‚ + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-splashscreen + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* アăžă‚ľăłç« OS +* アăłă‰ă­ă‚¤ă‰ +* ă–ă©ăă‚Żă™ăŞăĽ 10 +* iOS +* Windows Phone 7 㨠8 +* Windows 8 + +## ăˇă‚˝ă㉠+ +* splashscreen.show +* splashscreen.hide + +### Android ă®ç™– + +ă‚ăŞăźă® config.xml を以下ă®č¨­ĺ®šă‚’追加ă™ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ + + + + + +Foo ăŚă§ăŤă‚Śă° 9 ă‘ăăă•ă‚ˇă‚¤ă« splashscreen ă•ă‚ˇă‚¤ă«ă®ĺŤĺ‰Ťă§ă™ă€‚ 解ĺŹĺş¦/xml ă‡ă‚Łă¬ă‚ŻăăŞă®é©ĺ‡ăŞă•ă‚©ă«ă€ăĽă®ä¸‹ă« splashcreen ă•ă‚ˇă‚¤ă«ă‚’追加ă™ă‚‹ă“ă¨ă‚’確認ă—ăľă™ă€‚ 2 ç•Şç›®ă®ă‘ă©ăˇăĽă‚żăĽăŻă€ă‚ąă—ă©ăシ㥠㻠スクăŞăĽăłăŚă®čˇ¨ç¤şć™‚é–“ (ăźăŞç§’ĺŤä˝Ť) を表ă—ăľă™ă€‚ ă‡ă•ă‚©ă«ăă§ăŻ 3000 ăźăŞç§’ă§ă™ă€‚ č©łç´°ă«ă¤ă„ă¦ăŻă€[アイコăłă¨ă‚ąă—ă©ăă‚·ăĄç”»éť˘][1] を参照ă—ă¦ăŹă ă•ă„。 + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.hide + +ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’é–‰ăăľă™ă€‚ + + navigator.splashscreen.hide(); + + +### ă–ă©ăă‚Żă™ăŞăĽ 10ă€WP8ă€iOS ă®ć°—ăľăă‚Ś + +`config.xml` ă•ă‚ˇă‚¤ă«ă® `AutoHideSplashScreen` ă®č¨­ĺ®šăŻ `false` ă§ă‚ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ é…延を 2 秒間スă—ă©ăシ㥠スクăŞăĽăłă‚’非表示㫠`deviceready` イă™ăłă ăŹăłă‰ă©ăĽă§ă€ć¬ˇă®ă‚ă†ă‚żă‚¤ăžăĽă‚’追加ă—ăľă™ă€‚ + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +ă‚ąă—ă©ăă‚·ăĄç”»éť˘ăŚčˇ¨ç¤şă•ă‚Śăľă™ă€‚ + + navigator.splashscreen.show(); + + +アă—ăŞăŚé–‹ĺ§‹ă•ă‚Śă€`deviceready` イă™ăłăăŚç™şç”źă™ă‚‹ăľă§ă€ă‚˘ă—ăŞă‚±ăĽă‚·ă§ăłăŻ `navigator.splashscreen.show()` ă‚’ĺ‘Ľăłĺ‡şă™ă“ă¨ăŻă§ăŤăľă›ă‚“。 ă—ă‹ă—ă€ä»ĄćťĄă€é€šĺ¸¸ă‚ąă—ă©ăă‚·ăĄç”»éť˘ă‚˘ă—ăŞé–‹ĺ§‹ĺ‰Ťă«čˇ¨ç¤şă™ă‚‹ă‚‚ă®ă§ă™ă¨ć€ťă‚Źă‚Śă‚‹ă€ă‚ąă—ă©ăシ㥠スクăŞăĽăłă®ç›®çš„ă®ć•—北ă—ăľă™ă€‚ `config.xml` ă«ă„ăŹă¤ă‹ă®ć§‹ćă‚’ćŹäľ›ă™ă‚‹ăŻč‡Şĺ‹•çš„ă« `表示` ă‚ąă—ă©ăă‚·ăĄç”»éť˘ă€ă‚˘ă—ăŞă‚’起動後ă™ăă«ă€ăťă‚ŚăŚĺ®Śĺ…¨ă«čµ·ĺ‹•ă—ă€`deviceready` イă™ăłăを受信ă™ă‚‹ĺ‰Ťă«ă€‚ č©łç´°ă«ă¤ă„ă¦ăŻă“ă®ć§‹ćを行ă†ă«ăŻă€[アイコăłă¨ă‚ąă—ă©ăă‚·ăĄç”»éť˘][1] を参照ă—ă¦ăŹă ă•ă„。 ă“ă®ç†ç”±ă®ăźă‚ă«ă‚˘ă—ăŞčµ·ĺ‹•ć™‚ă®ă‚ąă—ă©ăシ㥠スクăŞăĽăłă‚’確認 `navigator.splashscreen.show()` ă‚’ă‚łăĽă«ă™ă‚‹ĺż…č¦ăŚă‚る可č˝ć€§ăŚé«ă„ă§ă™ă€‚ diff --git a/plugins/cordova-plugin-splashscreen/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/doc/ko/README.md new file mode 100644 index 0000000..5e10d20 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ko/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +ěť´ 플러그인은 í‘śě‹ś í• ęł  ěť‘ěš© 프로그램 실행 í•ëŠ” ëŹ™ě• ě‹śěž‘ 화면을 ě¨ęąë‹ë‹¤. + +## ě„¤ěą + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## ě§€ě› ë는 플랫폼 + + * ě•„ë§ěˇ´ 화재 ěš´ě 체제 + * ě• ë“ś 로이드 + * 블랙베리 10 + * iOS + * Windows Phone 7과 8 + * ěśëŹ„ěš° 8 + * ěśëŹ„ěš° + * 브라우저 + +## 메서드 + + * splashscreen.show + * splashscreen.hide + +### ě• ë“ś 로이드 ë‹¨ě  + +`Config.xml`ě— ë‹¤ěťŚ í™ę˛˝ ě„¤ě •ě— ě¶”ę°€ í•´ě•Ľ í•©ë‹ë‹¤. + + + + + + +여기서 foo splashscreen 파일, ě„ í¸ 9 íŚ¨ěą íŚŚěťĽěť ěť´ë¦„ěž…ë‹ë‹¤. ě ě  í•ś 폴더 ě•„ëž res/xml ë””ë ‰í† ë¦¬ě— splashcreen 파일을 추가 í•´ě•Ľ í•©ë‹ë‹¤. ë‘ ë˛ě§¸ 매개 변ě는 splashscreen ě–Ľë§ë‚ ë°€ë¦¬ě´ ë‹¨ěś„ëˇś í‘śě‹ś ë©ë‹ë‹¤ ë‚í€ë…ë‹ë‹¤. 3000 ms 기본값으로 사용 ë©ë‹ë‹¤. ěžě„¸í•ś 내용은 [ě•„ěť´ě˝ ë°Ź ě‹śěž‘ 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 í•ě‹­ě‹śě¤. + +"SplashMaintainAspectRatio" 취향은 ě„ íť ě‚¬í•­ěž…ë‹ë‹¤. Drawable, ě‹śěž‘ 화면 설정 í™”ë©´ě— ë§žę˛Ś 확장 ë지 í•ě§€ë§Ś 대신 단ěśíž "커버" CSS 같은 화면 "배경-í¬ę¸°: 덮개". ě‹śěž‘ 화면 이미지 ě: 풍경 ë는 텍스트를 포함 í•ëŠ” 경우 ě–´ë–¤ 식으로든ě—ě„ś 왜곡 ë  ě 없는 ę˛˝ěš°ě— ë§¤ěš° ěś ěš© í•©ë‹ë‹¤. ěť´ 설정은 í° ě—¬ë°± (ě•ě „ 지역) ě•ě „ í• ę˛Ś 다른 종횡비와 í™”ë©´ě— ěžëĄĽ ě ěžëŠ” ěť´ëŻ¸ě§€ě— ę°€ěžĄ ě í•© í•©ë‹ë‹¤. + +플러그인 다시 로드 스플ëžě‹ś drawable ë°©í–Ąěť´ 변경 ë  ë•Śë§ë‹¤ 세로 ë°Ź 가로 ë°©í–Ąě— ëŚ€ í•ś 다른 drawables를 지정할 ě ěžëŹ„록 í•©ë‹ë‹¤. + +### 브라우저 만지면 + +`Config.xml`ě— ë‹¤ěťŚ 기본 설정을 사용할 ě ěžěŠµë‹ë‹¤. + + + + + + + + + + + +### iOS ë‹¨ě  + + * `FadeSplashScreen` (부울 `true`로 기본값): ě‹śěž‘ 화면 í‘śě‹ś ěíśëˇś 변경 ë  ë•Ś 밖으로 í‡´ě‰ í•ě§€ 않도록 í•ë ¤ë©´ `false` 로 설정. + + + + + * `FadeSplashScreenDuration` (부동, `2`기본값): ě‹śěž‘ í™”ë©´ě— ëŚ€ í•ś ě´ íŽěť´ë“ś 효과를 실행 í•ëŠ” 지정 í•©ë‹ë‹¤. + + + + + * `ShowSplashScreenSpinner` (부울 `true`로 기본값): 스플ëžě‹ś 화면 회전ěžëĄĽ ě¨ę¸°ë ¤ë©´ `false` 로 설정. + + + + +## splashscreen.hide + +ě‹śěž‘ 화면을 닫습ë‹ë‹¤. + + navigator.splashscreen.hide(); + + +### 블랙베리 10, WP8, iOS íŠąě§ + +`config.xml` íŚŚěťĽěť `AutoHideSplashScreen` 설정을 `false` 여야 í•©ë‹ë‹¤. 2 ě´ ëŹ™ě• ě‹śěž‘ 화면을 ě¨ę¸°ęł  지연, `deviceready` 이벤트 ě˛ë¦¬ę¸°ě—ě„ś 다음과 같은 í€ěť´ë¨¸ëĄĽ 추가: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +ě‹śěž‘ 화면을 í‘śě‹śí•©ë‹ë‹¤. + + navigator.splashscreen.show(); + + +ěť‘ěš© 프로그램 ě‹śěž‘ ë°Ź `deviceready` 이벤트는 ë°śěť ë  ë•ŚęąŚě§€ ěť‘ěš© 프로그램이 `navigator.splashscreen.show()`ěť„ í¸ě¶śí•  ě 없습ë‹ë‹¤. í•ě§€ë§Ś ę·¸ 스플ëžě‹ś 스í¬ë¦°ěť ëŞ©ě  ę˛ ę°™ë‹¤ 일ë°ě ěśĽëˇś ě‹śěž‘ 화면이 ë‹ąě‹ ěť ě• í”Ś 리 케이 ě… ě‹śěž‘ í•ę¸° ě „ě— í‘śě‹ś ë  ěš´ëŞ…ěť´ 다, 이후. `config.xmlě—ě„ś` 몇 가지 구성을 ě śęłµ í• ěžëŹ™ěśĽëˇś 스플ëžě‹ś `í‘śě‹ś` 화면 애플 리 케이 ě… ě¶śě‹ś ě§í›„와 ę·¸ę˛ěť€ 완벽 í• ę˛Ś ě‹śěž‘ í• ęł  `deviceready` 이벤트를 받은 ě „ě—. ěť´ 구성 í• ęł  ěžě„¸í•ś 내용은 [ě•„ěť´ě˝ ë°Ź ě‹śěž‘ 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 í•ě‹­ě‹śě¤. 이러한 이유로, ę·¸ę˛ěť€ 가능성이 ě‹śěž‘ 화면은 ěť‘ěš© 프로그램 ě‹śěž‘ě— ëŚ€ í•ś í‘śě‹ś ë도록 `navigator.splashscreen.show()`를 í¸ě¶ś í•´ě•Ľěž…ë‹ë‹¤. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/ko/index.md b/plugins/cordova-plugin-splashscreen/doc/ko/index.md new file mode 100644 index 0000000..6a0ea98 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ko/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +ěť´ 플러그인은 í‘śě‹ś í• ęł  ěť‘ěš© 프로그램 실행 í•ëŠ” ëŹ™ě• ě‹śěž‘ 화면을 ě¨ęąë‹ë‹¤. + +## ě„¤ěą + + cordova plugin add cordova-plugin-splashscreen + + +## ě§€ě› ë는 플랫폼 + +* ě•„ë§ěˇ´ 화재 ěš´ě 체제 +* ě• ë“ś 로이드 +* 블랙베리 10 +* iOS +* Windows Phone 7과 8 +* ěśëŹ„ěš° 8 + +## 메서드 + +* splashscreen.show +* splashscreen.hide + +### ě• ë“ś 로이드 ë‹¨ě  + +ë‹ąě‹ ěť config.xmlě— ë‹¤ěťŚ í™ę˛˝ ě„¤ě •ě— ě¶”ę°€ í•´ě•Ľ í•©ë‹ë‹¤. + + + + + +여기서 foo splashscreen 파일, ě„ í¸ 9 íŚ¨ěą íŚŚěťĽěť ěť´ë¦„ěž…ë‹ë‹¤. ě ě  í•ś 폴더 ě•„ëž res/xml ë””ë ‰í† ë¦¬ě— splashcreen 파일을 추가 í•´ě•Ľ í•©ë‹ë‹¤. ë‘ ë˛ě§¸ 매개 변ě는 splashscreen ě–Ľë§ë‚ ë°€ë¦¬ě´ ë‹¨ěś„ëˇś í‘śě‹ś ë©ë‹ë‹¤ ë‚í€ë…ë‹ë‹¤. 3000 ms 기본값으로 사용 ë©ë‹ë‹¤. ěžě„¸í•ś 내용은 [ě•„ěť´ě˝ ë°Ź ě‹śěž‘ 화면을][1] 참조 í•ě‹­ě‹śě¤. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.hide + +ě‹śěž‘ 화면을 닫습ë‹ë‹¤. + + navigator.splashscreen.hide(); + + +### 블랙베리 10, WP8, iOS íŠąě§ + +`config.xml` íŚŚěťĽěť `AutoHideSplashScreen` 설정을 `false` 여야 í•©ë‹ë‹¤. 2 ě´ ëŹ™ě• ě‹śěž‘ 화면을 ě¨ę¸°ęł  지연, `deviceready` 이벤트 ě˛ë¦¬ę¸°ě—ě„ś 다음과 같은 í€ěť´ë¨¸ëĄĽ 추가: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +ě‹śěž‘ 화면을 í‘śě‹śí•©ë‹ë‹¤. + + navigator.splashscreen.show(); + + +ěť‘ěš© 프로그램 ě‹śěž‘ ë°Ź `deviceready` 이벤트는 ë°śěť ë  ë•ŚęąŚě§€ ěť‘ěš© 프로그램이 `navigator.splashscreen.show()`ěť„ í¸ě¶śí•  ě 없습ë‹ë‹¤. í•ě§€ë§Ś ę·¸ 스플ëžě‹ś 스í¬ë¦°ěť ëŞ©ě  ę˛ ę°™ë‹¤ 일ë°ě ěśĽëˇś ě‹śěž‘ 화면이 ë‹ąě‹ ěť ě• í”Ś 리 케이 ě… ě‹śěž‘ í•ę¸° ě „ě— í‘śě‹ś ë  ěš´ëŞ…ěť´ 다, 이후. `config.xmlě—ě„ś` 몇 가지 구성을 ě śęłµ í• ěžëŹ™ěśĽëˇś 스플ëžě‹ś `í‘śě‹ś` 화면 애플 리 케이 ě… ě¶śě‹ś ě§í›„와 ę·¸ę˛ěť€ 완벽 í• ę˛Ś ě‹śěž‘ í• ęł  `deviceready` 이벤트를 받은 ě „ě—. ěť´ 구성 í• ęł  ěžě„¸í•ś 내용은 [ě•„ěť´ě˝ ë°Ź ě‹śěž‘ 화면을][1] 참조 í•ě‹­ě‹śě¤. 이러한 이유로, ę·¸ę˛ěť€ 가능성이 ě‹śěž‘ 화면은 ěť‘ěš© 프로그램 ě‹śěž‘ě— ëŚ€ í•ś í‘śě‹ś ë도록 `navigator.splashscreen.show()`를 í¸ě¶ś í•´ě•Ľěž…ë‹ë‹¤. diff --git a/plugins/cordova-plugin-splashscreen/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/doc/pl/README.md new file mode 100644 index 0000000..0156be5 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/pl/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Ten plugin wyĹ›wietla i ukrywa ekran powitalny podczas uruchamiania aplikacji. + +## Instalacja + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## ObsĹ‚ugiwane platformy + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 i 8 + * Windows 8 + * Windows + * PrzeglÄ…darka + +## Metody + + * splashscreen.show + * splashscreen.Hide + +### Dziwactwa Androida + +W pliku `config.xml`musisz dodać nastÄ™pujÄ…ce preferencje: + + + + + + +Gdzie foo jest nazwÄ… pliku ekranu powitalnego, najlepiej 9 Ĺ‚atce. Upewnij siÄ™ dodać pliki splashcreen do katalogu res/xml w odpowiednich folderach. Drugi parametr reprezentuje, jak dĹ‚ugo ekranu powitalnego pojawi siÄ™ w milisekundach. DomyĹ›lnie 3000 ms. Aby uzyskać wiÄ™cej informacji, zobacz [ikony i ekrany powitalne w aplikacjach](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" preferencji jest opcjonalne. JeĹ›li zestaw na wartość true, ekran powitalny dolarowe nie jest rozciÄ…gniÄ™ty do ekranĂłw, ale zamiast po prostu "obejmuje" ekranu, jak CSS "tĹ‚o-rozmiar: okĹ‚adka". Jest to bardzo przydatne, kiedy opryskać tÄ™cza obrazy nie znieksztaĹ‚cony w jakikolwiek sposĂłb, na przykĹ‚ad, gdy zawierajÄ… one dekoracje lub tekst. To ustawienie dziaĹ‚a najlepiej z obrazĂłw, ktĂłre majÄ… duĹĽe marginesy (bezpiecznych obszarĂłw), ktĂłre mogÄ… być bezpiecznie przyciÄ™te na ekrany z różnych proporcji. + +Plugin Ĺ‚aduje rozchlapać dolarowe, gdy zmienia orientacjÄ™, tak moĹĽna okreĹ›lić różnych drawables do orientacji pionowej i poziomej. + +### Quirks przeglÄ…darki + +W pliku `config.xml`moĹĽna uĹĽyć nastÄ™pujÄ…ce preferencje: + + + + + + + + + + + +### Dziwactwa iOS + + * `FadeSplashScreen` (wartość logiczna, domyĹ›lnie `true`): zestaw na `false` , aby zapobiec ZnikajÄ…ca i odkĹ‚adane po zmianie stanu wyĹ›wietlania ekranu powitalnego. + + + + + * `FadeSplashScreenDuration` (float, domyĹ›lnie `2`): okreĹ›la liczbÄ™ sekund dla ekranu powitalnego zanikanie efekt do wykonać. + + + + + * `ShowSplashScreenSpinner` (wartość logiczna, domyĹ›lnie `true`): zestaw na `false` , aby ukryć pokrÄ™tĹ‚a ekran powitalny. + + + + +## splashscreen.Hide + +Odrzucić ten opryskaæ tĂŞcza. + + navigator.splashscreen.hide(); + + +### JeĹĽyna 10, WP8, iOS dziwactwo + +Plik `config.xml` `AutoHideSplashScreen` ustawienie musi być `false`. Opóźnienia, ukrywanie ekranu powitalnego przez dwie sekundy, dodać timer nastÄ™pujÄ…cych w `deviceready` obsĹ‚uga zdarzeĹ„: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +WyĹ›wietla ekran powitalny. + + navigator.splashscreen.show(); + + +Aplikacja nie moĹĽna wywoĹ‚ać `navigator.splashscreen.show()`, aĹĽ aplikacja zostaĹ‚a uruchomiona i zdarzenie `deviceready` zostaĹ‚ zwolniony. Ale poniewaĹĽ zazwyczaj opryskać tÄ™cza ma być widoczne przed rozpoczÄ™ciem aplikacji, wydaje siÄ™ sprzeczne z celem ekranu powitalnego. Dostarczanie niektĂłrych konfiguracji w `pliku config.xml` bÄ™dzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed peĹ‚ni rozpoczÄ…Ĺ‚ i odebraĹ‚ zdarzenie `deviceready`. Aby uzyskać wiÄ™cej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Z tego powodu jest maĹ‚o prawdopodobne, naleĹĽy zadzwonić `navigator.splashscreen.show()`, aby wyĹ›wietlić ekran powitalny dla uruchamiania aplikacji. \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/pl/index.md b/plugins/cordova-plugin-splashscreen/doc/pl/index.md new file mode 100644 index 0000000..33045cb --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/pl/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +Ten plugin wyĹ›wietla i ukrywa ekran powitalny podczas uruchamiania aplikacji. + +## Instalacja + + cordova plugin add cordova-plugin-splashscreen + + +## ObsĹ‚ugiwane platformy + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 i 8 +* Windows 8 + +## Metody + +* splashscreen.show +* splashscreen.Hide + +### Dziwactwa Androida + +W pliku config.xml musisz dodać nastÄ™pujÄ…ce preferencje: + + + + + +Gdzie foo jest nazwÄ… pliku ekranu powitalnego, najlepiej 9 Ĺ‚atce. Upewnij siÄ™ dodać pliki splashcreen do katalogu res/xml w odpowiednich folderach. Drugi parametr reprezentuje, jak dĹ‚ugo ekranu powitalnego pojawi siÄ™ w milisekundach. DomyĹ›lnie 3000 ms. Aby uzyskać wiÄ™cej informacji, zobacz [ikony i ekrany powitalne w aplikacjach][1]. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.Hide + +Odrzucić ten opryskaæ tĂŞcza. + + navigator.splashscreen.hide(); + + +### JeĹĽyna 10, WP8, iOS dziwactwo + +Plik `config.xml` `AutoHideSplashScreen` ustawienie musi być `false`. Opóźnienia, ukrywanie ekranu powitalnego przez dwie sekundy, dodać timer nastÄ™pujÄ…cych w `deviceready` obsĹ‚uga zdarzeĹ„: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +WyĹ›wietla ekran powitalny. + + navigator.splashscreen.show(); + + +Aplikacja nie moĹĽna wywoĹ‚ać `navigator.splashscreen.show()`, aĹĽ aplikacja zostaĹ‚a uruchomiona i zdarzenie `deviceready` zostaĹ‚ zwolniony. Ale poniewaĹĽ zazwyczaj opryskać tÄ™cza ma być widoczne przed rozpoczÄ™ciem aplikacji, wydaje siÄ™ sprzeczne z celem ekranu powitalnego. Dostarczanie niektĂłrych konfiguracji w `pliku config.xml` bÄ™dzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed peĹ‚ni rozpoczÄ…Ĺ‚ i odebraĹ‚ zdarzenie `deviceready`. Aby uzyskać wiÄ™cej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach][1]. Z tego powodu jest maĹ‚o prawdopodobne, naleĹĽy zadzwonić `navigator.splashscreen.show()`, aby wyĹ›wietlić ekran powitalny dla uruchamiania aplikacji. diff --git a/plugins/cordova-plugin-splashscreen/doc/ru/index.md b/plugins/cordova-plugin-splashscreen/doc/ru/index.md new file mode 100644 index 0000000..635c22d --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ru/index.md @@ -0,0 +1,75 @@ + + +# cordova-plugin-splashscreen + +Этот плагин отображает и Ńкрывает экран-Đ·Đ°ŃŃ‚Đ°Đ˛ĐşŃ ĐżŃ€Đ¸ Đ·Đ°ĐżŃŃке приложения. + +## ĐŁŃтановка + + cordova plugin add cordova-plugin-splashscreen + + +## Поддерживаемые платформы + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 и 8 +* Windows 8 + +## Методы + +* splashscreen.show +* splashscreen.hide + +### ĐžŃобенноŃти Android + +Đ’ ваŃем файле config.xml необходимо добавить ŃледŃющие наŃтройки: + +`` `` + +Где foo ŃŤŃ‚Đľ имя файла splashscreen, желательно 9 заплаткŃ. УбедитеŃŃŚ в том добавить ваŃи splashcreen файлы в ĐżĐ°ĐżĐşŃ res/xml в ŃоответŃтвŃющие папки. Второй параметр предŃтавляет, как долго splashscreen появитŃŃŹ в миллиŃекŃндах. По Ńмолчанию он 3000 МС. Увидеть [иконки и Đ·Đ°Ńтавки][1] для полŃчения дополнительной информации. + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.hide + +Закройте экран-Đ·Đ°Ńтавка. + + Navigator.SplashScreen.Hide(); + + +### ĐžŃобенноŃти BlackBerry 10, WP8, iOS + +`config.xml`Файла `AutoHideSplashScreen` должен быть `false` . Для задержки Ńкрытия Đ·Đ°Ńтавки на две ŃекŃнды, добавить таймер, например в `deviceready` обработчик Ńобытий: + + setTimeout(function() {navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +Отображает экран-Đ·Đ°ŃтавкŃ. + + Navigator.SplashScreen.Show(); + + +Đ’Đ°Ńе приложение не может вызвать `navigator.splashscreen.show()` Đ´Đľ тех пор, пока приложение началаŃŃŚ и `deviceready` Ńобытие инициировано. Но поŃĐşĐľĐ»ŃŚĐşŃ ĐľĐ±Ń‹Ń‡Đ˝Đľ экран-Đ·Đ°Ńтавка должен быть видимым Đ´Đľ начала ваŃего приложения, что казалоŃŃŚ бы поражение цели экрана-Đ·Đ°Ńтавки. ПредоŃтавление некоторых конфигŃрации в `config.xml` бŃдет автоматичеŃки `show` экран-Đ·Đ°ŃŃ‚Đ°Đ˛ĐşŃ ŃŃ€Đ°Đ·Ń Đ¶Đµ поŃле Đ·Đ°ĐżŃŃка ваŃего приложения и перед его полноŃŃ‚ŃŚŃŽ Đ·Đ°ĐżŃщен и полŃчил `deviceready` Ńобытие. Увидеть [иконки и Đ·Đ°Ńтавки][1] для полŃчения дополнительной информации на делать этой конфигŃрации. По этой причине маловероятно, вам Đ˝Ńжно вызвать `navigator.splashscreen.show()` для отображения экрана-Đ·Đ°Ńтавки для Đ·Đ°ĐżŃŃка приложения. diff --git a/plugins/cordova-plugin-splashscreen/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/doc/zh/README.md new file mode 100644 index 0000000..da37405 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/zh/README.md @@ -0,0 +1,119 @@ + + +# cordova-plugin-splashscreen + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +這個外掛程式顯示和隱藏在應用程式啟動期間的ĺťĺ§‹čž˘ĺą•ă€‚ + +## 安裝 + + // npm hosted (new) id + cordova plugin add cordova-plugin-splashscreen + // you may also install directly from this repo + cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git + + +## 支援的平臺 + + * 亞馬éśç« OS + * Android 系統 + * 黑莓 10 + * iOS + * Windows Phone 7 ĺ’Ś 8 + * Windows 8 + * Windows + * 瀏覽器 + +## ć–ąćł• + + * splashscreen.show + * splashscreen.hide + +### Android 的怪癖 + +在你的`config.xml`,您需č¦ć·»ĺŠ ä»Ąä¸‹ĺ„Şć : + + + + + + +美孚在哪裡é–ĺ±ŹćŞ”ďĽŚćś€ĺĄ˝ćŻ 9 修補程式檔的ĺŤç¨±ă€‚ 請確保您的 splashcreen ćŞ”ć·»ĺŠ ĺ° res/xml 目錄下相應的資料夾。 第二個ĺŹć•¸čˇ¨ç¤şĺ¤šäą…é–屏ćśéˇŻç¤şä»ĄćŻ«ç§’為單位。 ĺ®ĺ°‡é č¨­ç‚ş 3000 毫秒。 有關更多資訊,請ĺŹč¦‹ [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 + +"SplashMaintainAspectRatio"首é¸é …ćŻĺŹŻé¸çš„。 如果設置為 true,可繪製的ĺťĺ§‹čž˘ĺą•ä¸Ťćść‹‰äĽ¸ä»Ąé©ĺ螢幕,但相反只ćŻ"覆蓋"čž˘ĺą•ďĽŚĺŹ CSS"čŚć™Ż-大小: č“‹"。 這ćŻéťžĺ¸¸ćś‰ç”¨çš„不č˝ä»Ąä»»ä˝•ć–ąĺĽŹďĽŚäľ‹ĺ¦‚當他們包ĺ«ć–‡ćś¬ć–風景畸變é–屏圖ĺŹć™‚。 此設置é©ç”¨äşŽćś‰ĺ¤§ĺ©ć˝¤ (安全區),可以安全地čŁĺ‰Şä¸ŤĺŚé•·ĺŻ¬ćŻ”č‡čž˘ĺą•ä¸Šçš„ĺś–ĺŹă€‚ + +該外掛程式重新載入ĺťĺ§‹ĺŹŻçąŞčŁ˝ĺŹŞč¦ć–ąĺ‘發生變化,所以您可以指定不ĺŚçš„畫板為縱ĺ‘ĺ’Ść©«ĺ‘ć–ąĺ‘。 + +### 瀏覽器的怪癖 + +你可以用你的`config.xml`下ĺ—ĺ„Şĺ…é¸é …: + + + + + + + + + + + +### iOS 的怪癖 + + * `FadeSplashScreen`(é č¨­ç‚ş`true`çš„ĺ¸ćž—值): 設置為`false` ,以é˛ć­˘ĺ‡şçŹľé–屏衰č˝ĺ’Śé€€ĺ‡şĺ…¶éˇŻç¤şç‹€ć…‹ç™Ľç”źč®ŠĺŚ–時。 + + + + + * `FadeSplashScreenDuration`(float,é č¨­ç‚ş`2`): 指定的é–屏秒數淡出ć•ćžśäľ†ĺź·čˇŚă€‚ + + + + + * `ShowSplashScreenSpinner`(boolean, `true`çš„ĺ¸ćž—值): 設置為`false`來隱藏ĺťĺ§‹čž˘ĺą•ĺľ®čŞżćˇ†ă€‚ + + + + +## splashscreen.hide + +解雇的é–屏。 + + navigator.splashscreen.hide(); + + +### 黑莓 10,WP8,iOS 怪癖 + +`config.xml` 檔 `AutoHideSplashScreen` 設置必é ćŻ `ĺ‡` 的。 č‹Ąč¦ĺ»¶é˛ĺ…©ç§’é隱藏的é–屏,`deviceready` 事件處ç†ĺ¸¸ĺĽŹä¸­ć·»ĺŠ ä¸€ĺ€‹č¨ć™‚器,如下所示: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +顯示ĺťĺ§‹čž˘ĺą•ă€‚ + + navigator.splashscreen.show(); + + +您的應用程式無法調用 `navigator.splashscreen.show()`,直ĺ°č©˛ć‡‰ç”¨ç¨‹ĺĽŹĺ·˛ĺ•źĺ‹•ďĽŚä¸”觸發了 `deviceready` 事件。 但ćŻďĽŚç”±ć–Ľé€šĺ¸¸çš„é–屏為了ćŻĺŹŻč¦‹çš„在您的應用程式啟動之前,這似乎ćść‰“ć•—é–屏的目的。 ćŹäľ›ä¸€äş›é…Ťç˝®ĺś¨ `config.xml` 中的ćśč‡Şĺ‹• `show` ĺťĺ§‹čž˘ĺą•ć‚¨çš„應用程式啟動後立即和之前ĺ®ĺ·˛ç¶“ĺ®Śĺ…¨čµ·ć­Ąä¸¦ć”¶ĺ° `deviceready` 事件。 ĺšé€™ç¨®é…Ťç˝®çš„詳細資訊,請ĺŹé–± [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 出於此原因,不太可č˝ć‚¨éś€č¦čŞżç”¨ `navigator.splashscreen.show()`,使ĺťĺ§‹čž˘ĺą•ĺŹŻč¦‹ç‚şć‡‰ç”¨ç¨‹ĺĽŹĺ•źĺ‹•ă€‚ \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/doc/zh/index.md b/plugins/cordova-plugin-splashscreen/doc/zh/index.md new file mode 100644 index 0000000..efb309d --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/zh/index.md @@ -0,0 +1,78 @@ + + +# cordova-plugin-splashscreen + +這個外掛程式顯示和隱藏在應用程式啟動期間的ĺťĺ§‹čž˘ĺą•ă€‚ + +## 安裝 + + cordova plugin add cordova-plugin-splashscreen + + +## 支援的平臺 + +* 亞馬éśç« OS +* Android 系統 +* 黑莓 10 +* iOS +* Windows Phone 7 ĺ’Ś 8 +* Windows 8 + +## ć–ąćł• + +* splashscreen.show +* splashscreen.hide + +### Android 的怪癖 + +在你的 config.xml,您需č¦ć·»ĺŠ ä»Ąä¸‹ĺ„Şć ďĽš + + + + + +美孚在哪裡é–ĺ±ŹćŞ”ďĽŚćś€ĺĄ˝ćŻ 9 修補程式檔的ĺŤç¨±ă€‚ 請確保您的 splashcreen ćŞ”ć·»ĺŠ ĺ° res/xml 目錄下相應的資料夾。 第二個ĺŹć•¸čˇ¨ç¤şĺ¤šäą…é–屏ćśéˇŻç¤şä»ĄćŻ«ç§’為單位。 ĺ®ĺ°‡é č¨­ç‚ş 3000 毫秒。 有關更多資訊,請ĺŹč¦‹ [圖示和啟動畫面][1]。 + + [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html + +## splashscreen.hide + +解雇的é–屏。 + + navigator.splashscreen.hide(); + + +### 黑莓 10,WP8,iOS 怪癖 + +`config.xml` 檔 `AutoHideSplashScreen` 設置必é ćŻ `ĺ‡` 的。 č‹Ąč¦ĺ»¶é˛ĺ…©ç§’é隱藏的é–屏,`deviceready` 事件處ç†ĺ¸¸ĺĽŹä¸­ć·»ĺŠ ä¸€ĺ€‹č¨ć™‚器,如下所示: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +顯示ĺťĺ§‹čž˘ĺą•ă€‚ + + navigator.splashscreen.show(); + + +您的應用程式無法調用 `navigator.splashscreen.show()`,直ĺ°č©˛ć‡‰ç”¨ç¨‹ĺĽŹĺ·˛ĺ•źĺ‹•ďĽŚä¸”觸發了 `deviceready` 事件。 但ćŻďĽŚç”±ć–Ľé€šĺ¸¸çš„é–屏為了ćŻĺŹŻč¦‹çš„在您的應用程式啟動之前,這似乎ćść‰“ć•—é–屏的目的。 ćŹäľ›ä¸€äş›é…Ťç˝®ĺś¨ `config.xml` 中的ćśč‡Şĺ‹• `show` ĺťĺ§‹čž˘ĺą•ć‚¨çš„應用程式啟動後立即和之前ĺ®ĺ·˛ç¶“ĺ®Śĺ…¨čµ·ć­Ąä¸¦ć”¶ĺ° `deviceready` 事件。 ĺšé€™ç¨®é…Ťç˝®çš„詳細資訊,請ĺŹé–± [圖示和啟動畫面][1]。 出於此原因,不太可č˝ć‚¨éś€č¦čŞżç”¨ `navigator.splashscreen.show()`,使ĺťĺ§‹čž˘ĺą•ĺŹŻč¦‹ç‚şć‡‰ç”¨ç¨‹ĺĽŹĺ•źĺ‹•ă€‚ diff --git a/plugins/cordova-plugin-splashscreen/package.json b/plugins/cordova-plugin-splashscreen/package.json new file mode 100644 index 0000000..949caca --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/package.json @@ -0,0 +1,60 @@ +{ + "name": "cordova-plugin-splashscreen", + "version": "4.0.1", + "description": "Cordova Splashscreen Plugin", + "cordova": { + "id": "cordova-plugin-splashscreen", + "platforms": [ + "android", + "amazon-fireos", + "ubuntu", + "ios", + "blackberry10", + "wp8", + "windows8", + "windows", + "tizen" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/apache/cordova-plugin-splashscreen" + }, + "keywords": [ + "cordova", + "splashscreen", + "ecosystem:cordova", + "cordova-android", + "cordova-amazon-fireos", + "cordova-ubuntu", + "cordova-ios", + "cordova-blackberry10", + "cordova-wp8", + "cordova-windows8", + "cordova-windows", + "cordova-tizen" + ], + "scripts": { + "test": "npm run jshint", + "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests" + }, + "engines": { + "cordovaDependencies": { + "2.0.0": { + "cordova-android": ">=3.6.0" + }, + "4.0.0": { + "cordova-android": ">=3.6.0", + "cordova-windows": ">=4.4.0" + }, + "5.0.0": { + "cordova": ">100" + } + } + }, + "author": "Apache Software Foundation", + "license": "Apache-2.0", + "devDependencies": { + "jshint": "^2.6.0" + } +} diff --git a/plugins/cordova-plugin-splashscreen/plugin.xml b/plugins/cordova-plugin-splashscreen/plugin.xml new file mode 100644 index 0000000..483abbb --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/plugin.xml @@ -0,0 +1,135 @@ + + + + + Splashscreen + Cordova Splashscreen Plugin + Apache 2.0 + cordova,splashscreen + https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git + https://issues.apache.org/jira/browse/CB/component/12320653 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java new file mode 100644 index 0000000..14b6379 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java @@ -0,0 +1,385 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ + +package org.apache.cordova.splashscreen; + +import android.app.Dialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.res.Configuration; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.os.Handler; +import android.view.Display; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup.LayoutParams; +import android.view.WindowManager; +import android.view.animation.Animation; +import android.view.animation.AlphaAnimation; +import android.view.animation.DecelerateInterpolator; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.json.JSONArray; +import org.json.JSONException; + +public class SplashScreen extends CordovaPlugin { + private static final String LOG_TAG = "SplashScreen"; + // Cordova 3.x.x has a copy of this plugin bundled with it (SplashScreenInternal.java). + // Enable functionality only if running on 4.x.x. + private static final boolean HAS_BUILT_IN_SPLASH_SCREEN = Integer.valueOf(CordovaWebView.CORDOVA_VERSION.split("\\.")[0]) < 4; + private static final int DEFAULT_SPLASHSCREEN_DURATION = 3000; + private static final int DEFAULT_FADE_DURATION = 500; + private static Dialog splashDialog; + private static ProgressDialog spinnerDialog; + private static boolean firstShow = true; + private static boolean lastHideAfterDelay; // https://issues.apache.org/jira/browse/CB-9094 + + /** + * Displays the splash drawable. + */ + private ImageView splashImageView; + + /** + * Remember last device orientation to detect orientation changes. + */ + private int orientation; + + // Helper to be compile-time compatible with both Cordova 3.x and 4.x. + private View getView() { + try { + return (View)webView.getClass().getMethod("getView").invoke(webView); + } catch (Exception e) { + return (View)webView; + } + } + + @Override + protected void pluginInitialize() { + if (HAS_BUILT_IN_SPLASH_SCREEN) { + return; + } + // Make WebView invisible while loading URL + // CB-11326 Ensure we're calling this on UI thread + cordova.getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + getView().setVisibility(View.INVISIBLE); + } + }); + int drawableId = preferences.getInteger("SplashDrawableId", 0); + if (drawableId == 0) { + String splashResource = preferences.getString("SplashScreen", "screen"); + if (splashResource != null) { + drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName()); + if (drawableId == 0) { + drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName()); + } + preferences.set("SplashDrawableId", drawableId); + } + } + + // Save initial orientation. + orientation = cordova.getActivity().getResources().getConfiguration().orientation; + + if (firstShow) { + boolean autoHide = preferences.getBoolean("AutoHideSplashScreen", true); + showSplashScreen(autoHide); + } + + if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) { + firstShow = false; + } + } + + /** + * Shorter way to check value of "SplashMaintainAspectRatio" preference. + */ + private boolean isMaintainAspectRatio () { + return preferences.getBoolean("SplashMaintainAspectRatio", false); + } + + private int getFadeDuration () { + int fadeSplashScreenDuration = preferences.getBoolean("FadeSplashScreen", true) ? + preferences.getInteger("FadeSplashScreenDuration", DEFAULT_FADE_DURATION) : 0; + + if (fadeSplashScreenDuration < 30) { + // [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10 + // they mean 10 seconds, and not the meaningless 10ms + fadeSplashScreenDuration *= 1000; + } + + return fadeSplashScreenDuration; + } + + @Override + public void onPause(boolean multitasking) { + if (HAS_BUILT_IN_SPLASH_SCREEN) { + return; + } + // hide the splash screen to avoid leaking a window + this.removeSplashScreen(true); + } + + @Override + public void onDestroy() { + if (HAS_BUILT_IN_SPLASH_SCREEN) { + return; + } + // hide the splash screen to avoid leaking a window + this.removeSplashScreen(true); + // If we set this to true onDestroy, we lose track when we go from page to page! + //firstShow = true; + } + + @Override + public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { + if (action.equals("hide")) { + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + webView.postMessage("splashscreen", "hide"); + } + }); + } else if (action.equals("show")) { + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + webView.postMessage("splashscreen", "show"); + } + }); + } else { + return false; + } + + callbackContext.success(); + return true; + } + + @Override + public Object onMessage(String id, Object data) { + if (HAS_BUILT_IN_SPLASH_SCREEN) { + return null; + } + if ("splashscreen".equals(id)) { + if ("hide".equals(data.toString())) { + this.removeSplashScreen(false); + } else { + this.showSplashScreen(false); + } + } else if ("spinner".equals(id)) { + if ("stop".equals(data.toString())) { + getView().setVisibility(View.VISIBLE); + } + } else if ("onReceivedError".equals(id)) { + this.spinnerStop(); + } + return null; + } + + // Don't add @Override so that plugin still compiles on 3.x.x for a while + public void onConfigurationChanged(Configuration newConfig) { + if (newConfig.orientation != orientation) { + orientation = newConfig.orientation; + + // Splash drawable may change with orientation, so reload it. + if (splashImageView != null) { + int drawableId = preferences.getInteger("SplashDrawableId", 0); + if (drawableId != 0) { + splashImageView.setImageDrawable(cordova.getActivity().getResources().getDrawable(drawableId)); + } + } + } + } + + private void removeSplashScreen(final boolean forceHideImmediately) { + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + if (splashDialog != null && splashDialog.isShowing()) { + final int fadeSplashScreenDuration = getFadeDuration(); + // CB-10692 If the plugin is being paused/destroyed, skip the fading and hide it immediately + if (fadeSplashScreenDuration > 0 && forceHideImmediately == false) { + AlphaAnimation fadeOut = new AlphaAnimation(1, 0); + fadeOut.setInterpolator(new DecelerateInterpolator()); + fadeOut.setDuration(fadeSplashScreenDuration); + + splashImageView.setAnimation(fadeOut); + splashImageView.startAnimation(fadeOut); + + fadeOut.setAnimationListener(new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + spinnerStop(); + } + + @Override + public void onAnimationEnd(Animation animation) { + if (splashDialog != null && splashDialog.isShowing()) { + splashDialog.dismiss(); + splashDialog = null; + splashImageView = null; + } + } + + @Override + public void onAnimationRepeat(Animation animation) { + } + }); + } else { + spinnerStop(); + splashDialog.dismiss(); + splashDialog = null; + splashImageView = null; + } + } + } + }); + } + + /** + * Shows the splash screen over the full Activity + */ + @SuppressWarnings("deprecation") + private void showSplashScreen(final boolean hideAfterDelay) { + final int splashscreenTime = preferences.getInteger("SplashScreenDelay", DEFAULT_SPLASHSCREEN_DURATION); + final int drawableId = preferences.getInteger("SplashDrawableId", 0); + + final int fadeSplashScreenDuration = getFadeDuration(); + final int effectiveSplashDuration = Math.max(0, splashscreenTime - fadeSplashScreenDuration); + + lastHideAfterDelay = hideAfterDelay; + + // If the splash dialog is showing don't try to show it again + if (splashDialog != null && splashDialog.isShowing()) { + return; + } + if (drawableId == 0 || (splashscreenTime <= 0 && hideAfterDelay)) { + return; + } + + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + // Get reference to display + Display display = cordova.getActivity().getWindowManager().getDefaultDisplay(); + Context context = webView.getContext(); + + // Use an ImageView to render the image because of its flexible scaling options. + splashImageView = new ImageView(context); + splashImageView.setImageResource(drawableId); + LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); + splashImageView.setLayoutParams(layoutParams); + + splashImageView.setMinimumHeight(display.getHeight()); + splashImageView.setMinimumWidth(display.getWidth()); + + // TODO: Use the background color of the webView's parent instead of using the preference. + splashImageView.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK)); + + if (isMaintainAspectRatio()) { + // CENTER_CROP scale mode is equivalent to CSS "background-size:cover" + splashImageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + } + else { + // FIT_XY scales image non-uniformly to fit into image view. + splashImageView.setScaleType(ImageView.ScaleType.FIT_XY); + } + + // Create and show the dialog + splashDialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar); + // check to see if the splash screen should be full screen + if ((cordova.getActivity().getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) + == WindowManager.LayoutParams.FLAG_FULLSCREEN) { + splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + splashDialog.setContentView(splashImageView); + splashDialog.setCancelable(false); + splashDialog.show(); + + if (preferences.getBoolean("ShowSplashScreenSpinner", true)) { + spinnerStart(); + } + + // Set Runnable to remove splash screen just in case + if (hideAfterDelay) { + final Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + public void run() { + if (lastHideAfterDelay) { + removeSplashScreen(false); + } + } + }, effectiveSplashDuration); + } + } + }); + } + + // Show only spinner in the center of the screen + private void spinnerStart() { + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + spinnerStop(); + + spinnerDialog = new ProgressDialog(webView.getContext()); + spinnerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + public void onCancel(DialogInterface dialog) { + spinnerDialog = null; + } + }); + + spinnerDialog.setCancelable(false); + spinnerDialog.setIndeterminate(true); + + RelativeLayout centeredLayout = new RelativeLayout(cordova.getActivity()); + centeredLayout.setGravity(Gravity.CENTER); + centeredLayout.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + + ProgressBar progressBar = new ProgressBar(webView.getContext()); + RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); + layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE); + progressBar.setLayoutParams(layoutParams); + + centeredLayout.addView(progressBar); + + spinnerDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); + spinnerDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); + + spinnerDialog.show(); + spinnerDialog.setContentView(centeredLayout); + } + }); + } + + private void spinnerStop() { + cordova.getActivity().runOnUiThread(new Runnable() { + public void run() { + if (spinnerDialog != null && spinnerDialog.isShowing()) { + spinnerDialog.dismiss(); + spinnerDialog = null; + } + } + }); + } +} diff --git a/plugins/cordova-plugin-splashscreen/src/blackberry10/index.js b/plugins/cordova-plugin-splashscreen/src/blackberry10/index.js new file mode 100644 index 0000000..c682506 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/blackberry10/index.js @@ -0,0 +1,30 @@ +/* + * Copyright 2013 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* global PluginResult */ + +module.exports = { + show: function (success, fail, args, env) { + var result = new PluginResult(args, env); + result.error("Not supported on platform", false); + }, + + hide: function (success, fail, args, env) { + var result = new PluginResult(args, env); + window.qnx.webplatform.getApplication().windowVisible = true; + result.ok(undefined, false); + } +}; diff --git a/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js new file mode 100644 index 0000000..6cf9309 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js @@ -0,0 +1,138 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +// Default parameter values including image size can be changed in `config.xml` +var splashImageWidth = 170; +var splashImageHeight = 200; +var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight }; +var localSplash; // the image to display +var localSplashImage; +var bgColor = "#464646"; +var imageSrc = '/img/logo.png'; +var splashScreenDelay = 3000; // in milliseconds +var showSplashScreen = true; // show splashcreen by default +var cordova = require('cordova'); +var configHelper = cordova.require('cordova/confighelper'); + +function updateImageLocation() { + position.width = Math.min(splashImageWidth, window.innerWidth); + position.height = position.width * (splashImageHeight / splashImageWidth); + + localSplash.style.width = window.innerWidth + "px"; + localSplash.style.height = window.innerHeight + "px"; + localSplash.style.top = "0px"; + localSplash.style.left = "0px"; + + localSplashImage.style.top = "50%"; + localSplashImage.style.left = "50%"; + localSplashImage.style.height = position.height + "px"; + localSplashImage.style.width = position.width + "px"; + localSplashImage.style.marginTop = (-position.height / 2) + "px"; + localSplashImage.style.marginLeft = (-position.width / 2) + "px"; +} + +function onResize() { + updateImageLocation(); +} + +var SplashScreen = { + setBGColor: function (cssBGColor) { + bgColor = cssBGColor; + if (localSplash) { + localSplash.style.backgroundColor = bgColor; + } + }, + show: function () { + if(!localSplash) { + window.addEventListener("resize", onResize, false); + localSplash = document.createElement("div"); + localSplash.style.backgroundColor = bgColor; + localSplash.style.position = "absolute"; + + localSplashImage = document.createElement("img"); + localSplashImage.src = imageSrc; + localSplashImage.style.position = "absolute"; + + updateImageLocation(); + + localSplash.appendChild(localSplashImage); + document.body.appendChild(localSplash); + } + }, + hide: function () { + if(localSplash) { + window.removeEventListener("resize", onResize, false); + document.body.removeChild(localSplash); + localSplash = null; + } + } +}; + +/** + * Reads preferences via ConfigHelper and substitutes default parameters. + */ +function readPreferencesFromCfg(cfg) { + try { + var value = cfg.getPreferenceValue('ShowSplashScreen'); + if(typeof value != 'undefined') { + showSplashScreen = value === 'true'; + } + + splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay; + imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc; + bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor; + splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth; + splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight; + } catch(e) { + var msg = '[Browser][SplashScreen] Error occured on loading preferences from config.xml: ' + JSON.stringify(e); + console.error(msg); + } +} + +/** + * Shows and hides splashscreen if it is enabled, with a delay according the current preferences. + */ +function showAndHide() { + if(showSplashScreen) { + SplashScreen.show(); + + window.setTimeout(function() { + SplashScreen.hide(); + }, splashScreenDelay); + } +} + +/** + * Tries to read config.xml and override default properties and then shows and hides splashcreen if it is enabled. + */ +(function initAndShow() { + configHelper.readConfig(function(config) { + readPreferencesFromCfg(config); + showAndHide(); + }, function(err) { + console.error(err); + }); +})(); + +module.exports = SplashScreen; + +require("cordova/exec/proxy").add("SplashScreen", SplashScreen); + diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h new file mode 100644 index 0000000..ec5d602 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h @@ -0,0 +1,45 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import + +typedef struct { + BOOL iPhone; + BOOL iPad; + BOOL iPhone4; + BOOL iPhone5; + BOOL iPhone6; + BOOL iPhone6Plus; + BOOL retina; + +} CDV_iOSDevice; + +@interface CDVSplashScreen : CDVPlugin { + UIActivityIndicatorView* _activityView; + UIImageView* _imageView; + NSString* _curImageName; + BOOL _visible; + BOOL _destroyed; +} + +- (void)show:(CDVInvokedUrlCommand*)command; +- (void)hide:(CDVInvokedUrlCommand*)command; + +@end diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m new file mode 100644 index 0000000..ab97055 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m @@ -0,0 +1,506 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import "CDVSplashScreen.h" +#import +#import +#import "CDVViewController+SplashScreen.h" + +#define kSplashScreenDurationDefault 3000.0f +#define kFadeDurationDefault 500.0f + + +@implementation CDVSplashScreen + +- (void)pluginInitialize +{ + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:nil]; + + [self setVisible:YES]; +} + +- (void)show:(CDVInvokedUrlCommand*)command +{ + [self setVisible:YES]; +} + +- (void)hide:(CDVInvokedUrlCommand*)command +{ + [self setVisible:NO andForce:YES]; +} + +- (void)pageDidLoad +{ + id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]]; + + // if value is missing, default to yes + if ((autoHideSplashScreenValue == nil) || [autoHideSplashScreenValue boolValue]) { + [self setVisible:NO]; + } +} + +- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context +{ + [self updateImage]; +} + +- (void)createViews +{ + /* + * The Activity View is the top spinning throbber in the status/battery bar. We init it with the default Grey Style. + * + * whiteLarge = UIActivityIndicatorViewStyleWhiteLarge + * white = UIActivityIndicatorViewStyleWhite + * gray = UIActivityIndicatorViewStyleGray + * + */ + + // Determine whether rotation should be enabled for this device + // Per iOS HIG, landscape is only supported on iPad and iPhone 6+ + CDV_iOSDevice device = [self getCurrentDevice]; + BOOL autorotateValue = (device.iPad || device.iPhone6Plus) ? + [(CDVViewController *)self.viewController shouldAutorotateDefaultValue] : + NO; + + [(CDVViewController *)self.viewController setEnabledAutorotation:autorotateValue]; + + NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]]; + UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray; + + if ([topActivityIndicator isEqualToString:@"whiteLarge"]) + { + topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge; + } + else if ([topActivityIndicator isEqualToString:@"white"]) + { + topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite; + } + else if ([topActivityIndicator isEqualToString:@"gray"]) + { + topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray; + } + + UIView* parentView = self.viewController.view; + parentView.userInteractionEnabled = NO; // disable user interaction while splashscreen is shown + _activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:topActivityIndicatorStyle]; + _activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2); + _activityView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin + | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin; + [_activityView startAnimating]; + + // Set the frame & image later. + _imageView = [[UIImageView alloc] init]; + [parentView addSubview:_imageView]; + + id showSplashScreenSpinnerValue = [self.commandDelegate.settings objectForKey:[@"ShowSplashScreenSpinner" lowercaseString]]; + // backwards compatibility - if key is missing, default to true + if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue]) + { + [parentView addSubview:_activityView]; + } + + // Frame is required when launching in portrait mode. + // Bounds for landscape since it captures the rotation. + [parentView addObserver:self forKeyPath:@"frame" options:0 context:nil]; + [parentView addObserver:self forKeyPath:@"bounds" options:0 context:nil]; + + [self updateImage]; + _destroyed = NO; +} + +- (void)hideViews +{ + [_imageView setAlpha:0]; + [_activityView setAlpha:0]; +} + +- (void)destroyViews +{ + _destroyed = YES; + [(CDVViewController *)self.viewController setEnabledAutorotation:[(CDVViewController *)self.viewController shouldAutorotateDefaultValue]]; + + [_imageView removeFromSuperview]; + [_activityView removeFromSuperview]; + _imageView = nil; + _activityView = nil; + _curImageName = nil; + + self.viewController.view.userInteractionEnabled = YES; // re-enable user interaction upon completion + @try { + [self.viewController.view removeObserver:self forKeyPath:@"frame"]; + [self.viewController.view removeObserver:self forKeyPath:@"bounds"]; + } + @catch (NSException *exception) { + // When reloading the page from a remotely connected Safari, there + // are no observers, so the removeObserver method throws an exception, + // that we can safely ignore. + // Alternatively we can check whether there are observers before calling removeObserver + } +} + +- (CDV_iOSDevice) getCurrentDevice +{ + CDV_iOSDevice device; + + UIScreen* mainScreen = [UIScreen mainScreen]; + CGFloat mainScreenHeight = mainScreen.bounds.size.height; + CGFloat mainScreenWidth = mainScreen.bounds.size.width; + + int limit = MAX(mainScreenHeight,mainScreenWidth); + + device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad); + device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone); + device.retina = ([mainScreen scale] == 2.0); + device.iPhone4 = (device.iPhone && limit == 480.0); + device.iPhone5 = (device.iPhone && limit == 568.0); + // note these below is not a true device detect, for example if you are on an + // iPhone 6/6+ but the app is scaled it will prob set iPhone5 as true, but + // this is appropriate for detecting the runtime screen environment + device.iPhone6 = (device.iPhone && limit == 667.0); + device.iPhone6Plus = (device.iPhone && limit == 736.0); + + return device; +} + +- (BOOL) isUsingCDVLaunchScreen { + NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; + if (launchStoryboardName) { + return ([launchStoryboardName isEqualToString:@"CDVLaunchScreen"]); + } else { + return NO; + } +} + +- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id)orientationDelegate device:(CDV_iOSDevice)device +{ + // Use UILaunchImageFile if specified in plist. Otherwise, use Default. + NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"]; + + // detect if we are using CB-9762 Launch Storyboard; if so, return the associated image instead + if ([self isUsingCDVLaunchScreen]) { + imageName = @"LaunchStoryboard"; + return imageName; + } + + NSUInteger supportedOrientations = [orientationDelegate supportedInterfaceOrientations]; + + // Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape + BOOL supportsLandscape = (supportedOrientations & UIInterfaceOrientationMaskLandscape); + BOOL supportsPortrait = (supportedOrientations & UIInterfaceOrientationMaskPortrait || supportedOrientations & UIInterfaceOrientationMaskPortraitUpsideDown); + // this means there are no mixed orientations in there + BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape); + + if (imageName) + { + imageName = [imageName stringByDeletingPathExtension]; + } + else + { + imageName = @"Default"; + } + + // Add Asset Catalog specific prefixes + if ([imageName isEqualToString:@"LaunchImage"]) + { + if (device.iPhone4 || device.iPhone5 || device.iPad) { + imageName = [imageName stringByAppendingString:@"-700"]; + } else if(device.iPhone6) { + imageName = [imageName stringByAppendingString:@"-800"]; + } else if(device.iPhone6Plus) { + imageName = [imageName stringByAppendingString:@"-800"]; + if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown) + { + imageName = [imageName stringByAppendingString:@"-Portrait"]; + } + } + } + + if (device.iPhone5) + { // does not support landscape + imageName = [imageName stringByAppendingString:@"-568h"]; + } + else if (device.iPhone6) + { // does not support landscape + imageName = [imageName stringByAppendingString:@"-667h"]; + } + else if (device.iPhone6Plus) + { // supports landscape + if (isOrientationLocked) + { + imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"")]; + } + else + { + switch (currentOrientation) + { + case UIInterfaceOrientationLandscapeLeft: + case UIInterfaceOrientationLandscapeRight: + imageName = [imageName stringByAppendingString:@"-Landscape"]; + break; + default: + break; + } + } + imageName = [imageName stringByAppendingString:@"-736h"]; + + } + else if (device.iPad) + { // supports landscape + if (isOrientationLocked) + { + imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")]; + } + else + { + switch (currentOrientation) + { + case UIInterfaceOrientationLandscapeLeft: + case UIInterfaceOrientationLandscapeRight: + imageName = [imageName stringByAppendingString:@"-Landscape"]; + break; + + case UIInterfaceOrientationPortrait: + case UIInterfaceOrientationPortraitUpsideDown: + default: + imageName = [imageName stringByAppendingString:@"-Portrait"]; + break; + } + } + } + + return imageName; +} + +- (UIInterfaceOrientation)getCurrentOrientation +{ + UIInterfaceOrientation iOrientation = [UIApplication sharedApplication].statusBarOrientation; + UIDeviceOrientation dOrientation = [UIDevice currentDevice].orientation; + + bool landscape; + + if (dOrientation == UIDeviceOrientationUnknown || dOrientation == UIDeviceOrientationFaceUp || dOrientation == UIDeviceOrientationFaceDown) { + // If the device is laying down, use the UIInterfaceOrientation based on the status bar. + landscape = UIInterfaceOrientationIsLandscape(iOrientation); + } else { + // If the device is not laying down, use UIDeviceOrientation. + landscape = UIDeviceOrientationIsLandscape(dOrientation); + + // There's a bug in iOS!!!! http://openradar.appspot.com/7216046 + // So values needs to be reversed for landscape! + if (dOrientation == UIDeviceOrientationLandscapeLeft) + { + iOrientation = UIInterfaceOrientationLandscapeRight; + } + else if (dOrientation == UIDeviceOrientationLandscapeRight) + { + iOrientation = UIInterfaceOrientationLandscapeLeft; + } + else if (dOrientation == UIDeviceOrientationPortrait) + { + iOrientation = UIInterfaceOrientationPortrait; + } + else if (dOrientation == UIDeviceOrientationPortraitUpsideDown) + { + iOrientation = UIInterfaceOrientationPortraitUpsideDown; + } + } + + return iOrientation; +} + +// Sets the view's frame and image. +- (void)updateImage +{ + NSString* imageName = [self getImageName:[self getCurrentOrientation] delegate:(id)self.viewController device:[self getCurrentDevice]]; + + if (![imageName isEqualToString:_curImageName]) + { + UIImage* img = [UIImage imageNamed:imageName]; + _imageView.image = img; + _curImageName = imageName; + } + + // Check that splash screen's image exists before updating bounds + if (_imageView.image) + { + [self updateBounds]; + } + else + { + NSLog(@"WARNING: The splashscreen image named %@ was not found", imageName); + } +} + +- (void)updateBounds +{ + if ([self isUsingCDVLaunchScreen]) { + // CB-9762's launch screen expects the image to fill the screen and be scaled using AspectFill. + CGSize viewportSize = [UIApplication sharedApplication].delegate.window.bounds.size; + _imageView.frame = CGRectMake(0, 0, viewportSize.width, viewportSize.height); + _imageView.contentMode = UIViewContentModeScaleAspectFill; + return; + } + + UIImage* img = _imageView.image; + CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero; + + CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size; + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + CGAffineTransform imgTransform = CGAffineTransformIdentity; + + /* If and only if an iPhone application is landscape-only as per + * UISupportedInterfaceOrientations, the view controller's orientation is + * landscape. In this case the image must be rotated in order to appear + * correctly. + */ + CDV_iOSDevice device = [self getCurrentDevice]; + if (UIInterfaceOrientationIsLandscape(orientation) && !device.iPhone6Plus && !device.iPad) + { + imgTransform = CGAffineTransformMakeRotation(M_PI / 2); + imgBounds.size = CGSizeMake(imgBounds.size.height, imgBounds.size.width); + } + + // There's a special case when the image is the size of the screen. + if (CGSizeEqualToSize(screenSize, imgBounds.size)) + { + CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil]; + if (!(IsAtLeastiOSVersion(@"7.0"))) + { + imgBounds.origin.y -= statusFrame.size.height; + } + } + else if (imgBounds.size.width > 0) + { + CGRect viewBounds = self.viewController.view.bounds; + CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height; + CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height; + // This matches the behaviour of the native splash screen. + CGFloat ratio; + if (viewAspect > imgAspect) + { + ratio = viewBounds.size.width / imgBounds.size.width; + } + else + { + ratio = viewBounds.size.height / imgBounds.size.height; + } + imgBounds.size.height *= ratio; + imgBounds.size.width *= ratio; + } + + _imageView.transform = imgTransform; + _imageView.frame = imgBounds; +} + +- (void)setVisible:(BOOL)visible +{ + [self setVisible:visible andForce:NO]; +} + +- (void)setVisible:(BOOL)visible andForce:(BOOL)force +{ + if (visible != _visible || force) + { + _visible = visible; + + id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]]; + id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]]; + + float fadeDuration = fadeSplashScreenDuration == nil ? kFadeDurationDefault : [fadeSplashScreenDuration floatValue]; + + id splashDurationString = [self.commandDelegate.settings objectForKey: [@"SplashScreenDelay" lowercaseString]]; + float splashDuration = splashDurationString == nil ? kSplashScreenDurationDefault : [splashDurationString floatValue]; + + id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]]; + BOOL autoHideSplashScreen = true; + + if (autoHideSplashScreenValue != nil) { + autoHideSplashScreen = [autoHideSplashScreenValue boolValue]; + } + + if (!autoHideSplashScreen) { + // CB-10412 SplashScreenDelay does not make sense if the splashscreen is hidden manually + splashDuration = 0; + } + + + if (fadeSplashScreenValue == nil) + { + fadeSplashScreenValue = @"true"; + } + + if (![fadeSplashScreenValue boolValue]) + { + fadeDuration = 0; + } + else if (fadeDuration < 30) + { + // [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10 + // they mean 10 seconds, and not the meaningless 10ms + fadeDuration *= 1000; + } + + if (_visible) + { + if (_imageView == nil) + { + [self createViews]; + } + } + else if (fadeDuration == 0 && splashDuration == 0) + { + [self destroyViews]; + } + else + { + __weak __typeof(self) weakSelf = self; + float effectiveSplashDuration; + + // [CB-10562] AutoHideSplashScreen may be "true" but we should still be able to hide the splashscreen manually. + if (!autoHideSplashScreen || force) { + effectiveSplashDuration = (fadeDuration) / 1000; + } else { + effectiveSplashDuration = (splashDuration - fadeDuration) / 1000; + } + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) effectiveSplashDuration * NSEC_PER_SEC), dispatch_get_main_queue(), CFBridgingRelease(CFBridgingRetain(^(void) { + if (!_destroyed) { + [UIView transitionWithView:self.viewController.view + duration:(fadeDuration / 1000) + options:UIViewAnimationOptionTransitionNone + animations:^(void) { + [weakSelf hideViews]; + } + completion:^(BOOL finished) { + // Always destroy views, otherwise you could have an + // invisible splashscreen that is overlayed over your active views + // which causes that no touch events are passed + if (!_destroyed) { + [weakSelf destroyViews]; + // TODO: It might also be nice to have a js event happen here -jm + } + } + ]; + } + }))); + } + } +} + +@end diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h new file mode 100644 index 0000000..a948ea3 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h @@ -0,0 +1,28 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import + +@interface CDVViewController (SplashScreen) + +@property (nonatomic, assign) BOOL enabledAutorotation; +@property (nonatomic, readonly) BOOL shouldAutorotateDefaultValue; + + +@end diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m new file mode 100644 index 0000000..e483def --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m @@ -0,0 +1,89 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import "CDVViewController+SplashScreen.h" +#import + +@implementation CDVViewController (SplashScreen) + +@dynamic enabledAutorotation; + +- (void)setEnabledAutorotation:(BOOL)value +{ + objc_setAssociatedObject(self, + @selector(enabledAutorotation), + [NSNumber numberWithBool:value], + OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (BOOL)enabledAutorotation +{ + NSNumber *number = (NSNumber *)objc_getAssociatedObject(self, @selector(enabledAutorotation)); + + // Defaulting to YES to correspond parent CDVViewController behavior + if (number == nil) + { + return YES; + } + + return [number boolValue]; +} + ++ (void)load +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + Class class = [self class]; + + SEL originalSelector = @selector(shouldAutorotate); + SEL swizzledSelector = @selector(splash_shouldAutorotate); + + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + + BOOL didAddMethod = class_addMethod(class, + originalSelector, + method_getImplementation(swizzledMethod), + method_getTypeEncoding(swizzledMethod)); + + if (didAddMethod) { + class_replaceMethod(class, + swizzledSelector, + method_getImplementation(originalMethod), + method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } + }); +} + +#pragma mark - Method Swizzling + +- (BOOL)splash_shouldAutorotate +{ + return self.enabledAutorotation; +} + + +- (BOOL)shouldAutorotateDefaultValue +{ + return [self splash_shouldAutorotate]; +} + +@end diff --git a/plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js new file mode 100644 index 0000000..06c0697 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +( function() { + +var win = null; + +module.exports = { + show: function() { + if ( win === null ) { + win = window.open('splashscreen.html'); + } + }, + + hide: function() { + if ( win !== null ) { + win.close(); + win = null; + } + } +}; + +require("cordova/tizen/commandProxy").add("SplashScreen", module.exports); + +})(); diff --git a/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp new file mode 100644 index 0000000..1c9ecac --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp @@ -0,0 +1,42 @@ +/* + * + * Copyright 2013 Canonical Ltd. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +#include + +#include "splashscreen.h" +#include + +#define SPLASHSCREEN_STATE_NAME "splashscreen" + +Splashscreen::Splashscreen(Cordova *cordova): CPlugin(cordova) { +} + +void Splashscreen::show(int, int) { + m_cordova->rootObject()->setProperty("splashscreenPath", m_cordova->getSplashscreenPath()); + + m_cordova->pushViewState(SPLASHSCREEN_STATE_NAME); +} + +void Splashscreen::hide(int, int) { + m_cordova->popViewState(SPLASHSCREEN_STATE_NAME); +} diff --git a/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h new file mode 100644 index 0000000..1d437f8 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h @@ -0,0 +1,52 @@ +/* + * + * Copyright 2013 Canonical Ltd. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +#ifndef SPLASHSCREEN_H +#define SPLASHSCREEN_H + +#include +#include + +class Splashscreen: public CPlugin { + Q_OBJECT +public: + explicit Splashscreen(Cordova *cordova); + + virtual const QString fullName() override { + return Splashscreen::fullID(); + } + + virtual const QString shortName() override { + return "SplashScreen"; + } + + static const QString fullID() { + return "SplashScreen"; + } + +public slots: + void show(int, int); + void hide(int, int); +}; + +#endif // SPLASHSCREEN_H diff --git a/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs new file mode 100644 index 0000000..050c392 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs @@ -0,0 +1,39 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using Microsoft.Phone.Info; +using System; +using System.Windows; + +namespace WPCordovaClassLib.Cordova.Commands +{ + public enum Resolutions { WVGA, WXGA, HD }; + + public static class ResolutionHelper + { + public static Resolutions CurrentResolution + { + get + { + switch (Application.Current.Host.Content.ScaleFactor) + { + case 100: return Resolutions.WVGA; + case 160: return Resolutions.WXGA; + case 150: return Resolutions.HD; + } + throw new InvalidOperationException("Unknown resolution"); + } + } + } +} \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs new file mode 100644 index 0000000..c56d4ad --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs @@ -0,0 +1,255 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using Microsoft.Phone.Info; +using System.Windows.Controls.Primitives; +using System.Diagnostics; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.IO; +using System.Xml.Linq; +using System.Linq; +using System.Windows.Threading; + +namespace WPCordovaClassLib.Cordova.Commands +{ + /// + /// Listens for changes to the state of the battery on the device. + /// Currently only the "isPlugged" parameter available via native APIs. + /// + public class SplashScreen : BaseCommand + { + private Popup popup; + + // Time until we dismiss the splashscreen + private int prefDelay = 3000; + + // Whether we hide it by default + private bool prefAutoHide = true; + + // Path to image to use + private string prefImagePath = "SplashScreenImage.jpg"; + + // static because autodismiss is only ever applied once, at app launch + // subsequent page loads should not cause the SplashScreen to be shown. + private static bool WasShown = false; + + public SplashScreen() + { + LoadConfigPrefs(); + + Image SplashScreen = new Image() + { + Height = Application.Current.Host.Content.ActualHeight, + Width = Application.Current.Host.Content.ActualWidth, + Stretch = Stretch.Fill + }; + + var imageResource = GetSplashScreenImageResource(); + if (imageResource != null) + { + BitmapImage splash_image = new BitmapImage(); + splash_image.SetSource(imageResource.Stream); + SplashScreen.Source = splash_image; + } + + // Instansiate the popup and set the Child property of Popup to SplashScreen + popup = new Popup() { IsOpen = false, + Child = SplashScreen, + HorizontalAlignment = HorizontalAlignment.Stretch, + VerticalAlignment = VerticalAlignment.Center + + }; + } + + public override void OnInit() + { + // we only want to autoload on the first page load. + // but OnInit is called for every page load. + if (!SplashScreen.WasShown) + { + SplashScreen.WasShown = true; + show(); + } + } + + private void LoadConfigPrefs() + { + StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("config.xml", UriKind.Relative)); + if (streamInfo != null) + { + using (StreamReader sr = new StreamReader(streamInfo.Stream)) + { + //This will Read Keys Collection for the xml file + XDocument configFile = XDocument.Parse(sr.ReadToEnd()); + + string configAutoHide = configFile.Descendants() + .Where(x => x.Name.LocalName == "preference") + .Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen") + .Select(x => (string)x.Attribute("value")) + .FirstOrDefault(); + + bool bVal; + prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide; + + string configDelay = configFile.Descendants() + .Where(x => x.Name.LocalName == "preference") + .Where(x => (string)x.Attribute("name") == "SplashScreenDelay") + .Select(x => (string)x.Attribute("value")) + .FirstOrDefault(); + int nVal; + prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay; + + string configImage = configFile.Descendants() + .Where(x => x.Name.LocalName == "preference") + .Where(x => (string)x.Attribute("name") == "SplashScreen") + .Select(x => (string)x.Attribute("value")) + .FirstOrDefault(); + + if (!String.IsNullOrEmpty(configImage)) + { + prefImagePath = configImage; + } + } + } + } + + private StreamResourceInfo GetSplashScreenImageResource() + { + // Get the base filename for the splash screen images + string imageName = System.IO.Path.GetFileNameWithoutExtension(prefImagePath); + Uri imageUri = null; + StreamResourceInfo imageResource = null; + + // First, try to get a resolution-specific splashscreen + try + { + // Determine the device's resolution + switch (ResolutionHelper.CurrentResolution) + { + case Resolutions.HD: + imageUri = new Uri(imageName + ".screen-720p.jpg", UriKind.Relative); + break; + + case Resolutions.WVGA: + imageUri = new Uri(imageName + ".screen-WVGA.jpg", UriKind.Relative); + break; + + case Resolutions.WXGA: + default: + imageUri = new Uri(imageName + ".screen-WXGA.jpg", UriKind.Relative); + break; + } + + imageResource = Application.GetResourceStream(imageUri); + } + catch (Exception) + { + // It's OK if we didn't get a resolution-specific image + } + + // Fallback to the default image name without decoration + if (imageResource == null) + { + imageUri = new Uri(prefImagePath, UriKind.Relative); + imageResource = Application.GetResourceStream(imageUri); + } + + if (imageUri != null) Debug.WriteLine("INFO :: SplashScreen: using image {0}", imageUri.OriginalString); + + return imageResource; + } + + public void show(string options = null) + { + Deployment.Current.Dispatcher.BeginInvoke(() => + { + if (!popup.IsOpen) + { + popup.Child.Opacity = 0; + + Storyboard story = new Storyboard(); + DoubleAnimation animation = new DoubleAnimation() + { + From = 0.0, + To = 1.0, + Duration = new Duration(TimeSpan.FromSeconds(0.2)) + }; + + Storyboard.SetTarget(animation, popup.Child); + Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); + story.Children.Add(animation); + + story.Begin(); + + popup.IsOpen = true; + + if (prefAutoHide) + { + StartAutoHideTimer(); + } + } + }); + } + + public void hide(string options = null) + { + Deployment.Current.Dispatcher.BeginInvoke(() => + { + if (popup.IsOpen) + { + popup.Child.Opacity = 1.0; + + Storyboard story = new Storyboard(); + DoubleAnimation animation = new DoubleAnimation() + { + From = 1.0, + To = 0.0, + Duration = new Duration(TimeSpan.FromSeconds(0.4)) + }; + + Storyboard.SetTarget(animation, popup.Child); + Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); + story.Children.Add(animation); + story.Completed += (object sender, EventArgs e) => + { + popup.IsOpen = false; + }; + story.Begin(); + } + }); + } + + private void StartAutoHideTimer() + { + var timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(prefDelay) }; + timer.Tick += (object sender, EventArgs e) => + { + hide(); + timer.Stop(); + }; + timer.Start(); + } + } +} diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2dd325a --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout new file mode 100644 index 0000000..7e4cdb9 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 6BE9AD73-1B9F-4362-98D7-DC631BEC6185 + IDESourceControlProjectName + CDVSplashScreenTest + IDESourceControlProjectOriginsDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git + + IDESourceControlProjectPath + tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + ../../../../.. + + IDESourceControlProjectURL + https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlWCCName + cordova-plugin-splashscreen + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme new file mode 100644 index 0000000..13f9a15 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m new file mode 100644 index 0000000..1637d24 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m @@ -0,0 +1,702 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import +#import +#import "CDVSplashScreen.h" +#import "ImageNameTestDelegates.h" + +const CDV_iOSDevice CDV_iOSDeviceZero = { 0, 0, 0, 0, 0, 0 }; + +@interface ImageNameTest : XCTestCase + +@property (nonatomic, strong) CDVSplashScreen* plugin; + +@end + +@interface CDVSplashScreen () + +// expose private interface +- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id)orientationDelegate device:(CDV_iOSDevice)device; + +@end + +@implementation ImageNameTest + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. + + self.plugin = [[CDVSplashScreen alloc] init]; +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void) orientationHelper:(id)delegate expectedImageNameDictionary:(NSDictionary*)expectedImageNameDictionary device:(CDV_iOSDevice)device{ + + NSString* name = nil; + NSString* expectedImageName = nil; + UIInterfaceOrientation currentOrientation; + NSString* deviceName = device.iPad? @"iPad" : device.iPhone6Plus? @"iPhone6Plus": device.iPhone6? @"iPhone6": device.iPhone5? @"iPhone5" : @"iPhone"; + + // LandscapeLeft, should always return expectedImageName + currentOrientation = UIInterfaceOrientationLandscapeLeft; + name = [self.plugin getImageName:currentOrientation delegate:delegate device:device]; + expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeLeft"]; + XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name); + + // LandscapeRight - should always return expectedImageName + currentOrientation = UIInterfaceOrientationLandscapeRight; + name = [self.plugin getImageName:currentOrientation delegate:delegate device:device]; + expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeRight"]; + XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name); + + // Portrait - should always return expectedImageName + currentOrientation = UIInterfaceOrientationPortrait; + name = [self.plugin getImageName:currentOrientation delegate:delegate device:device]; + expectedImageName = [expectedImageNameDictionary objectForKey:@"portrait"]; + XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name); + + // PortraitUpsideDown - should always return expectedImageName + currentOrientation = UIInterfaceOrientationPortraitUpsideDown; + name = [self.plugin getImageName:currentOrientation delegate:delegate device:device]; + expectedImageName = [expectedImageNameDictionary objectForKey:@"portraitUpsideDown"]; + XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name); +} + +- (void)testiPadOrientation { + + CDV_iOSDevice device = CDV_iOSDeviceZero; + device.iPad = YES; + + // One orientation + + PortraitOnly* delegate = [[PortraitOnly alloc] init]; + [self orientationHelper:delegate expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Portrait", + @"landscapeRight" : @"Default-Portrait", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init]; + [self orientationHelper:delegate2 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Portrait", + @"landscapeRight" : @"Default-Portrait", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate3 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Landscape", + @"portraitUpsideDown" : @"Default-Landscape" + } + device:device]; + + LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init]; + [self orientationHelper:delegate4 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Landscape", + @"portraitUpsideDown" : @"Default-Landscape" + } + device:device]; + + // All Portrait + + AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init]; + [self orientationHelper:delegate5 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Portrait", + @"landscapeRight" : @"Default-Portrait", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + // All Landscape + + AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init]; + [self orientationHelper:delegate6 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Landscape", + @"portraitUpsideDown" : @"Default-Landscape" + } + device:device]; + + + // All orientations + + AllOrientations* delegate7 = [[AllOrientations alloc] init]; + [self orientationHelper:delegate7 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + // Portrait and Landscape Left + + PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate8 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + // Portrait and Landscape Right + + PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate9 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + // PortraitUpsideDown and Landscape Left + + PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate10 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; + + // PortraitUpsideDown and Landscape Right + + PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate11 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape", + @"landscapeRight" : @"Default-Landscape", + @"portrait" : @"Default-Portrait", + @"portraitUpsideDown" : @"Default-Portrait" + } + device:device]; +} + +- (void)testiPhoneOrientation { + + CDV_iOSDevice device = CDV_iOSDeviceZero; + device.iPhone = YES; + + // One orientation + + PortraitOnly* delegate = [[PortraitOnly alloc] init]; + [self orientationHelper:delegate expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init]; + [self orientationHelper:delegate2 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate3 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init]; + [self orientationHelper:delegate4 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // All Portrait + + AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init]; + [self orientationHelper:delegate5 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // All Landscape + + AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init]; + [self orientationHelper:delegate6 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + + // All orientations + + AllOrientations* delegate7 = [[AllOrientations alloc] init]; + [self orientationHelper:delegate7 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // Portrait and Landscape Left + + PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate8 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // Portrait and Landscape Right + + PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate9 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // PortraitUpsideDown and Landscape Left + + PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate10 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; + + // PortraitUpsideDown and Landscape Right + + PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate11 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default", + @"landscapeRight" : @"Default", + @"portrait" : @"Default", + @"portraitUpsideDown" : @"Default" + } + device:device]; +} + +- (void)testiPhone5Orientation { + + CDV_iOSDevice device = CDV_iOSDeviceZero; + device.iPhone = YES; + device.iPhone5 = YES; + + // One orientation + + PortraitOnly* delegate = [[PortraitOnly alloc] init]; + [self orientationHelper:delegate expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init]; + [self orientationHelper:delegate2 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate3 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init]; + [self orientationHelper:delegate4 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // All Portrait + + AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init]; + [self orientationHelper:delegate5 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // All Landscape + + AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init]; + [self orientationHelper:delegate6 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + + // All orientations + + AllOrientations* delegate7 = [[AllOrientations alloc] init]; + [self orientationHelper:delegate7 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // Portrait and Landscape Left + + PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate8 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // Portrait and Landscape Right + + PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate9 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // PortraitUpsideDown and Landscape Left + + PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate10 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; + + // PortraitUpsideDown and Landscape Right + + PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate11 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-568h", + @"landscapeRight" : @"Default-568h", + @"portrait" : @"Default-568h", + @"portraitUpsideDown" : @"Default-568h" + } + device:device]; +} + +- (void)testiPhone6Orientation { + + CDV_iOSDevice device = CDV_iOSDeviceZero; + device.iPhone = YES; + device.iPhone6 = YES; + + // One orientation + + PortraitOnly* delegate = [[PortraitOnly alloc] init]; + [self orientationHelper:delegate expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init]; + [self orientationHelper:delegate2 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate3 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init]; + [self orientationHelper:delegate4 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // All Portrait + + AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init]; + [self orientationHelper:delegate5 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // All Landscape + + AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init]; + [self orientationHelper:delegate6 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + + // All orientations + + AllOrientations* delegate7 = [[AllOrientations alloc] init]; + [self orientationHelper:delegate7 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // Portrait and Landscape Left + + PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate8 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // Portrait and Landscape Right + + PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate9 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // PortraitUpsideDown and Landscape Left + + PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate10 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; + + // PortraitUpsideDown and Landscape Right + + PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate11 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-667h", + @"landscapeRight" : @"Default-667h", + @"portrait" : @"Default-667h", + @"portraitUpsideDown" : @"Default-667h" + } + device:device]; +} + +- (void)testiPhone6PlusOrientation { + + CDV_iOSDevice device = CDV_iOSDeviceZero; + device.iPhone = YES; + device.iPhone6Plus = YES; + + // One orientation + + PortraitOnly* delegate = [[PortraitOnly alloc] init]; + [self orientationHelper:delegate expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-736h", + @"landscapeRight" : @"Default-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init]; + [self orientationHelper:delegate2 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-736h", + @"landscapeRight" : @"Default-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate3 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-Landscape-736h", + @"portraitUpsideDown" : @"Default-Landscape-736h" + } + device:device]; + + LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init]; + [self orientationHelper:delegate4 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-Landscape-736h", + @"portraitUpsideDown" : @"Default-Landscape-736h" + } + device:device]; + + // All Portrait + + AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init]; + [self orientationHelper:delegate5 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-736h", + @"landscapeRight" : @"Default-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + // All Landscape + + AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init]; + [self orientationHelper:delegate6 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-Landscape-736h", + @"portraitUpsideDown" : @"Default-Landscape-736h" + } + device:device]; + + + // All orientations + + AllOrientations* delegate7 = [[AllOrientations alloc] init]; + [self orientationHelper:delegate7 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + // Portrait and Landscape Left + + PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate8 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + // Portrait and Landscape Right + + PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate9 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + // PortraitUpsideDown and Landscape Left + + PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init]; + [self orientationHelper:delegate10 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; + + // PortraitUpsideDown and Landscape Right + + PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init]; + [self orientationHelper:delegate11 expectedImageNameDictionary:@{ + @"landscapeLeft" : @"Default-Landscape-736h", + @"landscapeRight" : @"Default-Landscape-736h", + @"portrait" : @"Default-736h", + @"portraitUpsideDown" : @"Default-736h" + } + device:device]; +} + + + +@end diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h new file mode 100644 index 0000000..be4a788 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h @@ -0,0 +1,57 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import + +@interface PortraitOnly : NSObject +@end + +@interface PortraitUpsideDownOnly : NSObject +@end + +@interface AllPortraitOnly : NSObject +@end + + +@interface LandscapeLeftOnly : NSObject +@end + +@interface LandscapeRightOnly : NSObject +@end + +@interface AllLandscapeOnly : NSObject +@end + + +@interface AllOrientations : NSObject +@end + +@interface PortraitAndLandscapeLeftOnly : NSObject +@end + +@interface PortraitAndLandscapeRightOnly : NSObject +@end + +@interface PortraitUpsideDownAndLandscapeLeftOnly : NSObject +@end + +@interface PortraitUpsideDownAndLandscapeRightOnly : NSObject +@end + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m new file mode 100644 index 0000000..b5a1b23 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m @@ -0,0 +1,200 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import "ImageNameTestDelegates.h" + +@implementation PortraitOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortrait; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation PortraitUpsideDownOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortraitUpsideDown; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation AllPortraitOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + + +@implementation LandscapeLeftOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskLandscapeLeft; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation LandscapeRightOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskLandscapeRight; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation AllLandscapeOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + + +@implementation AllOrientations + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation PortraitAndLandscapeLeftOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation PortraitAndLandscapeRightOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation PortraitUpsideDownAndLandscapeLeftOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeLeft; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + +@implementation PortraitUpsideDownAndLandscapeRightOnly + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeRight; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ; +} + +- (BOOL)shouldAutorotate { + return YES; +} + +@end + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist new file mode 100644 index 0000000..95c8add --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist @@ -0,0 +1,44 @@ + + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ce820d8 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj @@ -0,0 +1,505 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */; }; + 7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* ImageNameTest.m */; }; + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; }; + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; }; + 7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */; }; + 7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */; }; + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 68A32D7114102E1C006B237C; + remoteInfo = CordovaLib; + }; + 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7E9F519419DA102000DA31AC; + remoteInfo = CDVSplashScreenLib; + }; + 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 7E9F519319DA102000DA31AC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = ""; }; + 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVSplashScreenLib.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVSplashScreenLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = ../../../src/ios/CDVSplashScreen.m; sourceTree = SOURCE_ROOT; }; + 7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = ../../../src/ios/CDVSplashScreen.h; sourceTree = SOURCE_ROOT; }; + 7E9F51B019DA114400DA31AC /* ImageNameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTest.m; sourceTree = ""; }; + 7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageNameTestDelegates.h; sourceTree = ""; }; + 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTestDelegates.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7E9F519219DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519C19DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */, + 7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */, + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */, + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7E9F517119DA09CE00DA31AC = { + isa = PBXGroup; + children = ( + 7E9F51B419DA127E00DA31AC /* UIKit.framework */, + 7E9F51B219DA116500DA31AC /* Foundation.framework */, + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */, + 7E9F519619DA102000DA31AC /* CDVSplashScreenLib */, + 7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */, + 7E9F517D19DA0A0A00DA31AC /* Products */, + ); + sourceTree = ""; + }; + 7E9F517D19DA0A0A00DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */, + 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 7E9F518C19DA0F8300DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519019DA0F8300DA31AC /* libCordova.a */, + ); + name = Products; + sourceTree = ""; + }; + 7E9F519619DA102000DA31AC /* CDVSplashScreenLib */ = { + isa = PBXGroup; + children = ( + 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */, + 7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */, + ); + path = CDVSplashScreenLib; + sourceTree = SOURCE_ROOT; + }; + 7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */ = { + isa = PBXGroup; + children = ( + 7E9F51A119DA102000DA31AC /* Supporting Files */, + 7E9F51B019DA114400DA31AC /* ImageNameTest.m */, + 7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */, + 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */, + ); + path = CDVSplashScreenLibTests; + sourceTree = ""; + }; + 7E9F51A119DA102000DA31AC /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7E9F51A219DA102000DA31AC /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */; + buildPhases = ( + 7E9F519119DA102000DA31AC /* Sources */, + 7E9F519219DA102000DA31AC /* Frameworks */, + 7E9F519319DA102000DA31AC /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CDVSplashScreenLib; + productName = CDVSplashScreenLib; + productReference = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */; + productType = "com.apple.product-type.library.static"; + }; + 7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */; + buildPhases = ( + 7E9F519B19DA102000DA31AC /* Sources */, + 7E9F519C19DA102000DA31AC /* Frameworks */, + 7E9F519D19DA102000DA31AC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */, + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */, + ); + name = CDVSplashScreenLibTests; + productName = CDVSplashScreenLibTests; + productReference = 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7E9F517219DA09CE00DA31AC /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + TargetAttributes = { + 7E9F519419DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + 7E9F519E19DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7E9F517119DA09CE00DA31AC; + productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */; + ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */, + 7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 7E9F519019DA0F8300DA31AC /* libCordova.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCordova.a; + remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 7E9F519D19DA102000DA31AC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7E9F519119DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519B19DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */, + 7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */; + targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */; + }; + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CordovaLib; + targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 7E9F517619DA09CE00DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + 7E9F517719DA09CE00DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + 7E9F51A419DA102000DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\"$(OBJROOT)/UninstalledProducts/include\"", + "\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 7E9F51A519DA102000DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7E9F51A719DA102000DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 7E9F51A819DA102000DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F517619DA09CE00DA31AC /* Debug */, + 7E9F517719DA09CE00DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A419DA102000DA31AC /* Debug */, + 7E9F51A519DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A719DA102000DA31AC /* Debug */, + 7E9F51A819DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7E9F517219DA09CE00DA31AC /* Project object */; +} diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..8f91278 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout new file mode 100644 index 0000000..7e4cdb9 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 6BE9AD73-1B9F-4362-98D7-DC631BEC6185 + IDESourceControlProjectName + CDVSplashScreenTest + IDESourceControlProjectOriginsDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git + + IDESourceControlProjectPath + tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + ../../../../.. + + IDESourceControlProjectURL + https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlWCCName + cordova-plugin-splashscreen + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme new file mode 100644 index 0000000..b97b863 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme new file mode 100644 index 0000000..6a2a526 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/README.md new file mode 100644 index 0000000..97ee9df --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/README.md @@ -0,0 +1,40 @@ + + +# iOS Tests for CDVSplashScreen + +You need to install `node.js` to pull in `cordova-ios`. + +First install cordova-ios: + + npm install + +... in the current folder. + + +# Testing from Xcode + +1. Launch the `CDVSplashScreenTest.xcworkspace` file. +2. Choose "CDVSplashScreenLibTests" from the scheme drop-down menu +3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests + + +# Testing from the command line + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md new file mode 100644 index 0000000..9c7f0a4 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md @@ -0,0 +1,39 @@ + + +# iOS-Tests fĂĽr CDVSplashScreen + +Sie mĂĽssen installieren `node.js` in `Cordova-Ios` zu ziehen. + +Installieren Sie Cordova-Ios zum ersten Mal: + + npm install + + +... im aktuellen Ordner. + +# Testen von Xcode + + 1. Starten Sie die Datei `CDVSplashScreenTest.xcworkspace` . + 2. Wählen Sie im Dropdown-Schema "CDVSplashScreenLibTests" + 3. Klicken Sie und halten Sie auf den `Play` -Button und wählen Sie das `SchraubenschlĂĽssel` -Symbol zum AusfĂĽhren der tests + +# Tests von der Befehlszeile aus + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md new file mode 100644 index 0000000..2176c92 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md @@ -0,0 +1,39 @@ + + +# Pruebas de iOS para CDVSplashScreen + +Necesita instalar `node.js` en `CĂłrdoba-ios`. + +Primero instalar cordova-ios: + + npm install + + +... en la carpeta actual. + +# Prueba de Xcode + + 1. Iniciar el archivo `CDVSplashScreenTest.xcworkspace` . + 2. Elija "CDVSplashScreenLibTests" en el menĂş de lista desplegable esquema + 3. Haga clic y mantenga el botĂłn de `Play` y elegir el icono de `llave inglesa` para ejecutar las pruebas + +# Pruebas desde la lĂ­nea de comandos + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md new file mode 100644 index 0000000..0dbbd0d --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md @@ -0,0 +1,39 @@ + + +# Tests d'iOS pour CDVSplashScreen + +Vous devez installer `node.js` Ă  `cordova-ios`. + +Commencez par installer cordova-ios : + + npm install + + +... dans le dossier actuel. + +# Tests de Xcode + + 1. Lancez le fichier `CDVSplashScreenTest.xcworkspace` . + 2. Choisissez « CDVSplashScreenLibTests » dans le menu dĂ©roulant de rĂ©gime + 3. Cliquez et maintenez sur la touche `Play` et cliquez sur l'icĂ´ne de `clĂ©` pour exĂ©cuter les tests + +# Test de la ligne de commande + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md new file mode 100644 index 0000000..2a42df6 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md @@ -0,0 +1,39 @@ + + +# Test di iOS per CDVSplashScreen + +Ă necessario installare `node. js` per tirare in `cordova-ios`. + +In primo luogo installare cordova-ios: + + npm install + + +... nella cartella corrente. + +# Test da Xcode + + 1. Lanciare il file `CDVSplashScreenTest.xcworkspace` . + 2. Scegli "CDVSplashScreenLibTests" dal menu a discesa Schema + 3. Fare clic e tenere premuto il pulsante `Play` e scegliere l'icona della `chiave inglese` per eseguire i test + +# Test dalla riga di comando + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md new file mode 100644 index 0000000..011b824 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md @@ -0,0 +1,39 @@ + + +# CDVSplashScreen ă® iOS ă®ă†ă‚ąă + +`Node.js` `ă‚łă«ă‰ă`ios ă‚’ă—ă«ă™ă‚‹ă‚’イăłă‚ąăăĽă«ă™ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚. + +ă‚łă«ă‰ă ios をイăłă‚ąăăĽă«ă—ăľă™ă€‚ + + npm install + + +現在ă®ă•ă‚©ă«ă€ăĽă«. + +# Xcode ă‹ă‚‰ă†ă‚ąă + + 1. `CDVSplashScreenTest.xcworkspace`ă•ă‚ˇă‚¤ă«ă‚’čµ·ĺ‹•ă—ăľă™ă€‚ + 2. ă‚ąă‚­ăĽă ] ă‰ă­ăă—ă€ă‚¦ăł ăˇă‹ăĄăĽă‹ă‚‰"CDVSplashScreenLibTests"ă‚’é¸ćŠžă—ăľă™ă€‚ + 3. ă‚ŻăŞăă‚Żă—ă€`再生`ăśă‚żăłă‚’押ă—ă€ă†ă‚ąăを実行ă™ă‚‹`ă¬ăłă`ă®ă‚˘ă‚¤ă‚łăłă‚’é¸ćŠž + +# ă‚łăžăłă‰ă©ă‚¤ăłă‹ă‚‰ă†ă‚ąă + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md new file mode 100644 index 0000000..6981207 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md @@ -0,0 +1,39 @@ + + +# CDVSplashScreeně— ëŚ€ í•ś iOS 테스트 + +`Node.js` `코르도바` iosě—서를 ě„¤ěą í•´ě•Ľ. + +코르도바-ios를 ě„¤ěą í•ëŠ” 첫ë˛ě§¸ëŠ”: + + npm install + + +í„재 폴더ě—.... + +# Xcodeě—ě„ś 테스트 + + 1. `CDVSplashScreenTest.xcworkspace` 파일을 ě‹śěž‘ í•©ë‹ë‹¤. + 2. 구성표 드롭 다운 메뉴ě—ě„ś "CDVSplashScreenLibTests"를 ě„ íť + 3. í´ë¦­ í• ęł  `재ěť` 버튼ě—는 테스트를 실행 í•ë ¤ë©´ `공구 모양` ě•„ěť´ě˝ěť„ ě„ íť + +# 명령줄ě—ě„ś 테스트 + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md new file mode 100644 index 0000000..f13828f --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md @@ -0,0 +1,39 @@ + + +# iOS testy dla CDVSplashScreen + +Musisz zainstalować `node.js` ciÄ…gnąć w `cordova-ios`. + +Najpierw zainstalować cordova-ios: + + npm install + + +... w folderze bieĹĽÄ…cym. + +# Badania z Xcode + + 1. Uruchom plik `CDVSplashScreenTest.xcworkspace` . + 2. Wybierz z menu rozwijanego systemu "CDVSplashScreenLibTests" + 3. Kliknij i przytrzymaj przycisk `Play` i wybrać ikonÄ™ `klucz` do testĂłw + +# Badania z wiersza polecenia + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md new file mode 100644 index 0000000..3a04bcd --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md @@ -0,0 +1,39 @@ + + +# CDVSplashScreen çš„ iOS 測試 + +您需č¦ĺ®‰čŁť`node.js`拉`科çľĺ¤šç“¦ ios`中. + +第一次安裝科çľĺ¤šç“¦ ios: + + npm install + + +在當前資料夾中。 + +# ĺľž Xcode 測試 + + 1. ĺ•źĺ‹•`CDVSplashScreenTest.xcworkspace`檔。 + 2. ĺľžć–ąćˇä¸‹ć‹‰ĺĽŹĺŠźč˝čˇ¨ä¸­é¸ć“‡"CDVSplashScreenLibTests" + 3. 按一下並堅ćŚ`播放`按é•ďĽŚç„¶ĺľŚé¸ć“‡č¦é‹čˇŚçš„測試的`扳手`圖示 + +# 從命令ĺ—測試 + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/package.json b/plugins/cordova-plugin-splashscreen/tests/ios/package.json new file mode 100644 index 0000000..67f0edc --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/package.json @@ -0,0 +1,13 @@ +{ + "name": "cordova-plugin-splashscreen-test-ios", + "version": "1.0.0", + "description": "iOS Unit Tests for Splashscreen Plugin", + "author": "Apache Software Foundation", + "license": "Apache Version 2.0", + "dependencies": { + "cordova-ios": "*" + }, + "scripts": { + "test": "xcodebuild test -workspace CDVSplashScreenTest.xcworkspace -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp' HEADER_SEARCH_PATHS='$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include'" + } +} diff --git a/plugins/cordova-plugin-splashscreen/tests/plugin.xml b/plugins/cordova-plugin-splashscreen/tests/plugin.xml new file mode 100644 index 0000000..fd900f2 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/plugin.xml @@ -0,0 +1,29 @@ + + + + + Cordova Splashscreen Plugin Tests + Apache 2.0 + + + + diff --git a/plugins/cordova-plugin-splashscreen/tests/tests.js b/plugins/cordova-plugin-splashscreen/tests/tests.js new file mode 100644 index 0000000..7b55a81 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/tests.js @@ -0,0 +1,64 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function () { + describe('Splashscreen (cordova)', function () { + it("splashscreen.spec.1 should exist", function () { + expect(navigator.splashscreen).toBeDefined(); + }); + + it("splashscreen.spec.2 show method should exist", function () { + expect(navigator.splashscreen.show).toBeDefined(); + expect(typeof navigator.splashscreen.show).toBe('function'); + }); + + it("splashscreen.spec.3 hide method should exist", function () { + expect(navigator.splashscreen.hide).toBeDefined(); + expect(typeof navigator.splashscreen.hide).toBe('function'); + }); + }); +}; + +exports.defineManualTests = function (contentEl, createActionButton) { + function showFor(duration) { + navigator.splashscreen.show(); + window.setTimeout(function () { + navigator.splashscreen.hide(); + }, 1000 * duration); + } + + contentEl.innerHTML = '

Splashscreen Tests

' + + '

Note for WP: AutoHideSplashScreen must be set to false in config.xml

' + + '
' + + 'Expected result: Will show the Cordova splashscreen for 1 second' + + '

' + + 'Expected result: Will show the Cordova splashscreen for 5 seconds'; + + createActionButton('Show for 1 second', function () { + showFor(1); + }, 'show1'); + + createActionButton('Show for 5 seconds', function () { + showFor(5); + }, 'show5'); +}; diff --git a/plugins/cordova-plugin-splashscreen/www/splashscreen.js b/plugins/cordova-plugin-splashscreen/www/splashscreen.js new file mode 100644 index 0000000..7cb48bd --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/www/splashscreen.js @@ -0,0 +1,33 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var exec = require('cordova/exec'); + +var splashscreen = { + show:function() { + exec(null, null, "SplashScreen", "show", []); + }, + hide:function() { + exec(null, null, "SplashScreen", "hide", []); + } +}; + +module.exports = splashscreen; diff --git a/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js new file mode 100644 index 0000000..1003f06 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js @@ -0,0 +1,37 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/*jslint sloppy:true */ + +var splash = require('cordova/splashscreen'); + +var SplashScreen = { + show: function () { + splash.show(); + }, + hide: function () { + splash.hide(); + } +}; + +module.exports = SplashScreen; + +require("cordova/exec/proxy").add("SplashScreen", SplashScreen); diff --git a/plugins/cordova-plugin-statusbar/CONTRIBUTING.md b/plugins/cordova-plugin-statusbar/CONTRIBUTING.md new file mode 100644 index 0000000..4c8e6a5 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/CONTRIBUTING.md @@ -0,0 +1,37 @@ + + +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/contribute/). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/plugins/cordova-plugin-statusbar/LICENSE b/plugins/cordova-plugin-statusbar/LICENSE new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/plugins/cordova-plugin-statusbar/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/NOTICE b/plugins/cordova-plugin-statusbar/NOTICE new file mode 100644 index 0000000..8ec56a5 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/NOTICE @@ -0,0 +1,5 @@ +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/cordova-plugin-statusbar/README.md b/plugins/cordova-plugin-statusbar/README.md new file mode 100644 index 0000000..22c84d2 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/README.md @@ -0,0 +1,333 @@ +--- +title: Statusbar +description: Control the device status bar. +--- + + +|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI | +|:-:|:-:|:-:|:-:|:-:|:-:| +|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-statusbar)| + +# cordova-plugin-statusbar + +StatusBar +====== + +> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar. + +:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Statusbar%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC) + + +## Installation + +This installation method requires cordova 5.0+ + + cordova plugin add cordova-plugin-statusbar +Older versions of cordova can still install via the __deprecated__ id + + cordova plugin add org.apache.cordova.statusbar +It is also possible to install via repo url directly ( unstable ) + + cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git + + +Preferences +----------- + +#### config.xml + +- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup. + + + +- __StatusBarBackgroundColor__ (color hex string, no default value). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent. + + + +- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque. + + + +### Android Quirks +The Android 5+ guidelines specify using a different color for the statusbar than your main app color (unlike the uniform statusbar color of many iOS 7+ apps), so you may want to set the statusbar color at runtime instead via `StatusBar.backgroundColorByHexString` or `StatusBar.backgroundColorByName`. One way to do that would be: +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +Hiding at startup +----------- + +During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file. + +Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are: + + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +Methods +------- +This plugin defines global `StatusBar` object. + +Although in the global scope, it is not available until after the `deviceready` event. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + +- StatusBar.overlaysWebView +- StatusBar.styleDefault +- StatusBar.styleLightContent +- StatusBar.styleBlackTranslucent +- StatusBar.styleBlackOpaque +- StatusBar.backgroundColorByName +- StatusBar.backgroundColorByHexString +- StatusBar.hide +- StatusBar.show + +Properties +-------- + +- StatusBar.isVisible + +Events +------ + +- statusTap + +Permissions +----------- + +#### config.xml + + + + + +StatusBar.overlaysWebView +================= + +On iOS 7, make the statusbar overlay or not overlay the WebView. + + StatusBar.overlaysWebView(true); + +Description +----------- + +On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions. + + +Supported Platforms +------------------- + +- iOS + +Quick Example +------------- + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + +StatusBar.styleDefault +================= + +Use the default statusbar (dark text, for light backgrounds). + + StatusBar.styleDefault(); + + +Supported Platforms +------------------- + +- iOS +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.styleLightContent +================= + +Use the lightContent statusbar (light text, for dark backgrounds). + + StatusBar.styleLightContent(); + + +Supported Platforms +------------------- + +- iOS +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.styleBlackTranslucent +================= + +Use the blackTranslucent statusbar (light text, for dark backgrounds). + + StatusBar.styleBlackTranslucent(); + + +Supported Platforms +------------------- + +- iOS +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.styleBlackOpaque +================= + +Use the blackOpaque statusbar (light text, for dark backgrounds). + + StatusBar.styleBlackOpaque(); + + +Supported Platforms +------------------- + +- iOS +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + + +StatusBar.backgroundColorByName +================= + +On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name. + + StatusBar.backgroundColorByName("red"); + +Supported color names are: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +Supported Platforms +------------------- + +- iOS +- Android 5+ +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.backgroundColorByHexString +================= + +Sets the background color of the statusbar by a hex string. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + +CSS shorthand properties are also supported. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + +On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB). + +On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value + +Supported Platforms +------------------- + +- iOS +- Android 5+ +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.hide +================= + +Hide the statusbar. + + StatusBar.hide(); + + +Supported Platforms +------------------- + +- iOS +- Android +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + +StatusBar.show +================= + +Shows the statusbar. + + StatusBar.show(); + + +Supported Platforms +------------------- + +- iOS +- Android +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + + +StatusBar.isVisible +================= + +Read this property to see if the statusbar is visible or not. + + if (StatusBar.isVisible) { + // do something + } + + +Supported Platforms +------------------- + +- iOS +- Android +- Windows Phone 7 +- Windows Phone 8 +- Windows Phone 8.1 + + +statusTap +========= + +Listen for this event to know if the statusbar was tapped. + + window.addEventListener('statusTap', function() { + // scroll-up with document.body.scrollTop = 0; or do whatever you want + }); + + +Supported Platforms +------------------- + +- iOS diff --git a/plugins/cordova-plugin-statusbar/RELEASENOTES.md b/plugins/cordova-plugin-statusbar/RELEASENOTES.md new file mode 100644 index 0000000..9568a1b --- /dev/null +++ b/plugins/cordova-plugin-statusbar/RELEASENOTES.md @@ -0,0 +1,140 @@ + +# Release Notes + +### 2.2.1 (Dec 07, 2016) +* [CB-10288](https://issues.apache.org/jira/browse/CB-10288) statusbar plugin interaction with iOS multitasking +* [CB-10158](https://issues.apache.org/jira/browse/CB-10158) (ios) fix StatusBar issue when recovering from fullscreen video +* [CB-10341](https://issues.apache.org/jira/browse/CB-10341) ios, document statusTap event +* [CB-11191](https://issues.apache.org/jira/browse/CB-11191) Statusbar plugin causing issues with webview size +* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…" +* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version. + +### 2.2.0 (Sep 08, 2016) +* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies +* Handle extended status bar on **iOS** +* Plugin uses `Android Log class` and not `Cordova LOG class` +* [CB-11287](https://issues.apache.org/jira/browse/CB-11287) (**ios**) - fix webview resize after modal on **iPhones** +* [CB-11485](https://issues.apache.org/jira/browse/CB-11485) fix resize on rotation with popover +* Add badges for paramedic builds on Jenkins +* [CB-11197](https://issues.apache.org/jira/browse/CB-11197) Keep status bar hidden when keyboard pops up +* Add pull request template. +* [CB-10866](https://issues.apache.org/jira/browse/CB-10866) Adding engine info to `package.json` +* patched missing `_ready` method, and changed the way the proxy is installed +* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md` + +### 2.1.3 (Apr 15, 2016) +* [CB-11018](https://issues.apache.org/jira/browse/CB-11018) Fix statusbar with `inappbrowser` causing incorrect orientation on **iOS8** +* [CB-10884](https://issues.apache.org/jira/browse/CB-10884) `Inappbrowser` breaks UI while Screen orientation changes from landscape to portrait on **iOS** + +### 2.1.2 (Mar 09, 2016) +* [CB-10752](https://issues.apache.org/jira/browse/CB-10752) for for status bar overlays the webview on **iOS** 6 in some cases +* [CB-10683](https://issues.apache.org/jira/browse/CB-10683) Fix wrong StatusBar.isVisible initial value on **Windows** +* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins +* [CB-10047](https://issues.apache.org/jira/browse/CB-10047) fix **iOS** 8 deprecated warnings + +### 2.1.1 (Feb 09, 2016) +* [CB-10102](https://issues.apache.org/jira/browse/CB-10102) The removeObserver code was wrong and it might crash on plugin deallocation + +### 2.1.0 (Jan 15, 2016) +* [CB-9513](https://issues.apache.org/jira/browse/CB-9513) Allow to show/hide status bar in fullscreen mode. +* [CB-8720](https://issues.apache.org/jira/browse/CB-8720) Fix status bar position when app started upside down on **iOS 7**. +* [CB-10118](https://issues.apache.org/jira/browse/CB-10118) Fixes plugin loading error for **Browser** platform + +### 2.0.0 (Nov 18, 2015) +* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest +* Added `weakSelf` reference for block use +* Fixes [CB-4712](https://issues.apache.org/jira/browse/CB-4712), [CB-5439](https://issues.apache.org/jira/browse/CB-5439) statusbar issues +* Fixing contribute link. +* [CB-7965](https://issues.apache.org/jira/browse/CB-7965) Add cordova-plugin-statusbar support for **Browser** platform +* Don't use `IsAtLeastiOSVersion` macro to determine height +* Use correct statusbar height for landscape orientation in iOS >= 8 +* remove travis-ci +* [CB-9202](https://issues.apache.org/jira/browse/CB-9202) updated repo url to github mirror in package.json +* Added verbose install text for users on < cordova 5.0 +* update docs for `StatusBarBackgroundColor` + +### 1.0.1 (Jun 17, 2015) +* add auto-tests for basic api +* [CB-9180](https://issues.apache.org/jira/browse/CB-9180) Add correct supported check for Windows 8.1 desktop +* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar +* fix npm md issue + +### 1.0.0 (Apr 15, 2015) +* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump +* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id +* Use TRAVIS_BUILD_DIR, install paramedic by npm +* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme +* - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme. +* - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up +* Allow setting the statusbar backgroundcolor on Android +* [CB-8575](https://issues.apache.org/jira/browse/CB-8575) Integrate TravisCI +* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar +* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file + +### 0.1.10 (Feb 04, 2015) +* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension + +### 0.1.9 (Dec 02, 2014) +* Fix onload attribute within to be a +* [CB-8010](https://issues.apache.org/jira/browse/CB-8010) - Statusbar colour does not change to orange +* added checks for running on windows when StatusBar is NOT available +* [CB-7986](https://issues.apache.org/jira/browse/CB-7986) Add cordova-plugin-statusbar support for **Windows Phone 8.1** +* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs +* [CB-7979](https://issues.apache.org/jira/browse/CB-7979) Each plugin doc should have a ## Installation section +* Inserting leading space after # for consistency +* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) - (Re-fix) `StatusBar` **iOS 8** Landscape issue (closes #15) +* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar +* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin + +### 0.1.8 (Sep 17, 2014) +* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) [StatusBar][iOS 8] Landscape issue +* [CB-7486](https://issues.apache.org/jira/browse/CB-7486) Remove StatusBarBackgroundColor intial preference (black background) so background will be initially transparent +* Renamed test dir, added nested plugin.xml +* added documentation for manual tests, moved background color test below overlay test +* [CB-7195](https://issues.apache.org/jira/browse/CB-7195) ported statusbar tests to framework + +### 0.1.7 (Aug 06, 2014) +* Add LICENSE and NOTICE +* Update statusbar.js +* Update backgroundColorByHexString function +* ios: Use a persistent callbackId instead of calling sendJs +* [CB-6626](https://issues.apache.org/jira/browse/CB-6626) ios: Add a JS event for tapping on statusbar +* ios: Fix hide to adjust webview's frame only when status bar is not overlaying webview +* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs +* android: Fix StatusBar.initialize() not running on UI thread + +### 0.1.6 (Jun 05, 2014) +* [CB-6783](https://issues.apache.org/jira/browse/CB-6783) - added StatusBarStyle config preference, updated docs (closes #9) +* [CB-6812](https://issues.apache.org/jira/browse/CB-6812) Add license +* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md +* [CB-6264](https://issues.apache.org/jira/browse/CB-6264) minor formatting issue +* Update docs with recent WP changes, remove 'clear' from the loist of named colors in documentation +* [CB-6513](https://issues.apache.org/jira/browse/CB-6513) - Statusbar plugin for Android is not compiling + +### 0.1.5 (Apr 17, 2014) (First release as a core Cordova Plugin) +* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added README.md which point to the new location for docs +* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added license header to the documentation. Added README.md which point to the new location for docs +* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Moved StatusBar plugin documentation to docs folder +* [CB-6314](https://issues.apache.org/jira/browse/CB-6314): [android] Add StatusBar.isVisible support to Android +* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers diff --git a/plugins/cordova-plugin-statusbar/doc/de/README.md b/plugins/cordova-plugin-statusbar/doc/de/README.md new file mode 100644 index 0000000..9247598 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/de/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar. + +## Installation + + cordova plugin add cordova-plugin-statusbar + + +## "Einstellungen" + +#### "config.xml" + + * **StatusBarOverlaysWebView** (Boolean, der Standardwert ist True). Stellen Sie auf iOS 7 die Statusbar-Overlay oder keine Ăśberlagerung der WebView beim Start. + + + + + * **StatusBarBackgroundColor** (Farbe hex String, Standardwert ist #000000). Auf iOS legen 7 und Android 5, Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) beim Start. + + + + + * **StatusBarStyle** (Status Bar-Stil, der Standardwert ist Lightcontent). Legen Sie auf iOS 7 den Status-Bar-Stil. VerfĂĽgbaren Optionen Standard, Lightcontent, Blacktranslucent, Blackopaque. + + + + +### Android Eigenarten + +Die Android 5 + Leitlinien angeben, verwenden eine andere Farbe fĂĽr die Statusbar als Ihre Hauptanwendung Farbe (anders als die einheitliche Statusbar Farbe viele iOS 7 + apps), so Sie die Statusbar Farbe zur Laufzeit statt ĂĽber `StatusBar.backgroundColorByHexString` oder `StatusBar.backgroundColorByName`festzulegen möchten vielleicht. Eine Möglichkeit dazu wäre: + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## Beim Start ausblenden + +Während der Laufzeit können Sie die StatusBar.hide-Funktion unten, aber die StatusBar beim Start der app versteckt werden soll, mĂĽssen Sie Ihre app Info.plist Datei ändern. + +Diese beiden Attribute hinzufĂĽgen/bearbeiten, wenn nicht vorhanden. Legen Sie **"Statusleiste ist anfangs ausgeblendet"** auf **"YES"** und **"View Controller-basierte Status Bar aussehen"** auf **"NO"**. Wenn Sie es manuell ohne Xcode bearbeiten, werden die SchlĂĽssel und Werte: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Methoden + +Dieses Plugin wird globales `StatusBar`-Objekt definiert. + +Obwohl im globalen GĂĽltigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## Eigenschaften + + * StatusBar.isVisible + +## Berechtigungen + +#### "config.xml" + + + + + + +# StatusBar.overlaysWebView + +Stellen Sie auf iOS 7 Statusbar ĂĽberlagern oder nicht ĂĽberlagert die WebView. + + StatusBar.overlaysWebView(true); + + +## Beschreibung + +Auf iOS 7 zu der Statusbar wie iOS 6 erscheinen auf False festgelegt. Legen Sie die Stil und Hintergrund Farbe entsprechend mit den anderen Funktionen. + +## UnterstĂĽtzte Plattformen + + * iOS + +## Kurzes Beispiel + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Verwenden Sie die Standard-Statusbar (dunkle Text, fĂĽr helle HintergrĂĽnde). + + StatusBar.styleDefault(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.styleLightContent + +Verwenden Sie die LightContent-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleLightContent(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.styleBlackTranslucent + +Verwenden Sie die BlackTranslucent-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleBlackTranslucent(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.styleBlackOpaque + +Verwenden Sie die BlackOpaque-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleBlackOpaque(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.backgroundColorByName + +Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von Farbnamen festlegen. + + StatusBar.backgroundColorByName("red"); + + +UnterstĂĽtzte Farbnamen sind: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## UnterstĂĽtzte Plattformen + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.backgroundColorByHexString + +Legt die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge fest. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +CSS-Kurzschrift-Eigenschaften werden ebenfalls unterstĂĽtzt. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) festlegen. + +Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-Wert ist + +## UnterstĂĽtzte Plattformen + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.hide + +Ausblenden der Statusleiste. + + StatusBar.hide(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.show + +Zeigt die Statusleiste. + + StatusBar.show(); + + +## UnterstĂĽtzte Plattformen + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 + +# StatusBar.isVisible + +Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder nicht ist. + + if (StatusBar.isVisible) { + // do something + } + + +## UnterstĂĽtzte Plattformen + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone-8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/de/index.md b/plugins/cordova-plugin-statusbar/doc/de/index.md new file mode 100644 index 0000000..9f913c5 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/de/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar. + +## Installation + + cordova plugin add cordova-plugin-statusbar + + +## "Einstellungen" + +#### config.xml + +* **StatusBarOverlaysWebView** (Boolean, der Standardwert ist True). Stellen Sie auf iOS 7 die Statusbar-Overlay oder keine Ăśberlagerung der WebView beim Start. + + + + +* **StatusBarBackgroundColor** (Farbe hex String, der Standardwert ist #000000). Legen Sie auf iOS 7 die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) beim Start. + + + + +* **StatusBarStyle** (Status Bar-Stil, der Standardwert ist Lightcontent). Legen Sie auf iOS 7 den Status-Bar-Stil. VerfĂĽgbaren Optionen Standard, Lightcontent, Blacktranslucent, Blackopaque. + + + + +## Beim Start ausblenden + +Während der Laufzeit können Sie die StatusBar.hide-Funktion unten, aber die StatusBar beim Start der app versteckt werden soll, mĂĽssen Sie Ihre app Info.plist Datei ändern. + +Diese beiden Attribute hinzufĂĽgen/bearbeiten, wenn nicht vorhanden. Legen Sie **"Statusleiste ist anfangs ausgeblendet"** auf **"YES"** und **"View Controller-basierte Status Bar aussehen"** auf **"NO"**. Wenn Sie es manuell ohne Xcode bearbeiten, werden die SchlĂĽssel und Werte: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Methoden + +Dieses Plugin wird globales `StatusBar`-Objekt definiert. + +Obwohl im globalen GĂĽltigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## Eigenschaften + +* StatusBar.isVisible + +## Berechtigungen + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +Stellen Sie auf iOS 7 Statusbar ĂĽberlagern oder nicht ĂĽberlagert die WebView. + + StatusBar.overlaysWebView(true); + + +## Beschreibung + +Auf iOS 7 zu der Statusbar wie iOS 6 erscheinen auf False festgelegt. Legen Sie die Stil und Hintergrund Farbe entsprechend mit den anderen Funktionen. + +## UnterstĂĽtzte Plattformen + +* iOS + +## Kurzes Beispiel + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Verwenden Sie die Standard-Statusbar (dunkle Text, fĂĽr helle HintergrĂĽnde). + + StatusBar.styleDefault(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.styleLightContent + +Verwenden Sie die LightContent-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleLightContent(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.styleBlackTranslucent + +Verwenden Sie die BlackTranslucent-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleBlackTranslucent(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.styleBlackOpaque + +Verwenden Sie die BlackOpaque-Statusbar (heller Text, fĂĽr dunkle HintergrĂĽnde). + + StatusBar.styleBlackOpaque(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.backgroundColorByName + +Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von Farbnamen festlegen. + + StatusBar.backgroundColorByName("red"); + + +UnterstĂĽtzte Farbnamen sind: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.backgroundColorByHexString + +Legt die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge fest. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +CSS-Kurzschrift-Eigenschaften werden ebenfalls unterstĂĽtzt. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) festlegen. + +Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-Wert ist + +## UnterstĂĽtzte Plattformen + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.hide + +Ausblenden der Statusleiste. + + StatusBar.hide(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.show + +Zeigt die Statusleiste. + + StatusBar.show(); + + +## UnterstĂĽtzte Plattformen + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 + +# StatusBar.isVisible + +Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder nicht ist. + + if (StatusBar.isVisible) { + // do something + } + + +## UnterstĂĽtzte Plattformen + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone-8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/es/README.md b/plugins/cordova-plugin-statusbar/doc/es/README.md new file mode 100644 index 0000000..8be769d --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/es/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar. + +## InstalaciĂłn + + cordova plugin add cordova-plugin-statusbar + + +## Preferencias + +#### config.xml + + * **StatusBarOverlaysWebView** (boolean, true por defecto). En iOS 7, hacer la superposiciĂłn statusbar o no superponer la WebView al inicio. + + + + + * **StatusBarBackgroundColor** (color hex string por defecto #000000). IOS 7 y 5 Android, configurar el color de fondo de la barra de estado por una cadena hexadecimal (#RRGGBB) en el arranque. + + + + + * **StatusBarStyle** (status bar estilo por defecto lightcontent). En iOS 7, definir el estilo de barra de estado. Por defecto las opciones disponibles, lightcontent, blacktranslucent, blackopaque. + + + + +### Rarezas Android + +Android 5 + pautas especifican utilizando un color diferente para la barra de estado que la aplicaciĂłn principal de color (a diferencia del color de barra de estado uniforme de muchas apps de iOS 7 +), por lo que puede establecer el color de la barra de estado en tiempo de ejecuciĂłn en su lugar a travĂ©s de `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Una forma de hacerlo serĂ­a: + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## Escondido en el arranque + +Durante el tiempo de ejecuciĂłn puede utilizar la funciĂłn StatusBar.hide abajo, pero si quieres la barra de estado que está escondido en el inicio de la aplicaciĂłn, se debe modificar el archivo Info.plist de su aplicaciĂłn. + +Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"ApariciĂłn de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## MĂ©todos + +Este plugin define global `StatusBar` objeto. + +Aunque en el ámbito global, no estará disponible hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## Propiedades + + * StatusBar.isVisible + +## Permisos + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +En iOS 7, hacer la barra de estado superposiciĂłn o no superponer la vista Web. + + StatusBar.overlaysWebView(true); + + +## DescripciĂłn + +En iOS 7, establecida en false para que la barra de estado aparezca como iOS 6. Establece el color de fondo y estilo para utilizar las otras funciones. + +## Plataformas soportadas + + * iOS + +## Ejemplo rápido + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilice la barra de estado por defecto (texto oscuro, para fondos de luz). + + StatusBar.styleDefault(); + + +## Plataformas soportadas + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilice la barra de estado lightContent (texto ligero, para fondos oscuros). + + StatusBar.styleLightContent(); + + +## Plataformas soportadas + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros). + + StatusBar.styleBlackTranslucent(); + + +## Plataformas soportadas + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros). + + StatusBar.styleBlackOpaque(); + + +## Plataformas soportadas + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede establecer el color de fondo de la barra de estado nombre del color. + + StatusBar.backgroundColorByName("red"); + + +Nombres de los colores admitidos son: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Plataformas soportadas + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Establece el color de fondo de la barra de estado por una cadena hexadecimal. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +Propiedades CSS abreviada tambiĂ©n son compatibles. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB). + +En WP7 y WP8 tambiĂ©n puede especificar valores como #AARRGGBB, donde AA es un valor alfa + +## Plataformas soportadas + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +Ocultar la barra de estado. + + StatusBar.hide(); + + +## Plataformas soportadas + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +Muestra la barra de estado. + + StatusBar.show(); + + +## Plataformas soportadas + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +Lea esta propiedad para ver si la barra de estado es visible o no. + + if (StatusBar.isVisible) { + // do something + } + + +## Plataformas soportadas + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/es/index.md b/plugins/cordova-plugin-statusbar/doc/es/index.md new file mode 100644 index 0000000..fa4ba67 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/es/index.md @@ -0,0 +1,252 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar. + +## InstalaciĂłn + + Cordova plugin agregar cordova-plugin-statusbar + + +## Preferencias + +#### config.xml + +* **StatusBarOverlaysWebView** (boolean, true por defecto). En iOS 7, hacer la superposiciĂłn statusbar o no superponer la WebView al inicio. + + + + +* **StatusBarBackgroundColor** (cadena hexadecimal color, #000000 por defecto). En iOS 7, establecer el color de fondo de la barra de estado por una cadena hexadecimal (#RRGGBB) en el arranque. + + + + +* **StatusBarStyle** (status bar estilo por defecto lightcontent). En iOS 7, definir el estilo de barra de estado. Por defecto las opciones disponibles, lightcontent, blacktranslucent, blackopaque. + + + + +## Escondido en el arranque + +Durante el tiempo de ejecuciĂłn puede utilizar la funciĂłn StatusBar.hide abajo, pero si quieres la barra de estado que está escondido en el inicio de la aplicaciĂłn, se debe modificar el archivo Info.plist de su aplicaciĂłn. + +Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"ApariciĂłn de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son: + + < llave > UIStatusBarHidden < / key >< verdadero / >< llave > UIViewControllerBasedStatusBarAppearance < / key >< falso / > + + +## MĂ©todos + +Este plugin define global `StatusBar` objeto. + +Aunque en el ámbito global, no estará disponible hasta despuĂ©s de la `deviceready` evento. + + document.addEventListener ("deviceready", onDeviceReady, false); + function onDeviceReady() {console.log(StatusBar)}; + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## Propiedades + +* StatusBar.isVisible + +## Permisos + +#### config.xml + + < nombre de la funciĂłn = "StatusBar" >< nombre param = "ios-paquete" value = "CDVStatusBar" onload = "true" / >< / caracterĂ­stica > + + +# StatusBar.overlaysWebView + +En iOS 7, hacer la barra de estado superposiciĂłn o no superponer la vista Web. + + StatusBar.overlaysWebView(true); + + +## DescripciĂłn + +En iOS 7, establecida en false para que la barra de estado aparezca como iOS 6. Establece el color de fondo y estilo para utilizar las otras funciones. + +## Plataformas soportadas + +* iOS + +## Ejemplo rápido + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilice la barra de estado por defecto (texto oscuro, para fondos de luz). + + StatusBar.styleDefault(); + + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilice la barra de estado lightContent (texto ligero, para fondos oscuros). + + StatusBar.styleLightContent(); + + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros). + + StatusBar.styleBlackTranslucent(); + + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros). + + StatusBar.styleBlackOpaque(); + + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede establecer el color de fondo de la barra de estado nombre del color. + + StatusBar.backgroundColorByName("red"); + + +Nombres de los colores admitidos son: + + negro, gris oscuro, lightGray, blanco, gris, rojo, verde, azul, cian, amarillo, magenta, naranja, pĂşrpura, marrĂłn + + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Establece el color de fondo de la barra de estado por una cadena hexadecimal. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +Propiedades CSS abreviada tambiĂ©n son compatibles. + + StatusBar.backgroundColorByHexString("#333"); = > StatusBar.backgroundColorByHexString("#FAB") #333333; = > #FFAABB + + +En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB). + +En WP7 y WP8 tambiĂ©n puede especificar valores como #AARRGGBB, donde AA es un valor alfa + +## Plataformas soportadas + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +Ocultar la barra de estado. + + StatusBar.hide(); + + +## Plataformas soportadas + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +Muestra la barra de estado. + + StatusBar.show(); + + +## Plataformas soportadas + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +Lea esta propiedad para ver si la barra de estado es visible o no. + + Si (StatusBar.isVisible) {/ / hacer algo} + + +## Plataformas soportadas + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/fr/README.md b/plugins/cordova-plugin-statusbar/doc/fr/README.md new file mode 100644 index 0000000..6f7f9bf --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/fr/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar. + +## Installation + + cordova plugin add cordova-plugin-statusbar + + +## PrĂ©fĂ©rences + +#### config.Xml + + * **StatusBarOverlaysWebView** (boolean, la valeur par dĂ©faut true). Sur iOS 7, faire la superposition de statusbar ou pas superposition le WebView au dĂ©marrage. + + + + + * **StatusBarBackgroundColor** (chaĂ®ne hexadĂ©cimale de couleur, par dĂ©faut, #000000). Sur iOS 7 et 5 Android, dĂ©finir la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale (#RRGGBB) au dĂ©marrage. + + + + + * **StatusBarStyle** (style de barre de statut, par dĂ©faut, lightcontent). Sur iOS 7, dĂ©finir le style de barre de statut. Par dĂ©faut les options disponibles, lightcontent, blacktranslucent, blackopaque. + + + + +### Quirks Android + +Les lignes directrices 5 + Android spĂ©cifient Ă  l'aide d'une couleur diffĂ©rente pour la barre d'État Ă  votre application principale couleur (contrairement Ă  la couleur uniforme statusbar de nombreuses applications iOS 7 +), donc vous pouvez dĂ©finir la couleur de la barre d'Ă©tat lors de l'exĂ©cution au lieu de cela via `StatusBar.backgroundColorByHexString` ou `StatusBar.backgroundColorByName`. Une façon de le faire serait : + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## Cacher au dĂ©marrage + +Pendant l'exĂ©cution, vous pouvez utiliser la fonction StatusBar.hide en bas, mais si vous souhaitez que la barre d'État pour ĂŞtre cachĂ© au dĂ©marrage de l'application, vous devez modifier le fichier Info.plist de votre application. + +Ajouter/modifier ces deux attributs si n'est pas prĂ©sent. **"Barre d'État est initialement masquĂ©"** la valeur **"** Yes" et **"Ă€ l'apparence vue sur contrĂ´leur statut bar"** la valeur **"Non"**. Si vous modifiez manuellement sans Xcode, les clĂ©s et les valeurs sont : + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## MĂ©thodes + +Ce plugin dĂ©finit objet `StatusBar` global. + +Bien que dans la portĂ©e globale, il n'est pas disponible jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## PropriĂ©tĂ©s + + * StatusBar.isVisible + +## Autorisations + +#### config.Xml + + + + + + +# StatusBar.overlaysWebView + +Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView. + + StatusBar.overlaysWebView(true); + + +## Description + +Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. DĂ©finissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions. + +## Plates-formes supportĂ©es + + * iOS + +## Exemple court + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilisez la barre de statut par dĂ©faut (texte sombre, pour les arrière-plans lumineux). + + StatusBar.styleDefault(); + + +## Plates-formes supportĂ©es + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres). + + StatusBar.styleLightContent(); + + +## Plates-formes supportĂ©es + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans sombres). + + StatusBar.styleBlackTranslucent(); + + +## Plates-formes supportĂ©es + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres). + + StatusBar.styleBlackOpaque(); + + +## Plates-formes supportĂ©es + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Sur iOS 7, lorsque vous dĂ©finissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez dĂ©finir la couleur d'arrière-plan de la barre d'État par nom de couleur. + + StatusBar.backgroundColorByName("red"); + + +Les noms de couleurs prises en charge sont : + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Plates-formes supportĂ©es + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +DĂ©finit la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +PropriĂ©tĂ©s de raccourci CSS sont Ă©galement pris en charge. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Sur iOS 7, lorsque vous dĂ©finissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez dĂ©finir la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale (#RRGGBB). + +Sur WP7 et WP8, vous pouvez Ă©galement spĂ©cifier des valeurs comme #AARRGGBB, oĂą AA reprĂ©sente une valeur alpha + +## Plates-formes supportĂ©es + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +Masquer la barre d'État. + + StatusBar.hide(); + + +## Plates-formes supportĂ©es + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +Affiche la barre d'État. + + StatusBar.show(); + + +## Plates-formes supportĂ©es + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +Lire cette propriĂ©tĂ© afin de voir si la barre d'État est visible ou non. + + if (StatusBar.isVisible) { + // do something + } + + +## Plates-formes supportĂ©es + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/fr/index.md b/plugins/cordova-plugin-statusbar/doc/fr/index.md new file mode 100644 index 0000000..816f3df --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/fr/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar. + +## Installation + + cordova plugin add cordova-plugin-statusbar + + +## PrĂ©fĂ©rences + +#### config.xml + +* **StatusBarOverlaysWebView** (boolean, la valeur par dĂ©faut true). Sur iOS 7, faire la superposition de statusbar ou pas superposition le WebView au dĂ©marrage. + + + + +* **StatusBarBackgroundColor** (chaĂ®ne hexadĂ©cimale de couleur, par dĂ©faut, #000000). Sur iOS 7, dĂ©finir la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale (#RRGGBB) au dĂ©marrage. + + + + +* **StatusBarStyle** (style de barre de statut, par dĂ©faut, lightcontent). Sur iOS 7, dĂ©finir le style de barre de statut. Par dĂ©faut les options disponibles, lightcontent, blacktranslucent, blackopaque. + + + + +## Cacher au dĂ©marrage + +Pendant l'exĂ©cution, vous pouvez utiliser la fonction StatusBar.hide en bas, mais si vous souhaitez que la barre d'État pour ĂŞtre cachĂ© au dĂ©marrage de l'application, vous devez modifier le fichier Info.plist de votre application. + +Ajouter/modifier ces deux attributs si n'est pas prĂ©sent. **"Barre d'État est initialement masquĂ©"** la valeur **"** Yes" et **"Ă€ l'apparence vue sur contrĂ´leur statut bar"** la valeur **"Non"**. Si vous modifiez manuellement sans Xcode, les clĂ©s et les valeurs sont : + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## MĂ©thodes + +Ce plugin dĂ©finit objet `StatusBar` global. + +Bien que dans la portĂ©e globale, il n'est pas disponible jusqu'après la `deviceready` Ă©vĂ©nement. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## PropriĂ©tĂ©s + +* StatusBar.isVisible + +## Autorisations + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView. + + StatusBar.overlaysWebView(true); + + +## Description + +Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. DĂ©finissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions. + +## Plates-formes supportĂ©es + +* iOS + +## Exemple court + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilisez la barre de statut par dĂ©faut (texte sombre, pour les arrière-plans lumineux). + + StatusBar.styleDefault(); + + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres). + + StatusBar.styleLightContent(); + + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans sombres). + + StatusBar.styleBlackTranslucent(); + + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres). + + StatusBar.styleBlackOpaque(); + + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Sur iOS 7, lorsque vous dĂ©finissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez dĂ©finir la couleur d'arrière-plan de la barre d'État par nom de couleur. + + StatusBar.backgroundColorByName("red"); + + +Les noms de couleurs prises en charge sont : + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +DĂ©finit la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +PropriĂ©tĂ©s de raccourci CSS sont Ă©galement pris en charge. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Sur iOS 7, lorsque vous dĂ©finissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez dĂ©finir la couleur d'arrière-plan de la barre d'État par une chaĂ®ne hexadĂ©cimale (#RRGGBB). + +Sur WP7 et WP8, vous pouvez Ă©galement spĂ©cifier des valeurs comme #AARRGGBB, oĂą AA reprĂ©sente une valeur alpha + +## Plates-formes prises en charge + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +Masquer la barre d'État. + + StatusBar.hide(); + + +## Plates-formes prises en charge + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +Affiche la barre d'État. + + StatusBar.show(); + + +## Plates-formes prises en charge + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +Lire cette propriĂ©tĂ© afin de voir si la barre d'État est visible ou non. + + if (StatusBar.isVisible) { + // do something + } + + +## Plates-formes supportĂ©es + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/it/README.md b/plugins/cordova-plugin-statusbar/doc/it/README.md new file mode 100644 index 0000000..cf3f844 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/it/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar. + +## Installazione + + cordova plugin add cordova-plugin-statusbar + + +## Preferenze + +#### config. XML + + * **StatusBarOverlaysWebView** (boolean, default è true). IOS 7, rendono la statusbar sovrapposizione o la non sovrapposizione WebView all'avvio. + + + + + * **StatusBarBackgroundColor** (stringa esadecimale di colore, il valore predefinito è #000000). Su iOS 7 e 5 Android, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB) all'avvio. + + + + + * **StatusBarStyle** (status bar in stile, default è lightcontent). IOS 7, impostare lo stile di barra di stato. Predefinita di opzioni disponibili, lightcontent, blacktranslucent, blackopaque. + + + + +### Stranezze Android + +Le linee 5 + Android Guida specificano utilizzando un colore diverso per la barra di stato che l'app principale di colore (a differenza di colore uniforme statusbar di molte applicazioni di iOS 7 +), quindi si consiglia di impostare il colore della barra di stato in fase di esecuzione invece tramite `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Un modo per farlo sarebbe: + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## Nascondendo all'avvio + +In fase di esecuzione è possibile utilizzare la funzione di StatusBar.hide qui sotto, ma se si desidera che la barra di stato venga nascosta all'avvio di app, è necessario modificare il file info. plist dell'app. + +Aggiungere o modificare questi due attributi, se non presente. Impostare la **"barra di stato è inizialmente nascosto"** a **"YES"** e **"Aspetto di vista basati su controller status bar"** a **"NO"**. Se si modifica manualmente senza Xcode, le chiavi e i valori sono: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Metodi + +Questo plugin definisce globale oggetto `StatusBar`. + +Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## ProprietĂ  + + * StatusBar.isVisible + +## Autorizzazioni + +#### config. XML + + + + + + +# StatusBar.overlaysWebView + +IOS 7, rendono la statusbar sovrapposizione o non sovrapporre WebView. + + StatusBar.overlaysWebView(true); + + +## Descrizione + +IOS 7, impostato su false per rendere la barra di stato vengono visualizzati come iOS 6. Impostare il colore di sfondo e stile per soddisfare utilizzando altre funzioni. + +## Piattaforme supportate + + * iOS + +## Esempio rapido + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce). + + StatusBar.styleDefault(); + + +## Piattaforme supportate + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri). + + StatusBar.styleLightContent(); + + +## Piattaforme supportate + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri). + + StatusBar.styleBlackTranslucent(); + + +## Piattaforme supportate + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri). + + StatusBar.styleBlackOpaque(); + + +## Piattaforme supportate + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato con il nome di colore. + + StatusBar.backgroundColorByName("red"); + + +Nomi di colore supportati sono: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Piattaforme supportate + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Imposta il colore di sfondo della barra di stato di una stringa esadecimale. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +ProprietĂ  di scrittura stenografica CSS sono supportati anche. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB). + +Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA è un valore alfa + +## Piattaforme supportate + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +Nascondere la barra di stato. + + StatusBar.hide(); + + +## Piattaforme supportate + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +Mostra la barra di stato. + + StatusBar.show(); + + +## Piattaforme supportate + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +Leggere questa proprietĂ  per vedere se la barra di stato è visibile o no. + + if (StatusBar.isVisible) { + // do something + } + + +## Piattaforme supportate + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/it/index.md b/plugins/cordova-plugin-statusbar/doc/it/index.md new file mode 100644 index 0000000..73ddcd4 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/it/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar. + +## Installazione + + cordova plugin add cordova-plugin-statusbar + + +## Preferenze + +#### config.xml + +* **StatusBarOverlaysWebView** (boolean, default è true). IOS 7, rendono la statusbar sovrapposizione o la non sovrapposizione WebView all'avvio. + + + + +* **StatusBarBackgroundColor** (stringa esadecimale colore, predefinito è #000000). IOS 7, impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB) all'avvio. + + + + +* **StatusBarStyle** (status bar in stile, default è lightcontent). IOS 7, impostare lo stile di barra di stato. Predefinita di opzioni disponibili, lightcontent, blacktranslucent, blackopaque. + + + + +## Nascondendo all'avvio + +In fase di esecuzione è possibile utilizzare la funzione di StatusBar.hide qui sotto, ma se si desidera che la barra di stato venga nascosta all'avvio di app, è necessario modificare il file info. plist dell'app. + +Aggiungere o modificare questi due attributi, se non presente. Impostare la **"barra di stato è inizialmente nascosto"** a **"YES"** e **"Aspetto di vista basati su controller status bar"** a **"NO"**. Se si modifica manualmente senza Xcode, le chiavi e i valori sono: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Metodi + +Questo plugin definisce globale oggetto `StatusBar`. + +Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## ProprietĂ  + +* StatusBar.isVisible + +## Autorizzazioni + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +IOS 7, rendono la statusbar sovrapposizione o non sovrapporre WebView. + + StatusBar.overlaysWebView(true); + + +## Descrizione + +IOS 7, impostato su false per rendere la barra di stato vengono visualizzati come iOS 6. Impostare il colore di sfondo e stile per soddisfare utilizzando altre funzioni. + +## Piattaforme supportate + +* iOS + +## Esempio rapido + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce). + + StatusBar.styleDefault(); + + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri). + + StatusBar.styleLightContent(); + + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri). + + StatusBar.styleBlackTranslucent(); + + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri). + + StatusBar.styleBlackOpaque(); + + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato con il nome di colore. + + StatusBar.backgroundColorByName("red"); + + +Nomi di colore supportati sono: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Imposta il colore di sfondo della barra di stato di una stringa esadecimale. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +ProprietĂ  di scrittura stenografica CSS sono supportati anche. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB). + +Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA è un valore alfa + +## Piattaforme supportate + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +Nascondere la barra di stato. + + StatusBar.hide(); + + +## Piattaforme supportate + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +Mostra la barra di stato. + + StatusBar.show(); + + +## Piattaforme supportate + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +Leggere questa proprietĂ  per vedere se la barra di stato è visibile o no. + + if (StatusBar.isVisible) { + // do something + } + + +## Piattaforme supportate + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/ja/README.md b/plugins/cordova-plugin-statusbar/doc/ja/README.md new file mode 100644 index 0000000..fc8b59a --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/ja/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> `StatusBar`ă‚Şă–ジェクăăŻă€iOS 㨠Android ă‚ąă†ăĽă‚żă‚ą ăăĽă‚’ă‚«ă‚ąă‚żăžă‚¤ă‚şă™ă‚‹ă„ăŹă¤ă‹ă®ć©źč˝ă‚’ćŹäľ›ă—ăľă™ă€‚ + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-statusbar + + +## 基本設定 + +#### config.xml + + * **StatusBarOverlaysWebView**(ă–ăĽă«ĺ€¤ă€ă‡ă•ă‚©ă«ă㯠true)。IOS 7ă€čµ·ĺ‹•ć™‚ă«ă‚ąă†ăĽă‚żă‚ąă㼠オăĽăăĽă¬ă‚¤ăľăźăŻăŞă„ă‚ŞăĽăăĽă¬ă‚¤ă€WebView を作る。 + + + + + * **StatusBarBackgroundColor**(ă‚«ă©ăĽ 16 進文字ĺ—ă€ć—˘ĺ®šĺ€¤ăŻ #000000)。IOS 7 ă¨ă‚˘ăłă‰ă­ă‚¤ă‰ 5ă€16 é€˛ć–‡ĺ­—ĺ— (#RRGGBB) 起動時ă«ă‚ąă†ăĽă‚żă‚ąăăĽă®čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + + + + + * **StatusBarStyle**(ă‚ąă†ăĽă‚żă‚ą ăăĽă®ă‚ąă‚żă‚¤ă«ă€ć—˘ĺ®šĺ€¤ăŻ lightcontent)。Ios 7ă€ă‚ąă†ăĽă‚żă‚ą ăăĽă®ă‚ąă‚żă‚¤ă«ă‚’設定ă—ăľă™ă€‚使用可č˝ăŞă‚Şă—ă‚·ă§ăłă®ă‡ă•ă‚©ă«ăă€lightcontentă€blacktranslucentă€blackopaque。 + + + + +### Android ă®ç™– + +Android ă®ă‚¬ă‚¤ă‰ă©ă‚¤ăł 5 + 指定ăˇă‚¤ăł アă—ăŞă‚ă‚Šă‚‚ă‚ąă†ăĽă‚żă‚ąăăĽă®ç•°ăŞă‚‹č‰˛ă‚’使用ă—ă¦`StatusBar.backgroundColorByHexString`ăľăźăŻ`StatusBar.backgroundColorByName`経由ă§ä»Łă‚Źă‚Šă«ĺ®źčˇŚć™‚ă«ă‚ąă†ăĽă‚żă‚ą ăăĽă®č‰˛ă‚’設定ă™ă‚‹ĺ ´ĺăŚă‚ă‚Šăľă™ă®ă§ (ă¨ăŻé•ăŁă¦ĺ¶ćśŤă‚ąă†ăĽă‚żă‚ąăăĽč‰˛ĺ¤šăŹă® iOS 7 + アă—ăŞă®) 色ă—ăľă™ă€‚ ăťă‚Śă‚’行ă†ć–ąćł•ă® 1 ă¤ă«ăŞă‚Šăľă™ă€‚ + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## 起動時ă«éťžčˇ¨ç¤ş + +実行時ă«ä¸‹ă«ă€StatusBar.hide 関数を使用ă§ăŤăľă™ăŚă€StatusBar アă—ăŞčµ·ĺ‹•ć™‚ă«éťžčˇ¨ç¤şă«ă™ă‚‹ĺ ´ĺăŻă€ă‚˘ă—ăŞă® Info.plist ă•ă‚ˇă‚¤ă«ă‚’変更ă™ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ + +ă“れら 2 ă¤ă®ĺ±žć€§ă®čż˝ĺŠ /編集ĺ­ĺś¨ă—ăŞă„ĺ ´ĺ。 **「スă†ăĽă‚żă‚ą ăăĽăŚéťžčˇ¨ç¤şćś€ĺťă€Ť** **"YES"**を設定ă—〠**「ă“ăĄăĽ ă‚łăłă ă­ăĽă©ăĽ ă™ăĽă‚ąă®ă‚ąă†ăĽă‚żă‚ą ăăĽă®ĺ¤–観」** **"NO"**ă«ă—ăľă™ă€‚ Xcode ă›ăšć‰‹ĺ‹•ă§ç·¨é›†ă™ă‚‹ă€ă‚­ăĽă¨ĺ€¤ăŻă€‚ + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## ăˇă‚˝ă㉠+ +ă“ă®ă—ă©ă‚°ă‚¤ăłă§ăŻă€ă‚°ă­ăĽăă« `StatusBar` ă‚Şă–ジェクăを定義ă—ăľă™ă€‚ + +ă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ăŻă‚ă‚‹ăŚăťă‚ŚăŚăŞă„ăľă§ `deviceready` イă™ăłăă®ĺľŚă§ă™ă€‚ + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## ă—ă­ă‘ă†ă‚Ł + + * StatusBar.isVisible + +## アクセス許可 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +IOS 7ă€statusbar ă‚ŞăĽăăĽă¬ă‚¤ăľăźăŻăŞă„ WebView ă‚’ă‚ŞăĽăăĽă¬ă‚¤ă—ăľă™ă€‚ + + StatusBar.overlaysWebView(true); + + +## 解説 + +IOS 7ă€iOS ă® 6 ă®ă‚ă†ă«čˇ¨ç¤şă•ă‚Śă‚‹ă‚ąă†ăĽă‚żă‚ąăăĽă‚’ false ă«č¨­ĺ®šă—ăľă™ă€‚ä»–ă®é–˘ć•°ă®ä˝żç”¨ă«ĺă‚Źă›ă¦ă‚ąă‚żă‚¤ă«ă‚„čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + +## ç°ˇĺŤăŞäľ‹ + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +既定スă†ăĽă‚żă‚ą ă㼠(ćš—ă„ă†ă‚­ă‚ąăă€ć·ˇč‰˛ă®čŚć™Ż) を使用ă—ăľă™ă€‚ + + StatusBar.styleDefault(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +LightContent ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleLightContent(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +BlackTranslucent ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleBlackTranslucent(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +BlackOpaque ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleBlackOpaque(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Ios 7ă€StatusBar.statusBarOverlaysWebView ă‚’ false ă«č¨­ĺ®šă™ă‚‹ĺ ´ĺăŻă‚ąă†ăĽă‚żă‚ąăăĽă®čŚć™Żč‰˛ă®č‰˛ă®ĺŤĺ‰Ťă«ă‚ăŁă¦č¨­ĺ®šă§ăŤăľă™ă€‚ + + StatusBar.backgroundColorByName("red"); + + +サăťăĽăă•ă‚Śă¦ă„る色ă®ĺŤĺ‰ŤăŻć¬ˇă®ă¨ăŠă‚Šă§ă™ă€‚ + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +16 進文字ĺ—ă‚’ă‚ąă†ăĽă‚żă‚ą ăăĽă®čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +速č¨ă® CSS ă—ă­ă‘ă†ă‚Łă‚‚サăťăĽăă•ă‚Śă¦ă„ăľă™ă€‚ + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Ios 7ă€StatusBar.statusBarOverlaysWebView ă‚’ false ă«č¨­ĺ®šă™ă‚‹ĺ ´ĺăŻă‚ąă†ăĽă‚żă‚ąăăĽă®čŚć™Żč‰˛ă‚’ 16 é€˛ć–‡ĺ­—ĺ— (#RRGGBB) ă§č¨­ĺ®šă§ăŤăľă™ă€‚ + +WP7 㨠WP8 も指定ă§ăŤăľă™ĺ€¤ #AARRGGBB, AA ăŻă€ă‚˘ă«ă•ă‚ˇĺ€¤ă¨ă—㦠+ +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +ă‚ąă†ăĽă‚żă‚ąăăĽă‚’éš ă—ăľă™ă€‚ + + StatusBar.hide(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * アăłă‰ă­ă‚¤ă‰ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +ă‚ąă†ăĽă‚żă‚ą ăăĽăŚčˇ¨ç¤şă•ă‚Śăľă™ă€‚ + + StatusBar.show(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * アăłă‰ă­ă‚¤ă‰ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +ă“ă®ă—ă­ă‘ă†ă‚Łă€ă‚ąă†ăĽă‚żă‚ąăăĽăŚčˇ¨ç¤şă•ă‚Śă‚‹ă‹ă©ă†ă‹ă‚’ăŠčŞ­ăżăŹă ă•ă„。 + + if (StatusBar.isVisible) { + // do something + } + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + + * iOS + * アăłă‰ă­ă‚¤ă‰ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/ja/index.md b/plugins/cordova-plugin-statusbar/doc/ja/index.md new file mode 100644 index 0000000..79705f2 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/ja/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> `StatusBar`ă‚Şă–ジェクăăŻă€iOS 㨠Android ă‚ąă†ăĽă‚żă‚ą ăăĽă‚’ă‚«ă‚ąă‚żăžă‚¤ă‚şă™ă‚‹ă„ăŹă¤ă‹ă®ć©źč˝ă‚’ćŹäľ›ă—ăľă™ă€‚ + +## イăłă‚ąăăĽă« + + cordova plugin add cordova-plugin-statusbar + + +## 基本設定 + +#### config.xml + +* **StatusBarOverlaysWebView**(ă–ăĽă«ĺ€¤ă€ă‡ă•ă‚©ă«ă㯠true)。IOS 7ă€čµ·ĺ‹•ć™‚ă«ă‚ąă†ăĽă‚żă‚ąă㼠オăĽăăĽă¬ă‚¤ăľăźăŻăŞă„ă‚ŞăĽăăĽă¬ă‚¤ă€WebView を作る。 + + + + +* **StatusBarBackgroundColor**ďĽč‰˛ 16 進文字ĺ—ă€ă‡ă•ă‚©ă«ăăŻ ďĽ 000000)。Ios 7ă€čµ·ĺ‹•ć™‚ă« 16 é€˛ć–‡ĺ­—ĺ— (#RRGGBB) ă§ă‚ąă†ăĽă‚żă‚ą ăăĽă®čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + + + + +* **StatusBarStyle**(ă‚ąă†ăĽă‚żă‚ą ăăĽă®ă‚ąă‚żă‚¤ă«ă€ć—˘ĺ®šĺ€¤ăŻ lightcontent)。Ios 7ă€ă‚ąă†ăĽă‚żă‚ą ăăĽă®ă‚ąă‚żă‚¤ă«ă‚’設定ă—ăľă™ă€‚使用可č˝ăŞă‚Şă—ă‚·ă§ăłă®ă‡ă•ă‚©ă«ăă€lightcontentă€blacktranslucentă€blackopaque。 + + + + +## 起動時ă«éťžčˇ¨ç¤ş + +実行時ă«ä¸‹ă«ă€StatusBar.hide 関数を使用ă§ăŤăľă™ăŚă€StatusBar アă—ăŞčµ·ĺ‹•ć™‚ă«éťžčˇ¨ç¤şă«ă™ă‚‹ĺ ´ĺăŻă€ă‚˘ă—ăŞă® Info.plist ă•ă‚ˇă‚¤ă«ă‚’変更ă™ă‚‹ĺż…č¦ăŚă‚ă‚Šăľă™ă€‚ + +ă“れら 2 ă¤ă®ĺ±žć€§ă®čż˝ĺŠ /編集ĺ­ĺś¨ă—ăŞă„ĺ ´ĺ。 **「スă†ăĽă‚żă‚ą ăăĽăŚéťžčˇ¨ç¤şćś€ĺťă€Ť** **"YES"**を設定ă—〠**「ă“ăĄăĽ ă‚łăłă ă­ăĽă©ăĽ ă™ăĽă‚ąă®ă‚ąă†ăĽă‚żă‚ą ăăĽă®ĺ¤–観」** **"NO"**ă«ă—ăľă™ă€‚ Xcode ă›ăšć‰‹ĺ‹•ă§ç·¨é›†ă™ă‚‹ă€ă‚­ăĽă¨ĺ€¤ăŻă€‚ + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## ăˇă‚˝ă㉠+ +ă“ă®ă—ă©ă‚°ă‚¤ăłă§ăŻă€ă‚°ă­ăĽăă« `StatusBar` ă‚Şă–ジェクăを定義ă—ăľă™ă€‚ + +ă‚°ă­ăĽăă« ă‚ąă‚łăĽă—ă§ăŻă‚ă‚‹ăŚăťă‚ŚăŚăŞă„ăľă§ `deviceready` イă™ăłăă®ĺľŚă§ă™ă€‚ + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## ă—ă­ă‘ă†ă‚Ł + +* StatusBar.isVisible + +## アクセス許可 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +IOS 7ă€statusbar ă‚ŞăĽăăĽă¬ă‚¤ăľăźăŻăŞă„ WebView ă‚’ă‚ŞăĽăăĽă¬ă‚¤ă—ăľă™ă€‚ + + StatusBar.overlaysWebView(true); + + +## 解説 + +IOS 7ă€iOS ă® 6 ă®ă‚ă†ă«čˇ¨ç¤şă•ă‚Śă‚‹ă‚ąă†ăĽă‚żă‚ąăăĽă‚’ false ă«č¨­ĺ®šă—ăľă™ă€‚ä»–ă®é–˘ć•°ă®ä˝żç”¨ă«ĺă‚Źă›ă¦ă‚ąă‚żă‚¤ă«ă‚„čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS + +## ç°ˇĺŤăŞäľ‹ + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +既定スă†ăĽă‚żă‚ą ă㼠(ćš—ă„ă†ă‚­ă‚ąăă€ć·ˇč‰˛ă®čŚć™Ż) を使用ă—ăľă™ă€‚ + + StatusBar.styleDefault(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +LightContent ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleLightContent(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +BlackTranslucent ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleBlackTranslucent(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +BlackOpaque ă‚ąă†ăĽă‚żă‚ąă㼠(ćš—ă„čŚć™Żă®ćŽă‚‹ă„ă†ă‚­ă‚ąă) を使用ă—ăľă™ă€‚ + + StatusBar.styleBlackOpaque(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Ios 7ă€StatusBar.statusBarOverlaysWebView ă‚’ false ă«č¨­ĺ®šă™ă‚‹ĺ ´ĺăŻă‚ąă†ăĽă‚żă‚ąăăĽă®čŚć™Żč‰˛ă®č‰˛ă®ĺŤĺ‰Ťă«ă‚ăŁă¦č¨­ĺ®šă§ăŤăľă™ă€‚ + + StatusBar.backgroundColorByName("red"); + + +サăťăĽăă•ă‚Śă¦ă„る色ă®ĺŤĺ‰ŤăŻć¬ˇă®ă¨ăŠă‚Šă§ă™ă€‚ + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +16 進文字ĺ—ă‚’ă‚ąă†ăĽă‚żă‚ą ăăĽă®čŚć™Żč‰˛ă‚’設定ă—ăľă™ă€‚ + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +速č¨ă® CSS ă—ă­ă‘ă†ă‚Łă‚‚サăťăĽăă•ă‚Śă¦ă„ăľă™ă€‚ + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Ios 7ă€StatusBar.statusBarOverlaysWebView ă‚’ false ă«č¨­ĺ®šă™ă‚‹ĺ ´ĺăŻă‚ąă†ăĽă‚żă‚ąăăĽă®čŚć™Żč‰˛ă‚’ 16 é€˛ć–‡ĺ­—ĺ— (#RRGGBB) ă§č¨­ĺ®šă§ăŤăľă™ă€‚ + +WP7 㨠WP8 も指定ă§ăŤăľă™ĺ€¤ #AARRGGBB, AA ăŻă€ă‚˘ă«ă•ă‚ˇĺ€¤ă¨ă—㦠+ +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +ă‚ąă†ăĽă‚żă‚ąăăĽă‚’éš ă—ăľă™ă€‚ + + StatusBar.hide(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* アăłă‰ă­ă‚¤ă‰ +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +ă‚ąă†ăĽă‚żă‚ą ăăĽăŚčˇ¨ç¤şă•ă‚Śăľă™ă€‚ + + StatusBar.show(); + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* アăłă‰ă­ă‚¤ă‰ +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +ă“ă®ă—ă­ă‘ă†ă‚Łă€ă‚ąă†ăĽă‚żă‚ąăăĽăŚčˇ¨ç¤şă•ă‚Śă‚‹ă‹ă©ă†ă‹ă‚’ăŠčŞ­ăżăŹă ă•ă„。 + + if (StatusBar.isVisible) { + // do something + } + + +## サăťăĽăă•ă‚Śă¦ă„ă‚‹ă—ă©ăăă•ă‚©ăĽă  + +* iOS +* アăłă‰ă­ă‚¤ă‰ +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/ko/README.md b/plugins/cordova-plugin-statusbar/doc/ko/README.md new file mode 100644 index 0000000..f76ac3e --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/ko/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> `StatusBar`개체 iOS와 ě• ë“ś 로이드 ěíś í‘śě‹śě¤„ěť„ ě‚¬ěš©ěž ě§€ě • í•ë ¤ë©´ 몇 가지 기능을 ě śęłµ í•©ë‹ë‹¤. + +## ě„¤ěą + + cordova plugin add cordova-plugin-statusbar + + +## í™ę˛˝ 설정 + +#### config.xml + + * **StatusBarOverlaysWebView** (boolean, 기본값: true)ěž…ë‹ë‹¤. IOS 7, ě‹śěž‘ ě‹ś ěíś í‘śě‹śě¤„ ě¤ë˛„ë ěť´ ë는 WebView 중첩 ë지 확인 í•©ë‹ë‹¤. + + + + + * **StatusBarBackgroundColor** (ě‰ě 16 진ě 문ěžě—´ 기본값: #000000). IOSě—ě„ś 7과 ě• ë“ś 로이드 5 ě‹śěž‘ ě‹ś 16 진ě 문ěžě—´ (#RRGGBB) ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ěť„ 설정 í•©ë‹ë‹¤. + + + + + * **StatusBarStyle** (ěíś í‘śě‹śě¤„ 스í€ěťĽ, 기본값: lightcontent). Ios 7, ěíś í‘śě‹śě¤„ 스í€ěťĽěť„ 설정 í•©ë‹ë‹¤. 사용 가능한 ěµě… 기본, lightcontent, blacktranslucent, blackopaque. + + + + +### ě• ë“ś 로이드 ë‹¨ě  + +ě• ë“ś 로이드 5 + 지침 보다 ę·€í•ěť 주요 ěť‘ěš© 프로그램 ěíś í‘śě‹śě¤„ě— ëŚ€ í•ś 다른 ě‰ěť„ 사용 í• ě—¬ 지정한 ě‰ě (와 달리 균일 í•ś ěíś í‘śě‹śě¤„ěť ě‰ě 많은 iOS 7 + 애플 리 케이 ě…), `StatusBar.backgroundColorByHexString` ë는 `StatusBar.backgroundColorByName`를 통해 대신 ëź°í€ěž„ě— ěíś í‘śě‹śě¤„ ě‰ěť„ 설정 í•ęł ěž í•  ě ěžěŠµë‹ë‹¤. í•ś 가지 방법은 일 ę˛ěž…ë‹ë‹¤. + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## ě‹śěž‘ ě‹ś ě¨ę¸°ę¸° + +ëź°í€ěž„ ëŹ™ě• ě•„ëžěť StatusBar.hide 함ě를 사용할 ě ěžěŠµë‹ë‹¤ í•ě§€ë§Ś ë‹ąě‹ ěť´ ě›í•ëŠ” ěť‘ěš© 프로그램 ě‹śěž‘ ě‹ś ě¨ę˛¨ě§„ ěíś í‘śě‹śě¤„, ěť‘ěš© í”„ëˇśę·¸ëž¨ěť Info.plist 파일 ěě • í•´ě•Ľ í•©ë‹ë‹¤. + +추가 편집이 ë‘ íŠąě„±ěť´ 없는 경우. **"ěíś í‘śě‹śě¤„ ě˛ěťŚ ě¨ę˛¨ě§„"** **"YES"** 로 설정 í• ęł  **"ë·° 컨트롤러 ę¸°ë° ěíś í‘śě‹śě¤„ 모양"** **"NO"**로 설정 í•©ë‹ë‹¤. Xcode, 열쇠 없이 ě동으로 편집 í•ëŠ” 경우 값은: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## 메서드 + +ěť´ 플러그인 글로벌 `StatusBar` 개체를 ě •ěťí•©ë‹ë‹¤. + +ě „ě—­ ë˛”ěś„ě— ěžě§€ë§Ś ę·¸ę˛ěť€ ë¶ę°€ëŠĄęąŚě§€ `deviceready` 이벤트 후. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## 속성 + + * StatusBar.isVisible + +## 사용 권한 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +IOS 7, ě¤ë˛„ë ěť´ ë는 í•ě§€ WebView 중첩 ěíś í‘śě‹śě¤„ěť„ 확인 í•©ë‹ë‹¤. + + StatusBar.overlaysWebView(true); + + +## 설명 + +7 iOS, iOS 6 ě˛ëźĽ ë‚í€ë‚는 ěíś í‘śě‹śě¤„ěť„ false로 설정 í•©ë‹ë‹¤. 다른 함ě를 사용 í• ě—¬ě— ë§žę˛Ś 스í€ěťĽęłĽ 배경 ě‰ěěť„ 설정 í•©ë‹ë‹¤. + +## ě§€ě› ë는 플랫폼 + + * iOS + +## 빠른 ěě ś + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +기본 ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ 텍스트, 밝은 ë°°ę˛˝ě— ëŚ€ í•ś)를 사용 í•©ë‹ë‹¤. + + StatusBar.styleDefault(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +LightContent ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleLightContent(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +BlackTranslucent ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleBlackTranslucent(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +BlackOpaque ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleBlackOpaque(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Ios 7, StatusBar.statusBarOverlaysWebViewěť„ false로 설정 í•ë©´ 설정할 ě ěžëŠ” ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ ě‰ě 이름으로. + + StatusBar.backgroundColorByName("red"); + + +ě§€ě› ë는 ě‰ ěť´ë¦„ěž…ë‹ë‹¤. + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## ě§€ě› ë는 플랫폼 + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +16 진ě 문ěžě—´ ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ěť„ 설정합ë‹ë‹¤. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +CSS 대표 속성 ě§€ě› ë©ë‹ë‹¤. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Ios 7, StatusBar.statusBarOverlaysWebViewěť„ false로 설정 í•ë©´ 설정할 ě ěžëŠ” ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ 16 진ě 문ěžě—´ (#RRGGBB)ě— ěťí•´. + +WP7 ë°Ź WP8ě— ë‹ąě‹ ěť€ ëí•ś #AARRGGBB, AA는 알파 값으로 ę°’ěť„ 지정할 ě ěžěŠµë‹ë‹¤. + +## ě§€ě› ë는 플랫폼 + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +ě¨ę¸°ę¸° ěíś í‘śě‹śě¤„. + + StatusBar.hide(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * ě• ë“ś 로이드 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +ěíś í‘śě‹śě¤„ěť„ í‘śě‹śí•©ë‹ë‹¤. + + StatusBar.show(); + + +## ě§€ě› ë는 플랫폼 + + * iOS + * ě• ë“ś 로이드 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +ěť´ 속성을 ěíś í‘śě‹śě¤„ í‘śě‹ś ë는 경우 읽기. + + if (StatusBar.isVisible) { + // do something + } + + +## ě§€ě› ë는 플랫폼 + + * iOS + * ě• ë“ś 로이드 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/ko/index.md b/plugins/cordova-plugin-statusbar/doc/ko/index.md new file mode 100644 index 0000000..44de75b --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/ko/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> `StatusBar`개체 iOS와 ě• ë“ś 로이드 ěíś í‘śě‹śě¤„ěť„ ě‚¬ěš©ěž ě§€ě • í•ë ¤ë©´ 몇 가지 기능을 ě śęłµ í•©ë‹ë‹¤. + +## ě„¤ěą + + cordova plugin add cordova-plugin-statusbar + + +## í™ę˛˝ 설정 + +#### config.xml + +* **StatusBarOverlaysWebView** (boolean, 기본값: true)ěž…ë‹ë‹¤. IOS 7, ě‹śěž‘ ě‹ś ěíś í‘śě‹śě¤„ ě¤ë˛„ë ěť´ ë는 WebView 중첩 ë지 확인 í•©ë‹ë‹¤. + + + + +* **StatusBarBackgroundColor** (ě‰ě 16 진ě 문ěžě—´ 기본값: #000000). Ios 7, ě‹śěž‘ ě‹ś 16 진ě 문ěžě—´ (#RRGGBB) ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ěť„ 설정 í•©ë‹ë‹¤. + + + + +* **StatusBarStyle** (ěíś í‘śě‹śě¤„ 스í€ěťĽ, 기본값: lightcontent). Ios 7, ěíś í‘śě‹śě¤„ 스í€ěťĽěť„ 설정 í•©ë‹ë‹¤. 사용 가능한 ěµě… 기본, lightcontent, blacktranslucent, blackopaque. + + + + +## ě‹śěž‘ ě‹ś ě¨ę¸°ę¸° + +ëź°í€ěž„ ëŹ™ě• ě•„ëžěť StatusBar.hide 함ě를 사용할 ě ěžěŠµë‹ë‹¤ í•ě§€ë§Ś ë‹ąě‹ ěť´ ě›í•ëŠ” ěť‘ěš© 프로그램 ě‹śěž‘ ě‹ś ě¨ę˛¨ě§„ ěíś í‘śě‹śě¤„, ěť‘ěš© í”„ëˇśę·¸ëž¨ěť Info.plist 파일 ěě • í•´ě•Ľ í•©ë‹ë‹¤. + +추가 편집이 ë‘ íŠąě„±ěť´ 없는 경우. **"ěíś í‘śě‹śě¤„ ě˛ěťŚ ě¨ę˛¨ě§„"** **"YES"** 로 설정 í• ęł  **"ë·° 컨트롤러 ę¸°ë° ěíś í‘śě‹śě¤„ 모양"** **"NO"**로 설정 í•©ë‹ë‹¤. Xcode, 열쇠 없이 ě동으로 편집 í•ëŠ” 경우 값은: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## 메서드 + +ěť´ 플러그인 글로벌 `StatusBar` 개체를 ě •ěťí•©ë‹ë‹¤. + +ě „ě—­ ë˛”ěś„ě— ěžě§€ë§Ś ę·¸ę˛ěť€ ë¶ę°€ëŠĄęąŚě§€ `deviceready` 이벤트 후. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## 속성 + +* StatusBar.isVisible + +## 사용 권한 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +IOS 7, ě¤ë˛„ë ěť´ ë는 í•ě§€ WebView 중첩 ěíś í‘śě‹śě¤„ěť„ 확인 í•©ë‹ë‹¤. + + StatusBar.overlaysWebView(true); + + +## 설명 + +7 iOS, iOS 6 ě˛ëźĽ ë‚í€ë‚는 ěíś í‘śě‹śě¤„ěť„ false로 설정 í•©ë‹ë‹¤. 다른 함ě를 사용 í• ě—¬ě— ë§žę˛Ś 스í€ěťĽęłĽ 배경 ě‰ěěť„ 설정 í•©ë‹ë‹¤. + +## ě§€ě› ë는 플랫폼 + +* iOS + +## 빠른 ěě ś + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +기본 ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ 텍스트, 밝은 ë°°ę˛˝ě— ëŚ€ í•ś)를 사용 í•©ë‹ë‹¤. + + StatusBar.styleDefault(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +LightContent ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleLightContent(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +BlackTranslucent ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleBlackTranslucent(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +BlackOpaque ěíś í‘śě‹śě¤„ (ě–´ë‘ěš´ ë°°ę˛˝ě— ëŚ€ í•ś 가벼운 텍스트)ěť„ 사용 í•©ë‹ë‹¤. + + StatusBar.styleBlackOpaque(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Ios 7, StatusBar.statusBarOverlaysWebViewěť„ false로 설정 í•ë©´ 설정할 ě ěžëŠ” ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ ě‰ě 이름으로. + + StatusBar.backgroundColorByName("red"); + + +ě§€ě› ë는 ě‰ ěť´ë¦„ěž…ë‹ë‹¤. + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +16 진ě 문ěžě—´ ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ěť„ 설정합ë‹ë‹¤. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +CSS 대표 속성 ě§€ě› ë©ë‹ë‹¤. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Ios 7, StatusBar.statusBarOverlaysWebViewěť„ false로 설정 í•ë©´ 설정할 ě ěžëŠ” ěíś í‘śě‹śě¤„ěť ë°°ę˛˝ě‰ 16 진ě 문ěžě—´ (#RRGGBB)ě— ěťí•´. + +WP7 ë°Ź WP8ě— ë‹ąě‹ ěť€ ëí•ś #AARRGGBB, AA는 알파 값으로 ę°’ěť„ 지정할 ě ěžěŠµë‹ë‹¤. + +## ě§€ě› ë는 플랫폼 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +ě¨ę¸°ę¸° ěíś í‘śě‹śě¤„. + + StatusBar.hide(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* ě• ë“ś 로이드 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +ěíś í‘śě‹śě¤„ěť„ í‘śě‹śí•©ë‹ë‹¤. + + StatusBar.show(); + + +## ě§€ě› ë는 플랫폼 + +* iOS +* ě• ë“ś 로이드 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +ěť´ 속성을 ěíś í‘śě‹śě¤„ í‘śě‹ś ë는 경우 읽기. + + if (StatusBar.isVisible) { + // do something + } + + +## ě§€ě› ë는 플랫폼 + +* iOS +* ě• ë“ś 로이드 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/pl/README.md b/plugins/cordova-plugin-statusbar/doc/pl/README.md new file mode 100644 index 0000000..1b116cc --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/pl/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar. + +## Instalacja + + cordova plugin add cordova-plugin-statusbar + + +## Preferencje + +#### config.xml + + * **StatusBarOverlaysWebView** (boolean, domyĹ›lnie na wartość true). Na iOS 7 zrobić nakĹ‚adki stanu lub nie nakĹ‚adki widoku sieci Web podczas uruchamiania. + + + + + * **StatusBarBackgroundColor** (kolor ciÄ…g szesnastkowy, domyĹ›lnie #000000). Na iOS 7 i Android 5 kolor tĹ‚a stanu przez ciÄ…g szesnastkowy (#RRGGBB) przy starcie systemu. + + + + + * **StatusBarStyle** (stan styl paska, domyĹ›lnie lightcontent.) Na iOS 7 ustawić styl paska stanu. DostÄ™pne opcje domyĹ›lne, lightcontent, blacktranslucent, blackopaque. + + + + +### Dziwactwa Androida + +Android 5 + wytyczne okreĹ›lajÄ… przy uĹĽyciu różnych kolorĂłw statusbar niĹĽ gĹ‚Ăłwne aplikacji kolor (w przeciwieĹ„stwie do stanu jednolitych kolorĂłw wiele aplikacje iOS 7 +), wiÄ™c moĹĽe chcesz ustawić kolor pasek stanu w czasie wykonywania zamiast za poĹ›rednictwem `StatusBar.backgroundColorByHexString` lub `StatusBar.backgroundColorByName`. Jednym sposobem na to byĹ‚oby: + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## Przy starcie + +Podczas uruchamiania moĹĽna uĹĽyć funkcji StatusBar.hide poniĹĽej, ale jeĹ›li chcesz StatusBar ukryty w uruchamiania aplikacji, naleĹĽy zmodyfikować plik Info.plist Twojej aplikacji. + +Dodawanie/edycja tych dwĂłch atrybutĂłw jeĹ›li nie obecny. Ustawianie **"pasek stanu jest poczÄ…tkowo ukryte"** na **"Tak"** i **"Oparte na kontroler stanu paska wyglÄ…d"** na **"Nie"**. JeĹ›li moĹĽesz go edytować rÄ™cznie bez Xcode, kluczy i wartoĹ›ci sÄ…: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Metody + +Ten plugin definiuje obiekt globalny `StatusBar`. + +ChociaĹĽ w globalnym zasiÄ™gu, to nie dostÄ™pne dopiero po `deviceready` imprezie. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## WĹ‚aĹ›ciwoĹ›ci + + * StatusBar.isVisible + +## Uprawnienia + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +Na iOS 7 zrobić statusbar nakĹ‚adki lub nie nakĹ‚adka widoku sieci Web. + + StatusBar.overlaysWebView(true); + + +## Opis + +Na iOS 7 zestaw do false, aby na pasku stanu pojawia siÄ™ jak iOS 6. Ustaw kolor tĹ‚a i styl do korzystania z innych funkcji. + +## ObsĹ‚ugiwane platformy + + * iOS + +## Szybki przykĹ‚ad + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +UĹĽyj domyĹ›lnego stanu (ciemny tekst, teĹ‚ Ĺ›wiatĹ‚a). + + StatusBar.styleDefault(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +UĹĽyj lightContent stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleLightContent(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +UĹĽyj blackTranslucent stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleBlackTranslucent(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +UĹĽyj blackOpaque stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleBlackOpaque(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView moĹĽna ustawić kolor tĹ‚a stanu przez nazwÄ™ koloru. + + StatusBar.backgroundColorByName("red"); + + +Nazwy kolorĂłw obsĹ‚ugiwane sÄ…: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## ObsĹ‚ugiwane platformy + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Ustawia kolor tĹ‚a stanu przez ciÄ…g szesnastkowy. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +ObsĹ‚ugiwane sÄ… rĂłwnieĹĽ wĹ‚aĹ›ciwoĹ›ci CSS. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView moĹĽna ustawić kolor tĹ‚a stanu przez ciÄ…g szesnastkowy (#RRGGBB). + +Na WP7 i WP8 moĹĽna rĂłwnieĹĽ okreĹ›lić wartoĹ›ci jako #AARRGGBB, gdzie AA jest wartoĹ›ciÄ… alfa + +## ObsĹ‚ugiwane platformy + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +Ukryj pasek stanu. + + StatusBar.hide(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +Pokazuje pasek stanu. + + StatusBar.show(); + + +## ObsĹ‚ugiwane platformy + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +Czytać tej wĹ‚aĹ›ciwość, aby sprawdzić, czy stanu jest widoczne lub nie. + + if (StatusBar.isVisible) { + // do something + } + + +## ObsĹ‚ugiwane platformy + + * iOS + * Android + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/pl/index.md b/plugins/cordova-plugin-statusbar/doc/pl/index.md new file mode 100644 index 0000000..4f13a37 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/pl/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar. + +## Instalacja + + cordova plugin add cordova-plugin-statusbar + + +## Preferencje + +#### config.xml + +* **StatusBarOverlaysWebView** (boolean, domyĹ›lnie na wartość true). Na iOS 7 zrobić nakĹ‚adki stanu lub nie nakĹ‚adki widoku sieci Web podczas uruchamiania. + + + + +* **StatusBarBackgroundColor** (kolor szesnastkowy ciÄ…g, domyĹ›lnie #000000). Na iOS 7 ustawić kolor tĹ‚a stanu przez ciÄ…g szesnastkowy (#RRGGBB) przy starcie systemu. + + + + +* **StatusBarStyle** (stan styl paska, domyĹ›lnie lightcontent.) Na iOS 7 ustawić styl paska stanu. DostÄ™pne opcje domyĹ›lne, lightcontent, blacktranslucent, blackopaque. + + + + +## Przy starcie + +Podczas uruchamiania moĹĽna uĹĽyć funkcji StatusBar.hide poniĹĽej, ale jeĹ›li chcesz StatusBar ukryty w uruchamiania aplikacji, naleĹĽy zmodyfikować plik Info.plist Twojej aplikacji. + +Dodawanie/edycja tych dwĂłch atrybutĂłw jeĹ›li nie obecny. Ustawianie **"pasek stanu jest poczÄ…tkowo ukryte"** na **"Tak"** i **"Oparte na kontroler stanu paska wyglÄ…d"** na **"Nie"**. JeĹ›li moĹĽesz go edytować rÄ™cznie bez Xcode, kluczy i wartoĹ›ci sÄ…: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Metody + +Ten plugin definiuje obiekt globalny `StatusBar`. + +ChociaĹĽ w globalnym zasiÄ™gu, to nie dostÄ™pne dopiero po `deviceready` imprezie. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## WĹ‚aĹ›ciwoĹ›ci + +* StatusBar.isVisible + +## Uprawnienia + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +Na iOS 7 zrobić statusbar nakĹ‚adki lub nie nakĹ‚adka widoku sieci Web. + + StatusBar.overlaysWebView(true); + + +## Opis + +Na iOS 7 zestaw do false, aby na pasku stanu pojawia siÄ™ jak iOS 6. Ustaw kolor tĹ‚a i styl do korzystania z innych funkcji. + +## ObsĹ‚ugiwane platformy + +* iOS + +## Szybki przykĹ‚ad + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +UĹĽyj domyĹ›lnego stanu (ciemny tekst, teĹ‚ Ĺ›wiatĹ‚a). + + StatusBar.styleDefault(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +UĹĽyj lightContent stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleLightContent(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +UĹĽyj blackTranslucent stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleBlackTranslucent(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +UĹĽyj blackOpaque stanu (Ĺ›wiatĹ‚o tekst, ciemne tĹ‚o). + + StatusBar.styleBlackOpaque(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView moĹĽna ustawić kolor tĹ‚a stanu przez nazwÄ™ koloru. + + StatusBar.backgroundColorByName("red"); + + +Nazwy kolorĂłw obsĹ‚ugiwane sÄ…: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +Ustawia kolor tĹ‚a stanu przez ciÄ…g szesnastkowy. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +ObsĹ‚ugiwane sÄ… rĂłwnieĹĽ wĹ‚aĹ›ciwoĹ›ci CSS. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView moĹĽna ustawić kolor tĹ‚a stanu przez ciÄ…g szesnastkowy (#RRGGBB). + +Na WP7 i WP8 moĹĽna rĂłwnieĹĽ okreĹ›lić wartoĹ›ci jako #AARRGGBB, gdzie AA jest wartoĹ›ciÄ… alfa + +## ObsĹ‚ugiwane platformy + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +Ukryj pasek stanu. + + StatusBar.hide(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +Pokazuje pasek stanu. + + StatusBar.show(); + + +## ObsĹ‚ugiwane platformy + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +Czytać tej wĹ‚aĹ›ciwość, aby sprawdzić, czy stanu jest widoczne lub nie. + + if (StatusBar.isVisible) { + // do something + } + + +## ObsĹ‚ugiwane platformy + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/doc/ru/index.md b/plugins/cordova-plugin-statusbar/doc/ru/index.md new file mode 100644 index 0000000..fdb95ee --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/ru/index.md @@ -0,0 +1,238 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> Объект `StatusBar` предоŃтавляет некоторые Ń„Ńнкции для наŃтройки ŃŃ‚Đ°Ń‚ŃŃной панели на iOS и Android. + +## НаŃтройки + +#### config.xml + +* **StatusBarOverlaysWebView** (логичеŃкое значение, по Ńмолчанию true). Đ’ iOS 7 определяет необходимо ли Ńделать наложение ŃŃ‚Đ°Ń‚ŃŃной панели на WebView при Đ·Đ°ĐżŃŃке или нет. + + + + +* **StatusBarBackgroundColor** (ŃеŃтнадцатеричная Ńтрока цвета, значения по Ńмолчанию #000000). На iOS 7 ŃŃтановит цвет фона ŃŃ‚Đ°Ń‚ŃŃной панели при Đ·Đ°ĐżŃŃке, на ĐľŃновании ŃеŃтнадцатеричной Ńтроки цвета (#RRGGBB). + + + + +* **StatusBarStyle** (ŃŃ‚Đ°Ń‚ŃŃ Đ±Đ°Ń€ Ńтиль, по Ńмолчанию lightcontent). На iOS 7 ŃŃтановите Ńтиль Ńтроки ŃĐľŃтояния. ДоŃŃ‚Ńпные параметры по Ńмолчанию, lightcontent, blacktranslucent, blackopaque. + + + + +## Скрытие при Đ·Đ°ĐżŃŃке + +Đ’Đľ время выполнения можно иŃпользовать Ń„Ńнкцию StatusBar.hide ниже, но еŃли вы хотите StatusBar быть Ńкрыты при Đ·Đ°ĐżŃŃке приложения, необходимо изменить файл Info.plist ваŃего приложения. + +Добавьте/измените эти два атрибŃŃ‚Đ°, еŃли они не приŃŃŃ‚ŃтвŃŃŽŃ‚ или отличаютŃŃŹ от нижеŃказанных значений. ĐŁŃтановите значение **«Status bar is initially hidden»** равное **«YES»** и ŃŃтановите значение **«View controller-based status bar appearance»** на **«NO»**. Đ•Ńли вы измените его врŃчнŃŃŽ без Xcode, ключи и значения являютŃŃŹ ŃледŃющими: + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## Методы + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## Параметры + +* StatusBar.isVisible + +## РазреŃения + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +На iOS 7 Сделайте statusbar overlay или не поверх WebView. + + StatusBar.overlaysWebView(true); + + +## ОпиŃание + +На iOS 7 ĐŁŃтановите значение false чтобы Ńделать statusbar появляютŃŃŹ как iOS 6. Задайте Ńтиль и цвет фона в ŃоответŃтвии Ń Đ¸Ńпользованием Đ´Ń€Ńгих Ń„Ńнкций. + +## Поддерживаемые платформы + +* iOS + +## Краткий пример + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +ĐŃпользŃйте по Ńмолчанию statusbar (темный текŃŃ‚, для легких Ńтола). + + StatusBar.styleDefault(); + + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.styleLightContent + +ĐŃпользŃйте lightContent statusbar (Ńветлый текŃŃ‚, на темном фоне). + + StatusBar.styleLightContent(); + + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.styleBlackTranslucent + +ĐŃпользŃйте blackTranslucent statusbar (Ńветлый текŃŃ‚, на темном фоне). + + StatusBar.styleBlackTranslucent(); + + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.styleBlackOpaque + +ĐŃпользŃйте blackOpaque statusbar (Ńветлый текŃŃ‚, на темном фоне). + + StatusBar.styleBlackOpaque(); + + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.backgroundColorByName + +На iOS 7 когда StatusBar.statusBarOverlaysWebView приŃвоено значение false, можно Đ·Đ°Đ´Đ°Ń‚ŃŚ цвет фона для объекта statusbar по имени цвета. + + StatusBar.backgroundColorByName("red"); + + +Đмена поддерживаемых цветов являютŃŃŹ: + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.backgroundColorByHexString + +Задает цвет фона для объекта statusbar, ŃеŃтнадцатеричная Ńтрока. + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +Также поддерживаютŃŃŹ ŃвойŃтва CSS Ńтенографию. + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +На iOS 7 когда StatusBar.statusBarOverlaysWebView приŃвоено значение false, можно Đ·Đ°Đ´Đ°Ń‚ŃŚ цвет фона для объекта statusbar, ŃеŃтнадцатеричная Ńтрока (#RRGGBB). + +На WP7 и WP8 также можно Ńказать значения как #AARRGGBB, где AA — ŃŤŃ‚Đľ альфа-значение + +## Поддерживаемые платформы + +* iOS +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.hide + +Скройте ŃŃ‚Ń€ĐľĐşŃ ŃĐľŃтояния statusbar. + + StatusBar.hide(); + + +## Поддерживаемые платформы + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.show + +Показывает ŃŃ‚Ń€ĐľĐşŃ ŃĐľŃтояния statusbar. + + StatusBar.show(); + + +## Поддерживаемые платформы + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 + +# StatusBar.isVisible + +Чтение ŃŤŃ‚Đľ ŃвойŃтво, чтобы Ńвидеть, еŃли statusbar являетŃŃŹ видимым или нет. + + if (StatusBar.isVisible) { + // do something + } + + +## Поддерживаемые платформы + +* iOS +* Android +* Windows Phone 7 +* Windows Phone 8 diff --git a/plugins/cordova-plugin-statusbar/doc/zh/README.md b/plugins/cordova-plugin-statusbar/doc/zh/README.md new file mode 100644 index 0000000..8a63699 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/zh/README.md @@ -0,0 +1,276 @@ + + +# cordova-plugin-statusbar + +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar) + +# StatusBar + +> `StatusBar`物件ćŹäľ›äş†ä¸€äş›ĺŠźč˝ďĽŚč‡Şč¨‚çš„ iOS ĺ’Ś Android 狀態ĺ—。 + +## 安裝 + + cordova plugin add cordova-plugin-statusbar + + +## 首é¸é … + +#### config.xml + + * **StatusBarOverlaysWebView**ďĽĺ¸ćž—值,é č¨­ĺ€Ľç‚ş true)。在 iOS 7,使狀態ĺ—覆蓋ć–不覆蓋 web 視圖在啟動時。 + + + + + * **StatusBarBackgroundColor**(顏色ĺŤĺ…­é€˛ä˝Ťĺ­—串,é č¨­ĺ€Ľç‚ş #000000)。IOS 7 ĺ’Ś Android 5,由ĺŤĺ…­é€˛ä˝Ťĺ­—串 (#RRGGBB) 在啟動時設置狀態ĺ—çš„čŚć™Żč‰˛ă€‚ + + + + + * **狀態ĺ—**ďĽç‹€ć…‹ĺ—樣式,é č¨­ĺ€Ľç‚ş lightcontent)。在 iOS 7,設置的狀態橫條圖樣式。可用的é¸é …é č¨­ďĽŚlightcontent,blacktranslucent,blackopaque。 + + + + +### Android 的怪癖 + +Android çš„ 5 + 準則指定使用不ĺŚçš„顏色比您主č¦çš„應用程式狀態欄顏色 (不ĺŹĺľĺ¤š iOS 7 + 應用程式的統一狀態ĺ—顏色),所以你可č˝ćłč¦č¨­ç˝®ĺś¨é‹čˇŚć™‚顯示狀態ĺ—顏色而不ćŻé€šéŽ`StatusBar.backgroundColorByHexString`ć–`StatusBar.backgroundColorByName`。 一個的方式ĺšĺ°é€™ä¸€é»žĺ°‡ćŻ: + +```js +if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#333"); +} +``` + +## 在啟動時隱藏 + +在é‹čˇŚć™‚期間,你可以使用 StatusBar.hide 函數下面,但如果你ćłč¦éˇŻç¤şç‹€ć…‹ĺ—隱藏在應用程式啟動時,你必é äż®ć”ąä˝ çš„應用程式的 Info.plist 檔。 + +添加編輯這兩個屬性,如果不ĺ­ĺś¨ă€‚ ĺ°‡**"狀態ĺ—最ĺťéš±č—Ź"**設置為**"YES"**ĺ’Ś**"視圖基於控ĺ¶ĺ™¨çš„狀態ĺ—外觀"**設置為**"ĺ¦"**。 如果您手動編輯ĺ®ć˛’有 Xcode,鍵和值ćŻďĽš + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## ć–ąćł• + +這個外掛程式定義全域 `StatusBar` 物件。 + +雖然在全ç範圍內,ĺ®ä¸ŤĺŹŻç”¨ç›´ĺ° `deviceready` 事件之後。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + + * StatusBar.overlaysWebView + * StatusBar.styleDefault + * StatusBar.styleLightContent + * StatusBar.styleBlackTranslucent + * StatusBar.styleBlackOpaque + * StatusBar.backgroundColorByName + * StatusBar.backgroundColorByHexString + * StatusBar.hide + * StatusBar.show + +## 屬性 + + * StatusBar.isVisible + +## 許可權 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +在 iOS 7,使狀態ĺ—覆蓋ć–不覆蓋 web 視圖。 + + StatusBar.overlaysWebView(true); + + +## čŞŞćŽ + +在 iOS 7,設置為 false,使狀態ĺ—ĺ‡şçŹľĺŹ iOS 6。設置樣式和čŚć™ŻéˇŹč‰˛ďĽŚé©ĺ使用其他函數。 + +## 支援的平臺 + + * iOS + +## 快速的示例 + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +使用é č¨­ç‹€ć…‹ĺ— ďĽć·şč‰˛čŚć™Żć·±č‰˛ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleDefault(); + + +## 支援的平臺 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleLightContent + +使用 lightContent ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleLightContent(); + + +## 支援的平臺 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +使用 blackTranslucent ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleBlackTranslucent(); + + +## 支援的平臺 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +使用 blackOpaque ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleBlackOpaque(); + + +## 支援的平臺 + + * iOS + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +在 iOS 7,當您將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態ĺ—çš„čŚć™Żč‰˛çš„顏色ĺŤç¨±ă€‚ + + StatusBar.backgroundColorByName("red"); + + +支援的顏色ĺŤç¨±ćŻďĽš + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## 支援的平臺 + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +ç”±ĺŤĺ…­é€˛ä˝Ťĺ­—串設置狀態ĺ—çš„čŚć™Żč‰˛ă€‚ + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +此外支援 CSS 速č¨ĺ±¬ć€§ă€‚ + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,您可以設置狀態ĺ—çš„čŚć™Żč‰˛ç”±ĺŤĺ…­é€˛ä˝Ťĺ­—串 ďĽ#RRGGBB)。 + +WP7 ĺ’Ś WP8 您還可以指定值為 #AARRGGBB,其中 AA ćŻ Alpha 值 + +## 支援的平臺 + + * iOS + * Android 5+ + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.hide + +隱藏狀態ĺ—。 + + StatusBar.hide(); + + +## 支援的平臺 + + * iOS + * Android 系統 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.show + +顯示狀態ĺ—。 + + StatusBar.show(); + + +## 支援的平臺 + + * iOS + * Android 系統 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 + +# StatusBar.isVisible + +讀取此屬性,以查看狀態ĺ—ćŻĺ¦ĺŹŻč¦‹ă€‚ + + if (StatusBar.isVisible) { + // do something + } + + +## 支援的平臺 + + * iOS + * Android 系統 + * Windows Phone 7 + * Windows Phone 8 + * Windows Phone 8.1 \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/doc/zh/index.md b/plugins/cordova-plugin-statusbar/doc/zh/index.md new file mode 100644 index 0000000..a8805da --- /dev/null +++ b/plugins/cordova-plugin-statusbar/doc/zh/index.md @@ -0,0 +1,262 @@ + + +# cordova-plugin-statusbar + +# StatusBar + +> `StatusBar`物件ćŹäľ›äş†ä¸€äş›ĺŠźč˝ďĽŚč‡Şč¨‚çš„ iOS ĺ’Ś Android 狀態ĺ—。 + +## 安裝 + + cordova plugin add cordova-plugin-statusbar + + +## 首é¸é … + +#### config.xml + +* **StatusBarOverlaysWebView**ďĽĺ¸ćž—值,é č¨­ĺ€Ľç‚ş true)。在 iOS 7,使狀態ĺ—覆蓋ć–不覆蓋 web 視圖在啟動時。 + + + + +* **StatusBarBackgroundColor**ďĽéˇŹč‰˛ĺŤĺ…­é€˛ä˝Ťĺ­—串,é č¨­ĺ€Ľç‚ş #000000)。在 iOS 7,通éŽä¸€ĺ€‹ĺŤĺ…­é€˛ä˝Ťĺ­—串 ďĽ#RRGGBB) 在啟動時設置狀態ĺ—çš„čŚć™Żč‰˛ă€‚ + + + + +* **狀態ĺ—**ďĽç‹€ć…‹ĺ—樣式,é č¨­ĺ€Ľç‚ş lightcontent)。在 iOS 7,設置的狀態橫條圖樣式。可用的é¸é …é č¨­ďĽŚlightcontent,blacktranslucent,blackopaque。 + + + + +## 在啟動時隱藏 + +在é‹čˇŚć™‚期間,你可以使用 StatusBar.hide 函數下面,但如果你ćłč¦éˇŻç¤şç‹€ć…‹ĺ—隱藏在應用程式啟動時,你必é äż®ć”ąä˝ çš„應用程式的 Info.plist 檔。 + +添加編輯這兩個屬性,如果不ĺ­ĺś¨ă€‚ ĺ°‡**"狀態ĺ—最ĺťéš±č—Ź"**設置為**"YES"**ĺ’Ś**"視圖基於控ĺ¶ĺ™¨çš„狀態ĺ—外觀"**設置為**"ĺ¦"**。 如果您手動編輯ĺ®ć˛’有 Xcode,鍵和值ćŻďĽš + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + + +## ć–ąćł• + +這個外掛程式定義全域 `StatusBar` 物件。 + +雖然在全ç範圍內,ĺ®ä¸ŤĺŹŻç”¨ç›´ĺ° `deviceready` 事件之後。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(StatusBar); + } + + +* StatusBar.overlaysWebView +* StatusBar.styleDefault +* StatusBar.styleLightContent +* StatusBar.styleBlackTranslucent +* StatusBar.styleBlackOpaque +* StatusBar.backgroundColorByName +* StatusBar.backgroundColorByHexString +* StatusBar.hide +* StatusBar.show + +## 屬性 + +* StatusBar.isVisible + +## 許可權 + +#### config.xml + + + + + + +# StatusBar.overlaysWebView + +在 iOS 7,使狀態ĺ—覆蓋ć–不覆蓋 web 視圖。 + + StatusBar.overlaysWebView(true); + + +## čŞŞćŽ + +在 iOS 7,設置為 false,使狀態ĺ—ĺ‡şçŹľĺŹ iOS 6。設置樣式和čŚć™ŻéˇŹč‰˛ďĽŚé©ĺ使用其他函數。 + +## 支援的平臺 + +* iOS + +## 快速的示例 + + StatusBar.overlaysWebView(true); + StatusBar.overlaysWebView(false); + + +# StatusBar.styleDefault + +使用é č¨­ç‹€ć…‹ĺ— ďĽć·şč‰˛čŚć™Żć·±č‰˛ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleDefault(); + + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleLightContent + +使用 lightContent ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleLightContent(); + + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackTranslucent + +使用 blackTranslucent ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleBlackTranslucent(); + + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.styleBlackOpaque + +使用 blackOpaque ç‹€ć…‹ĺ— ďĽć·±č‰˛čŚć™Żĺ…‰ć–‡ćś¬ďĽ‰ă€‚ + + StatusBar.styleBlackOpaque(); + + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByName + +在 iOS 7,當您將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態ĺ—çš„čŚć™Żč‰˛çš„顏色ĺŤç¨±ă€‚ + + StatusBar.backgroundColorByName("red"); + + +支援的顏色ĺŤç¨±ćŻďĽš + + black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown + + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.backgroundColorByHexString + +ç”±ĺŤĺ…­é€˛ä˝Ťĺ­—串設置狀態ĺ—çš„čŚć™Żč‰˛ă€‚ + + StatusBar.backgroundColorByHexString("#C0C0C0"); + + +此外支援 CSS 速č¨ĺ±¬ć€§ă€‚ + + StatusBar.backgroundColorByHexString("#333"); // => #333333 + StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB + + +在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,您可以設置狀態ĺ—çš„čŚć™Żč‰˛ç”±ĺŤĺ…­é€˛ä˝Ťĺ­—串 ďĽ#RRGGBB)。 + +WP7 ĺ’Ś WP8 您還可以指定值為 #AARRGGBB,其中 AA ćŻ Alpha 值 + +## 支援的平臺 + +* iOS +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.hide + +隱藏狀態ĺ—。 + + StatusBar.hide(); + + +## 支援的平臺 + +* iOS +* 安卓系統 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.show + +顯示狀態ĺ—。 + + StatusBar.show(); + + +## 支援的平臺 + +* iOS +* 安卓系統 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 + +# StatusBar.isVisible + +讀取此屬性,以查看狀態ĺ—ćŻĺ¦ĺŹŻč¦‹ă€‚ + + if (StatusBar.isVisible) { + // do something + } + + +## 支援的平臺 + +* iOS +* 安卓系統 +* Windows Phone 7 +* Windows Phone 8 +* Windows Phone 8.1 diff --git a/plugins/cordova-plugin-statusbar/package.json b/plugins/cordova-plugin-statusbar/package.json new file mode 100644 index 0000000..4027d6c --- /dev/null +++ b/plugins/cordova-plugin-statusbar/package.json @@ -0,0 +1,48 @@ +{ + "name": "cordova-plugin-statusbar", + "version": "2.2.1", + "description": "Cordova StatusBar Plugin", + "cordova": { + "id": "cordova-plugin-statusbar", + "platforms": [ + "android", + "ios", + "wp7", + "wp8", + "windows" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/apache/cordova-plugin-statusbar" + }, + "keywords": [ + "cordova", + "statusbar", + "ecosystem:cordova", + "cordova-android", + "cordova-ios", + "cordova-wp7", + "cordova-wp8", + "cordova-windows" + ], + "scripts": { + "test": "npm run jshint", + "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests" + }, + "engines": { + "cordovaDependencies": { + "0.1.0": { + "cordova": ">=3.0.0" + }, + "3.0.0": { + "cordova": ">100" + } + } + }, + "author": "Apache Software Foundation", + "license": "Apache-2.0", + "devDependencies": { + "jshint": "^2.6.0" + } +} diff --git a/plugins/cordova-plugin-statusbar/plugin.xml b/plugins/cordova-plugin-statusbar/plugin.xml new file mode 100644 index 0000000..a84ab03 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/plugin.xml @@ -0,0 +1,99 @@ + + + + + StatusBar + Cordova StatusBar Plugin + Apache 2.0 + cordova,statusbar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/cordova-plugin-statusbar/src/android/StatusBar.java b/plugins/cordova-plugin-statusbar/src/android/StatusBar.java new file mode 100644 index 0000000..294a5db --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/android/StatusBar.java @@ -0,0 +1,167 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.cordova.statusbar; + +import android.app.Activity; +import android.graphics.Color; +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaArgs; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.LOG; +import org.apache.cordova.PluginResult; +import org.json.JSONException; + +public class StatusBar extends CordovaPlugin { + private static final String TAG = "StatusBar"; + + /** + * Sets the context of the Command. This can then be used to do things like + * get file paths associated with the Activity. + * + * @param cordova The context of the main Activity. + * @param webView The CordovaWebView Cordova is running in. + */ + @Override + public void initialize(final CordovaInterface cordova, CordovaWebView webView) { + LOG.v(TAG, "StatusBar: initialization"); + super.initialize(cordova, webView); + + this.cordova.getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially + // by the Cordova. + Window window = cordova.getActivity().getWindow(); + window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); + + // Read 'StatusBarBackgroundColor' from config.xml, default is #000000. + setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000")); + } + }); + } + + /** + * Executes the request and returns PluginResult. + * + * @param action The action to execute. + * @param args JSONArry of arguments for the plugin. + * @param callbackContext The callback id used when calling back into JavaScript. + * @return True if the action was valid, false otherwise. + */ + @Override + public boolean execute(final String action, final CordovaArgs args, final CallbackContext callbackContext) throws JSONException { + LOG.v(TAG, "Executing action: " + action); + final Activity activity = this.cordova.getActivity(); + final Window window = activity.getWindow(); + + if ("_ready".equals(action)) { + boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0; + callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible)); + return true; + } + + if ("show".equals(action)) { + this.cordova.getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + // SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we + // use KitKat here to be aligned with "Fullscreen" preference + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + int uiOptions = window.getDecorView().getSystemUiVisibility(); + uiOptions &= ~View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + uiOptions &= ~View.SYSTEM_UI_FLAG_FULLSCREEN; + + window.getDecorView().setSystemUiVisibility(uiOptions); + } + + // CB-11197 We still need to update LayoutParams to force status bar + // to be hidden when entering e.g. text fields + window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + }); + return true; + } + + if ("hide".equals(action)) { + this.cordova.getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + // SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we + // use KitKat here to be aligned with "Fullscreen" preference + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + int uiOptions = window.getDecorView().getSystemUiVisibility() + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_FULLSCREEN; + + window.getDecorView().setSystemUiVisibility(uiOptions); + } + + // CB-11197 We still need to update LayoutParams to force status bar + // to be hidden when entering e.g. text fields + window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + }); + return true; + } + + if ("backgroundColorByHexString".equals(action)) { + this.cordova.getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + try { + setStatusBarBackgroundColor(args.getString(0)); + } catch (JSONException ignore) { + LOG.e(TAG, "Invalid hexString argument, use f.i. '#777777'"); + } + } + }); + return true; + } + + return false; + } + + private void setStatusBarBackgroundColor(final String colorPref) { + if (Build.VERSION.SDK_INT >= 21) { + if (colorPref != null && !colorPref.isEmpty()) { + final Window window = cordova.getActivity().getWindow(); + // Method and constants not available on all SDKs but we want to be able to compile this code with any SDK + window.clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + window.addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + try { + // Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21 + window.getClass().getDeclaredMethod("setStatusBarColor", int.class).invoke(window, Color.parseColor(colorPref)); + } catch (IllegalArgumentException ignore) { + LOG.e(TAG, "Invalid hexString argument, use f.i. '#999999'"); + } catch (Exception ignore) { + // this should not happen, only in case Android removes this method in a version > 21 + LOG.w(TAG, "Method window.setStatusBarColor not found for SDK level " + Build.VERSION.SDK_INT); + } + } + } + } +} diff --git a/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js b/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js new file mode 100644 index 0000000..3e90c6c --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +function notSupported(win,fail) { + // + console.log('StatusBar is not supported'); + setTimeout(function(){ + win(); + // note that while it is not explicitly supported, it does not fail + // this is really just here to allow developers to test their code in the browser + // and if we fail, then their app might as well. -jm + },0); +} + +module.exports = { + isVisible: false, + styleBlackTranslucent:notSupported, + styleDefault:notSupported, + styleLightContent:notSupported, + styleBlackOpaque:notSupported, + overlaysWebView:notSupported, + styleLightContect: notSupported, + backgroundColorByName: notSupported, + backgroundColorByHexString: notSupported, + hide: notSupported, + show: notSupported, + _ready:notSupported +}; + +require("cordova/exec/proxy").add("StatusBar", module.exports); + diff --git a/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h new file mode 100644 index 0000000..84f37fa --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h @@ -0,0 +1,49 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import +#import + +@interface CDVStatusBar : CDVPlugin { + @protected + BOOL _statusBarOverlaysWebView; + UIView* _statusBarBackgroundView; + BOOL _uiviewControllerBasedStatusBarAppearance; + UIColor* _statusBarBackgroundColor; + NSString* _eventsCallbackId; +} + +@property (atomic, assign) BOOL statusBarOverlaysWebView; + +- (void) overlaysWebView:(CDVInvokedUrlCommand*)command; + +- (void) styleDefault:(CDVInvokedUrlCommand*)command; +- (void) styleLightContent:(CDVInvokedUrlCommand*)command; +- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command; +- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command; + +- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command; +- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command; + +- (void) hide:(CDVInvokedUrlCommand*)command; +- (void) show:(CDVInvokedUrlCommand*)command; + +- (void) _ready:(CDVInvokedUrlCommand*)command; + +@end diff --git a/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m new file mode 100644 index 0000000..37c6dcd --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m @@ -0,0 +1,508 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +/* + NOTE: plugman/cordova cli should have already installed this, + but you need the value UIViewControllerBasedStatusBarAppearance + in your Info.plist as well to set the styles in iOS 7 + */ + +#import "CDVStatusBar.h" +#import +#import + +static const void *kHideStatusBar = &kHideStatusBar; +static const void *kStatusBarStyle = &kStatusBarStyle; + +@interface CDVViewController (StatusBar) + +@property (nonatomic, retain) id sb_hideStatusBar; +@property (nonatomic, retain) id sb_statusBarStyle; + +@end + +@implementation CDVViewController (StatusBar) + +@dynamic sb_hideStatusBar; +@dynamic sb_statusBarStyle; + +- (id)sb_hideStatusBar { + return objc_getAssociatedObject(self, kHideStatusBar); +} + +- (void)setSb_hideStatusBar:(id)newHideStatusBar { + objc_setAssociatedObject(self, kHideStatusBar, newHideStatusBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (id)sb_statusBarStyle { + return objc_getAssociatedObject(self, kStatusBarStyle); +} + +- (void)setSb_statusBarStyle:(id)newStatusBarStyle { + objc_setAssociatedObject(self, kStatusBarStyle, newStatusBarStyle, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (BOOL) prefersStatusBarHidden { + return [self.sb_hideStatusBar boolValue]; +} + +- (UIStatusBarStyle)preferredStatusBarStyle +{ + return (UIStatusBarStyle)[self.sb_statusBarStyle intValue]; +} + +@end + + +@interface CDVStatusBar () +- (void)fireTappedEvent; +- (void)updateIsVisible:(BOOL)visible; +@end + +@implementation CDVStatusBar + +- (id)settingForKey:(NSString*)key +{ + return [self.commandDelegate.settings objectForKey:[key lowercaseString]]; +} + +- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context +{ + if ([keyPath isEqual:@"statusBarHidden"]) { + NSNumber* newValue = [change objectForKey:NSKeyValueChangeNewKey]; + [self updateIsVisible:![newValue boolValue]]; + } +} + +-(void)cordovaViewWillAppear:(NSNotification*)notification +{ + [self resizeWebView]; +} + +-(void)statusBarDidChangeFrame:(NSNotification*)notification +{ + //add a small delay for iOS 7 ( 0.1 seconds ) + __weak CDVStatusBar* weakSelf = self; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [weakSelf resizeWebView]; + }); +} + +- (void)pluginInitialize +{ + BOOL isiOS7 = (IsAtLeastiOSVersion(@"7.0")); + + // init + NSNumber* uiviewControllerBasedStatusBarAppearance = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"]; + _uiviewControllerBasedStatusBarAppearance = (uiviewControllerBasedStatusBarAppearance == nil || [uiviewControllerBasedStatusBarAppearance boolValue]) && isiOS7; + + // observe the statusBarHidden property + [[UIApplication sharedApplication] addObserver:self forKeyPath:@"statusBarHidden" options:NSKeyValueObservingOptionNew context:NULL]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarDidChangeFrame:) name: UIApplicationDidChangeStatusBarFrameNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cordovaViewWillAppear:) name: @"CDVViewWillAppearNotification" object:nil]; + + _statusBarOverlaysWebView = YES; // default + + [self initializeStatusBarBackgroundView]; + + self.viewController.view.autoresizesSubviews = YES; + + NSString* setting; + + setting = @"StatusBarBackgroundColor"; + if ([self settingForKey:setting]) { + [self _backgroundColorByHexString:[self settingForKey:setting]]; + } + + setting = @"StatusBarStyle"; + if ([self settingForKey:setting]) { + [self setStatusBarStyle:[self settingForKey:setting]]; + } + + // blank scroll view to intercept status bar taps + self.webView.scrollView.scrollsToTop = NO; + UIScrollView *fakeScrollView = [[UIScrollView alloc] initWithFrame:UIScreen.mainScreen.bounds]; + fakeScrollView.delegate = self; + fakeScrollView.scrollsToTop = YES; + [self.viewController.view addSubview:fakeScrollView]; // Add scrollview to the view heirarchy so that it will begin accepting status bar taps + [self.viewController.view sendSubviewToBack:fakeScrollView]; // Send it to the very back of the view heirarchy + fakeScrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height * 2.0f); // Make the scroll view longer than the screen itself + fakeScrollView.contentOffset = CGPointMake(0.0f, UIScreen.mainScreen.bounds.size.height); // Scroll down so a tap will take scroll view back to the top +} + +- (void)onReset { + _eventsCallbackId = nil; +} + +- (void)fireTappedEvent { + if (_eventsCallbackId == nil) { + return; + } + NSDictionary* payload = @{@"type": @"tap"}; + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:payload]; + [result setKeepCallbackAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:_eventsCallbackId]; +} + +- (void)updateIsVisible:(BOOL)visible { + if (_eventsCallbackId == nil) { + return; + } + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:visible]; + [result setKeepCallbackAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:_eventsCallbackId]; +} + +- (void) _ready:(CDVInvokedUrlCommand*)command +{ + _eventsCallbackId = command.callbackId; + [self updateIsVisible:![UIApplication sharedApplication].statusBarHidden]; + NSString* setting = @"StatusBarOverlaysWebView"; + if ([self settingForKey:setting]) { + self.statusBarOverlaysWebView = [(NSNumber*)[self settingForKey:setting] boolValue]; + if (self.statusBarOverlaysWebView) { + [self resizeWebView]; + } + } +} + +- (void) initializeStatusBarBackgroundView +{ + CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; + + if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown && + statusBarFrame.size.height + statusBarFrame.origin.y == [self.viewController.view.window bounds].size.height) { + + // When started in upside-down orientation on iOS 7, status bar will be bound to lower edge of the + // screen (statusBarFrame.origin.y will be somewhere around screen height). In this case we need to + // correct frame's coordinates + statusBarFrame.origin.y = 0; + } + + statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; + + _statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame]; + _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor; + _statusBarBackgroundView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin); + _statusBarBackgroundView.autoresizesSubviews = YES; +} + +- (CGRect) invertFrameIfNeeded:(CGRect)rect { + // landscape is where (width > height). On iOS < 8, we need to invert since frames are + // always in Portrait context. Do not run this on ios 8 or above to avoid breaking ipad pro multitask layout + if (!IsAtLeastiOSVersion(@"8.0") && UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) { + CGFloat temp = rect.size.width; + rect.size.width = rect.size.height; + rect.size.height = temp; + rect.origin = CGPointZero; + } + + return rect; +} + +- (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView +{ + // we only care about the latest iOS version or a change in setting + if (!IsAtLeastiOSVersion(@"7.0") || statusBarOverlaysWebView == _statusBarOverlaysWebView) { + return; + } + + _statusBarOverlaysWebView = statusBarOverlaysWebView; + + [self resizeWebView]; + + if (statusBarOverlaysWebView) { + + [_statusBarBackgroundView removeFromSuperview]; + + } else { + + [self initializeStatusBarBackgroundView]; + [self.webView.superview addSubview:_statusBarBackgroundView]; + + } + +} + +- (BOOL) statusBarOverlaysWebView +{ + return _statusBarOverlaysWebView; +} + +- (void) overlaysWebView:(CDVInvokedUrlCommand*)command +{ + id value = [command argumentAtIndex:0]; + if (!([value isKindOfClass:[NSNumber class]])) { + value = [NSNumber numberWithBool:YES]; + } + + self.statusBarOverlaysWebView = [value boolValue]; +} + +- (void) refreshStatusBarAppearance +{ + SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate"); + if ([self.viewController respondsToSelector:sel]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [self.viewController performSelector:sel withObject:nil]; +#pragma clang diagnostic pop + } +} + +- (void) setStyleForStatusBar:(UIStatusBarStyle)style +{ + if (_uiviewControllerBasedStatusBarAppearance) { + CDVViewController* vc = (CDVViewController*)self.viewController; + vc.sb_statusBarStyle = [NSNumber numberWithInt:style]; + [self refreshStatusBarAppearance]; + + } else { + [[UIApplication sharedApplication] setStatusBarStyle:style]; + } +} + +- (void) setStatusBarStyle:(NSString*)statusBarStyle +{ + // default, lightContent, blackTranslucent, blackOpaque + NSString* lcStatusBarStyle = [statusBarStyle lowercaseString]; + + if ([lcStatusBarStyle isEqualToString:@"default"]) { + [self styleDefault:nil]; + } else if ([lcStatusBarStyle isEqualToString:@"lightcontent"]) { + [self styleLightContent:nil]; + } else if ([lcStatusBarStyle isEqualToString:@"blacktranslucent"]) { + [self styleBlackTranslucent:nil]; + } else if ([lcStatusBarStyle isEqualToString:@"blackopaque"]) { + [self styleBlackOpaque:nil]; + } +} + +- (void) styleDefault:(CDVInvokedUrlCommand*)command +{ + [self setStyleForStatusBar:UIStatusBarStyleDefault]; +} + +- (void) styleLightContent:(CDVInvokedUrlCommand*)command +{ + [self setStyleForStatusBar:UIStatusBarStyleLightContent]; +} + +- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command +{ + #if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 + # define TRANSLUCENT_STYLE UIStatusBarStyleBlackTranslucent + #else + # define TRANSLUCENT_STYLE UIStatusBarStyleLightContent + #endif + [self setStyleForStatusBar:TRANSLUCENT_STYLE]; +} + +- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command +{ + #if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 + # define OPAQUE_STYLE UIStatusBarStyleBlackOpaque + #else + # define OPAQUE_STYLE UIStatusBarStyleLightContent + #endif + [self setStyleForStatusBar:OPAQUE_STYLE]; +} + +- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command +{ + id value = [command argumentAtIndex:0]; + if (!([value isKindOfClass:[NSString class]])) { + value = @"black"; + } + + SEL selector = NSSelectorFromString([value stringByAppendingString:@"Color"]); + if ([UIColor respondsToSelector:selector]) { + _statusBarBackgroundView.backgroundColor = [UIColor performSelector:selector]; + } +} + +- (void) _backgroundColorByHexString:(NSString*)hexString +{ + unsigned int rgbValue = 0; + NSScanner* scanner = [NSScanner scannerWithString:hexString]; + [scanner setScanLocation:1]; + [scanner scanHexInt:&rgbValue]; + + _statusBarBackgroundColor = [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0]; + _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor; +} + +- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command +{ + NSString* value = [command argumentAtIndex:0]; + if (!([value isKindOfClass:[NSString class]])) { + value = @"#000000"; + } + + if (![value hasPrefix:@"#"] || [value length] < 7) { + return; + } + + [self _backgroundColorByHexString:value]; +} + +- (void) hideStatusBar +{ + if (_uiviewControllerBasedStatusBarAppearance) { + CDVViewController* vc = (CDVViewController*)self.viewController; + vc.sb_hideStatusBar = [NSNumber numberWithBool:YES]; + [self refreshStatusBarAppearance]; + + } else { + UIApplication* app = [UIApplication sharedApplication]; + [app setStatusBarHidden:YES]; + } +} + +- (void) hide:(CDVInvokedUrlCommand*)command +{ + UIApplication* app = [UIApplication sharedApplication]; + + if (!app.isStatusBarHidden) + { + + [self hideStatusBar]; + + if (IsAtLeastiOSVersion(@"7.0")) { + [_statusBarBackgroundView removeFromSuperview]; + } + + [self resizeWebView]; + + _statusBarBackgroundView.hidden = YES; + } +} + +- (void) showStatusBar +{ + if (_uiviewControllerBasedStatusBarAppearance) { + CDVViewController* vc = (CDVViewController*)self.viewController; + vc.sb_hideStatusBar = [NSNumber numberWithBool:NO]; + [self refreshStatusBarAppearance]; + + } else { + UIApplication* app = [UIApplication sharedApplication]; + [app setStatusBarHidden:NO]; + } +} + +- (void) show:(CDVInvokedUrlCommand*)command +{ + UIApplication* app = [UIApplication sharedApplication]; + + if (app.isStatusBarHidden) + { + BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0")); + + [self showStatusBar]; + [self resizeWebView]; + + if (isIOS7) { + + if (!self.statusBarOverlaysWebView) { + + // there is a possibility that when the statusbar was hidden, it was in a different orientation + // from the current one. Therefore we need to expand the statusBarBackgroundView as well to the + // statusBar's current size + CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; + statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; + CGRect sbBgFrame = _statusBarBackgroundView.frame; + sbBgFrame.size = statusBarFrame.size; + _statusBarBackgroundView.frame = sbBgFrame; + [self.webView.superview addSubview:_statusBarBackgroundView]; + + } + + } + + _statusBarBackgroundView.hidden = NO; + } +} + +-(void)resizeWebView +{ + BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0")); + + if (isIOS7) { + CGRect bounds = [self.viewController.view.window bounds]; + bounds = [self invertFrameIfNeeded:bounds]; + + if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) { + self.viewController.view.frame = bounds; + } else if (self.viewController.presentedViewController != nil) { + // https://issues.apache.org/jira/browse/CB-11018 + BOOL isIOS8 = (IsAtLeastiOSVersion(@"8.0")); + BOOL isIOS9 = (IsAtLeastiOSVersion(@"9.0")); + if (isIOS8 && !isIOS9) { + // iOS 8 + bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height); + } else { + // iOS7, iOS9+ + if ([self.viewController.presentedViewController.presentationController isKindOfClass:[UIPopoverPresentationController class]] || UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) { + bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height); + } else { + bounds = CGRectMake(0, 0, bounds.size.height, bounds.size.width); + } + } + } + self.webView.frame = bounds; + + CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; + statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; + CGRect frame = self.webView.frame; + CGFloat height = statusBarFrame.size.height; + + if (!self.statusBarOverlaysWebView) { + // CB-10158 If a full screen video is playing the status bar height will be 0, set it to 20 + frame.origin.y = height > 0 ? height: 20; + } else { + // Even if overlay is used, we want to handle in-call/recording/hotspot larger status bar + frame.origin.y = height >= 20 ? height - 20 : 0; + } + frame.size.height -= frame.origin.y; + self.webView.frame = frame; + } else { + CGRect bounds = [[UIScreen mainScreen] applicationFrame]; + self.viewController.view.frame = bounds; + } +} + +- (void) dealloc +{ + [[UIApplication sharedApplication] removeObserver:self forKeyPath:@"statusBarHidden"]; + [[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; +} + + +#pragma mark - UIScrollViewDelegate + +- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView +{ + [self fireTappedEvent]; + return NO; +} + +@end diff --git a/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js b/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js new file mode 100644 index 0000000..3929ff0 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js @@ -0,0 +1,114 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +/* global Windows */ + +var _supported = null; // set to null so we can check first time + +function isSupported() { + // if not checked before, run check + if (_supported === null) { + var viewMan = Windows.UI.ViewManagement; + _supported = (viewMan.StatusBar && viewMan.StatusBar.getForCurrentView); + } + return _supported; +} + +function getViewStatusBar() { + if (!isSupported()) { + throw new Error("Status bar is not supported"); + } + return Windows.UI.ViewManagement.StatusBar.getForCurrentView(); +} + +function hexToRgb(hex) { + // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") + var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + hex = hex.replace(shorthandRegex, function (m, r, g, b) { + return r + r + g + g + b + b; + }); + + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null; +} + +module.exports = { + _ready: function(win, fail) { + if(isSupported()) { + var statusBar = getViewStatusBar(); + win(statusBar.occludedRect.height !== 0); + } + }, + overlaysWebView: function () { + // not supported + }, + + styleDefault: function () { + // dark text ( to be used on a light background ) + if (isSupported()) { + getViewStatusBar().foregroundColor = { a: 0, r: 0, g: 0, b: 0 }; + } + }, + + styleLightContent: function () { + // light text ( to be used on a dark background ) + if (isSupported()) { + getViewStatusBar().foregroundColor = { a: 0, r: 255, g: 255, b: 255 }; + } + }, + + styleBlackTranslucent: function () { + // #88000000 ? Apple says to use lightContent instead + return module.exports.styleLightContent(); + }, + + styleBlackOpaque: function () { + // #FF000000 ? Apple says to use lightContent instead + return module.exports.styleLightContent(); + }, + + backgroundColorByHexString: function (win, fail, args) { + var rgb = hexToRgb(args[0]); + if(isSupported()) { + var statusBar = getViewStatusBar(); + statusBar.backgroundColor = { a: 0, r: rgb.r, g: rgb.g, b: rgb.b }; + statusBar.backgroundOpacity = 1; + } + }, + + show: function (win, fail) { + // added support check so no error thrown, when calling this method + if (isSupported()) { + getViewStatusBar().showAsync().done(win, fail); + } + }, + + hide: function (win, fail) { + // added support check so no error thrown, when calling this method + if (isSupported()) { + getViewStatusBar().hideAsync().done(win, fail); + } + } +}; +require("cordova/exec/proxy").add("StatusBar", module.exports); \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs b/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs new file mode 100644 index 0000000..ec83ca8 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs @@ -0,0 +1,141 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + + +using Microsoft.Phone.Shell; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Threading; +using System.Windows; +using System.Windows.Media; +using System.Windows.Threading; + + +/* + * http://www.idev101.com/code/User_Interface/StatusBar.html + * https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html + * https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/c/econst/UIStatusBarStyleDefault + * */ + + +namespace WPCordovaClassLib.Cordova.Commands +{ + public class StatusBar : BaseCommand + { + + // returns an argb value, if the hex is only rgb, it will be full opacity + protected Color ColorFromHex(string hexString) + { + string cleanHex = hexString.Replace("#", "").Replace("0x", ""); + // turn #FFF into #FFFFFF + if (cleanHex.Length == 3) + { + cleanHex = "" + cleanHex[0] + cleanHex[0] + cleanHex[1] + cleanHex[1] + cleanHex[2] + cleanHex[2]; + } + // add an alpha 100% if it is missing + if (cleanHex.Length == 6) + { + cleanHex = "FF" + cleanHex; + } + int argb = Int32.Parse(cleanHex, NumberStyles.HexNumber); + Color clr = Color.FromArgb((byte)((argb & 0xff000000) >> 0x18), + (byte)((argb & 0xff0000) >> 0x10), + (byte)((argb & 0xff00) >> 8), + (byte)(argb & 0xff)); + return clr; + } + + public void _ready(string options) + { + Deployment.Current.Dispatcher.BeginInvoke(() => + { + bool isVis = SystemTray.IsVisible; + // TODO: pass this to JS + //Debug.WriteLine("Result::" + res); + DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isVis)); + }); + } + + public void overlaysWebView(string options) + { //exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]); + // string arg = JSON.JsonHelper.Deserialize(options)[0]; + } + + public void styleDefault(string options) + { //exec(null, null, "StatusBar", "styleDefault", []); + Deployment.Current.Dispatcher.BeginInvoke(() => + { + SystemTray.ForegroundColor = Colors.Black; + }); + } + + public void styleLightContent(string options) + { //exec(null, null, "StatusBar", "styleLightContent", []); + + Deployment.Current.Dispatcher.BeginInvoke(() => + { + SystemTray.ForegroundColor = Colors.White; + }); + } + + public void styleBlackTranslucent(string options) + { //exec(null, null, "StatusBar", "styleBlackTranslucent", []); + styleLightContent(options); + } + + public void styleBlackOpaque(string options) + { //exec(null, null, "StatusBar", "styleBlackOpaque", []); + styleLightContent(options); + } + + public void backgroundColorByName(string options) + { //exec(null, null, "StatusBar", "backgroundColorByName", [colorname]); + // this should NOT be called, js should now be using/converting color names to hex + } + + public void backgroundColorByHexString(string options) + { //exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]); + string argb = JSON.JsonHelper.Deserialize(options)[0]; + + Color clr = ColorFromHex(argb); + + Deployment.Current.Dispatcher.BeginInvoke(() => + { + SystemTray.Opacity = clr.A / 255.0d; + SystemTray.BackgroundColor = clr; + + }); + } + + public void hide(string options) + { //exec(null, null, "StatusBar", "hide", []); + Deployment.Current.Dispatcher.BeginInvoke(() => + { + SystemTray.IsVisible = false; + }); + + } + + public void show(string options) + { //exec(null, null, "StatusBar", "show", []); + Deployment.Current.Dispatcher.BeginInvoke(() => + { + SystemTray.IsVisible = true; + }); + } + } +} \ No newline at end of file diff --git a/plugins/cordova-plugin-statusbar/tests/plugin.xml b/plugins/cordova-plugin-statusbar/tests/plugin.xml new file mode 100644 index 0000000..34b1bc1 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/tests/plugin.xml @@ -0,0 +1,31 @@ + + + + + Cordova StatusBar Plugin Tests + Apache 2.0 + + + + diff --git a/plugins/cordova-plugin-statusbar/tests/tests.js b/plugins/cordova-plugin-statusbar/tests/tests.js new file mode 100644 index 0000000..5a8fe39 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/tests/tests.js @@ -0,0 +1,151 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ +/* global StatusBar */ + +exports.defineAutoTests = function () { + describe("StatusBar", function () { + it("statusbar.spec.1 should exist", function() { + expect(window.StatusBar).toBeDefined(); + }); + + it("statusbar.spec.2 should have show|hide methods", function() { + expect(window.StatusBar.show).toBeDefined(); + expect(typeof window.StatusBar.show).toBe("function"); + + expect(window.StatusBar.hide).toBeDefined(); + expect(typeof window.StatusBar.hide).toBe("function"); + }); + + it("statusbar.spec.3 should have set backgroundColor methods", function() { + expect(window.StatusBar.backgroundColorByName).toBeDefined(); + expect(typeof window.StatusBar.backgroundColorByName).toBe("function"); + + expect(window.StatusBar.backgroundColorByHexString).toBeDefined(); + expect(typeof window.StatusBar.backgroundColorByHexString).toBe("function"); + }); + + it("statusbar.spec.4 should have set style methods", function() { + expect(window.StatusBar.styleBlackTranslucent).toBeDefined(); + expect(typeof window.StatusBar.styleBlackTranslucent).toBe("function"); + + expect(window.StatusBar.styleDefault).toBeDefined(); + expect(typeof window.StatusBar.styleDefault).toBe("function"); + + expect(window.StatusBar.styleLightContent).toBeDefined(); + expect(typeof window.StatusBar.styleLightContent).toBe("function"); + + expect(window.StatusBar.styleBlackOpaque).toBeDefined(); + expect(typeof window.StatusBar.styleBlackOpaque).toBe("function"); + + expect(window.StatusBar.overlaysWebView).toBeDefined(); + expect(typeof window.StatusBar.overlaysWebView).toBe("function"); + }); + }); +}; + +exports.defineManualTests = function (contentEl, createActionButton) { + function log(msg) { + var el = document.getElementById("info"); + var logLine = document.createElement('div'); + logLine.innerHTML = msg; + el.appendChild(logLine); + } + + function doShow() { + StatusBar.show(); + log('StatusBar.isVisible=' + StatusBar.isVisible); + } + + function doHide() { + StatusBar.hide(); + log('StatusBar.isVisible=' + StatusBar.isVisible); + } + + function doColor1() { + log('set color=red'); + StatusBar.backgroundColorByName('red'); + } + + function doColor2() { + log('set style=translucent black'); + StatusBar.styleBlackTranslucent(); + } + + function doColor3() { + log('set style=default'); + StatusBar.styleDefault(); + } + + var showOverlay = true; + function doOverlay() { + showOverlay = !showOverlay; + StatusBar.overlaysWebView(showOverlay); + log('Set overlay=' + showOverlay); + } + + /******************************************************************************/ + + contentEl.innerHTML = '
' + + 'Also: tapping bar on iOS should emit a log.' + + '
' + + 'Expected result: Status bar will be visible' + + '

' + + 'Expected result: Status bar will be hidden' + + '

' + + 'Expected result: Status bar text will be a light (white) color' + + '

' + + 'Expected result: Status bar text will be a dark (black) color' + + '

' + + 'Expected result:
Overlay true = status bar will lay on top of web view content
Overlay false = status bar will be separate from web view and will not cover content' + + '

' + + 'Expected result: If overlay false, background color for status bar will be red'; + + log('StatusBar.isVisible=' + StatusBar.isVisible); + window.addEventListener('statusTap', function () { + log('tap!'); + }, false); + + createActionButton("Show", function () { + doShow(); + }, 'action-show'); + + createActionButton("Hide", function () { + doHide(); + }, 'action-hide'); + + createActionButton("Style=red (background)", function () { + doColor1(); + }, 'action-color1'); + + createActionButton("Style=translucent black", function () { + doColor2(); + }, 'action-color2'); + + createActionButton("Style=default", function () { + doColor3(); + }, 'action-color3'); + + createActionButton("Toggle Overlays", function () { + doOverlay(); + }, 'action-overlays'); +}; diff --git a/plugins/cordova-plugin-statusbar/www/statusbar.js b/plugins/cordova-plugin-statusbar/www/statusbar.js new file mode 100644 index 0000000..d9d0ea5 --- /dev/null +++ b/plugins/cordova-plugin-statusbar/www/statusbar.js @@ -0,0 +1,113 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* global cordova */ + +var exec = require('cordova/exec'); + +var namedColors = { + "black": "#000000", + "darkGray": "#A9A9A9", + "lightGray": "#D3D3D3", + "white": "#FFFFFF", + "gray": "#808080", + "red": "#FF0000", + "green": "#00FF00", + "blue": "#0000FF", + "cyan": "#00FFFF", + "yellow": "#FFFF00", + "magenta": "#FF00FF", + "orange": "#FFA500", + "purple": "#800080", + "brown": "#A52A2A" +}; + +var StatusBar = { + + isVisible: true, + + overlaysWebView: function (doOverlay) { + exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]); + }, + + styleDefault: function () { + // dark text ( to be used on a light background ) + exec(null, null, "StatusBar", "styleDefault", []); + }, + + styleLightContent: function () { + // light text ( to be used on a dark background ) + exec(null, null, "StatusBar", "styleLightContent", []); + }, + + styleBlackTranslucent: function () { + // #88000000 ? Apple says to use lightContent instead + exec(null, null, "StatusBar", "styleBlackTranslucent", []); + }, + + styleBlackOpaque: function () { + // #FF000000 ? Apple says to use lightContent instead + exec(null, null, "StatusBar", "styleBlackOpaque", []); + }, + + backgroundColorByName: function (colorname) { + return StatusBar.backgroundColorByHexString(namedColors[colorname]); + }, + + backgroundColorByHexString: function (hexString) { + if (hexString.charAt(0) !== "#") { + hexString = "#" + hexString; + } + + if (hexString.length === 4) { + var split = hexString.split(""); + hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3]; + } + + exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]); + }, + + hide: function () { + exec(null, null, "StatusBar", "hide", []); + StatusBar.isVisible = false; + }, + + show: function () { + exec(null, null, "StatusBar", "show", []); + StatusBar.isVisible = true; + } + +}; + +// prime it. setTimeout so that proxy gets time to init +window.setTimeout(function () { + exec(function (res) { + if (typeof res == 'object') { + if (res.type == 'tap') { + cordova.fireWindowEvent('statusTap'); + } + } else { + StatusBar.isVisible = res; + } + }, null, "StatusBar", "_ready", []); +}, 0); + +module.exports = StatusBar; diff --git a/plugins/cordova-plugin-whitelist/CONTRIBUTING.md b/plugins/cordova-plugin-whitelist/CONTRIBUTING.md new file mode 100644 index 0000000..7de4c64 --- /dev/null +++ b/plugins/cordova-plugin-whitelist/CONTRIBUTING.md @@ -0,0 +1,37 @@ + + +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/contribute/). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/plugins/cordova-plugin-whitelist/LICENSE b/plugins/cordova-plugin-whitelist/LICENSE new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/plugins/cordova-plugin-whitelist/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/plugins/cordova-plugin-whitelist/NOTICE b/plugins/cordova-plugin-whitelist/NOTICE new file mode 100644 index 0000000..8ec56a5 --- /dev/null +++ b/plugins/cordova-plugin-whitelist/NOTICE @@ -0,0 +1,5 @@ +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/plugins/cordova-plugin-whitelist/README.md b/plugins/cordova-plugin-whitelist/README.md new file mode 100644 index 0000000..e19d230 --- /dev/null +++ b/plugins/cordova-plugin-whitelist/README.md @@ -0,0 +1,163 @@ +--- +title: Whitelist +description: Whitelist external content accessible by your app. +--- + + +# cordova-plugin-whitelist + +This plugin implements a whitelist policy for navigating the application webview on Cordova 4.0 + +:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Whitelist%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC) + +## Installation + +You can install whitelist plugin with Cordova CLI, from npm: + +``` +$ cordova plugin add cordova-plugin-whitelist +$ cordova prepare +``` + +## Supported Cordova Platforms + +* Android 4.0.0 or above + +## Navigation Whitelist +Controls which URLs the WebView itself can be navigated to. Applies to +top-level navigations only. + +Quirks: on Android it also applies to iframes for non-http(s) schemes. + +By default, navigations only to `file://` URLs, are allowed. To allow others URLs, you must add `` tags to your `config.xml`: + + + + + + + + + + + + + + + +## Intent Whitelist +Controls which URLs the app is allowed to ask the system to open. +By default, no external URLs are allowed. + +On Android, this equates to sending an intent of type BROWSEABLE. + +This whitelist does not apply to plugins, only hyperlinks and calls to `window.open()`. + +In `config.xml`, add `` tags, like this: + + + + + + + + + + + + + + + + + + + + + + + +## Network Request Whitelist +Controls which network requests (images, XHRs, etc) are allowed to be made (via cordova native hooks). + +Note: We suggest you use a Content Security Policy (see below), which is more secure. This whitelist is mostly historical for webviews which do not support CSP. + +In `config.xml`, add `` tags, like this: + + + + + + + + + + + + + + + + + +Without any `` tags, only requests to `file://` URLs are allowed. However, the default Cordova application includes `` by default. + + +Note: Whitelist cannot block network redirects from a whitelisted remote website (i.e. http or https) to a non-whitelisted website. Use CSP rules to mitigate redirects to non-whitelisted websites for webviews that support CSP. + +Quirk: Android also allows requests to https://ssl.gstatic.com/accessibility/javascript/android/ by default, since this is required for TalkBack to function properly. + +### Content Security Policy +Controls which network requests (images, XHRs, etc) are allowed to be made (via webview directly). + +On Android and iOS, the network request whitelist (see above) is not able to filter all types of requests (e.g. `