├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── example ├── bower.json ├── config.xml ├── gulpfile.js ├── hooks │ ├── README.md │ └── after_prepare │ │ └── 010_add_platform_class.js ├── ionic.project ├── package.json ├── plugins │ ├── com.ionic.keyboard │ │ ├── .fetch.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── package.json │ │ ├── plugin.xml │ │ ├── src │ │ │ ├── android │ │ │ │ └── IonicKeyboard.java │ │ │ └── ios │ │ │ │ ├── IonicKeyboard.h │ │ │ │ ├── IonicKeyboard.m │ │ │ │ ├── UIWebViewExtension.h │ │ │ │ └── UIWebViewExtension.m │ │ └── www │ │ │ └── keyboard.js │ ├── org.apache.cordova.console │ │ ├── .fetch.json │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── RELEASENOTES.md │ │ ├── doc │ │ │ ├── de │ │ │ │ └── index.md │ │ │ ├── es │ │ │ │ └── index.md │ │ │ ├── fr │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ ├── it │ │ │ │ └── index.md │ │ │ ├── ja │ │ │ │ └── index.md │ │ │ ├── ko │ │ │ │ └── index.md │ │ │ ├── pl │ │ │ │ └── index.md │ │ │ ├── ru │ │ │ │ └── index.md │ │ │ └── zh │ │ │ │ └── index.md │ │ ├── package.json │ │ ├── plugin.xml │ │ ├── src │ │ │ ├── ios │ │ │ │ ├── CDVLogger.h │ │ │ │ └── CDVLogger.m │ │ │ ├── ubuntu │ │ │ │ ├── console.cpp │ │ │ │ └── console.h │ │ │ └── wp │ │ │ │ └── DebugConsole.cs │ │ └── www │ │ │ ├── console-via-logger.js │ │ │ └── logger.js │ └── org.apache.cordova.device │ │ ├── .fetch.json │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── RELEASENOTES.md │ │ ├── doc │ │ ├── de │ │ │ └── index.md │ │ ├── es │ │ │ └── index.md │ │ ├── fr │ │ │ └── index.md │ │ ├── index.md │ │ ├── it │ │ │ └── index.md │ │ ├── ja │ │ │ └── index.md │ │ ├── ko │ │ │ └── index.md │ │ ├── pl │ │ │ └── index.md │ │ ├── ru │ │ │ └── index.md │ │ └── zh │ │ │ └── index.md │ │ ├── package.json │ │ ├── plugin.xml │ │ ├── src │ │ ├── android │ │ │ └── Device.java │ │ ├── blackberry10 │ │ │ └── index.js │ │ ├── browser │ │ │ └── DeviceProxy.js │ │ ├── firefoxos │ │ │ └── DeviceProxy.js │ │ ├── ios │ │ │ ├── CDVDevice.h │ │ │ └── CDVDevice.m │ │ ├── tizen │ │ │ └── DeviceProxy.js │ │ ├── ubuntu │ │ │ ├── device.cpp │ │ │ ├── device.h │ │ │ └── device.js │ │ ├── windows │ │ │ └── DeviceProxy.js │ │ ├── windows8 │ │ │ └── DeviceProxy.js │ │ └── wp │ │ │ └── Device.cs │ │ ├── tests │ │ ├── plugin.xml │ │ └── tests.js │ │ └── www │ │ └── device.js ├── scss │ └── ionic.app.scss └── www │ ├── css │ └── style.css │ ├── img │ ├── ionic.png │ ├── pic.png │ ├── pic2.png │ ├── pic3.png │ └── pic4.png │ ├── index.html │ ├── js │ ├── app.js │ └── ionic.swipecards.js │ └── lib │ └── ionic │ ├── css │ ├── ionic.css │ └── ionic.min.css │ ├── fonts │ ├── ionicons.eot │ ├── ionicons.svg │ ├── ionicons.ttf │ └── ionicons.woff │ ├── js │ ├── angular-ui │ │ ├── angular-ui-router.js │ │ └── angular-ui-router.min.js │ ├── angular │ │ ├── angular-animate.js │ │ ├── angular-animate.min.js │ │ ├── angular-resource.js │ │ ├── angular-resource.min.js │ │ ├── angular-sanitize.js │ │ ├── angular-sanitize.min.js │ │ ├── angular.js │ │ └── angular.min.js │ ├── ionic-angular.js │ ├── ionic-angular.min.js │ ├── ionic.bundle.js │ ├── ionic.bundle.min.js │ ├── ionic.js │ └── ionic.min.js │ ├── scss │ ├── _action-sheet.scss │ ├── _animations.scss │ ├── _backdrop.scss │ ├── _badge.scss │ ├── _bar.scss │ ├── _button-bar.scss │ ├── _button.scss │ ├── _checkbox.scss │ ├── _form.scss │ ├── _grid.scss │ ├── _items.scss │ ├── _list.scss │ ├── _loading.scss │ ├── _menu.scss │ ├── _mixins.scss │ ├── _modal.scss │ ├── _platform.scss │ ├── _popover.scss │ ├── _popup.scss │ ├── _progress.scss │ ├── _radio.scss │ ├── _range.scss │ ├── _reset.scss │ ├── _scaffolding.scss │ ├── _select.scss │ ├── _slide-box.scss │ ├── _tabs.scss │ ├── _toggle.scss │ ├── _type.scss │ ├── _util.scss │ ├── _variables.scss │ ├── ionic.scss │ └── ionicons │ │ ├── _ionicons-animation.scss │ │ ├── _ionicons-font.scss │ │ ├── _ionicons-icons.scss │ │ ├── _ionicons-variables.scss │ │ └── ionicons.scss │ └── version.json └── ionic.swipecards.js /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .*.sw* 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Drifty 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ionic Contrib: Swipeable Cards 2 | =================== 3 | 4 | Swipeable card based layout for Ionic and Angular. As seen in apps like [Jelly](http://jelly.co/) 5 | 6 | [Demo](http://ionicframework.com/demos/swipe-cards/) 7 | 8 | ## Usage 9 | 10 | Include `ionic.swipecards.js` after the rest of your Ionic and Angular includes. Then use the following AngularJS directives: 11 | 12 | ```html 13 | 14 | 15 | Card content here 16 | 17 | 18 | ``` 19 | 20 | To add new cards dynamically, just add them to the cards array: 21 | 22 | ```javascript 23 | $scope.cards = [ 24 | { // card 1 }, 25 | { // card 2 } 26 | ]; 27 | 28 | $scope.cardDestroyed = function(index) { 29 | $scope.cards.splice(index, 1); 30 | }; 31 | 32 | $scope.cardSwiped = function(index) { 33 | var newCard = // new card data 34 | $scope.cards.push(newCard); 35 | }; 36 | ``` 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-ion-swipe-cards", 3 | "version": "1.0.0", 4 | "homepage": "https://github.com/driftyco/ionic-ion-swipe-cards", 5 | "authors": [ 6 | "Max Lynch " 7 | ], 8 | "description": "Swipeable cards ala the Jelly app", 9 | "main": [ 10 | "ionic.swipecards.js" 11 | ], 12 | "keywords": [ 13 | "mobile", 14 | "html5", 15 | "ionic" 16 | ], 17 | "license": "MIT", 18 | "private": false 19 | } 20 | -------------------------------------------------------------------------------- /example/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tmp", 3 | "private": "true", 4 | "devDependencies": { 5 | "ionic": "driftyco/ionic-bower#1.0.0-beta.13" 6 | } 7 | } -------------------------------------------------------------------------------- /example/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tmp 4 | 5 | An Ionic Framework and Cordova project. 6 | 7 | 8 | Ionic Framework Team 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var gutil = require('gulp-util'); 3 | var bower = require('bower'); 4 | var concat = require('gulp-concat'); 5 | var sass = require('gulp-sass'); 6 | var minifyCss = require('gulp-minify-css'); 7 | var rename = require('gulp-rename'); 8 | var sh = require('shelljs'); 9 | 10 | var paths = { 11 | sass: ['./scss/**/*.scss'] 12 | }; 13 | 14 | gulp.task('default', ['sass']); 15 | 16 | gulp.task('sass', function(done) { 17 | gulp.src('./scss/ionic.app.scss') 18 | .pipe(sass()) 19 | .pipe(gulp.dest('./www/css/')) 20 | .pipe(minifyCss({ 21 | keepSpecialComments: 0 22 | })) 23 | .pipe(rename({ extname: '.min.css' })) 24 | .pipe(gulp.dest('./www/css/')) 25 | .on('end', done); 26 | }); 27 | 28 | gulp.task('watch', function() { 29 | gulp.watch(paths.sass, ['sass']); 30 | }); 31 | 32 | gulp.task('install', ['git-check'], function() { 33 | return bower.commands.install() 34 | .on('log', function(data) { 35 | gutil.log('bower', gutil.colors.cyan(data.id), data.message); 36 | }); 37 | }); 38 | 39 | gulp.task('git-check', function(done) { 40 | if (!sh.which('git')) { 41 | console.log( 42 | ' ' + gutil.colors.red('Git is not installed.'), 43 | '\n Git, the version control system, is required to download Ionic.', 44 | '\n Download git here:', gutil.colors.cyan('http://git-scm.com/downloads') + '.', 45 | '\n Once git is installed, run \'' + gutil.colors.cyan('gulp install') + '\' again.' 46 | ); 47 | process.exit(1); 48 | } 49 | done(); 50 | }); 51 | -------------------------------------------------------------------------------- /example/hooks/README.md: -------------------------------------------------------------------------------- 1 | 21 | # Cordova Hooks 22 | 23 | This directory may contain scripts used to customize cordova commands. This 24 | directory used to exist at `.cordova/hooks`, but has now been moved to the 25 | project root. Any scripts you add to these directories will be executed before 26 | and after the commands corresponding to the directory name. Useful for 27 | integrating your own build systems or integrating with version control systems. 28 | 29 | __Remember__: Make your scripts executable. 30 | 31 | ## Hook Directories 32 | The following subdirectories will be used for hooks: 33 | 34 | after_build/ 35 | after_compile/ 36 | after_docs/ 37 | after_emulate/ 38 | after_platform_add/ 39 | after_platform_rm/ 40 | after_platform_ls/ 41 | after_plugin_add/ 42 | after_plugin_ls/ 43 | after_plugin_rm/ 44 | after_plugin_search/ 45 | after_prepare/ 46 | after_run/ 47 | after_serve/ 48 | before_build/ 49 | before_compile/ 50 | before_docs/ 51 | before_emulate/ 52 | before_platform_add/ 53 | before_platform_rm/ 54 | before_platform_ls/ 55 | before_plugin_add/ 56 | before_plugin_ls/ 57 | before_plugin_rm/ 58 | before_plugin_search/ 59 | before_prepare/ 60 | before_run/ 61 | before_serve/ 62 | pre_package/ <-- Windows 8 and Windows Phone only. 63 | 64 | ## Script Interface 65 | 66 | All scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables: 67 | 68 | * CORDOVA_VERSION - The version of the Cordova-CLI. 69 | * CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios). 70 | * CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer) 71 | * CORDOVA_HOOK - Path to the hook that is being executed. 72 | * CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate) 73 | 74 | If a script returns a non-zero exit code, then the parent cordova command will be aborted. 75 | 76 | 77 | ## Writing hooks 78 | 79 | We highly recommend writting your hooks using Node.js so that they are 80 | cross-platform. Some good examples are shown here: 81 | 82 | [http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) 83 | 84 | -------------------------------------------------------------------------------- /example/hooks/after_prepare/010_add_platform_class.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Add Platform Class 4 | // v1.0 5 | // Automatically adds the platform class to the body tag 6 | // after the `prepare` command. By placing the platform CSS classes 7 | // directly in the HTML built for the platform, it speeds up 8 | // rendering the correct layout/style for the specific platform 9 | // instead of waiting for the JS to figure out the correct classes. 10 | 11 | var fs = require('fs'); 12 | var path = require('path'); 13 | 14 | var rootdir = process.argv[2]; 15 | 16 | function addPlatformBodyTag(indexPath, platform) { 17 | // add the platform class to the body tag 18 | try { 19 | var platformClass = 'platform-' + platform; 20 | var cordovaClass = 'platform-cordova platform-webview'; 21 | 22 | var html = fs.readFileSync(indexPath, 'utf8'); 23 | 24 | var bodyTag = findBodyTag(html); 25 | if(!bodyTag) return; // no opening body tag, something's wrong 26 | 27 | if(bodyTag.indexOf(platformClass) > -1) return; // already added 28 | 29 | var newBodyTag = bodyTag; 30 | 31 | var classAttr = findClassAttr(bodyTag); 32 | if(classAttr) { 33 | // body tag has existing class attribute, add the classname 34 | var endingQuote = classAttr.substring(classAttr.length-1); 35 | var newClassAttr = classAttr.substring(0, classAttr.length-1); 36 | newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote; 37 | newBodyTag = bodyTag.replace(classAttr, newClassAttr); 38 | 39 | } else { 40 | // add class attribute to the body tag 41 | newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">'); 42 | } 43 | 44 | html = html.replace(bodyTag, newBodyTag); 45 | 46 | fs.writeFileSync(indexPath, html, 'utf8'); 47 | 48 | process.stdout.write('add to body class: ' + platformClass + '\n'); 49 | } catch(e) { 50 | process.stdout.write(e); 51 | } 52 | } 53 | 54 | function findBodyTag(html) { 55 | // get the body tag 56 | try{ 57 | return html.match(/])(.*?)>/gi)[0]; 58 | }catch(e){} 59 | } 60 | 61 | function findClassAttr(bodyTag) { 62 | // get the body tag's class attribute 63 | try{ 64 | return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0]; 65 | }catch(e){} 66 | } 67 | 68 | if (rootdir) { 69 | 70 | // go through each of the platform directories that have been prepared 71 | var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); 72 | 73 | for(var x=0; x 36 | 37 | 38 | 39 | 40 | Keyboard.hideKeyboardAccessoryBar 41 | ================= 42 | 43 | Hide the keyboard accessory bar with the next, previous and done buttons. 44 | 45 | cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 46 | cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false); 47 | 48 | Supported Platforms 49 | ------------------- 50 | 51 | - iOS 52 | 53 | 54 | Keyboard.close 55 | ================= 56 | 57 | Close the keyboard if it is open. 58 | 59 | cordova.plugins.Keyboard.close(); 60 | 61 | Supported Platforms 62 | ------------------- 63 | 64 | - iOS, Android 65 | 66 | 67 | Keyboard.disableScroll 68 | ================= 69 | 70 | Disable native scrolling, useful if you are using JavaScript to scroll 71 | 72 | cordova.plugins.Keyboard.disableScroll(true); 73 | cordova.plugins.Keyboard.disableScroll(false); 74 | 75 | Supported Platforms 76 | ------------------- 77 | 78 | - iOS 79 | 80 | Keyboard.show 81 | ================= 82 | 83 | Force keyboard to be shown on Android. This typically helps if autofocus on a text element does not pop up the keyboard automatically 84 | 85 | cordova.plugins.Keyboard.show(); 86 | 87 | Supported Platforms 88 | 89 | - Android 90 | 91 | native.keyboardshow 92 | ================= 93 | 94 | This event fires when the keyboard will be shown 95 | 96 | window.addEventListener('native.keyboardshow', keyboardShowHandler); 97 | 98 | function keyboardShowHandler(e){ 99 | alert('Keyboard height is: ' + e.keyboardHeight); 100 | } 101 | 102 | Properties 103 | ----------- 104 | 105 | keyboardHeight: the height of the keyboard in pixels 106 | 107 | 108 | Supported Platforms 109 | ------------------- 110 | 111 | - iOS, Android 112 | 113 | 114 | native.keyboardhide 115 | ================= 116 | 117 | This event fires when the keyboard will hide 118 | 119 | window.addEventListener('native.keyboardhide', keyboardHideHandler); 120 | 121 | function keyboardHideHandler(e){ 122 | alert('Goodnight, sweet prince'); 123 | } 124 | 125 | Properties 126 | ----------- 127 | 128 | None 129 | 130 | Supported Platforms 131 | ------------------- 132 | 133 | - iOS, Android 134 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.3", 3 | "name": "com.ionic.keyboard", 4 | "cordova_name": "Keyboard", 5 | "description": "Ionic Keyboard Plugin", 6 | "license": "Apache 2.0", 7 | "repo": "https://github.com/driftyco/ionic-plugins-keyboard.git", 8 | "issue": "https://github.com/driftyco/ionic-plugins-keyboard/issues", 9 | "keywords": [ 10 | "Ionic", 11 | "keyboard" 12 | ], 13 | "platforms": [ 14 | "android", 15 | "ios" 16 | ], 17 | "engines": [] 18 | } -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Keyboard 7 | Ionic Keyboard Plugin 8 | Apache 2.0 9 | Ionic,keyboard 10 | https://github.com/driftyco/ionic-plugins-keyboard.git 11 | https://github.com/driftyco/ionic-plugins-keyboard/issues 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/src/android/IonicKeyboard.java: -------------------------------------------------------------------------------- 1 | package com.ionic.keyboard; 2 | 3 | import org.apache.cordova.CallbackContext; 4 | import org.apache.cordova.CordovaInterface; 5 | import org.apache.cordova.CordovaPlugin; 6 | import org.apache.cordova.CordovaWebView; 7 | import org.apache.cordova.PluginResult.Status; 8 | import org.json.JSONArray; 9 | import org.json.JSONException; 10 | 11 | import android.content.Context; 12 | import android.graphics.Rect; 13 | import android.util.DisplayMetrics; 14 | import android.view.View; 15 | import android.view.ViewTreeObserver.OnGlobalLayoutListener; 16 | import android.view.inputmethod.InputMethodManager; 17 | 18 | public class IonicKeyboard extends CordovaPlugin{ 19 | 20 | public void initialize(CordovaInterface cordova, CordovaWebView webView) { 21 | super.initialize(cordova, webView); 22 | 23 | //calculate density-independent pixels (dp) 24 | //http://developer.android.com/guide/practices/screens_support.html 25 | DisplayMetrics dm = new DisplayMetrics(); 26 | cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); 27 | final float density = dm.density; 28 | 29 | final CordovaWebView appView = webView; 30 | 31 | //http://stackoverflow.com/a/4737265/1091751 detect if keyboard is showing 32 | final View rootView = cordova.getActivity().getWindow().getDecorView().findViewById(android.R.id.content).getRootView(); 33 | OnGlobalLayoutListener list = new OnGlobalLayoutListener() { 34 | int previousHeightDiff = 0; 35 | @Override 36 | public void onGlobalLayout() { 37 | Rect r = new Rect(); 38 | //r will be populated with the coordinates of your view that area still visible. 39 | rootView.getWindowVisibleDisplayFrame(r); 40 | 41 | int heightDiff = rootView.getRootView().getHeight() - (r.bottom - r.top); 42 | int pixelHeightDiff = (int)(heightDiff / density); 43 | if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard... 44 | appView.sendJavascript("cordova.plugins.Keyboard.isVisible = true"); 45 | appView.sendJavascript("cordova.fireWindowEvent('native.keyboardshow', { 'keyboardHeight':" + Integer.toString(pixelHeightDiff)+"});"); 46 | 47 | //deprecated 48 | appView.sendJavascript("cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight':" + Integer.toString(pixelHeightDiff)+"});"); 49 | } 50 | else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelHeightDiff ) > 100 ){ 51 | appView.sendJavascript("cordova.plugins.Keyboard.isVisible = false"); 52 | appView.sendJavascript("cordova.fireWindowEvent('native.keyboardhide')"); 53 | 54 | //deprecated 55 | appView.sendJavascript("cordova.fireWindowEvent('native.hidekeyboard')"); 56 | } 57 | previousHeightDiff = pixelHeightDiff; 58 | } 59 | }; 60 | 61 | rootView.getViewTreeObserver().addOnGlobalLayoutListener(list); 62 | } 63 | 64 | public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { 65 | if ("close".equals(action)) { 66 | cordova.getThreadPool().execute(new Runnable() { 67 | public void run() { 68 | //http://stackoverflow.com/a/7696791/1091751 69 | InputMethodManager inputManager = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); 70 | View v = cordova.getActivity().getCurrentFocus(); 71 | 72 | if (v == null) { 73 | callbackContext.error("No current focus"); 74 | } 75 | inputManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); 76 | callbackContext.success(); // Thread-safe. 77 | } 78 | }); 79 | return true; 80 | } 81 | if ("show".equals(action)) { 82 | cordova.getThreadPool().execute(new Runnable() { 83 | public void run() { 84 | ((InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY); 85 | callbackContext.success(); // Thread-safe. 86 | } 87 | }); 88 | return true; 89 | } 90 | return false; // Returning false results in a "MethodNotFound" error. 91 | } 92 | 93 | 94 | } 95 | 96 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/src/ios/IonicKeyboard.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface IonicKeyboard : CDVPlugin { 4 | @protected 5 | id _keyboardShowObserver, _keyboardHideObserver; 6 | } 7 | 8 | @property (readwrite, assign) BOOL hideKeyboardAccessoryBar; 9 | @property (readwrite, assign) BOOL disableScroll; 10 | //@property (readwrite, assign) BOOL styleDark; 11 | 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/src/ios/IonicKeyboard.m: -------------------------------------------------------------------------------- 1 | #import "IonicKeyboard.h" 2 | #import "UIWebViewExtension.h" 3 | #import 4 | 5 | @implementation IonicKeyboard 6 | 7 | @synthesize hideKeyboardAccessoryBar = _hideKeyboardAccessoryBar; 8 | @synthesize disableScroll = _disableScroll; 9 | //@synthesize styleDark = _styleDark; 10 | 11 | - (void)pluginInitialize { 12 | 13 | NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; 14 | __weak IonicKeyboard* weakSelf = self; 15 | 16 | //set defaults 17 | self.hideKeyboardAccessoryBar = NO; 18 | self.disableScroll = NO; 19 | //self.styleDark = NO; 20 | 21 | _keyboardShowObserver = [nc addObserverForName:UIKeyboardWillShowNotification 22 | object:nil 23 | queue:[NSOperationQueue mainQueue] 24 | usingBlock:^(NSNotification* notification) { 25 | 26 | CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 27 | keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil]; 28 | 29 | [weakSelf.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.plugins.Keyboard.isVisible = true; cordova.fireWindowEvent('native.keyboardshow', { 'keyboardHeight': %@ }); ", [@(keyboardFrame.size.height) stringValue]]]; 30 | 31 | //deprecated 32 | [weakSelf.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight': %@ }); ", [@(keyboardFrame.size.height) stringValue]]]; 33 | }]; 34 | 35 | _keyboardHideObserver = [nc addObserverForName:UIKeyboardWillHideNotification 36 | object:nil 37 | queue:[NSOperationQueue mainQueue] 38 | usingBlock:^(NSNotification* notification) { 39 | [weakSelf.commandDelegate evalJs:@"cordova.plugins.Keyboard.isVisible = false; cordova.fireWindowEvent('native.keyboardhide'); "]; 40 | 41 | //deprecated 42 | [weakSelf.commandDelegate evalJs:@"cordova.fireWindowEvent('native.hidekeyboard'); "]; 43 | }]; 44 | } 45 | - (BOOL)disableScroll { 46 | return _disableScroll; 47 | } 48 | 49 | - (void)setDisableScroll:(BOOL)disableScroll { 50 | if (disableScroll == _disableScroll) { 51 | return; 52 | } 53 | if (disableScroll) { 54 | self.webView.scrollView.scrollEnabled = NO; 55 | self.webView.scrollView.delegate = self; 56 | } 57 | else { 58 | self.webView.scrollView.scrollEnabled = YES; 59 | self.webView.scrollView.delegate = nil; 60 | } 61 | 62 | _disableScroll = disableScroll; 63 | } 64 | 65 | 66 | - (BOOL)hideKeyboardAccessoryBar { 67 | return _hideKeyboardAccessoryBar; 68 | } 69 | 70 | - (void)setHideKeyboardAccessoryBar:(BOOL)hideKeyboardAccessoryBar { 71 | if (hideKeyboardAccessoryBar == _hideKeyboardAccessoryBar) { 72 | return; 73 | } 74 | if (hideKeyboardAccessoryBar) { 75 | self.webView.hackishlyHidesInputAccessoryView = YES; 76 | } 77 | else { 78 | self.webView.hackishlyHidesInputAccessoryView = NO; 79 | } 80 | 81 | _hideKeyboardAccessoryBar = hideKeyboardAccessoryBar; 82 | } 83 | 84 | /* 85 | - (BOOL)styleDark { 86 | return _styleDark; 87 | } 88 | 89 | - (void)setStyleDark:(BOOL)styleDark { 90 | if (styleDark == _styleDark) { 91 | return; 92 | } 93 | if (styleDark) { 94 | self.webView.styleDark = YES; 95 | } 96 | else { 97 | self.webView.styleDark = NO; 98 | } 99 | 100 | _styleDark = styleDark; 101 | } 102 | */ 103 | 104 | 105 | /* ------------------------------------------------------------- */ 106 | 107 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 108 | [scrollView setContentOffset: CGPointZero]; 109 | } 110 | 111 | /* ------------------------------------------------------------- */ 112 | 113 | - (void)dealloc { 114 | NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; 115 | 116 | [nc removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 117 | [nc removeObserver:self name:UIKeyboardWillHideNotification object:nil]; 118 | } 119 | 120 | /* ------------------------------------------------------------- */ 121 | 122 | - (void) disableScroll:(CDVInvokedUrlCommand*)command { 123 | if (!command.arguments || ![command.arguments count]){ 124 | return; 125 | } 126 | id value = [command.arguments objectAtIndex:0]; 127 | 128 | self.disableScroll = [value boolValue]; 129 | } 130 | 131 | - (void) hideKeyboardAccessoryBar:(CDVInvokedUrlCommand*)command { 132 | if (!command.arguments || ![command.arguments count]){ 133 | return; 134 | } 135 | id value = [command.arguments objectAtIndex:0]; 136 | 137 | self.hideKeyboardAccessoryBar = [value boolValue]; 138 | } 139 | 140 | - (void) close:(CDVInvokedUrlCommand*)command { 141 | [self.webView endEditing:YES]; 142 | } 143 | 144 | /* 145 | - (void) styleDark:(CDVInvokedUrlCommand*)command { 146 | if (!command.arguments || ![command.arguments count]){ 147 | return; 148 | } 149 | id value = [command.arguments objectAtIndex:0]; 150 | 151 | self.styleDark = [value boolValue]; 152 | } 153 | */ 154 | 155 | @end 156 | 157 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/src/ios/UIWebViewExtension.h: -------------------------------------------------------------------------------- 1 | @interface UIWebView (HackishAccessoryHiding) 2 | @property (nonatomic, assign) BOOL hackishlyHidesInputAccessoryView; 3 | //@property (nonatomic, assign) BOOL styleDark; 4 | @end 5 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/src/ios/UIWebViewExtension.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "UIWebViewExtension.h" 4 | 5 | //Credit: https://gist.github.com/bjhomer/2048571 6 | //Also: http://stackoverflow.com/a/23398487/1091751 7 | @implementation UIWebView (HackishAccessoryHiding) 8 | 9 | static const char * const hackishFixClassName = "UIWebBrowserViewMinusAccessoryView"; 10 | static Class hackishFixClass = Nil; 11 | 12 | - (UIView *)hackishlyFoundBrowserView { 13 | UIScrollView *scrollView = self.scrollView; 14 | 15 | UIView *browserView = nil; 16 | for (UIView *subview in scrollView.subviews) { 17 | if ([NSStringFromClass([subview class]) hasPrefix:@"UIWebBrowserView"]) { 18 | browserView = subview; 19 | break; 20 | } 21 | } 22 | return browserView; 23 | } 24 | 25 | - (id)methodReturningNil { 26 | return nil; 27 | } 28 | 29 | - (void)ensureHackishSubclassExistsOfBrowserViewClass:(Class)browserViewClass { 30 | if (!hackishFixClass) { 31 | Class newClass = objc_allocateClassPair(browserViewClass, hackishFixClassName, 0); 32 | IMP nilImp = [self methodForSelector:@selector(methodReturningNil)]; 33 | class_addMethod(newClass, @selector(inputAccessoryView), nilImp, "@@:"); 34 | objc_registerClassPair(newClass); 35 | 36 | hackishFixClass = newClass; 37 | } 38 | } 39 | 40 | - (BOOL) hackishlyHidesInputAccessoryView { 41 | UIView *browserView = [self hackishlyFoundBrowserView]; 42 | return [browserView class] == hackishFixClass; 43 | } 44 | 45 | - (void) setHackishlyHidesInputAccessoryView:(BOOL)value { 46 | UIView *browserView = [self hackishlyFoundBrowserView]; 47 | if (browserView == nil) { 48 | return; 49 | } 50 | [self ensureHackishSubclassExistsOfBrowserViewClass:[browserView class]]; 51 | 52 | if (value) { 53 | object_setClass(browserView, hackishFixClass); 54 | } 55 | else { 56 | Class normalClass = objc_getClass("UIWebBrowserView"); 57 | object_setClass(browserView, normalClass); 58 | } 59 | [browserView reloadInputViews]; 60 | } 61 | /* ---------------------------------------------------------------- */ 62 | 63 | /* 64 | - (UIKeyboardAppearance) darkKeyboardAppearanceTemplateMethod { 65 | return UIKeyboardAppearanceDark; 66 | } 67 | 68 | - (UIKeyboardAppearance) lightKeyboardAppearanceTemplateMethod { 69 | return UIKeyboardAppearanceLight; 70 | } 71 | 72 | - (BOOL) styleDark { 73 | UIView *browserView = [self hackishlyFoundBrowserView]; 74 | if (browserView == nil) { 75 | return false; 76 | } 77 | 78 | Method m = class_getInstanceMethod( [self class], @selector( darkKeyboardAppearanceTemplateMethod ) ); 79 | IMP imp = method_getImplementation( m ); 80 | 81 | Method m2 = class_getInstanceMethod( [browserView class], @selector(keyboardAppearance) ); 82 | IMP imp2 = method_getImplementation( m2 ); 83 | 84 | return imp == imp2; 85 | } 86 | 87 | - (void) setStyleDark:(BOOL)styleDark { 88 | UIView *browserView = [self hackishlyFoundBrowserView]; 89 | if (browserView == nil) { 90 | return; 91 | } 92 | 93 | if ( styleDark ) { 94 | Method m = class_getInstanceMethod( [self class], @selector( darkKeyboardAppearanceTemplateMethod ) ); 95 | IMP imp = method_getImplementation( m ); 96 | const char* typeEncoding = method_getTypeEncoding( m ); 97 | class_replaceMethod( [browserView class], @selector(keyboardAppearance), imp, typeEncoding ); 98 | } 99 | else { 100 | Method m = class_getInstanceMethod( [self class], @selector( lightKeyboardAppearanceTemplateMethod ) ); 101 | IMP imp = method_getImplementation( m ); 102 | const char* typeEncoding = method_getTypeEncoding( m ); 103 | class_replaceMethod( [browserView class], @selector(keyboardAppearance), imp, typeEncoding ); 104 | } 105 | } 106 | */ 107 | 108 | @end 109 | 110 | -------------------------------------------------------------------------------- /example/plugins/com.ionic.keyboard/www/keyboard.js: -------------------------------------------------------------------------------- 1 | 2 | var argscheck = require('cordova/argscheck'), 3 | utils = require('cordova/utils'), 4 | exec = require('cordova/exec'); 5 | 6 | var Keyboard = function() { 7 | }; 8 | 9 | Keyboard.hideKeyboardAccessoryBar = function(hide) { 10 | exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]); 11 | }; 12 | 13 | Keyboard.close = function() { 14 | exec(null, null, "Keyboard", "close", []); 15 | }; 16 | 17 | Keyboard.show = function() { 18 | exec(null, null, "Keyboard", "show", []); 19 | }; 20 | 21 | Keyboard.disableScroll = function(disable) { 22 | exec(null, null, "Keyboard", "disableScroll", [disable]); 23 | }; 24 | 25 | /* 26 | Keyboard.styleDark = function(dark) { 27 | exec(null, null, "Keyboard", "styleDark", [dark]); 28 | }; 29 | */ 30 | 31 | Keyboard.isVisible = false; 32 | 33 | module.exports = Keyboard; 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/.fetch.json: -------------------------------------------------------------------------------- 1 | {"source":{"type":"local","path":"/Users/mhartington/.plugman/cache/org.apache.cordova.console/0.2.11/package"}} -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | # Contributing to Apache Cordova 23 | 24 | Anyone can contribute to Cordova. And we need your contributions. 25 | 26 | There are multiple ways to contribute: report bugs, improve the docs, and 27 | contribute code. 28 | 29 | For instructions on this, start with the 30 | [contribution overview](http://cordova.apache.org/#contribute). 31 | 32 | The details are explained there, but the important items are: 33 | - Sign and submit an Apache ICLA (Contributor License Agreement). 34 | - Have a Jira issue open that corresponds to your contribution. 35 | - Run the tests so your patch doesn't break existing functionality. 36 | 37 | We look forward to your contributions! 38 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Cordova 2 | Copyright 2012 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | Plugin documentation: [doc/index.md](doc/index.md) 23 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/RELEASENOTES.md: -------------------------------------------------------------------------------- 1 | 21 | # Release Notes 22 | 23 | ### 0.2.3 (Sept 25, 2013) 24 | * CB-4889 bumping&resetting version 25 | * CB-4889 renaming org.apache.cordova.core.console to org.apache.cordova.console 26 | * Rename CHANGELOG.md -> RELEASENOTES.md 27 | * [CB-4752] Incremented plugin version on dev branch. 28 | 29 | ### 0.2.4 (Oct 28, 2013) 30 | * CB-5154 log formatting incorrectly to native 31 | * CB-5128: added repo + issue tag to plugin.xml for console plugin 32 | * [CB-4915] Incremented plugin version on dev branch. 33 | 34 | ### 0.2.5 (Dec 4, 2013) 35 | * add ubuntu platform 36 | 37 | ### 0.2.6 (Jan 02, 2014) 38 | * CB-5658 Add doc/index.md for Console plugin 39 | 40 | ### 0.2.7 (Feb 05, 2014) 41 | * Native console needs to be called DebugConsole to avoid ambiguous reference. This commit requires the 3.4.0 version of the native class factory 42 | * CB-4718 fixed Console plugin not working on wp 43 | 44 | ### 0.2.8 (Apr 17, 2014) 45 | * CB-6460: Update license headers 46 | * Add NOTICE file 47 | 48 | ### 0.2.9 (Jun 05, 2014) 49 | * CB-6848 Add Android quirk, list applicable platforms 50 | * CB-6796 Add license 51 | * CB-6491 add CONTRIBUTING.md 52 | 53 | ### 0.2.10 (Aug 06, 2014) 54 | * CB-6127 Updated translations for docs 55 | 56 | ### 0.2.11 (Sep 17, 2014) 57 | * CB-7249 cordova-plugin-console documentation translation 58 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/de/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 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. 23 | 24 | ## Installation 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Android Eigenarten 30 | 31 | Auf einigen anderen Plattformen als Android reagiert der Befehl console.log ("1", "2", "3") auf mehrere Befehle. In diesem Fall 1, 2 und 3. Android wird jedoch nur auf das erste Argument (1) reagieren. Nachfolgende Argumente zu console.log() (2 und 3) werden ignoriert. Dafür ist aber nicht dieses Plugin verantwortlich! Es ist eine Limitierung die von Android kommt und nicht von diesem Plugin beeinflusst werden kann. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/es/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 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. 23 | 24 | ## Instalación 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Rarezas Android 30 | 31 | 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. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/fr/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 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. 23 | 24 | ## Installation 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Quirks Android 30 | 31 | 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. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | This plugin is meant to ensure that console.log() is as useful as it can be. 23 | It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows 8. If 24 | you are happy with how console.log() works for you, then you probably 25 | don't need this plugin. 26 | 27 | ## Installation 28 | 29 | cordova plugin add org.apache.cordova.console 30 | 31 | ### Android Quirks 32 | 33 | On some platforms other than Android, console.log() will act on multiple 34 | arguments, such as console.log("1", "2", "3"). However, Android will act only 35 | on the first argument. Subsequent arguments to console.log() will be ignored. 36 | This plugin is not the cause of that, it is a limitation of Android itself. 37 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/it/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 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. 23 | 24 | ## Installazione 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Stranezze Android 30 | 31 | 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. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/ja/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | このプラグインは、その console.log() がすることができます便利なことを確認するものです。 それは、iOS、Ubuntu、Windows Phone 8 および Windows 8 の追加関数を追加します。 場合はあなたのための console.log() の作品に満足しているし、おそらく必要はありませんこのプラグイン。 23 | 24 | ## インストール 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Android の癖 30 | 31 | アンドロイド以外のいくつかのプラットフォームで console.log() は console.log (「1」、「2」、「3」) など、複数の引数に動作します。 しかし、アンドロイドは、最初の引数でのみ動作します。 Console.log() に後続の引数は無視されます。 このプラグインが原因ではない、それは Android の自体の制限です。 -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/ko/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 이 플러그인을 console.log()로 수 유용 되도록 의미입니다. IOS, 우분투, Windows Phone 8 및 윈도우 8에 대 한 추가 기능을 추가 하 고 합니다. Console.log() 당신을 위해 작동 하는 어떻게 행복 한 경우에, 그때 당신은 아마 필요 하지 않습니다이 플러그인. 23 | 24 | ## 설치 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### 안 드 로이드 단점 30 | 31 | 안 드 로이드 이외의 일부 플랫폼에서 console.log() console.log ("1", "2", "3")와 같이 여러 인수에 작동할 것 이다. 그러나, 안 드 로이드는 첫 번째 인수에만 작동할 것 이다. Console.log() 후속 인수는 무시 됩니다. 이 플러그인의 원인이 되지 않습니다, 그리고 그것은 안 드 로이드 자체의 한계입니다. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/pl/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 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. 23 | 24 | ## Instalacji 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Android dziwactwa 30 | 31 | 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. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/ru/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | Этот плагин предназначен для обеспечения как полезным, поскольку это может быть что console.log(). Он добавляет дополнительные функции для iOS, Ubuntu, Windows Phone 8 и Windows 8. Если вы не довольны как console.log() работает для вас, то вы вероятно не нужен этот плагин. 23 | 24 | ## Установка 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Android причуды 30 | 31 | На некоторых платформах, отличных от Android console.log() будет действовать на нескольких аргументов, например console.log («1», «2», «3»). Тем не менее Android будет действовать только на первого аргумента. Последующие аргументы для console.log() будет игнорироваться. Этот плагин не является причиной этого, это ограничение Android сам. -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/doc/zh/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.console 21 | 22 | 這個外掛程式是為了確保該 console.log() 是一樣有用,它可以是。 它將添加附加功能的 iOS、 Ubuntu,Windows Phone 8 和 Windows 8。 如果你是快樂與 console.log() 是如何為你工作,那麼可能不需要這個外掛程式。 23 | 24 | ## 安裝 25 | 26 | cordova plugin add org.apache.cordova.console 27 | 28 | 29 | ### Android 的怪癖 30 | 31 | 在一些非 Android 平臺上,console.log() 將作用於多個參數,如 console.log ("1"、"2"、"3")。 然而,Android 將僅在第一個參數上採取行動。 對 console.log() 的後續參數將被忽略。 這個外掛程式不是的原因,,它是安卓系統本身的限制。 -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.11", 3 | "name": "org.apache.cordova.console", 4 | "cordova_name": "Console", 5 | "description": "Cordova Console Plugin", 6 | "license": "Apache 2.0", 7 | "repo": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git", 8 | "issue": "https://issues.apache.org/jira/browse/CB/component/12320644", 9 | "keywords": [ 10 | "cordova", 11 | "console" 12 | ], 13 | "platforms": [ 14 | "ios", 15 | "ubuntu", 16 | "wp7", 17 | "wp8", 18 | "windows8" 19 | ], 20 | "engines": [], 21 | "englishdoc": "\n\n# org.apache.cordova.console\n\nThis plugin is meant to ensure that console.log() is as useful as it can be.\nIt adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows 8. If\nyou are happy with how console.log() works for you, then you probably\ndon't need this plugin.\n\n## Installation\n\n cordova plugin add org.apache.cordova.console\n\n### Android Quirks\n\nOn some platforms other than Android, console.log() will act on multiple\narguments, such as console.log(\"1\", \"2\", \"3\"). However, Android will act only\non the first argument. Subsequent arguments to console.log() will be ignored.\nThis plugin is not the cause of that, it is a limitation of Android itself.\n" 22 | } -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | 25 | Console 26 | Cordova Console Plugin 27 | Apache 2.0 28 | cordova,console 29 | https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git 30 | https://issues.apache.org/jira/browse/CB/component/12320644 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/src/ios/CDVLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | #import 21 | 22 | @interface CDVLogger : CDVPlugin 23 | 24 | - (void)logLevel:(CDVInvokedUrlCommand*)command; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/src/ios/CDVLogger.m: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | #import "CDVLogger.h" 21 | #import 22 | 23 | @implementation CDVLogger 24 | 25 | /* log a message */ 26 | - (void)logLevel:(CDVInvokedUrlCommand*)command 27 | { 28 | id level = [command.arguments objectAtIndex:0]; 29 | id message = [command.arguments objectAtIndex:1]; 30 | 31 | if ([level isEqualToString:@"LOG"]) { 32 | NSLog(@"%@", message); 33 | } else { 34 | NSLog(@"%@: %@", level, message); 35 | } 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/src/ubuntu/console.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | #include "console.h" 16 | 17 | #include 18 | 19 | Console::Console(Cordova *cordova) : CPlugin(cordova) { 20 | } 21 | 22 | void Console::logLevel(int scId, int ecId, QString level, QString message) { 23 | Q_UNUSED(scId) 24 | Q_UNUSED(ecId) 25 | 26 | if (level != "LOG") 27 | std::cout << "[" << level.toStdString() << "] "; 28 | std::cout << message.toStdString() << std::endl; 29 | } 30 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/src/ubuntu/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | #ifndef CONSOLE_H_FDSVCXGFRS 16 | #define CONSOLE_H_FDSVCXGFRS 17 | 18 | #include 19 | 20 | #include 21 | 22 | class Console : public CPlugin { 23 | Q_OBJECT 24 | public: 25 | explicit Console(Cordova *cordova); 26 | 27 | virtual const QString fullName() override { 28 | return Console::fullID(); 29 | } 30 | 31 | virtual const QString shortName() override { 32 | return "Console"; 33 | } 34 | 35 | static const QString fullID() { 36 | return "Console"; 37 | } 38 | 39 | public slots: 40 | void logLevel(int scId, int ecId, QString level, QString message); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.console/src/wp/DebugConsole.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | using System; 16 | using System.Net; 17 | using System.Windows; 18 | using System.Windows.Controls; 19 | using System.Windows.Documents; 20 | using System.Windows.Ink; 21 | using System.Windows.Input; 22 | using System.Windows.Media; 23 | using System.Windows.Media.Animation; 24 | using System.Windows.Shapes; 25 | using System.Diagnostics; 26 | 27 | namespace WPCordovaClassLib.Cordova.Commands 28 | { 29 | public class DebugConsole : BaseCommand 30 | { 31 | public void logLevel(string options) 32 | { 33 | string[] args = JSON.JsonHelper.Deserialize(options); 34 | string level = args[0]; 35 | string msg = args[1]; 36 | 37 | if (level.Equals("LOG")) 38 | { 39 | Debug.WriteLine(msg); 40 | } 41 | else 42 | { 43 | Debug.WriteLine(level + ": " + msg); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/.fetch.json: -------------------------------------------------------------------------------- 1 | {"source":{"type":"local","path":"/Users/mhartington/.plugman/cache/org.apache.cordova.device/0.2.12/package"}} -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | # Contributing to Apache Cordova 23 | 24 | Anyone can contribute to Cordova. And we need your contributions. 25 | 26 | There are multiple ways to contribute: report bugs, improve the docs, and 27 | contribute code. 28 | 29 | For instructions on this, start with the 30 | [contribution overview](http://cordova.apache.org/#contribute). 31 | 32 | The details are explained there, but the important items are: 33 | - Sign and submit an Apache ICLA (Contributor License Agreement). 34 | - Have a Jira issue open that corresponds to your contribution. 35 | - Run the tests so your patch doesn't break existing functionality. 36 | 37 | We look forward to your contributions! 38 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Cordova 2 | Copyright 2012 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.device 21 | 22 | Plugin documentation: [doc/index.md](doc/index.md) 23 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/RELEASENOTES.md: -------------------------------------------------------------------------------- 1 | 21 | # Release Notes 22 | 23 | ### 0.2.1 (Sept 5, 2013) 24 | * removed extraneous print statement 25 | * [CB-4432] copyright notice change 26 | 27 | ### 0.2.3 (Sept 25, 2013) 28 | * CB-4889 bumping&resetting version 29 | * [windows8] commandProxy has moved 30 | * [BlackBerry10] removed uneeded permission tags in plugin.xml 31 | * CB-4889 renaming org.apache.cordova.core.device to org.apache.cordova.device 32 | * Rename CHANGELOG.md -> RELEASENOTES.md 33 | * updated to use commandProxy for ffos 34 | * add firefoxos support 35 | * [CB-4752] Incremented plugin version on dev branch. 36 | 37 | ### 0.2.4 (Oct 28, 2013) 38 | * CB-5128: added repo + issue tag in plugin.xml for device plugin 39 | * CB-5085 device.cordova returning wrong value 40 | * [CB-4915] Incremented plugin version on dev branch. 41 | 42 | ### 0.2.5 (Dec 4, 2013) 43 | * CB-5316 Spell Cordova as a brand unless it's a command or script 44 | * [ubuntu] use cordova/exec/proxy 45 | * add ubuntu platform 46 | * Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices 47 | * 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos' 48 | 49 | ### 0.2.6 (Jan 02, 2014) 50 | * CB-5658 Add doc/index.md for Device plugin 51 | * CB-5504 Moving Telephony Logic out of Device 52 | 53 | ### 0.2.7 (Jan 07, 2014) 54 | * CB-5737 Fix exception on close caused by left over telephony code from CB-5504 55 | 56 | ### 0.2.8 (Feb 05, 2014) 57 | * Tizen support added 58 | 59 | ### 0.2.9 (Apr 17, 2014) 60 | * CB-5105: [Android, windows8, WP, BlackBerry10] Removed dead code for device.version 61 | * CB-6422: [windows8] use cordova/exec/proxy 62 | * CB-6460: Update license headers 63 | * Add NOTICE file 64 | 65 | ### 0.2.10 (Jun 05, 2014) 66 | * CB-6127 Spanish and French Translations added. Github close #12 67 | * Changing 1.5 to 2.0 68 | * added firefoxos version - conversion 69 | * added firefoxos version 70 | * CB-6800 Add license 71 | * CB-6491 add CONTRIBUTING.md 72 | 73 | ### 0.2.11 (Aug 06, 2014) 74 | * [FFOS] update DeviceProxy.js 75 | * CB-6127 Updated translations for docs 76 | * Use Windows system calls to get better info 77 | 78 | ### 0.2.12 (Sep 17, 2014) 79 | * CB-7471 cordova-plugin-device documentation translation 80 | * CB-7552 device.name docs have not been removed 81 | * [fxos] Fix cordova version 82 | * added status box and documentation to manual tests 83 | * [fxos] Fix cordova version 84 | * added status box and documentation to manual tests 85 | * Added plugin support for the browser 86 | * CB-7262 Adds support for universal windows apps. 87 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/doc/ja/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.device 21 | 22 | このプラグインをグローバル定義します `device` オブジェクトは、デバイスのハードウェアとソフトウェアについて説明します。 それは後まで利用可能なオブジェクトがグローバル スコープでは、 `deviceready` イベント。 23 | 24 | document.addEventListener("deviceready", onDeviceReady, false); 25 | function onDeviceReady() { 26 | console.log(device.cordova); 27 | } 28 | 29 | 30 | ## インストール 31 | 32 | cordova plugin add org.apache.cordova.device 33 | 34 | 35 | ## プロパティ 36 | 37 | * device.cordova 38 | * device.model 39 | * device.platform 40 | * device.uuid 41 | * device.version 42 | 43 | ## device.cordova 44 | 45 | デバイスで実行されているコルドバのバージョンを取得します。 46 | 47 | ### サポートされているプラットフォーム 48 | 49 | * アマゾン火 OS 50 | * アンドロイド 51 | * ブラックベリー 10 52 | * ブラウザー 53 | * Firefox の OS 54 | * iOS 55 | * Tizen 56 | * Windows Phone 7 と 8 57 | * Windows 8 58 | 59 | ## device.model 60 | 61 | `device.model`、デバイスのモデルまたは製品の名前を返します。値は、デバイスの製造元によって設定され、同じ製品のバージョン間で異なる可能性があります。 62 | 63 | ### サポートされているプラットフォーム 64 | 65 | * アンドロイド 66 | * ブラックベリー 10 67 | * ブラウザー 68 | * iOS 69 | * Tizen 70 | * Windows Phone 7 と 8 71 | * Windows 8 72 | 73 | ### 簡単な例 74 | 75 | // Android: Nexus One returns "Passion" (Nexus One code name) 76 | // Motorola Droid returns "voles" 77 | // BlackBerry: Torch 9800 returns "9800" 78 | // Browser: Google Chrome returns "Chrome" 79 | // Safari returns "Safari" 80 | // 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; 81 | 82 | 83 | ### Android の癖 84 | 85 | * 生産コード名は[モデル名][1]の代わりに[製品名][2]を取得します。 たとえば、ネクサス 1 つを返します `Passion` 、Motorola のドロイドを返します`voles`. 86 | 87 | [1]: http://developer.android.com/reference/android/os/Build.html#MODEL 88 | [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT 89 | 90 | ### Tizen の癖 91 | 92 | * たとえば、ベンダーによって割り当てられているデバイスのモデルを返します`TIZEN` 93 | 94 | ### Windows Phone 7 と 8 癖 95 | 96 | * 製造元によって指定されたデバイスのモデルを返します。たとえば、三星フォーカスを返します`SGH-i917`. 97 | 98 | ## device.platform 99 | 100 | デバイスのオペレーティング システム名を取得します。 101 | 102 | var string = device.platform; 103 | 104 | 105 | ### サポートされているプラットフォーム 106 | 107 | * アンドロイド 108 | * ブラックベリー 10 109 | * Browser4 110 | * Firefox の OS 111 | * iOS 112 | * Tizen 113 | * Windows Phone 7 と 8 114 | * Windows 8 115 | 116 | ### 簡単な例 117 | 118 | // Depending on the device, a few examples are: 119 | // - "Android" 120 | // - "BlackBerry 10" 121 | // - Browser: returns "MacIntel" on Mac 122 | // returns "Win32" on Windows 123 | // - "iOS" 124 | // - "WinCE" 125 | // - "Tizen" 126 | var devicePlatform = device.platform; 127 | 128 | 129 | ### Windows Phone 7 の癖 130 | 131 | Windows Phone 7 デバイスとプラットフォームを報告します。`WinCE`. 132 | 133 | ### Windows Phone 8 癖 134 | 135 | Windows Phone 8 デバイスとプラットフォームを報告します。`Win32NT`. 136 | 137 | ## device.uuid 138 | 139 | デバイスのユニバーサル ・ ユニーク識別子 ([UUID][3]を取得します。). 140 | 141 | [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier 142 | 143 | var string = device.uuid; 144 | 145 | 146 | ### 説明 147 | 148 | UUID を生成する方法の詳細は、デバイスの製造元によって決定され、デバイスのプラットフォームやモデルに固有です。 149 | 150 | ### サポートされているプラットフォーム 151 | 152 | * アンドロイド 153 | * ブラックベリー 10 154 | * iOS 155 | * Tizen 156 | * Windows Phone 7 と 8 157 | * Windows 8 158 | 159 | ### 簡単な例 160 | 161 | //アンドロイド: ランダムな 64 ビットの整数 (を文字列として返します、再び !)/デバイスの最初の起動時に生成される整数/////ブラックベリー: デバイスのピン番号を返します//これは 9 桁の一意な整数 (を文字列としても !)////iPhone: (UIDevice クラスのドキュメントから言い換え)//識別複数のハードウェアから作成されたハッシュ値の文字列を返します。。 162 | //それはすべてのデバイスに対して一意であることが保証され、接続することはできません//ユーザー アカウント。 163 | //Windows Phone 7: デバイス + 現在のユーザーのハッシュを返します//ユーザーが定義されていない場合 guid が生成され、アプリがアンインストールされるまで保持されます//Tizen: デバイスの IMEI を返します (国際モバイル機器アイデンティティまたは IMEI は番号です//すべての GSM および UMTS の携帯電話に固有です。 164 | var deviceID = device.uuid; 165 | 166 | 167 | ### iOS の気まぐれ 168 | 169 | `uuid`IOS で、デバイスに固有ではないインストールごと、アプリケーションごとに異なります。 削除、アプリを再インストールした場合に変更と多分またときアップグレード iOS の, またはもアップグレードするアプリ (iOS の 5.1 で明らかに) バージョンごと。 `uuid`は信頼性の高い値ではありません。 170 | 171 | ### Windows Phone 7 と 8 癖 172 | 173 | `uuid`のために Windows Phone 7 には、権限が必要です `ID_CAP_IDENTITY_DEVICE` 。 Microsoft はすぐにこのプロパティを廃止して可能性があります。 機能が利用できない場合、アプリケーションはデバイスへのアプリケーションのインストールの持続期間のために保持されている永続的な guid を生成します。 174 | 175 | ## device.version 176 | 177 | オペレーティング システムのバージョンを取得します。 178 | 179 | var string = device.version; 180 | 181 | 182 | ### サポートされているプラットフォーム 183 | 184 | * アンドロイド 2.1 + 185 | * ブラックベリー 10 186 | * ブラウザー 187 | * iOS 188 | * Tizen 189 | * Windows Phone 7 と 8 190 | * Windows 8 191 | 192 | ### 簡単な例 193 | 194 | // Android: Froyo OS would return "2.2" 195 | // Eclair OS would return "2.1", "2.0.1", or "2.0" 196 | // Version can also return update level "2.1-update1" 197 | // 198 | // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" 199 | // 200 | // Browser: Returns version number for the browser 201 | // 202 | // iPhone: iOS 3.2 returns "3.2" 203 | // 204 | // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 205 | // Tizen: returns "TIZEN_20120425_2" 206 | var deviceVersion = device.version; -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/doc/ko/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.device 21 | 22 | 이 플러그인 정의 전역 `device` 개체, 디바이스의 하드웨어 및 소프트웨어에 설명 합니다. 개체는 전역 범위에서 비록 그것은 후까지 사용할 수 있는 `deviceready` 이벤트. 23 | 24 | document.addEventListener("deviceready", onDeviceReady, false); 25 | function onDeviceReady() { 26 | console.log(device.cordova); 27 | } 28 | 29 | 30 | ## 설치 31 | 32 | cordova plugin add org.apache.cordova.device 33 | 34 | 35 | ## 속성 36 | 37 | * device.cordova 38 | * device.model 39 | * device.platform 40 | * device.uuid 41 | * device.version 42 | 43 | ## device.cordova 44 | 45 | 코르도바는 장치에서 실행 중인 버전을 얻을. 46 | 47 | ### 지원 되는 플랫폼 48 | 49 | * 아마존 화재 운영 체제 50 | * 안 드 로이드 51 | * 블랙베리 10 52 | * 브라우저 53 | * Firefox 운영 체제 54 | * iOS 55 | * Tizen 56 | * Windows Phone 7과 8 57 | * 윈도우 8 58 | 59 | ## device.model 60 | 61 | `device.model`소자의 모델 또는 제품의 이름을 반환 합니다. 값 장치 제조업체에서 설정 되 고 동일 제품의 버전 간에 다를 수 있습니다. 62 | 63 | ### 지원 되는 플랫폼 64 | 65 | * 안 드 로이드 66 | * 블랙베리 10 67 | * 브라우저 68 | * iOS 69 | * Tizen 70 | * Windows Phone 7과 8 71 | * 윈도우 8 72 | 73 | ### 빠른 예제 74 | 75 | // Android: Nexus One returns "Passion" (Nexus One code name) 76 | // Motorola Droid returns "voles" 77 | // BlackBerry: Torch 9800 returns "9800" 78 | // Browser: Google Chrome returns "Chrome" 79 | // Safari returns "Safari" 80 | // 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; 81 | 82 | 83 | ### 안 드 로이드 단점 84 | 85 | * 어떤은 종종 프로덕션 코드 이름 대신 [제품 모델 이름][1], [제품 이름][2] 을 가져옵니다. 예를 들어 넥서스 하나 반환 합니다 `Passion` , 모토로라 Droid를 반환 합니다`voles`. 86 | 87 | [1]: http://developer.android.com/reference/android/os/Build.html#MODEL 88 | [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT 89 | 90 | ### Tizen 특수 91 | 92 | * 예를 들어, 공급 업체에 의해 할당 된 디바이스 모델을 반환 합니다.`TIZEN` 93 | 94 | ### Windows Phone 7, 8 특수 95 | 96 | * 제조업체에서 지정 하는 장치 모델을 반환 합니다. 예를 들어 삼성 포커스를 반환 합니다.`SGH-i917`. 97 | 98 | ## device.platform 99 | 100 | 장치의 운영 체제 이름을 얻을. 101 | 102 | var string = device.platform; 103 | 104 | 105 | ### 지원 되는 플랫폼 106 | 107 | * 안 드 로이드 108 | * 블랙베리 10 109 | * Browser4 110 | * Firefox 운영 체제 111 | * iOS 112 | * Tizen 113 | * Windows Phone 7과 8 114 | * 윈도우 8 115 | 116 | ### 빠른 예제 117 | 118 | // Depending on the device, a few examples are: 119 | // - "Android" 120 | // - "BlackBerry 10" 121 | // - Browser: returns "MacIntel" on Mac 122 | // returns "Win32" on Windows 123 | // - "iOS" 124 | // - "WinCE" 125 | // - "Tizen" 126 | var devicePlatform = device.platform; 127 | 128 | 129 | ### Windows Phone 7 단점 130 | 131 | Windows Phone 7 장치 보고 플랫폼으로`WinCE`. 132 | 133 | ### Windows Phone 8 단점 134 | 135 | Windows Phone 8 장치 보고 플랫폼으로`Win32NT`. 136 | 137 | ## device.uuid 138 | 139 | 소자의 보편적으로 고유 식별자 ([UUID][3] 를 얻을합니다). 140 | 141 | [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier 142 | 143 | var string = device.uuid; 144 | 145 | 146 | ### 설명 147 | 148 | UUID 생성 방법의 자세한 내용은 장치 제조업체에 의해 결정 됩니다 및 소자의 플랫폼 이나 모델. 149 | 150 | ### 지원 되는 플랫폼 151 | 152 | * 안 드 로이드 153 | * 블랙베리 10 154 | * iOS 155 | * Tizen 156 | * Windows Phone 7과 8 157 | * 윈도우 8 158 | 159 | ### 빠른 예제 160 | 161 | / / 안 드 로이드: (문자열로 다시!) 임의의 64 비트 정수를 반환 합니다 / / 정수 장치의 첫 번째 부팅에서 생성 / / / / 블랙베리: 디바이스의 핀 번호를 반환 합니다 / / 이것은 9 자리 고유 정수 (문자열로 비록!) / / / / 아이폰: (UIDevice 클래스 설명서에서 읊 었) / / 문자열 여러 하드웨어에서 생성 하는 해시 값을 식별 하는 반환 합니다. 162 | / 그것은 모든 장치에 대 한 고유 해야 보장 되 고 묶일 수 없습니다 / / / 사용자 계정에. 163 | / / Windows Phone 7: 장치 + 현재 사용자의 해시를 반환 합니다 / / 사용자 정의 되지 않은 경우 guid 생성 되 고 응용 프로그램을 제거할 때까지 유지 됩니다 / / Tizen: 반환 장치 IMEI (국제 모바일 기기 식별 또는 IMEI 숫자입니다 / / 모든 GSM와 UMTS 휴대 전화 고유. 164 | var deviceID = device.uuid; 165 | 166 | 167 | ### iOS 특질 168 | 169 | `uuid`ios 장치에 고유 하지 않습니다 하지만 각 설치에 대 한 응용 프로그램 마다 다릅니다. 삭제 하 고 다시 애플 리 케이 션을 설치 하는 경우 변경 가능 하 게 또한 iOS를 업그레이드 하거나 때 버전 (iOS 5.1에에서 명백한) 당 응용 프로그램 업그레이드도 하 고. `uuid`은 신뢰할 수 있는 값이 아닙니다. 170 | 171 | ### Windows Phone 7, 8 특수 172 | 173 | `uuid`Windows Phone 7 필요 허가 `ID_CAP_IDENTITY_DEVICE` . Microsoft는 곧이 속성을 세웁니다 가능성이 것입니다. 기능을 사용할 수 없는 경우 응용 프로그램 장치에 응용 프로그램의 설치 하는 동안 유지 하는 영구 guid를 생성 합니다. 174 | 175 | ## device.version 176 | 177 | 운영 체제 버전을 얻을. 178 | 179 | var string = device.version; 180 | 181 | 182 | ### 지원 되는 플랫폼 183 | 184 | * 안 드 로이드 2.1 + 185 | * 블랙베리 10 186 | * 브라우저 187 | * iOS 188 | * Tizen 189 | * Windows Phone 7과 8 190 | * 윈도우 8 191 | 192 | ### 빠른 예제 193 | 194 | // Android: Froyo OS would return "2.2" 195 | // Eclair OS would return "2.1", "2.0.1", or "2.0" 196 | // Version can also return update level "2.1-update1" 197 | // 198 | // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" 199 | // 200 | // Browser: Returns version number for the browser 201 | // 202 | // iPhone: iOS 3.2 returns "3.2" 203 | // 204 | // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 205 | // Tizen: returns "TIZEN_20120425_2" 206 | var deviceVersion = device.version; -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/doc/zh/index.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # org.apache.cordova.device 21 | 22 | 這個外掛程式定義全球 `device` 物件,描述該設備的硬體和軟體。 雖然物件是在全球範圍內,但不是可用,直到後 `deviceready` 事件。 23 | 24 | document.addEventListener("deviceready", onDeviceReady, false); 25 | function onDeviceReady() { 26 | console.log(device.cordova); 27 | } 28 | 29 | 30 | ## 安裝 31 | 32 | cordova plugin add org.apache.cordova.device 33 | 34 | 35 | ## 屬性 36 | 37 | * device.cordova 38 | * device.model 39 | * device.platform 40 | * device.uuid 41 | * device.version 42 | 43 | ## device.cordova 44 | 45 | 獲取科爾多瓦在設備上運行的版本。 46 | 47 | ### 支援的平臺 48 | 49 | * 亞馬遜火 OS 50 | * Android 系統 51 | * 黑莓 10 52 | * 瀏覽器 53 | * 火狐瀏覽器的作業系統 54 | * iOS 55 | * 泰 56 | * Windows Phone 7 和 8 57 | * Windows 8 58 | 59 | ## device.model 60 | 61 | `device.model`返回設備的模型或產品的名稱。值由設備製造商設置和同一產品的不同版本可能不同。 62 | 63 | ### 支援的平臺 64 | 65 | * Android 系統 66 | * 黑莓 10 67 | * 瀏覽器 68 | * iOS 69 | * 泰 70 | * Windows Phone 7 和 8 71 | * Windows 8 72 | 73 | ### 快速的示例 74 | 75 | // Android: Nexus One returns "Passion" (Nexus One code name) 76 | // Motorola Droid returns "voles" 77 | // BlackBerry: Torch 9800 returns "9800" 78 | // Browser: Google Chrome returns "Chrome" 79 | // Safari returns "Safari" 80 | // 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 ; 81 | 82 | 83 | ### Android 的怪癖 84 | 85 | * 獲取[產品名稱][1]而不是[產品型號名稱][2],這往往是生產代碼名稱。 例如,Nexus One 返回 `Passion` ,和摩托羅拉 Droid 返回`voles`. 86 | 87 | [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT 88 | [2]: http://developer.android.com/reference/android/os/Build.html#MODEL 89 | 90 | ### Tizen 怪癖 91 | 92 | * 例如,返回與供應商指派的設備模型`TIZEN` 93 | 94 | ### Windows Phone 7 和 8 怪癖 95 | 96 | * 返回由製造商指定的設備模型。例如,三星焦點返回`SGH-i917`. 97 | 98 | ## device.platform 99 | 100 | 獲取設備的作業系統名稱。 101 | 102 | var string = device.platform; 103 | 104 | 105 | ### 支援的平臺 106 | 107 | * Android 系統 108 | * 黑莓 10 109 | * Browser4 110 | * 火狐瀏覽器的作業系統 111 | * iOS 112 | * 泰 113 | * Windows Phone 7 和 8 114 | * Windows 8 115 | 116 | ### 快速的示例 117 | 118 | // Depending on the device, a few examples are: 119 | // - "Android" 120 | // - "BlackBerry 10" 121 | // - Browser: returns "MacIntel" on Mac 122 | // returns "Win32" on Windows 123 | // - "iOS" 124 | // - "WinCE" 125 | // - "Tizen" 126 | var devicePlatform = device.platform; 127 | 128 | 129 | ### Windows Phone 7 的怪癖 130 | 131 | Windows Phone 7 設備報告作為平臺`WinCE`. 132 | 133 | ### Windows Phone 8 怪癖 134 | 135 | Windows Phone 8 設備報告作為平臺`Win32NT`. 136 | 137 | ## device.uuid 138 | 139 | 獲取設備的通用唯一識別碼 ([UUID][3]). 140 | 141 | [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier 142 | 143 | var string = device.uuid; 144 | 145 | 146 | ### 說明 147 | 148 | 如何生成一個 UUID 的細節由設備製造商和特定于設備的平臺或模型。 149 | 150 | ### 支援的平臺 151 | 152 | * Android 系統 153 | * 黑莓 10 154 | * iOS 155 | * Tizen 156 | * Windows Phone 7 和 8 157 | * Windows 8 158 | 159 | ### 快速的示例 160 | 161 | / / Android: 一個隨機的 64 位整數 (作為字串返回,再次!) / / 上設備的第一次啟動生成的整數 / / / / 黑莓手機: 返回設備的 PIN 號碼 / / 這是九個數字的唯一整數 (作為字串,雖然!) / / / / iPhone: (從 UIDevice 類文檔解釋) / / 返回一個字串的雜湊值創建的多個硬體標識。 162 | / / 它保證是唯一的每個設備並不能綁 / / 到使用者帳戶。 163 | / / Windows Phone 7: 返回的雜湊代碼的設備 + 當前使用者,/ / 如果未定義使用者,則一個 guid 生成的並且將會保留直到卸載該應用程式 / / Tizen: 返回設備 IMEI (國際行動裝置身份或 IMEI 是一個數位 / / 獨有的每一個 UMTS 和 GSM 行動電話。 164 | var deviceID = device.uuid; 165 | 166 | 167 | ### iOS 怪癖 168 | 169 | `uuid`在 iOS 不是唯一的一種裝置,但對於每個應用程式,為每個安裝而異。 如果您刪除並重新安裝該應用程式,它更改和可能還當你升級 iOS,或甚至升級每個版本 (iOS 5.1 中存在明顯的) 的應用程式。 `uuid`不是一個可靠的值。 170 | 171 | ### Windows Phone 7 和 8 怪癖 172 | 173 | `uuid`為 Windows Phone 7 須經許可 `ID_CAP_IDENTITY_DEVICE` 。 Microsoft 可能會很快棄用此屬性。 如果沒有可用的能力,應用程式將生成設備上應用程式的安裝過程中保持持續的 guid。 174 | 175 | ## device.version 176 | 177 | 獲取作業系統版本。 178 | 179 | var string = device.version; 180 | 181 | 182 | ### 支援的平臺 183 | 184 | * Android 2.1 + 185 | * 黑莓 10 186 | * 瀏覽器 187 | * iOS 188 | * 泰 189 | * Windows Phone 7 和 8 190 | * Windows 8 191 | 192 | ### 快速的示例 193 | 194 | // Android: Froyo OS would return "2.2" 195 | // Eclair OS would return "2.1", "2.0.1", or "2.0" 196 | // Version can also return update level "2.1-update1" 197 | // 198 | // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600" 199 | // 200 | // Browser: Returns version number for the browser 201 | // 202 | // iPhone: iOS 3.2 returns "3.2" 203 | // 204 | // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720 205 | // Tizen: returns "TIZEN_20120425_2" 206 | var deviceVersion = device.version; -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 26 | Device 27 | Cordova Device Plugin 28 | Apache 2.0 29 | cordova,device 30 | https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git 31 | https://issues.apache.org/jira/browse/CB/component/12320648 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | read_device_identifying_information 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/android/Device.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova.device; 20 | 21 | import java.util.TimeZone; 22 | 23 | import org.apache.cordova.CordovaWebView; 24 | import org.apache.cordova.CallbackContext; 25 | import org.apache.cordova.CordovaPlugin; 26 | import org.apache.cordova.CordovaInterface; 27 | import org.json.JSONArray; 28 | import org.json.JSONException; 29 | import org.json.JSONObject; 30 | 31 | import android.provider.Settings; 32 | 33 | public class Device extends CordovaPlugin { 34 | public static final String TAG = "Device"; 35 | 36 | public static String platform; // Device OS 37 | public static String uuid; // Device UUID 38 | 39 | private static final String ANDROID_PLATFORM = "Android"; 40 | private static final String AMAZON_PLATFORM = "amazon-fireos"; 41 | private static final String AMAZON_DEVICE = "Amazon"; 42 | 43 | /** 44 | * Constructor. 45 | */ 46 | public Device() { 47 | } 48 | 49 | /** 50 | * Sets the context of the Command. This can then be used to do things like 51 | * get file paths associated with the Activity. 52 | * 53 | * @param cordova The context of the main Activity. 54 | * @param webView The CordovaWebView Cordova is running in. 55 | */ 56 | public void initialize(CordovaInterface cordova, CordovaWebView webView) { 57 | super.initialize(cordova, webView); 58 | Device.uuid = getUuid(); 59 | } 60 | 61 | /** 62 | * Executes the request and returns PluginResult. 63 | * 64 | * @param action The action to execute. 65 | * @param args JSONArry of arguments for the plugin. 66 | * @param callbackContext The callback id used when calling back into JavaScript. 67 | * @return True if the action was valid, false if not. 68 | */ 69 | public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { 70 | if (action.equals("getDeviceInfo")) { 71 | JSONObject r = new JSONObject(); 72 | r.put("uuid", Device.uuid); 73 | r.put("version", this.getOSVersion()); 74 | r.put("platform", this.getPlatform()); 75 | r.put("model", this.getModel()); 76 | callbackContext.success(r); 77 | } 78 | else { 79 | return false; 80 | } 81 | return true; 82 | } 83 | 84 | //-------------------------------------------------------------------------- 85 | // LOCAL METHODS 86 | //-------------------------------------------------------------------------- 87 | 88 | /** 89 | * Get the OS name. 90 | * 91 | * @return 92 | */ 93 | public String getPlatform() { 94 | String platform; 95 | if (isAmazonDevice()) { 96 | platform = AMAZON_PLATFORM; 97 | } else { 98 | platform = ANDROID_PLATFORM; 99 | } 100 | return platform; 101 | } 102 | 103 | /** 104 | * Get the device's Universally Unique Identifier (UUID). 105 | * 106 | * @return 107 | */ 108 | public String getUuid() { 109 | String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); 110 | return uuid; 111 | } 112 | 113 | public String getModel() { 114 | String model = android.os.Build.MODEL; 115 | return model; 116 | } 117 | 118 | public String getProductName() { 119 | String productname = android.os.Build.PRODUCT; 120 | return productname; 121 | } 122 | 123 | /** 124 | * Get the OS version. 125 | * 126 | * @return 127 | */ 128 | public String getOSVersion() { 129 | String osversion = android.os.Build.VERSION.RELEASE; 130 | return osversion; 131 | } 132 | 133 | public String getSDKVersion() { 134 | @SuppressWarnings("deprecation") 135 | String sdkversion = android.os.Build.VERSION.SDK; 136 | return sdkversion; 137 | } 138 | 139 | public String getTimeZoneID() { 140 | TimeZone tz = TimeZone.getDefault(); 141 | return (tz.getID()); 142 | } 143 | 144 | /** 145 | * Function to check if the device is manufactured by Amazon 146 | * 147 | * @return 148 | */ 149 | public boolean isAmazonDevice() { 150 | if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) { 151 | return true; 152 | } 153 | return false; 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/blackberry10/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | function getModelName () { 23 | var modelName = window.qnx.webplatform.device.modelName; 24 | //Pre 10.2 (meaning Z10 or Q10) 25 | if (typeof modelName === "undefined") { 26 | if (window.screen.height === 720 && window.screen.width === 720) { 27 | if ( window.matchMedia("(-blackberry-display-technology: -blackberry-display-oled)").matches) { 28 | modelName = "Q10"; 29 | } else { 30 | modelName = "Q5"; 31 | } 32 | } else if ((window.screen.height === 1280 && window.screen.width === 768) || 33 | (window.screen.height === 768 && window.screen.width === 1280)) { 34 | modelName = "Z10"; 35 | } else { 36 | modelName = window.qnx.webplatform.deviceName; 37 | } 38 | } 39 | 40 | return modelName; 41 | } 42 | 43 | function getUUID () { 44 | var uuid = ""; 45 | try { 46 | //Must surround by try catch because this will throw if the app is missing permissions 47 | uuid = window.qnx.webplatform.device.devicePin; 48 | } catch (e) { 49 | //DO Nothing 50 | } 51 | return uuid; 52 | } 53 | 54 | module.exports = { 55 | getDeviceInfo: function (success, fail, args, env) { 56 | var result = new PluginResult(args, env), 57 | modelName = getModelName(), 58 | uuid = getUUID(), 59 | info = { 60 | platform: "blackberry10", 61 | version: window.qnx.webplatform.device.scmBundle, 62 | model: modelName, 63 | uuid: uuid 64 | }; 65 | 66 | result.ok(info); 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/browser/DeviceProxy.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | var browser = require('cordova/platform'); 22 | var cordova = require('cordova'); 23 | 24 | function getPlatform() { 25 | return navigator.platform; 26 | } 27 | 28 | function getModel() { 29 | return getBrowserInfo(true); 30 | } 31 | 32 | function getVersion() { 33 | return getBrowserInfo(false); 34 | } 35 | 36 | function getBrowserInfo(getModel) { 37 | var userAgent = navigator.userAgent; 38 | var returnVal; 39 | 40 | if ((offset = userAgent.indexOf('Chrome')) !== -1) { 41 | returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7); 42 | } else if ((offset = userAgent.indexOf('Safari')) !== -1) { 43 | if (getModel) { 44 | returnVal = 'Safari'; 45 | } else { 46 | returnVal = userAgent.substring(offset + 7); 47 | 48 | if ((offset = userAgent.indexOf('Version')) !== -1) { 49 | returnVal = userAgent.substring(offset + 8); 50 | } 51 | } 52 | } else if ((offset = userAgent.indexOf('Firefox')) !== -1) { 53 | returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8); 54 | } 55 | 56 | if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) { 57 | returnVal = returnVal.substring(0, offset); 58 | } 59 | 60 | return returnVal; 61 | } 62 | 63 | 64 | module.exports = { 65 | getDeviceInfo: function (success, error) { 66 | setTimeout(function () { 67 | success({ 68 | cordova: browser.cordovaVersion, 69 | platform: getPlatform(), 70 | model: getModel(), 71 | version: getVersion(), 72 | uuid: null 73 | }); 74 | }, 0); 75 | } 76 | }; 77 | 78 | require("cordova/exec/proxy").add("Device", module.exports); 79 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/firefoxos/DeviceProxy.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | //example UA String for Firefox OS 22 | //Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0 23 | var firefoxos = require('cordova/platform'); 24 | var cordova = require('cordova'); 25 | 26 | //UA parsing not recommended but currently this is the only way to get the Firefox OS version 27 | //https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference 28 | 29 | //Should be replaced when better conversion to Firefox OS Version is available 30 | function convertVersionNumber(ver) { 31 | var hashVersion = { 32 | '18.0': '1.0.1', 33 | '18.1': '1.1', 34 | '26.0': '1.2', 35 | '28.0': '1.3', 36 | '30.0': '1.4', 37 | '32.0': '2.0' 38 | }; 39 | var rver = ver; 40 | var sStr = ver.substring(0, 4); 41 | if (hashVersion[sStr]) { 42 | rver = hashVersion[sStr]; 43 | } 44 | return (rver); 45 | 46 | } 47 | function getVersion() { 48 | if (navigator.userAgent.match(/(mobile|tablet)/i)) { 49 | var ffVersionArray = (navigator.userAgent.match(/Firefox\/([\d]+\.[\w]?\.?[\w]+)/)); 50 | if (ffVersionArray.length === 2) { 51 | return (convertVersionNumber(ffVersionArray[1])); 52 | } 53 | } 54 | return (null); 55 | } 56 | 57 | function getModel() { 58 | var uaArray = navigator.userAgent.split(/\s*[;)(]\s*/); 59 | if (navigator.userAgent.match(/(mobile|tablet)/i)) { 60 | if (uaArray.length === 5) { 61 | return (uaArray[2]); 62 | } 63 | } 64 | return (null); 65 | } 66 | module.exports = { 67 | getDeviceInfo: function (success, error) { 68 | setTimeout(function () { 69 | success({ 70 | platform: 'firefoxos', 71 | model: getModel(), 72 | version: getVersion(), 73 | uuid: null 74 | }); 75 | }, 0); 76 | } 77 | }; 78 | 79 | require("cordova/exec/proxy").add("Device", module.exports); 80 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/ios/CDVDevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | #import 21 | #import 22 | 23 | @interface CDVDevice : CDVPlugin 24 | {} 25 | 26 | + (NSString*)cordovaVersion; 27 | 28 | - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/ios/CDVDevice.m: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #import 24 | #import "CDVDevice.h" 25 | 26 | @implementation UIDevice (ModelVersion) 27 | 28 | - (NSString*)modelVersion 29 | { 30 | size_t size; 31 | 32 | sysctlbyname("hw.machine", NULL, &size, NULL, 0); 33 | char* machine = malloc(size); 34 | sysctlbyname("hw.machine", machine, &size, NULL, 0); 35 | NSString* platform = [NSString stringWithUTF8String:machine]; 36 | free(machine); 37 | 38 | return platform; 39 | } 40 | 41 | @end 42 | 43 | @interface CDVDevice () {} 44 | @end 45 | 46 | @implementation CDVDevice 47 | 48 | - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command 49 | { 50 | NSDictionary* deviceProperties = [self deviceProperties]; 51 | CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties]; 52 | 53 | /* Settings.plist 54 | * Read the optional Settings.plist file and push these user-defined settings down into the web application. 55 | * This can be useful for supplying build-time configuration variables down to the app to change its behavior, 56 | * such as specifying Full / Lite version, or localization (English vs German, for instance). 57 | */ 58 | // TODO: turn this into an iOS only plugin 59 | NSDictionary* temp = [CDVViewController getBundlePlist:@"Settings"]; 60 | 61 | if ([temp respondsToSelector:@selector(JSONString)]) { 62 | NSLog(@"Deprecation warning: window.Setting will be removed Aug 2013. Refer to https://issues.apache.org/jira/browse/CB-2433"); 63 | NSString* js = [NSString stringWithFormat:@"window.Settings = %@;", [temp JSONString]]; 64 | [self.commandDelegate evalJs:js]; 65 | } 66 | 67 | [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; 68 | } 69 | 70 | - (NSDictionary*)deviceProperties 71 | { 72 | UIDevice* device = [UIDevice currentDevice]; 73 | NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4]; 74 | 75 | [devProps setObject:[device modelVersion] forKey:@"model"]; 76 | [devProps setObject:@"iOS" forKey:@"platform"]; 77 | [devProps setObject:[device systemVersion] forKey:@"version"]; 78 | [devProps setObject:[device uniqueAppInstanceIdentifier] forKey:@"uuid"]; 79 | [devProps setObject:[[self class] cordovaVersion] forKey:@"cordova"]; 80 | 81 | NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps]; 82 | return devReturn; 83 | } 84 | 85 | + (NSString*)cordovaVersion 86 | { 87 | return CDV_VERSION; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/tizen/DeviceProxy.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | var tizen = require('cordova/platform'); 23 | var cordova = require('cordova'); 24 | 25 | module.exports = { 26 | getDeviceInfo: function(success, error) { 27 | setTimeout(function () { 28 | success({ 29 | cordova: tizen.cordovaVersion, 30 | platform: 'tizen', 31 | model: null, 32 | version: null, 33 | uuid: null 34 | }); 35 | }, 0); 36 | } 37 | }; 38 | 39 | require("cordova/tizen/commandProxy").add("Device", module.exports); 40 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/ubuntu/device.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Wolfgang Koller - http://www.gofg.at/ 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include"device.h" 21 | 22 | #define CORDOVA "3.0.0" 23 | 24 | Device::Device(Cordova *cordova) : CPlugin(cordova) { 25 | } 26 | 27 | static QString getOSName() { 28 | #ifdef Q_OS_SYMBIAN 29 | QString platform = "Symbian"; 30 | #endif 31 | #ifdef Q_OS_WIN 32 | QString platform = "Windows"; 33 | #endif 34 | #ifdef Q_OS_WINCE 35 | QString platform = "Windows CE"; 36 | #endif 37 | #ifdef Q_OS_LINUX 38 | QString platform = "Linux"; 39 | #endif 40 | return platform; 41 | } 42 | 43 | void Device::getInfo(int scId, int ecId) { 44 | Q_UNUSED(ecId) 45 | 46 | QDeviceInfo systemDeviceInfo; 47 | QDeviceInfo systemInfo; 48 | 49 | QString platform = getOSName(); 50 | 51 | QString uuid = systemDeviceInfo.uniqueDeviceID(); 52 | if (uuid.isEmpty()) { 53 | QString deviceDescription = systemInfo.imei(0) + ";" + systemInfo.manufacturer() + ";" + systemInfo.model() + ";" + systemInfo.productName() + ";" + platform; 54 | QString user = qgetenv("USER"); 55 | if (user.isEmpty()) { 56 | user = qgetenv("USERNAME"); 57 | if (user.isEmpty()) 58 | user = QDir::homePath(); 59 | } 60 | uuid = QString(QCryptographicHash::hash((deviceDescription + ";" + user).toUtf8(), QCryptographicHash::Md5).toHex()); 61 | } 62 | 63 | this->cb(scId, systemDeviceInfo.model(), CORDOVA, platform, uuid, systemInfo.version(QDeviceInfo::Os)); 64 | } 65 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/ubuntu/device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Wolfgang Koller - http://www.gofg.at/ 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef DEVICE_H_FDSAFAS 18 | #define DEVICE_H_FDSAFAS 19 | 20 | #include 21 | 22 | #include 23 | 24 | class Device: public CPlugin { 25 | Q_OBJECT 26 | public: 27 | explicit Device(Cordova *cordova); 28 | 29 | virtual const QString fullName() override { 30 | return Device::fullID(); 31 | } 32 | 33 | virtual const QString shortName() override { 34 | return "Device"; 35 | } 36 | 37 | static const QString fullID() { 38 | return "com.cordova.Device"; 39 | } 40 | 41 | signals: 42 | 43 | public slots: 44 | void getInfo(int scId, int ecId); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/ubuntu/device.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | var cordova = require('cordova'); 23 | var exec = require('cordova/exec'); 24 | 25 | module.exports = { 26 | getInfo:function(win,fail,args) { 27 | Cordova.exec(function (model, cordova, platform, uuid, version) { 28 | win({name: name, model: model, cordova: cordova, 29 | platform: platform, uuid: uuid, version: version}); 30 | }, null, "com.cordova.Device", "getInfo", []); 31 | } 32 | }; 33 | 34 | require("cordova/exec/proxy").add("Device", module.exports); 35 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/windows/DeviceProxy.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | module.exports = { 23 | 24 | getDeviceInfo:function(win, fail, args) { 25 | 26 | // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId 27 | var deviceId; 28 | var localSettings = Windows.Storage.ApplicationData.current.localSettings; 29 | if (localSettings.values.deviceId) { 30 | deviceId = localSettings.values.deviceId; 31 | } 32 | else { 33 | // App-specific hardware id could be used as uuid, but it changes if the hardware changes... 34 | try { 35 | var ASHWID = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null).id; 36 | deviceId = Windows.Storage.Streams.DataReader.fromBuffer(ASHWID).readGuid(); 37 | } catch (e) { 38 | // Couldn't get the hardware UUID 39 | deviceId = createUUID(); 40 | } 41 | //...so cache it per-install 42 | localSettings.values.deviceId = deviceId; 43 | } 44 | 45 | var userAgent = window.clientInformation.userAgent, 46 | // this will report "windows" in windows8.1 and windows phone 8.1 apps 47 | // and "windows8" in windows 8.0 apps similar to cordova.js 48 | // See https://github.com/apache/cordova-js/blob/master/src/windows/platform.js#L25 49 | devicePlatform = userAgent.indexOf("MSAppHost/1.0") == -1 ? "windows" : "windows8", 50 | versionString = userAgent.match(/Windows (?:Phone |NT )?([0-9.]+)/)[1]; 51 | 52 | var ROOT_CONTAINER = "{00000000-0000-0000-FFFF-FFFFFFFFFFFF}"; 53 | var DEVICE_CLASS_KEY = "{A45C254E-DF1C-4EFD-8020-67D146A850E0},10"; 54 | var DEVICE_CLASS_KEY_NO_SEMICOLON = '{A45C254E-DF1C-4EFD-8020-67D146A850E0}10'; 55 | var ROOT_CONTAINER_QUERY = "System.Devices.ContainerId:=\"" + ROOT_CONTAINER + "\""; 56 | var HAL_DEVICE_CLASS = "4d36e966-e325-11ce-bfc1-08002be10318"; 57 | var DEVICE_DRIVER_VERSION_KEY = "{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"; 58 | var pnpObject = Windows.Devices.Enumeration.Pnp.PnpObject; 59 | pnpObject.findAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType.device, 60 | [DEVICE_DRIVER_VERSION_KEY, DEVICE_CLASS_KEY], ROOT_CONTAINER_QUERY) 61 | .then(function(rootDevices) { 62 | for (var i = 0; i < rootDevices.length; i++) { 63 | var rootDevice = rootDevices[i]; 64 | if (!rootDevice.properties) continue; 65 | if (rootDevice.properties[DEVICE_CLASS_KEY_NO_SEMICOLON] == HAL_DEVICE_CLASS) { 66 | versionString = rootDevice.properties[DEVICE_DRIVER_VERSION_KEY]; 67 | break; 68 | } 69 | } 70 | 71 | setTimeout(function () { 72 | win({ platform: devicePlatform, version: versionString, 73 | uuid: deviceId, model: window.clientInformation.platform }); 74 | }, 0); 75 | }); 76 | } 77 | 78 | }; 79 | 80 | require("cordova/exec/proxy").add("Device", module.exports); 81 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/windows8/DeviceProxy.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | 23 | var cordova = require('cordova'); 24 | var utils = require('cordova/utils'); 25 | 26 | module.exports = { 27 | 28 | getDeviceInfo:function(win,fail,args) { 29 | 30 | // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId 31 | var deviceId; 32 | 33 | var localSettings = Windows.Storage.ApplicationData.current.localSettings; 34 | 35 | if (localSettings.values.deviceId) { 36 | deviceId = localSettings.values.deviceId; 37 | } 38 | else { 39 | // App-specific hardware id could be used as uuid, but it changes if the hardware changes... 40 | try { 41 | var ASHWID = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null).id; 42 | deviceId = Windows.Storage.Streams.DataReader.fromBuffer(ASHWID).readGuid(); 43 | } catch (e) { 44 | // Couldn't get the hardware UUID 45 | deviceId = createUUID(); 46 | } 47 | //...so cache it per-install 48 | localSettings.values.deviceId = deviceId; 49 | } 50 | 51 | var versionString = window.clientInformation.userAgent.match(/Windows NT ([0-9.]+)/)[1]; 52 | 53 | (function(self){ 54 | var ROOT_CONTAINER = "{00000000-0000-0000-FFFF-FFFFFFFFFFFF}"; 55 | var DEVICE_CLASS_KEY = "{A45C254E-DF1C-4EFD-8020-67D146A850E0},10"; 56 | var DEVICE_CLASS_KEY_NO_SEMICOLON = '{A45C254E-DF1C-4EFD-8020-67D146A850E0}10'; 57 | var ROOT_CONTAINER_QUERY = "System.Devices.ContainerId:=\"" + ROOT_CONTAINER + "\""; 58 | var HAL_DEVICE_CLASS = "4d36e966-e325-11ce-bfc1-08002be10318"; 59 | var DEVICE_DRIVER_VERSION_KEY = "{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"; 60 | var pnpObject = Windows.Devices.Enumeration.Pnp.PnpObject; 61 | pnpObject.findAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType.device, [DEVICE_DRIVER_VERSION_KEY, DEVICE_CLASS_KEY], ROOT_CONTAINER_QUERY).then(function(rootDevices) { 62 | 63 | for (var i = 0; i < rootDevices.length; i++) { 64 | var rootDevice = rootDevices[i]; 65 | if (!rootDevice.properties) continue; 66 | if (rootDevice.properties[DEVICE_CLASS_KEY_NO_SEMICOLON] == HAL_DEVICE_CLASS) { 67 | versionString = rootDevice.properties[DEVICE_DRIVER_VERSION_KEY]; 68 | break; 69 | } 70 | } 71 | 72 | setTimeout(function () { 73 | win({ platform: "windows8", version: versionString, uuid: deviceId, model: window.clientInformation.platform }); 74 | }, 0); 75 | }); 76 | })(this); 77 | } 78 | 79 | }; 80 | 81 | require("cordova/exec/proxy").add("Device", module.exports); 82 | 83 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/src/wp/Device.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | using System; 16 | using System.Net; 17 | using System.Windows; 18 | using System.Windows.Controls; 19 | using System.Windows.Documents; 20 | using System.Windows.Ink; 21 | using System.Windows.Input; 22 | using System.Windows.Media; 23 | using System.Windows.Media.Animation; 24 | using System.Windows.Shapes; 25 | using Microsoft.Phone.Info; 26 | using System.IO.IsolatedStorage; 27 | using System.Windows.Resources; 28 | using System.IO; 29 | using System.Diagnostics; 30 | 31 | namespace WPCordovaClassLib.Cordova.Commands 32 | { 33 | public class Device : BaseCommand 34 | { 35 | public void getDeviceInfo(string notused) 36 | { 37 | 38 | string res = String.Format("\"name\":\"{0}\",\"platform\":\"{1}\",\"uuid\":\"{2}\",\"version\":\"{3}\",\"model\":\"{4}\"", 39 | this.name, 40 | this.platform, 41 | this.uuid, 42 | this.version, 43 | this.model); 44 | 45 | res = "{" + res + "}"; 46 | //Debug.WriteLine("Result::" + res); 47 | DispatchCommandResult(new PluginResult(PluginResult.Status.OK, res)); 48 | } 49 | 50 | public string model 51 | { 52 | get 53 | { 54 | return DeviceStatus.DeviceName; 55 | //return String.Format("{0},{1},{2}", DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceHardwareVersion, DeviceStatus.DeviceFirmwareVersion); 56 | } 57 | } 58 | 59 | public string name 60 | { 61 | get 62 | { 63 | return DeviceStatus.DeviceName; 64 | 65 | } 66 | } 67 | 68 | public string platform 69 | { 70 | get 71 | { 72 | return Environment.OSVersion.Platform.ToString(); 73 | } 74 | } 75 | 76 | public string uuid 77 | { 78 | get 79 | { 80 | string returnVal = ""; 81 | object id; 82 | UserExtendedProperties.TryGetValue("ANID", out id); 83 | 84 | if (id != null) 85 | { 86 | returnVal = id.ToString().Substring(2, 32); 87 | } 88 | else 89 | { 90 | returnVal = "???unknown???"; 91 | 92 | using (IsolatedStorageFile appStorage = IsolatedStorageFile.GetUserStoreForApplication()) 93 | { 94 | try 95 | { 96 | IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("DeviceID.txt", FileMode.Open, FileAccess.Read, appStorage); 97 | 98 | using (StreamReader reader = new StreamReader(fileStream)) 99 | { 100 | returnVal = reader.ReadLine(); 101 | } 102 | } 103 | catch (Exception /*ex*/) 104 | { 105 | 106 | } 107 | } 108 | } 109 | 110 | return returnVal; 111 | } 112 | } 113 | 114 | public string version 115 | { 116 | get 117 | { 118 | return Environment.OSVersion.Version.ToString(); 119 | } 120 | } 121 | 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/tests/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 26 | Cordova Device Plugin Tests 27 | Apache 2.0 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/tests/tests.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | exports.defineAutoTests = function() { 23 | describe('Device Information (window.device)', function () { 24 | it("should exist", function() { 25 | expect(window.device).toBeDefined(); 26 | }); 27 | 28 | it("should contain a platform specification that is a string", function() { 29 | expect(window.device.platform).toBeDefined(); 30 | expect((new String(window.device.platform)).length > 0).toBe(true); 31 | }); 32 | 33 | it("should contain a version specification that is a string", function() { 34 | expect(window.device.version).toBeDefined(); 35 | expect((new String(window.device.version)).length > 0).toBe(true); 36 | }); 37 | 38 | it("should contain a UUID specification that is a string or a number", function() { 39 | expect(window.device.uuid).toBeDefined(); 40 | if (typeof window.device.uuid == 'string' || typeof window.device.uuid == 'object') { 41 | expect((new String(window.device.uuid)).length > 0).toBe(true); 42 | } else { 43 | expect(window.device.uuid > 0).toBe(true); 44 | } 45 | }); 46 | 47 | it("should contain a cordova specification that is a string", function() { 48 | expect(window.device.cordova).toBeDefined(); 49 | expect((new String(window.device.cordova)).length > 0).toBe(true); 50 | }); 51 | 52 | it("should depend on the precense of cordova.version string", function() { 53 | expect(window.cordova.version).toBeDefined(); 54 | expect((new String(window.cordova.version)).length > 0).toBe(true); 55 | }); 56 | 57 | it("should contain device.cordova equal to cordova.version", function() { 58 | expect(window.device.cordova).toBe(window.cordova.version); 59 | }); 60 | 61 | it("should contain a model specification that is a string", function() { 62 | expect(window.device.model).toBeDefined(); 63 | expect((new String(window.device.model)).length > 0).toBe(true); 64 | }); 65 | }); 66 | }; 67 | 68 | exports.defineManualTests = function(contentEl, createActionButton) { 69 | var logMessage = function (message, color) { 70 | var log = document.getElementById('info'); 71 | var logLine = document.createElement('div'); 72 | if (color) { 73 | logLine.style.color = color; 74 | } 75 | logLine.innerHTML = message; 76 | log.appendChild(logLine); 77 | } 78 | 79 | var clearLog = function () { 80 | var log = document.getElementById('info'); 81 | log.innerHTML = ''; 82 | } 83 | 84 | var device_tests = '

Press Dump Device button to get device information

' + 85 | '
' + 86 | 'Expected result: Status box will get updated with device info. (i.e. platform, version, uuid, model, etc)'; 87 | 88 | contentEl.innerHTML = '
' + device_tests; 89 | 90 | createActionButton('Dump device', function() { 91 | clearLog(); 92 | logMessage(JSON.stringify(window.device, null, '\t')); 93 | }, "dump_device"); 94 | }; 95 | -------------------------------------------------------------------------------- /example/plugins/org.apache.cordova.device/www/device.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | var argscheck = require('cordova/argscheck'), 23 | channel = require('cordova/channel'), 24 | utils = require('cordova/utils'), 25 | exec = require('cordova/exec'), 26 | cordova = require('cordova'); 27 | 28 | channel.createSticky('onCordovaInfoReady'); 29 | // Tell cordova channel to wait on the CordovaInfoReady event 30 | channel.waitForInitialization('onCordovaInfoReady'); 31 | 32 | /** 33 | * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the 34 | * phone, etc. 35 | * @constructor 36 | */ 37 | function Device() { 38 | this.available = false; 39 | this.platform = null; 40 | this.version = null; 41 | this.uuid = null; 42 | this.cordova = null; 43 | this.model = null; 44 | 45 | var me = this; 46 | 47 | channel.onCordovaReady.subscribe(function() { 48 | me.getInfo(function(info) { 49 | //ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js 50 | //TODO: CB-5105 native implementations should not return info.cordova 51 | var buildLabel = cordova.version; 52 | me.available = true; 53 | me.platform = info.platform; 54 | me.version = info.version; 55 | me.uuid = info.uuid; 56 | me.cordova = buildLabel; 57 | me.model = info.model; 58 | channel.onCordovaInfoReady.fire(); 59 | },function(e) { 60 | me.available = false; 61 | utils.alert("[ERROR] Error initializing Cordova: " + e); 62 | }); 63 | }); 64 | } 65 | 66 | /** 67 | * Get device info 68 | * 69 | * @param {Function} successCallback The function to call when the heading data is available 70 | * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) 71 | */ 72 | Device.prototype.getInfo = function(successCallback, errorCallback) { 73 | argscheck.checkArgs('fF', 'Device.getInfo', arguments); 74 | exec(successCallback, errorCallback, "Device", "getDeviceInfo", []); 75 | }; 76 | 77 | module.exports = new Device(); 78 | -------------------------------------------------------------------------------- /example/scss/ionic.app.scss: -------------------------------------------------------------------------------- 1 | /* 2 | To customize the look and feel of Ionic, you can override the variables 3 | in ionic's _variables.scss file. 4 | 5 | For example, you might change some of the default colors: 6 | 7 | $light: #fff !default; 8 | $stable: #f8f8f8 !default; 9 | $positive: #4a87ee !default; 10 | $calm: #43cee6 !default; 11 | $balanced: #66cc33 !default; 12 | $energized: #f0b840 !default; 13 | $assertive: #ef4e3a !default; 14 | $royal: #8a6de9 !default; 15 | $dark: #444 !default; 16 | */ 17 | 18 | // The path for our ionicons font files, relative to the built CSS in www/css 19 | $ionicons-font-path: "../lib/ionic/fonts" !default; 20 | 21 | // Include all of Ionic 22 | @import "www/lib/ionic/scss/ionic"; 23 | 24 | -------------------------------------------------------------------------------- /example/www/css/style.css: -------------------------------------------------------------------------------- 1 | /* Your app's CSS, go crazy, make it your own */ 2 | 3 | .ionic-logo { 4 | display: block; 5 | margin: 15px auto; 6 | width: 96px; 7 | height: 96px; 8 | } 9 | 10 | .pane { 11 | background-color: #333; 12 | } 13 | 14 | .bar.bar-transparent { 15 | background-color: transparent; 16 | background-image: none; 17 | border: none; 18 | } 19 | 20 | .bar .title { 21 | color: #eee; 22 | } 23 | 24 | .swipe-cards { 25 | position: fixed; 26 | } 27 | 28 | swipe-card { 29 | display: none; 30 | position: fixed; 31 | -webkit-transform: scale(1,1); 32 | left: 50%; 33 | top: 50%; 34 | width: 300px; 35 | height: 300px; 36 | margin-left: -150px; 37 | margin-top: -150px; 38 | box-sizing: border-box; 39 | background-color: rgb(255,255,255); 40 | border-radius: 4px; 41 | overflow: hidden; 42 | -webkit-animation-fill-mode: forwards; 43 | } 44 | 45 | swipe-card .title { 46 | height: 40px; 47 | padding: 5px; 48 | line-height: 30px; 49 | color: #444; 50 | } 51 | swipe-card .image { 52 | overflow: hidden; 53 | max-height: 210px; 54 | } 55 | swipe-card .button { 56 | border: none; 57 | } 58 | swipe-card .image img { 59 | width: 100%; 60 | border-radius: 0px 0px 4px 4px; 61 | } 62 | 63 | #start-card { 64 | color: #fff; 65 | background-color: #30BD8A; 66 | line-height: 300px; 67 | word-wrap: break-word; 68 | border: 6px solid #4CD68E; 69 | text-align: center; 70 | } 71 | #start-card span { 72 | display: inline-block; 73 | line-height: 40px; 74 | width: 200px; 75 | font-size: 30px; 76 | vertical-align: middle; 77 | } 78 | 79 | #footer .button { 80 | color: #fff; 81 | } 82 | 83 | @-webkit-keyframes bounceIn { 84 | 0% { 85 | -webkit-transform: scale(0,0); 86 | } 87 | 70% { 88 | -webkit-transform: scale(1.2,1.2); 89 | } 90 | 100% { 91 | -webkit-transform: scale(1,1); 92 | } 93 | } 94 | 95 | swipe-card.pop-in-start { 96 | -webkit-transform: scale(0,0); 97 | } 98 | swipe-card.pop-in { 99 | -webkit-animation: bounceIn 0.4s ease-out; 100 | } 101 | -------------------------------------------------------------------------------- /example/www/img/ionic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/img/ionic.png -------------------------------------------------------------------------------- /example/www/img/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/img/pic.png -------------------------------------------------------------------------------- /example/www/img/pic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/img/pic2.png -------------------------------------------------------------------------------- /example/www/img/pic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/img/pic3.png -------------------------------------------------------------------------------- /example/www/img/pic4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/img/pic4.png -------------------------------------------------------------------------------- /example/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |

Help Out

33 |
34 | 35 | 36 | 37 | Swipe down for a new card 38 | 39 | 40 |
41 |
42 | {{card.title}} 43 |
44 |
45 | 46 |
47 |
48 | 49 | 50 |
51 |
52 |
53 |
54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/www/js/app.js: -------------------------------------------------------------------------------- 1 | // Ionic Starter App 2 | 3 | // angular.module is a global place for creating, registering and retrieving Angular modules 4 | // 'starter' is the name of this angular module example (also set in a attribute in index.html) 5 | // the 2nd parameter is an array of 'requires' 6 | angular.module('starter', ['ionic', 'ionic.contrib.ui.cards']) 7 | 8 | .run(function($ionicPlatform) { 9 | $ionicPlatform.ready(function() { 10 | // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 11 | // for form inputs) 12 | if (window.cordova && window.cordova.plugins.Keyboard) { 13 | cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 14 | } 15 | if (window.StatusBar) { 16 | StatusBar.styleDefault(); 17 | } 18 | }); 19 | }) 20 | 21 | .directive('noScroll', function($document) { 22 | 23 | return { 24 | restrict: 'A', 25 | link: function($scope, $element, $attr) { 26 | 27 | $document.on('touchmove', function(e) { 28 | e.preventDefault(); 29 | }); 30 | } 31 | } 32 | }) 33 | 34 | 35 | .controller('CardsCtrl', function($scope, $ionicSwipeCardDelegate) { 36 | var cardTypes = [{ 37 | title: 'Swipe down to clear the card', 38 | image: 'img/pic.png' 39 | }, { 40 | title: 'Where is this?', 41 | image: 'img/pic.png' 42 | }, { 43 | title: 'What kind of grass is this?', 44 | image: 'img/pic2.png' 45 | }, { 46 | title: 'What beach is this?', 47 | image: 'img/pic3.png' 48 | }, { 49 | title: 'What kind of clouds are these?', 50 | image: 'img/pic4.png' 51 | }]; 52 | 53 | $scope.cards = Array.prototype.slice.call(cardTypes, 0, 0); 54 | 55 | $scope.cardSwiped = function(index) { 56 | $scope.addCard(); 57 | }; 58 | 59 | $scope.cardDestroyed = function(index) { 60 | $scope.cards.splice(index, 1); 61 | }; 62 | 63 | $scope.addCard = function() { 64 | var newCard = cardTypes[Math.floor(Math.random() * cardTypes.length)]; 65 | newCard.id = Math.random(); 66 | $scope.cards.push(angular.extend({}, newCard)); 67 | } 68 | }) 69 | 70 | .controller('CardCtrl', function($scope, $ionicSwipeCardDelegate) { 71 | $scope.goAway = function() { 72 | var card = $ionicSwipeCardDelegate.getSwipeableCard($scope); 73 | card.swipe(); 74 | }; 75 | }); 76 | -------------------------------------------------------------------------------- /example/www/lib/ionic/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/lib/ionic/fonts/ionicons.eot -------------------------------------------------------------------------------- /example/www/lib/ionic/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/lib/ionic/fonts/ionicons.ttf -------------------------------------------------------------------------------- /example/www/lib/ionic/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-ion-swipe-cards/bf014776de0ccff3d53f278351ba2781e8a2feb7/example/www/lib/ionic/fonts/ionicons.woff -------------------------------------------------------------------------------- /example/www/lib/ionic/js/angular/angular-resource.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.6 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(I,d,B){'use strict';function D(f,q){q=q||{};d.forEach(q,function(d,h){delete q[h]});for(var h in f)!f.hasOwnProperty(h)||"$"===h.charAt(0)&&"$"===h.charAt(1)||(q[h]=f[h]);return q}var w=d.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var f=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}}; 7 | this.$get=["$http","$q",function(q,h){function t(d,g){this.template=d;this.defaults=s({},f.defaults,g);this.urlParams={}}function v(x,g,l,m){function c(b,k){var c={};k=s({},g,k);r(k,function(a,k){u(a)&&(a=a());var d;if(a&&a.charAt&&"@"==a.charAt(0)){d=b;var e=a.substr(1);if(null==e||""===e||"hasOwnProperty"===e||!C.test("."+e))throw w("badmember",e);for(var e=e.split("."),n=0,g=e.length;n=c;e--)d.end&&d.end(f[e]);f.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,k,f=[],m=a,l;for(f.last=function(){return f[f.length-1]};a;){l="";k=!0;if(f.last()&&x[f.last()])a=a.replace(new RegExp("(.*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(a,b){b=b.replace(H,"$1").replace(I,"$1");d.chars&&d.chars(r(b));return""}),e("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(d.comment&&d.comment(a.substring(4, 8 | b)),a=a.substring(b+3),k=!1);else if(y.test(a)){if(b=a.match(y))a=a.replace(b[0],""),k=!1}else if(J.test(a)){if(b=a.match(z))a=a.substring(b[0].length),b[0].replace(z,e),k=!1}else K.test(a)&&((b=a.match(A))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(A,c)),k=!1):(l+="<",a=a.substring(1)));k&&(b=a.indexOf("<"),l+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),d.chars&&d.chars(r(l)))}if(a==m)throw L("badparse",a);m=a}e()}function r(a){if(!a)return"";var d=M.exec(a);a=d[1];var c=d[3];if(d=d[2])q.innerHTML= 9 | d.replace(//g,">")}function s(a,d){var c=!1,e=h.bind(a,a.push);return{start:function(a,k,f){a=h.lowercase(a);!c&&x[a]&&(c=a);c||!0!==C[a]||(e("<"),e(a),h.forEach(k,function(c,f){var k= 10 | h.lowercase(f),g="img"===a&&"src"===k||"background"===k;!0!==P[k]||!0===D[k]&&!d(c,g)||(e(" "),e(f),e('="'),e(B(c)),e('"'))}),e(f?"/>":">"))},end:function(a){a=h.lowercase(a);c||!0!==C[a]||(e(""));a==c&&(c=!1)},chars:function(a){c||e(B(a))}}}var L=h.$$minErr("$sanitize"),A=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,z=/^<\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^]*?)>/i,I=/"\u201d\u2019]/,c=/^mailto:/;return function(e,b){function k(a){a&&g.push(E(a))} 15 | function f(a,c){g.push("');k(c);g.push("")}if(!e)return e;for(var m,l=e,g=[],n,p;m=l.match(d);)n=m[0],m[2]||m[4]||(n=(m[3]?"http://":"mailto:")+n),p=m.index,k(l.substr(0,p)),f(n,m[0].replace(c,"")),l=l.substring(p+m[0].length);k(l);return a(g.join(""))}}])})(window,window.angular); 16 | //# sourceMappingURL=angular-sanitize.min.js.map 17 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_action-sheet.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Action Sheets 3 | * -------------------------------------------------- 4 | */ 5 | 6 | .action-sheet-backdrop { 7 | @include transition(background-color 300ms ease-in-out); 8 | position: fixed; 9 | top: 0; 10 | left: 0; 11 | z-index: $z-index-action-sheet; 12 | width: 100%; 13 | height: 100%; 14 | background-color: rgba(0,0,0,0); 15 | 16 | &.active { 17 | background-color: rgba(0,0,0,0.5); 18 | } 19 | } 20 | 21 | .action-sheet-wrapper { 22 | @include translate3d(0, 100%, 0); 23 | @include transition(all ease-in-out 300ms); 24 | position: absolute; 25 | bottom: 0; 26 | width: 100%; 27 | } 28 | 29 | .action-sheet-up { 30 | @include translate3d(0, 0, 0); 31 | } 32 | 33 | .action-sheet { 34 | margin-left: 15px; 35 | margin-right: 15px; 36 | width: auto; 37 | z-index: $z-index-action-sheet; 38 | overflow: hidden; 39 | 40 | .button { 41 | display: block; 42 | padding: 1px; 43 | width: 100%; 44 | border-radius: 0; 45 | 46 | background-color: transparent; 47 | 48 | color: $positive; 49 | font-size: 18px; 50 | 51 | &.destructive { 52 | color: $assertive; 53 | } 54 | } 55 | } 56 | 57 | .action-sheet-title { 58 | padding: 10px; 59 | color: lighten($base-color, 40%); 60 | text-align: center; 61 | font-size: 12px; 62 | } 63 | 64 | .action-sheet-group { 65 | margin-bottom: 5px; 66 | border-radius: $sheet-border-radius; 67 | background-color: #fff; 68 | .button { 69 | border-width: 1px 0px 0px 0px; 70 | border-radius: 0; 71 | 72 | &.active { 73 | background-color: transparent; 74 | color: inherit; 75 | } 76 | } 77 | .button:first-child:last-child { 78 | border-width: 0; 79 | } 80 | } 81 | 82 | .action-sheet-open { 83 | pointer-events: none; 84 | 85 | &.modal-open .modal { 86 | pointer-events: none; 87 | } 88 | 89 | .action-sheet-backdrop { 90 | pointer-events: auto; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_backdrop.scss: -------------------------------------------------------------------------------- 1 | 2 | .backdrop { 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | z-index: $z-index-backdrop; 7 | 8 | width: 100%; 9 | height: 100%; 10 | 11 | background-color: rgba(0,0,0,0.4); 12 | 13 | visibility: hidden; 14 | opacity: 0; 15 | 16 | &.visible { 17 | visibility: visible; 18 | } 19 | &.active { 20 | opacity: 1; 21 | } 22 | 23 | @include transition(0.1s opacity linear); 24 | } 25 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_badge.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Badges 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .badge { 8 | @include badge-style($badge-default-bg, $badge-default-text); 9 | z-index: $z-index-badge; 10 | display: inline-block; 11 | padding: 3px 8px; 12 | min-width: 10px; 13 | border-radius: $badge-border-radius; 14 | vertical-align: baseline; 15 | text-align: center; 16 | white-space: nowrap; 17 | font-weight: $badge-font-weight; 18 | font-size: $badge-font-size; 19 | line-height: $badge-line-height; 20 | 21 | &:empty { 22 | display: none; 23 | } 24 | } 25 | 26 | //Be sure to override specificity of rule that 'badge color matches tab color by default' 27 | .tabs .tab-item .badge, 28 | .badge { 29 | &.badge-light { 30 | @include badge-style($badge-light-bg, $badge-light-text); 31 | } 32 | &.badge-stable { 33 | @include badge-style($badge-stable-bg, $badge-stable-text); 34 | } 35 | &.badge-positive { 36 | @include badge-style($badge-positive-bg, $badge-positive-text); 37 | } 38 | &.badge-calm { 39 | @include badge-style($badge-calm-bg, $badge-calm-text); 40 | } 41 | &.badge-assertive { 42 | @include badge-style($badge-assertive-bg, $badge-assertive-text); 43 | } 44 | &.badge-balanced { 45 | @include badge-style($badge-balanced-bg, $badge-balanced-text); 46 | } 47 | &.badge-energized { 48 | @include badge-style($badge-energized-bg, $badge-energized-text); 49 | } 50 | &.badge-royal { 51 | @include badge-style($badge-royal-bg, $badge-royal-text); 52 | } 53 | &.badge-dark { 54 | @include badge-style($badge-dark-bg, $badge-dark-text); 55 | } 56 | } 57 | 58 | // Quick fix for labels/badges in buttons 59 | .button .badge { 60 | position: relative; 61 | top: -1px; 62 | } 63 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_button-bar.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Button Bar 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .button-bar { 8 | @include display-flex(); 9 | @include flex(1); 10 | width: 100%; 11 | 12 | &.button-bar-inline { 13 | display: block; 14 | width: auto; 15 | 16 | @include clearfix(); 17 | 18 | > .button { 19 | width: auto; 20 | display: inline-block; 21 | float: left; 22 | } 23 | } 24 | } 25 | 26 | .button-bar > .button { 27 | @include flex(1); 28 | display: block; 29 | 30 | overflow: hidden; 31 | 32 | padding: 0 16px; 33 | 34 | width: 0; 35 | 36 | border-width: 1px 0px 1px 1px; 37 | border-radius: 0; 38 | text-align: center; 39 | text-overflow: ellipsis; 40 | white-space: nowrap; 41 | 42 | &:before, 43 | .icon:before { 44 | line-height: 44px; 45 | } 46 | 47 | &:first-child { 48 | border-radius: 2px 0px 0px 2px; 49 | } 50 | &:last-child { 51 | border-right-width: 1px; 52 | border-radius: 0px 2px 2px 0px; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_checkbox.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Checkbox 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .checkbox { 8 | // set the color defaults 9 | @include checkbox-style($checkbox-off-border-default, $checkbox-on-bg-default); 10 | 11 | position: relative; 12 | display: inline-block; 13 | padding: ($checkbox-height / 4) ($checkbox-width / 4); 14 | cursor: pointer; 15 | } 16 | .checkbox-light { 17 | @include checkbox-style($checkbox-off-border-light, $checkbox-on-bg-light); 18 | } 19 | .checkbox-stable { 20 | @include checkbox-style($checkbox-off-border-stable, $checkbox-on-bg-stable); 21 | } 22 | .checkbox-positive { 23 | @include checkbox-style($checkbox-off-border-positive, $checkbox-on-bg-positive); 24 | } 25 | .checkbox-calm { 26 | @include checkbox-style($checkbox-off-border-calm, $checkbox-on-bg-calm); 27 | } 28 | .checkbox-assertive { 29 | @include checkbox-style($checkbox-off-border-assertive, $checkbox-on-bg-assertive); 30 | } 31 | .checkbox-balanced { 32 | @include checkbox-style($checkbox-off-border-balanced, $checkbox-on-bg-balanced); 33 | } 34 | .checkbox-energized{ 35 | @include checkbox-style($checkbox-off-border-energized, $checkbox-on-bg-energized); 36 | } 37 | .checkbox-royal { 38 | @include checkbox-style($checkbox-off-border-royal, $checkbox-on-bg-royal); 39 | } 40 | .checkbox-dark { 41 | @include checkbox-style($checkbox-off-border-dark, $checkbox-on-bg-dark); 42 | } 43 | 44 | .checkbox input:disabled:before, 45 | .checkbox input:disabled + .checkbox-icon:before { 46 | border-color: $checkbox-off-border-light; 47 | } 48 | 49 | .checkbox input:disabled:checked:before, 50 | .checkbox input:disabled:checked + .checkbox-icon:before { 51 | background: $checkbox-on-bg-light; 52 | } 53 | 54 | 55 | .checkbox.checkbox-input-hidden input { 56 | display: none !important; 57 | } 58 | 59 | .checkbox input, 60 | .checkbox-icon { 61 | position: relative; 62 | width: $checkbox-width; 63 | height: $checkbox-height; 64 | display: block; 65 | border: 0; 66 | background: transparent; 67 | cursor: pointer; 68 | -webkit-appearance: none; 69 | 70 | &:before { 71 | // what the checkbox looks like when its not checked 72 | display: table; 73 | width: 100%; 74 | height: 100%; 75 | border-width: $checkbox-border-width; 76 | border-style: solid; 77 | border-radius: $checkbox-border-radius; 78 | background: $checkbox-off-bg-color; 79 | content: ' '; 80 | transition: background-color 20ms ease-in-out; 81 | } 82 | } 83 | 84 | .checkbox input:checked:before, 85 | input:checked + .checkbox-icon:before { 86 | border-width: $checkbox-border-width + 1; 87 | } 88 | 89 | // the checkmark within the box 90 | .checkbox input:after, 91 | .checkbox-icon:after { 92 | @include transition(opacity .05s ease-in-out); 93 | @include rotate(-45deg); 94 | position: absolute; 95 | top: 30%; 96 | left: 26%; 97 | display: table; 98 | width: ($checkbox-width / 2) + 1; 99 | height: ($checkbox-width / 3) + 1; 100 | border: $checkbox-check-width solid $checkbox-check-color; 101 | border-top: 0; 102 | border-right: 0; 103 | content: ' '; 104 | opacity: 0; 105 | } 106 | 107 | .grade-c .checkbox input:after, 108 | .grade-c .checkbox-icon:after { 109 | @include rotate(0); 110 | top: 3px; 111 | left: 4px; 112 | border: none; 113 | color: $checkbox-check-color; 114 | content: '\2713'; 115 | font-weight: bold; 116 | font-size: 20px; 117 | } 118 | 119 | // what the checkmark looks like when its checked 120 | .checkbox input:checked:after, 121 | input:checked + .checkbox-icon:after { 122 | opacity: 1; 123 | } 124 | 125 | // make sure item content have enough padding on left to fit the checkbox 126 | .item-checkbox { 127 | padding-left: ($item-padding * 2) + $checkbox-width; 128 | 129 | &.active { 130 | box-shadow: none; 131 | } 132 | } 133 | 134 | // position the checkbox to the left within an item 135 | .item-checkbox .checkbox { 136 | position: absolute; 137 | top: 50%; 138 | right: $item-padding / 2; 139 | left: $item-padding / 2; 140 | z-index: $z-index-item-checkbox; 141 | margin-top: (($checkbox-height + ($checkbox-height / 2)) / 2) * -1; 142 | } 143 | 144 | 145 | .item-checkbox.item-checkbox-right { 146 | padding-right: ($item-padding * 2) + $checkbox-width; 147 | padding-left: $item-padding; 148 | } 149 | 150 | .item-checkbox-right .checkbox input, 151 | .item-checkbox-right .checkbox-icon { 152 | float: right; 153 | } -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_grid.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Grid 3 | * -------------------------------------------------- 4 | * Using flexbox for the grid, inspired by Philip Walton: 5 | * http://philipwalton.github.io/solved-by-flexbox/demos/grids/ 6 | * By default each .col within a .row will evenly take up 7 | * available width, and the height of each .col with take 8 | * up the height of the tallest .col in the same .row. 9 | */ 10 | 11 | .row { 12 | @include display-flex(); 13 | padding: ($grid-padding-width / 2); 14 | width: 100%; 15 | } 16 | 17 | .row-wrap { 18 | @include flex-wrap(wrap); 19 | } 20 | 21 | .row + .row { 22 | margin-top: ($grid-padding-width / 2) * -1; 23 | padding-top: 0; 24 | } 25 | 26 | .col { 27 | @include flex(1); 28 | display: block; 29 | padding: ($grid-padding-width / 2); 30 | width: 100%; 31 | } 32 | 33 | 34 | /* Vertically Align Columns */ 35 | /* .row-* vertically aligns every .col in the .row */ 36 | .row-top { 37 | @include align-items(flex-start); 38 | } 39 | .row-bottom { 40 | @include align-items(flex-end); 41 | } 42 | .row-center { 43 | @include align-items(center); 44 | } 45 | .row-stretch { 46 | @include align-items(stretch); 47 | } 48 | .row-baseline { 49 | @include align-items(baseline); 50 | } 51 | 52 | /* .col-* vertically aligns an individual .col */ 53 | .col-top { 54 | @include align-self(flex-start); 55 | } 56 | .col-bottom { 57 | @include align-self(flex-end); 58 | } 59 | .col-center { 60 | @include align-self(center); 61 | } 62 | 63 | /* Column Offsets */ 64 | .col-offset-10 { 65 | margin-left: 10%; 66 | } 67 | .col-offset-20 { 68 | margin-left: 20%; 69 | } 70 | .col-offset-25 { 71 | margin-left: 25%; 72 | } 73 | .col-offset-33, .col-offset-34 { 74 | margin-left: 33.3333%; 75 | } 76 | .col-offset-50 { 77 | margin-left: 50%; 78 | } 79 | .col-offset-66, .col-offset-67 { 80 | margin-left: 66.6666%; 81 | } 82 | .col-offset-75 { 83 | margin-left: 75%; 84 | } 85 | .col-offset-80 { 86 | margin-left: 80%; 87 | } 88 | .col-offset-90 { 89 | margin-left: 90%; 90 | } 91 | 92 | 93 | /* Explicit Column Percent Sizes */ 94 | /* By default each grid column will evenly distribute */ 95 | /* across the grid. However, you can specify individual */ 96 | /* columns to take up a certain size of the available area */ 97 | .col-10 { 98 | @include flex(0, 0, 10%); 99 | max-width: 10%; 100 | } 101 | .col-20 { 102 | @include flex(0, 0, 20%); 103 | max-width: 20%; 104 | } 105 | .col-25 { 106 | @include flex(0, 0, 25%); 107 | max-width: 25%; 108 | } 109 | .col-33, .col-34 { 110 | @include flex(0, 0, 33.3333%); 111 | max-width: 33.3333%; 112 | } 113 | .col-50 { 114 | @include flex(0, 0, 50%); 115 | max-width: 50%; 116 | } 117 | .col-66, .col-67 { 118 | @include flex(0, 0, 66.6666%); 119 | max-width: 66.6666%; 120 | } 121 | .col-75 { 122 | @include flex(0, 0, 75%); 123 | max-width: 75%; 124 | } 125 | .col-80 { 126 | @include flex(0, 0, 80%); 127 | max-width: 80%; 128 | } 129 | .col-90 { 130 | @include flex(0, 0, 90%); 131 | max-width: 90%; 132 | } 133 | 134 | 135 | /* Responsive Grid Classes */ 136 | /* Adding a class of responsive-X to a row */ 137 | /* will trigger the flex-direction to */ 138 | /* change to column and add some margin */ 139 | /* to any columns in the row for clearity */ 140 | 141 | @include responsive-grid-break('.responsive-sm', $grid-responsive-sm-break); 142 | @include responsive-grid-break('.responsive-md', $grid-responsive-md-break); 143 | @include responsive-grid-break('.responsive-lg', $grid-responsive-lg-break); 144 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_list.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Lists 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .list { 8 | position: relative; 9 | padding-top: $item-border-width; 10 | padding-bottom: $item-border-width; 11 | padding-left: 0; // reset padding because ul and ol 12 | margin-bottom: 20px; 13 | } 14 | .list:last-child { 15 | margin-bottom: 0px; 16 | &.card{ 17 | margin-bottom:40px; 18 | } 19 | } 20 | 21 | 22 | /** 23 | * List Header 24 | * -------------------------------------------------- 25 | */ 26 | 27 | .list-header { 28 | margin-top: $list-header-margin-top; 29 | padding: $list-header-padding; 30 | background-color: $list-header-bg; 31 | color: $list-header-color; 32 | font-weight: bold; 33 | } 34 | 35 | // when its a card make sure it doesn't duplicate top and bottom borders 36 | .card.list .list-item { 37 | padding-right: 1px; 38 | padding-left: 1px; 39 | } 40 | 41 | 42 | /** 43 | * Cards and Inset Lists 44 | * -------------------------------------------------- 45 | * A card and list-inset are close to the same thing, except a card as a box shadow. 46 | */ 47 | 48 | .card, 49 | .list-inset { 50 | overflow: hidden; 51 | margin: ($content-padding * 2) $content-padding; 52 | border-radius: $card-border-radius; 53 | background-color: $card-body-bg; 54 | } 55 | 56 | .card { 57 | padding-top: $item-border-width; 58 | padding-bottom: $item-border-width; 59 | box-shadow: 0 1px 2px rgba(0, 0, 0, .10); 60 | } 61 | 62 | .padding { 63 | .card, .list-inset { 64 | margin-left: 0; 65 | margin-right: 0; 66 | } 67 | } 68 | 69 | .card .item, 70 | .list-inset .item, 71 | .padding > .list .item 72 | { 73 | &:first-child { 74 | border-top-left-radius: $card-border-radius; 75 | border-top-right-radius: $card-border-radius; 76 | 77 | .item-content { 78 | border-top-left-radius: $card-border-radius; 79 | border-top-right-radius: $card-border-radius; 80 | } 81 | } 82 | &:last-child { 83 | border-bottom-right-radius: $card-border-radius; 84 | border-bottom-left-radius: $card-border-radius; 85 | 86 | .item-content { 87 | border-bottom-right-radius: $card-border-radius; 88 | border-bottom-left-radius: $card-border-radius; 89 | } 90 | } 91 | } 92 | 93 | .card .item:last-child, 94 | .list-inset .item:last-child { 95 | margin-bottom: $item-border-width * -1; 96 | } 97 | 98 | .card .item, 99 | .list-inset .item, 100 | .padding > .list .item, 101 | .padding-horizontal > .list .item { 102 | margin-right: 0; 103 | margin-left: 0; 104 | 105 | &.item-input input { 106 | padding-right: 44px; 107 | } 108 | } 109 | .padding-left > .list .item { 110 | margin-left: 0; 111 | } 112 | .padding-right > .list .item { 113 | margin-right: 0; 114 | } 115 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_loading.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Loading 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .loading-container { 8 | position: absolute; 9 | left: 0; 10 | top: 0; 11 | right: 0; 12 | bottom: 0; 13 | 14 | z-index: $z-index-loading; 15 | 16 | @include display-flex(); 17 | @include justify-content(center); 18 | @include align-items(center); 19 | 20 | @include transition(0.2s opacity linear); 21 | visibility: hidden; 22 | opacity: 0; 23 | 24 | &:not(.visible) .icon { 25 | display: none; 26 | } 27 | &.visible { 28 | visibility: visible; 29 | } 30 | &.active { 31 | opacity: 1; 32 | } 33 | 34 | .loading { 35 | padding: $loading-padding; 36 | 37 | border-radius: $loading-border-radius; 38 | background-color: $loading-bg-color; 39 | 40 | color: $loading-text-color; 41 | 42 | text-align: center; 43 | text-overflow: ellipsis; 44 | font-size: $loading-font-size; 45 | 46 | h1, h2, h3, h4, h5, h6 { 47 | color: $loading-text-color; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_menu.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Menus 4 | * -------------------------------------------------- 5 | * Side panel structure 6 | */ 7 | 8 | .menu { 9 | position: absolute; 10 | top: 0; 11 | bottom: 0; 12 | z-index: $z-index-menu; 13 | overflow: hidden; 14 | 15 | min-height: 100%; 16 | max-height: 100%; 17 | width: $menu-width; 18 | 19 | background-color: $menu-bg; 20 | 21 | .scroll-content { 22 | z-index: $z-index-menu-scroll-content; 23 | } 24 | 25 | .bar-header { 26 | z-index: $z-index-menu-bar-header; 27 | } 28 | } 29 | 30 | .menu-content { 31 | @include transform(none); 32 | box-shadow: $menu-side-shadow; 33 | } 34 | 35 | .menu-open .menu-content .pane, 36 | .menu-open .menu-content .scroll-content { 37 | pointer-events: none; 38 | } 39 | 40 | .grade-b .menu-content, 41 | .grade-c .menu-content { 42 | @include box-sizing(content-box); 43 | right: -1px; 44 | left: -1px; 45 | border-right: 1px solid #ccc; 46 | border-left: 1px solid #ccc; 47 | box-shadow: none; 48 | } 49 | 50 | .menu-left { 51 | left: 0; 52 | } 53 | 54 | .menu-right { 55 | right: 0; 56 | } 57 | 58 | .aside-open.aside-resizing .menu-right { 59 | display: none; 60 | } 61 | 62 | .menu-animated { 63 | @include transition-transform($menu-animation-speed ease); 64 | } 65 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_modal.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Modals 4 | * -------------------------------------------------- 5 | * Modals are independent windows that slide in from off-screen. 6 | */ 7 | 8 | .modal-backdrop { 9 | @include transition(background-color 300ms ease-in-out); 10 | position: fixed; 11 | top: 0; 12 | left: 0; 13 | z-index: $z-index-modal; 14 | width: 100%; 15 | height: 100%; 16 | background-color: $modal-backdrop-bg-inactive; 17 | 18 | &.active { 19 | background-color: $modal-backdrop-bg-active; 20 | } 21 | } 22 | 23 | .modal { 24 | display: block; 25 | position: absolute; 26 | top: 0; 27 | z-index: $z-index-modal; 28 | overflow: hidden; 29 | min-height: 100%; 30 | width: 100%; 31 | background-color: $modal-bg-color; 32 | } 33 | 34 | @media (min-width: $modal-inset-mode-break-point) { 35 | // inset mode is when the modal doesn't fill the entire 36 | // display but instead is centered within a large display 37 | .modal { 38 | top: $modal-inset-mode-top; 39 | right: $modal-inset-mode-right; 40 | bottom: $modal-inset-mode-bottom; 41 | left: $modal-inset-mode-left; 42 | overflow: visible; 43 | min-height: $modal-inset-mode-min-height; 44 | width: (100% - $modal-inset-mode-left - $modal-inset-mode-right); 45 | } 46 | 47 | .modal.ng-leave-active { 48 | bottom: 0; 49 | } 50 | 51 | // remove ios header padding from inset header 52 | .platform-ios.platform-cordova .modal-wrapper .modal{ 53 | .bar-header:not(.bar-subheader) { 54 | height: $bar-height; 55 | > * { 56 | margin-top: 0; 57 | } 58 | } 59 | .tabs-top > .tabs, 60 | .tabs.tabs-top { 61 | top: $bar-height; 62 | } 63 | .has-header, 64 | .bar-subheader { 65 | top: $bar-height; 66 | } 67 | .has-subheader { 68 | top: (2 * $bar-height); 69 | } 70 | .has-tabs-top { 71 | top: $bar-height + $tabs-height; 72 | } 73 | .has-header.has-subheader.has-tabs-top { 74 | top: 2 * $bar-height + $tabs-height; 75 | } 76 | } 77 | } 78 | 79 | // disable clicks on all but the modal 80 | .modal-open { 81 | pointer-events: none; 82 | 83 | .modal, 84 | .modal-backdrop { 85 | pointer-events: auto; 86 | } 87 | // prevent clicks on modal when loading overlay is active though 88 | &.loading-active { 89 | .modal, 90 | .modal-backdrop { 91 | pointer-events: none; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_platform.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Platform 4 | * -------------------------------------------------- 5 | * Platform specific tweaks 6 | */ 7 | 8 | 9 | /** 10 | * Apply roboto font 11 | */ 12 | 13 | .roboto { 14 | font-family: "Roboto", $font-family-base; 15 | 16 | input { 17 | font-family: "Roboto", $font-family-base; 18 | } 19 | } 20 | /* 21 | .platform-android { 22 | 23 | 24 | .bar { 25 | padding: 0; 26 | 27 | line-height: 40px; 28 | 29 | .button { 30 | line-height: 40px; 31 | } 32 | 33 | .button-icon:before { 34 | font-size: 24px; 35 | } 36 | } 37 | 38 | .back-button { 39 | &.button-icon:before { 40 | line-height: 40px; 41 | } 42 | margin-left: -3px; 43 | padding: 0px 2px !important; 44 | &.ion-android-arrow-back:before { 45 | font-size: 12px; 46 | } 47 | 48 | &.back-button.active, 49 | &.back-button.activated { 50 | background-color: rgba(0,0,0,0.1); 51 | } 52 | } 53 | 54 | .item-divider { 55 | background: none; 56 | border-top-width: 0; 57 | border-bottom-width: 2px; 58 | text-transform: uppercase; 59 | margin-top: 10px; 60 | font-size: 14px; 61 | } 62 | .item { 63 | border-left-width: 0; 64 | border-right-width: 0; 65 | } 66 | 67 | .item-divider ~ .item:not(.item-divider) { 68 | border-bottom-width: 0; 69 | } 70 | 71 | .back-button:not(.ng-hide) + .left-buttons + .title { 72 | // Don't allow normal titles in this mode 73 | display: none; 74 | } 75 | 76 | .bar .title { 77 | text-align: left; 78 | font-weight: normal; 79 | } 80 | 81 | font-family: 'Roboto'; 82 | 83 | h1, h2, h3, h4, h5 { 84 | font-family: 'Roboto', $font-family-base; 85 | } 86 | 87 | .tab-item { 88 | font-family: 'Roboto', $font-family-base; 89 | } 90 | 91 | 92 | input, button, select, textarea { 93 | font-family: 'Roboto', $font-family-base; 94 | } 95 | */ 96 | //} 97 | 98 | .platform-ios.platform-cordova { 99 | // iOS7/8 has a status bar which sits on top of the header. 100 | // Bump down everything to make room for it. However, if 101 | // if its in Cordova, and set to fullscreen, then disregard the bump. 102 | &:not(.fullscreen) { 103 | .bar-header:not(.bar-subheader) { 104 | height: $bar-height + $ios-statusbar-height; 105 | 106 | &.item-input-inset .item-input-wrapper { 107 | margin-top: 19px !important; 108 | } 109 | 110 | > * { 111 | margin-top: $ios-statusbar-height; 112 | } 113 | } 114 | .tabs-top > .tabs, 115 | .tabs.tabs-top { 116 | top: $bar-height + $ios-statusbar-height; 117 | } 118 | 119 | .has-header, 120 | .bar-subheader { 121 | top: $bar-height + $ios-statusbar-height; 122 | } 123 | .has-subheader { 124 | top: (2 * $bar-height) + $ios-statusbar-height; 125 | } 126 | .has-tabs-top { 127 | top: $bar-height + $tabs-height + $ios-statusbar-height; 128 | } 129 | .has-header.has-subheader.has-tabs-top { 130 | top: 2 * $bar-height + $tabs-height + $ios-statusbar-height; 131 | } 132 | } 133 | &.status-bar-hide { 134 | // Cordova doesn't adjust the body height correctly, this makes up for it 135 | margin-bottom: 20px; 136 | } 137 | } 138 | 139 | @media (orientation:landscape) { 140 | .platform-ios.platform-browser.platform-ipad { 141 | position: fixed; // required for iPad 7 Safari 142 | } 143 | } 144 | 145 | .platform-c:not(.enable-transitions) * { 146 | // disable transitions on grade-c devices (Android 2) 147 | -webkit-transition: none !important; 148 | transition: none !important; 149 | } 150 | 151 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_popover.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Popovers 4 | * -------------------------------------------------- 5 | * Popovers are independent views which float over content 6 | */ 7 | 8 | .popover-backdrop { 9 | position: fixed; 10 | top: 0; 11 | left: 0; 12 | z-index: $z-index-popover; 13 | width: 100%; 14 | height: 100%; 15 | background-color: $popover-backdrop-bg-inactive; 16 | 17 | &.active { 18 | background-color: $popover-backdrop-bg-active; 19 | } 20 | } 21 | 22 | .popover { 23 | position: absolute; 24 | top: 25%; 25 | left: 50%; 26 | z-index: $z-index-popover; 27 | display: block; 28 | margin-top: 12px; 29 | margin-left: -$popover-width / 2; 30 | height: $popover-height; 31 | width: $popover-width; 32 | background-color: $popover-bg-color; 33 | box-shadow: $popover-box-shadow; 34 | opacity: 0; 35 | 36 | .item:first-child { 37 | border-top: 0; 38 | } 39 | 40 | .item:last-child { 41 | border-bottom: 0; 42 | } 43 | 44 | &.popover-bottom { 45 | margin-top: -12px; 46 | } 47 | } 48 | 49 | 50 | // Set popover border-radius 51 | .popover, 52 | .popover .bar-header { 53 | border-radius: $popover-border-radius; 54 | } 55 | .popover .scroll-content { 56 | z-index: 1; 57 | margin: 2px 0; 58 | } 59 | .popover .bar-header { 60 | border-bottom-right-radius: 0; 61 | border-bottom-left-radius: 0; 62 | } 63 | .popover .has-header { 64 | border-top-right-radius: 0; 65 | border-top-left-radius: 0; 66 | } 67 | .popover-arrow { 68 | display: none; 69 | } 70 | 71 | 72 | // iOS Popover 73 | .platform-ios { 74 | 75 | .popover { 76 | box-shadow: $popover-box-shadow-ios; 77 | } 78 | 79 | .popover, 80 | .popover .bar-header { 81 | border-radius: $popover-border-radius-ios; 82 | } 83 | .popover .scroll-content { 84 | margin: 8px 0; 85 | border-radius: $popover-border-radius-ios; 86 | } 87 | .popover .scroll-content.has-header { 88 | margin-top: 0; 89 | } 90 | .popover-arrow { 91 | position: absolute; 92 | display: block; 93 | top: -17px; 94 | width: 30px; 95 | height: 19px; 96 | overflow: hidden; 97 | 98 | &:after { 99 | position: absolute; 100 | top: 12px; 101 | left: 5px; 102 | width: 20px; 103 | height: 20px; 104 | background-color: $popover-bg-color; 105 | border-radius: 3px; 106 | content: ''; 107 | @include rotate(-45deg); 108 | } 109 | } 110 | .popover-bottom .popover-arrow { 111 | top: auto; 112 | bottom: -10px; 113 | &:after { 114 | top: -6px; 115 | } 116 | } 117 | } 118 | 119 | 120 | // Android Popover 121 | .platform-android { 122 | 123 | .popover { 124 | margin-top: -32px; 125 | background-color: $popover-bg-color-android; 126 | box-shadow: $popover-box-shadow-android; 127 | 128 | .item { 129 | border-color: $popover-bg-color-android; 130 | background-color: $popover-bg-color-android; 131 | color: #4d4d4d; 132 | } 133 | &.popover-bottom { 134 | margin-top: 32px; 135 | } 136 | } 137 | 138 | .popover-backdrop, 139 | .popover-backdrop.active { 140 | background-color: transparent; 141 | } 142 | } 143 | 144 | 145 | // disable clicks on all but the popover 146 | .popover-open { 147 | pointer-events: none; 148 | 149 | .popover, 150 | .popover-backdrop { 151 | pointer-events: auto; 152 | } 153 | // prevent clicks on popover when loading overlay is active though 154 | &.loading-active { 155 | .popover, 156 | .popover-backdrop { 157 | pointer-events: none; 158 | } 159 | } 160 | } 161 | 162 | 163 | // wider popover on larger viewports 164 | @media (min-width: $popover-large-break-point) { 165 | .popover { 166 | width: $popover-large-width; 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_popup.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Popups 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .popup-container { 8 | position: absolute; 9 | top: 0; 10 | left: 0; 11 | bottom: 0; 12 | right: 0; 13 | background: rgba(0,0,0,0); 14 | 15 | @include display-flex(); 16 | @include justify-content(center); 17 | @include align-items(center); 18 | 19 | z-index: $z-index-popup; 20 | 21 | // Start hidden 22 | visibility: hidden; 23 | &.popup-showing { 24 | visibility: visible; 25 | } 26 | 27 | &.popup-hidden .popup { 28 | @include animation-name(scaleOut); 29 | @include animation-duration($popup-leave-animation-duration); 30 | @include animation-timing-function(ease-in-out); 31 | @include animation-fill-mode(both); 32 | } 33 | 34 | &.active .popup { 35 | @include animation-name(superScaleIn); 36 | @include animation-duration($popup-enter-animation-duration); 37 | @include animation-timing-function(ease-in-out); 38 | @include animation-fill-mode(both); 39 | } 40 | 41 | .popup { 42 | width: $popup-width; 43 | max-width: 100%; 44 | max-height: 90%; 45 | 46 | border-radius: $popup-border-radius; 47 | background-color: $popup-background-color; 48 | 49 | @include display-flex(); 50 | @include flex-direction(column); 51 | } 52 | } 53 | 54 | .popup-head { 55 | padding: 15px 10px; 56 | border-bottom: 1px solid #eee; 57 | text-align: center; 58 | } 59 | .popup-title { 60 | margin: 0; 61 | padding: 0; 62 | font-size: 15px; 63 | } 64 | .popup-sub-title { 65 | margin: 5px 0 0 0; 66 | padding: 0; 67 | font-weight: normal; 68 | font-size: 11px; 69 | } 70 | .popup-body { 71 | padding: 10px; 72 | overflow: scroll; 73 | } 74 | 75 | .popup-buttons { 76 | @include display-flex(); 77 | @include flex-direction(row); 78 | padding: 10px; 79 | min-height: $popup-button-min-height + 20; 80 | 81 | .button { 82 | @include flex(1); 83 | display: block; 84 | min-height: $popup-button-min-height; 85 | border-radius: $popup-button-border-radius; 86 | line-height: $popup-button-line-height; 87 | 88 | margin-right: 5px; 89 | &:last-child { 90 | margin-right: 0px; 91 | } 92 | } 93 | } 94 | 95 | .popup-open { 96 | pointer-events: none; 97 | 98 | &.modal-open .modal { 99 | pointer-events: none; 100 | } 101 | 102 | .popup-backdrop, .popup { 103 | pointer-events: auto; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_progress.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Progress 4 | * -------------------------------------------------- 5 | */ 6 | 7 | progress { 8 | display: block; 9 | margin: $progress-margin; 10 | width: $progress-width; 11 | } 12 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_radio.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Radio Button Inputs 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .item-radio { 8 | padding: 0; 9 | 10 | &:hover { 11 | cursor: pointer; 12 | } 13 | } 14 | 15 | .item-radio .item-content { 16 | /* give some room to the right for the checkmark icon */ 17 | padding-right: $item-padding * 4; 18 | } 19 | 20 | .item-radio .radio-icon { 21 | /* checkmark icon will be hidden by default */ 22 | position: absolute; 23 | top: 0; 24 | right: 0; 25 | z-index: $z-index-item-radio; 26 | visibility: hidden; 27 | padding: $item-padding - 2; 28 | height: 100%; 29 | font-size: 24px; 30 | } 31 | 32 | .item-radio input { 33 | /* hide any radio button inputs elements (the ugly circles) */ 34 | position: absolute; 35 | left: -9999px; 36 | 37 | &:checked ~ .item-content { 38 | /* style the item content when its checked */ 39 | background: #f7f7f7; 40 | } 41 | 42 | &:checked ~ .radio-icon { 43 | /* show the checkmark icon when its checked */ 44 | visibility: visible; 45 | } 46 | } 47 | 48 | // Hack for Android to correctly display the checked item 49 | // http://timpietrusky.com/advanced-checkbox-hack 50 | .platform-android.grade-b .item-radio, 51 | .platform-android.grade-c .item-radio { 52 | -webkit-animation: androidCheckedbugfix infinite 1s; 53 | } 54 | @-webkit-keyframes androidCheckedbugfix { 55 | from { padding: 0; } 56 | to { padding: 0; } 57 | } 58 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_range.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Range 4 | * -------------------------------------------------- 5 | */ 6 | 7 | input[type="range"] { 8 | display: inline-block; 9 | overflow: hidden; 10 | margin-top: 5px; 11 | margin-bottom: 5px; 12 | padding-right: 2px; 13 | padding-left: 1px; 14 | width: auto; 15 | height: $range-slider-height + 15; 16 | outline: none; 17 | background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $range-default-track-bg), color-stop(100%, $range-default-track-bg)); 18 | background: linear-gradient(to right, $range-default-track-bg 0%, $range-default-track-bg 100%); 19 | background-position: center; 20 | background-size: 99% $range-track-height; 21 | background-repeat: no-repeat; 22 | -webkit-appearance: none; 23 | 24 | &::-webkit-slider-thumb { 25 | position: relative; 26 | width: $range-slider-width; 27 | height: $range-slider-height; 28 | border-radius: $range-slider-border-radius; 29 | background-color: $toggle-handle-off-bg-color; 30 | box-shadow: 0 0 2px rgba(0,0,0,.5), 1px 3px 5px rgba(0,0,0,0.25); 31 | cursor: pointer; 32 | -webkit-appearance: none; 33 | } 34 | 35 | &::-webkit-slider-thumb:before { 36 | /* what creates the colorful line on the left side of the slider */ 37 | position: absolute; 38 | top: ($range-slider-height / 2) - ($range-track-height / 2); 39 | left: -2001px; 40 | width: 2000px; 41 | height: $range-track-height; 42 | background: $dark; 43 | content: ' '; 44 | } 45 | 46 | &::-webkit-slider-thumb:after { 47 | /* create a larger (but hidden) hit area */ 48 | position: absolute; 49 | top: -20px; 50 | left: -20px; 51 | padding: 30px; 52 | content: ' '; 53 | //background: red; 54 | //opacity: .5; 55 | } 56 | 57 | } 58 | 59 | .range { 60 | @include display-flex(); 61 | @include align-items(center); 62 | padding: 2px 11px; 63 | 64 | &.range-light { 65 | input { @include range-style($range-light-track-bg); } 66 | } 67 | &.range-stable { 68 | input { @include range-style($range-stable-track-bg); } 69 | } 70 | &.range-positive { 71 | input { @include range-style($range-positive-track-bg); } 72 | } 73 | &.range-calm { 74 | input { @include range-style($range-calm-track-bg); } 75 | } 76 | &.range-balanced { 77 | input { @include range-style($range-balanced-track-bg); } 78 | } 79 | &.range-assertive { 80 | input { @include range-style($range-assertive-track-bg); } 81 | } 82 | &.range-energized { 83 | input { @include range-style($range-energized-track-bg); } 84 | } 85 | &.range-royal { 86 | input { @include range-style($range-royal-track-bg); } 87 | } 88 | &.range-dark { 89 | input { @include range-style($range-dark-track-bg); } 90 | } 91 | } 92 | 93 | .range .icon { 94 | @include flex(0); 95 | display: block; 96 | min-width: $range-icon-size; 97 | text-align: center; 98 | font-size: $range-icon-size; 99 | } 100 | 101 | .range input { 102 | @include flex(1); 103 | display: block; 104 | margin-right: 10px; 105 | margin-left: 10px; 106 | } 107 | 108 | .range-label { 109 | @include flex(0, 0, auto); 110 | display: block; 111 | white-space: nowrap; 112 | } 113 | 114 | .range-label:first-child { 115 | padding-left: 5px; 116 | } 117 | .range input + .range-label { 118 | padding-right: 5px; 119 | padding-left: 0; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_select.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Select 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .item-select { 8 | position: relative; 9 | 10 | select { 11 | @include appearance(none); 12 | position: absolute; 13 | top: 0; 14 | right: 0; 15 | padding: ($item-padding - 2) ($item-padding * 3) ($item-padding) $item-padding; 16 | max-width: 65%; 17 | 18 | border: none; 19 | background: $item-default-bg; 20 | color: #333; 21 | 22 | // hack to hide default dropdown arrow in FF 23 | text-indent: .01px; 24 | text-overflow: ''; 25 | 26 | white-space: nowrap; 27 | font-size: $font-size-base; 28 | 29 | cursor: pointer; 30 | direction: rtl; // right align the select text 31 | } 32 | 33 | select::-ms-expand { 34 | // hide default dropdown arrow in IE 35 | display: none; 36 | } 37 | 38 | option { 39 | direction: ltr; 40 | } 41 | 42 | &:after { 43 | position: absolute; 44 | top: 50%; 45 | right: $item-padding; 46 | margin-top: -3px; 47 | width: 0; 48 | height: 0; 49 | border-top: 5px solid; 50 | border-right: 5px solid rgba(0, 0, 0, 0); 51 | border-left: 5px solid rgba(0, 0, 0, 0); 52 | color: #999; 53 | content: ""; 54 | pointer-events: none; 55 | } 56 | &.item-light { 57 | select{ 58 | background:$item-light-bg; 59 | color:$item-light-text; 60 | } 61 | } 62 | &.item-stable { 63 | select{ 64 | background:$item-stable-bg; 65 | color:$item-stable-text; 66 | } 67 | &:after, .input-label{ 68 | color:darken($item-stable-border,30%); 69 | } 70 | } 71 | &.item-positive { 72 | select{ 73 | background:$item-positive-bg; 74 | color:$item-positive-text; 75 | } 76 | &:after, .input-label{ 77 | color:$item-positive-text; 78 | } 79 | } 80 | &.item-calm { 81 | select{ 82 | background:$item-calm-bg; 83 | color:$item-calm-text; 84 | } 85 | &:after, .input-label{ 86 | color:$item-calm-text; 87 | } 88 | } 89 | &.item-assertive { 90 | select{ 91 | background:$item-assertive-bg; 92 | color:$item-assertive-text; 93 | } 94 | &:after, .input-label{ 95 | color:$item-assertive-text; 96 | } 97 | } 98 | &.item-balanced { 99 | select{ 100 | background:$item-balanced-bg; 101 | color:$item-balanced-text; 102 | } 103 | &:after, .input-label{ 104 | color:$item-balanced-text; 105 | } 106 | } 107 | &.item-energized { 108 | select{ 109 | background:$item-energized-bg; 110 | color:$item-energized-text; 111 | } 112 | &:after, .input-label{ 113 | color:$item-energized-text; 114 | } 115 | } 116 | &.item-royal { 117 | select{ 118 | background:$item-royal-bg; 119 | color:$item-royal-text; 120 | } 121 | &:after, .input-label{ 122 | color:$item-royal-text; 123 | } 124 | } 125 | &.item-dark { 126 | select{ 127 | background:$item-dark-bg; 128 | color:$item-dark-text; 129 | } 130 | &:after, .input-label{ 131 | color:$item-dark-text; 132 | } 133 | } 134 | } 135 | 136 | select { 137 | &[multiple], 138 | &[size] { 139 | height: auto; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_slide-box.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Slide Box 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .slider { 8 | position: relative; 9 | visibility: hidden; 10 | // Make sure items don't scroll over ever 11 | overflow: hidden; 12 | } 13 | 14 | .slider-slides { 15 | position: relative; 16 | height: 100%; 17 | } 18 | 19 | .slider-slide { 20 | position: relative; 21 | display: block; 22 | float: left; 23 | width: 100%; 24 | height: 100%; 25 | vertical-align: top; 26 | } 27 | 28 | .slider-slide-image { 29 | > img { 30 | width: 100%; 31 | } 32 | } 33 | 34 | .slider-pager { 35 | position: absolute; 36 | bottom: 20px; 37 | z-index: $z-index-slider-pager; 38 | width: 100%; 39 | height: 15px; 40 | text-align: center; 41 | 42 | .slider-pager-page { 43 | display: inline-block; 44 | margin: 0px 3px; 45 | width: 15px; 46 | color: #000; 47 | text-decoration: none; 48 | 49 | opacity: 0.3; 50 | 51 | &.active { 52 | @include transition(opacity 0.4s ease-in); 53 | opacity: 1; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_toggle.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Toggle 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .item-toggle { 8 | pointer-events: none; 9 | } 10 | 11 | .toggle { 12 | // set the color defaults 13 | @include toggle-style($toggle-on-default-border, $toggle-on-default-bg); 14 | 15 | position: relative; 16 | display: inline-block; 17 | pointer-events: auto; 18 | margin: -$toggle-hit-area-expansion; 19 | padding: $toggle-hit-area-expansion; 20 | 21 | &.dragging { 22 | .handle { 23 | background-color: $toggle-handle-dragging-bg-color !important; 24 | } 25 | } 26 | 27 | &.toggle-light { 28 | @include toggle-style($toggle-on-light-border, $toggle-on-light-bg); 29 | } 30 | &.toggle-stable { 31 | @include toggle-style($toggle-on-stable-border, $toggle-on-stable-bg); 32 | } 33 | &.toggle-positive { 34 | @include toggle-style($toggle-on-positive-border, $toggle-on-positive-bg); 35 | } 36 | &.toggle-calm { 37 | @include toggle-style($toggle-on-calm-border, $toggle-on-calm-bg); 38 | } 39 | &.toggle-assertive { 40 | @include toggle-style($toggle-on-assertive-border, $toggle-on-assertive-bg); 41 | } 42 | &.toggle-balanced { 43 | @include toggle-style($toggle-on-balanced-border, $toggle-on-balanced-bg); 44 | } 45 | &.toggle-energized { 46 | @include toggle-style($toggle-on-energized-border, $toggle-on-energized-bg); 47 | } 48 | &.toggle-royal { 49 | @include toggle-style($toggle-on-royal-border, $toggle-on-royal-bg); 50 | } 51 | &.toggle-dark { 52 | @include toggle-style($toggle-on-dark-border, $toggle-on-dark-bg); 53 | } 54 | } 55 | 56 | .toggle input { 57 | // hide the actual input checkbox 58 | display: none; 59 | } 60 | 61 | /* the track appearance when the toggle is "off" */ 62 | .toggle .track { 63 | @include transition-timing-function(ease-in-out); 64 | @include transition-duration($toggle-transition-duration); 65 | @include transition-property((background-color, border)); 66 | 67 | display: inline-block; 68 | box-sizing: border-box; 69 | width: $toggle-width; 70 | height: $toggle-height; 71 | border: solid $toggle-border-width $toggle-off-border-color; 72 | border-radius: $toggle-border-radius; 73 | background-color: $toggle-off-bg-color; 74 | content: ' '; 75 | cursor: pointer; 76 | pointer-events: none; 77 | } 78 | 79 | /* Fix to avoid background color bleeding */ 80 | /* (occured on (at least) Android 4.2, Asus MeMO Pad HD7 ME173X) */ 81 | .platform-android4_2 .toggle .track { 82 | -webkit-background-clip: padding-box; 83 | } 84 | 85 | /* the handle (circle) thats inside the toggle's track area */ 86 | /* also the handle's appearance when it is "off" */ 87 | .toggle .handle { 88 | @include transition($toggle-transition-duration ease-in-out); 89 | position: absolute; 90 | display: block; 91 | width: $toggle-handle-width; 92 | height: $toggle-handle-height; 93 | border-radius: $toggle-handle-radius; 94 | background-color: $toggle-handle-off-bg-color; 95 | top: $toggle-border-width + $toggle-hit-area-expansion; 96 | left: $toggle-border-width + $toggle-hit-area-expansion; 97 | 98 | &:before { 99 | // used to create a larger (but hidden) hit area to slide the handle 100 | position: absolute; 101 | top: -4px; 102 | left: ( ($toggle-handle-width / 2) * -1) - 8; 103 | padding: ($toggle-handle-height / 2) + 5 ($toggle-handle-width + 7); 104 | content: " "; 105 | } 106 | } 107 | 108 | .toggle input:checked + .track .handle { 109 | // the handle when the toggle is "on" 110 | @include translate3d($toggle-width - $toggle-handle-width - ($toggle-border-width * 2), 0, 0); 111 | background-color: $toggle-handle-on-bg-color; 112 | } 113 | 114 | .item-toggle.active { 115 | box-shadow: none; 116 | } 117 | 118 | .item-toggle, 119 | .item-toggle.item-complex .item-content { 120 | // make sure list item content have enough padding on right to fit the toggle 121 | padding-right: ($item-padding * 3) + $toggle-width; 122 | } 123 | 124 | .item-toggle.item-complex { 125 | padding-right: 0; 126 | } 127 | 128 | .item-toggle .toggle { 129 | // position the toggle to the right within a list item 130 | position: absolute; 131 | top: $item-padding / 2; 132 | right: $item-padding; 133 | z-index: $z-index-item-toggle; 134 | } 135 | 136 | .toggle input:disabled + .track { 137 | opacity: .6; 138 | } 139 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_type.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Typography 4 | * -------------------------------------------------- 5 | */ 6 | 7 | 8 | // Body text 9 | // ------------------------- 10 | 11 | p { 12 | margin: 0 0 ($line-height-computed / 2); 13 | } 14 | 15 | 16 | // Emphasis & misc 17 | // ------------------------- 18 | 19 | small { font-size: 85%; } 20 | cite { font-style: normal; } 21 | 22 | 23 | // Alignment 24 | // ------------------------- 25 | 26 | .text-left { text-align: left; } 27 | .text-right { text-align: right; } 28 | .text-center { text-align: center; } 29 | 30 | 31 | // Headings 32 | // ------------------------- 33 | 34 | h1, h2, h3, h4, h5, h6, 35 | .h1, .h2, .h3, .h4, .h5, .h6 { 36 | color: $base-color; 37 | font-weight: $headings-font-weight; 38 | font-family: $headings-font-family; 39 | line-height: $headings-line-height; 40 | 41 | small { 42 | font-weight: normal; 43 | line-height: 1; 44 | } 45 | } 46 | 47 | h1, .h1, 48 | h2, .h2, 49 | h3, .h3 { 50 | margin-top: $line-height-computed; 51 | margin-bottom: ($line-height-computed / 2); 52 | 53 | &:first-child { 54 | margin-top: 0; 55 | } 56 | 57 | + h1, + .h1, 58 | + h2, + .h2, 59 | + h3, + .h3 { 60 | margin-top: ($line-height-computed / 2); 61 | } 62 | } 63 | 64 | h4, .h4, 65 | h5, .h5, 66 | h6, .h6 { 67 | margin-top: ($line-height-computed / 2); 68 | margin-bottom: ($line-height-computed / 2); 69 | } 70 | 71 | h1, .h1 { font-size: floor($font-size-base * 2.60); } // ~36px 72 | h2, .h2 { font-size: floor($font-size-base * 2.15); } // ~30px 73 | h3, .h3 { font-size: ceil($font-size-base * 1.70); } // ~24px 74 | h4, .h4 { font-size: ceil($font-size-base * 1.25); } // ~18px 75 | h5, .h5 { font-size: $font-size-base; } 76 | h6, .h6 { font-size: ceil($font-size-base * 0.85); } // ~12px 77 | 78 | h1 small, .h1 small { font-size: ceil($font-size-base * 1.70); } // ~24px 79 | h2 small, .h2 small { font-size: ceil($font-size-base * 1.25); } // ~18px 80 | h3 small, .h3 small, 81 | h4 small, .h4 small { font-size: $font-size-base; } 82 | 83 | 84 | // Description Lists 85 | // ------------------------- 86 | 87 | dl { 88 | margin-bottom: $line-height-computed; 89 | } 90 | dt, 91 | dd { 92 | line-height: $line-height-base; 93 | } 94 | dt { 95 | font-weight: bold; 96 | } 97 | 98 | 99 | // Blockquotes 100 | // ------------------------- 101 | 102 | blockquote { 103 | margin: 0 0 $line-height-computed; 104 | padding: ($line-height-computed / 2) $line-height-computed; 105 | border-left: 5px solid gray; 106 | 107 | p { 108 | font-weight: 300; 109 | font-size: ($font-size-base * 1.25); 110 | line-height: 1.25; 111 | } 112 | 113 | p:last-child { 114 | margin-bottom: 0; 115 | } 116 | 117 | small { 118 | display: block; 119 | line-height: $line-height-base; 120 | &:before { 121 | content: '\2014 \00A0';// EM DASH, NBSP; 122 | } 123 | } 124 | } 125 | 126 | 127 | // Quotes 128 | // ------------------------- 129 | 130 | q:before, 131 | q:after, 132 | blockquote:before, 133 | blockquote:after { 134 | content: ""; 135 | } 136 | 137 | 138 | // Addresses 139 | // ------------------------- 140 | 141 | address { 142 | display: block; 143 | margin-bottom: $line-height-computed; 144 | font-style: normal; 145 | line-height: $line-height-base; 146 | } 147 | 148 | 149 | // Links 150 | // ------------------------- 151 | 152 | a.subdued { 153 | padding-right: 10px; 154 | color: #888; 155 | text-decoration: none; 156 | 157 | &:hover { 158 | text-decoration: none; 159 | } 160 | &:last-child { 161 | padding-right: 0; 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/_util.scss: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Utility Classes 4 | * -------------------------------------------------- 5 | */ 6 | 7 | .hide { 8 | display: none; 9 | } 10 | .opacity-hide { 11 | opacity: 0; 12 | } 13 | .grade-b .opacity-hide, 14 | .grade-c .opacity-hide { 15 | opacity: 1; 16 | display: none; 17 | } 18 | .show { 19 | display: block; 20 | } 21 | .opacity-show { 22 | opacity: 1; 23 | } 24 | .invisible { 25 | visibility: hidden; 26 | } 27 | 28 | .keyboard-open .hide-on-keyboard-open { 29 | display: none; 30 | } 31 | 32 | .keyboard-open .tabs.hide-on-keyboard-open + .pane .has-tabs, 33 | .keyboard-open .bar-footer.hide-on-keyboard-open + .pane .has-footer { 34 | bottom: 0; 35 | } 36 | 37 | .inline { 38 | display: inline-block; 39 | } 40 | 41 | .disable-pointer-events { 42 | pointer-events: none; 43 | } 44 | 45 | .enable-pointer-events { 46 | pointer-events: auto; 47 | } 48 | 49 | .disable-user-behavior { 50 | // used to prevent the browser from doing its native behavior. this doesnt 51 | // prevent the scrolling, but cancels the contextmenu, tap highlighting, etc 52 | 53 | @include user-select(none); 54 | @include touch-callout(none); 55 | @include tap-highlight-transparent(); 56 | 57 | -webkit-user-drag: none; 58 | 59 | -ms-touch-action: none; 60 | -ms-content-zooming: none; 61 | } 62 | 63 | // Fill the screen to block clicks (a better pointer-events: none) for the body 64 | // to avoid full-page reflows and paints which can cause flickers 65 | .click-block { 66 | position: absolute; 67 | top: 0; 68 | left: 0; 69 | z-index: $z-index-click-block; 70 | width: 100%; 71 | height: 100%; 72 | background: transparent; 73 | } 74 | 75 | .no-resize { 76 | resize: none; 77 | } 78 | 79 | .block { 80 | display: block; 81 | clear: both; 82 | &:after { 83 | display: block; 84 | visibility: hidden; 85 | clear: both; 86 | height: 0; 87 | content: "."; 88 | } 89 | } 90 | 91 | .full-image { 92 | width: 100%; 93 | } 94 | 95 | .clearfix { 96 | *zoom: 1; 97 | &:before, 98 | &:after { 99 | display: table; 100 | content: ""; 101 | // Fixes Opera/contenteditable bug: 102 | // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952 103 | line-height: 0; 104 | } 105 | &:after { 106 | clear: both; 107 | } 108 | } 109 | 110 | /** 111 | * Content Padding 112 | * -------------------------------------------------- 113 | */ 114 | 115 | .padding { 116 | padding: $content-padding; 117 | } 118 | 119 | .padding-top, 120 | .padding-vertical { 121 | padding-top: $content-padding; 122 | } 123 | 124 | .padding-right, 125 | .padding-horizontal { 126 | padding-right: $content-padding; 127 | } 128 | 129 | .padding-bottom, 130 | .padding-vertical { 131 | padding-bottom: $content-padding; 132 | } 133 | 134 | .padding-left, 135 | .padding-horizontal { 136 | padding-left: $content-padding; 137 | } 138 | 139 | 140 | /** 141 | * Rounded 142 | * -------------------------------------------------- 143 | */ 144 | 145 | .rounded { 146 | border-radius: $border-radius-base; 147 | } 148 | 149 | 150 | /** 151 | * Utility Colors 152 | * -------------------------------------------------- 153 | * Utility colors are added to help set a naming convention. You'll 154 | * notice we purposely do not use words like "red" or "blue", but 155 | * instead have colors which represent an emotion or generic theme. 156 | */ 157 | 158 | .light, a.light { 159 | color: $light; 160 | } 161 | .light-bg { 162 | background-color: $light; 163 | } 164 | .light-border { 165 | border-color: $button-light-border; 166 | } 167 | 168 | .stable, a.stable { 169 | color: $stable; 170 | } 171 | .stable-bg { 172 | background-color: $stable; 173 | } 174 | .stable-border { 175 | border-color: $button-stable-border; 176 | } 177 | 178 | .positive, a.positive { 179 | color: $positive; 180 | } 181 | .positive-bg { 182 | background-color: $positive; 183 | } 184 | .positive-border { 185 | border-color: $button-positive-border; 186 | } 187 | 188 | .calm, a.calm { 189 | color: $calm; 190 | } 191 | .calm-bg { 192 | background-color: $calm; 193 | } 194 | .calm-border { 195 | border-color: $button-calm-border; 196 | } 197 | 198 | .assertive, a.assertive { 199 | color: $assertive; 200 | } 201 | .assertive-bg { 202 | background-color: $assertive; 203 | } 204 | .assertive-border { 205 | border-color: $button-assertive-border; 206 | } 207 | 208 | .balanced, a.balanced { 209 | color: $balanced; 210 | } 211 | .balanced-bg { 212 | background-color: $balanced; 213 | } 214 | .balanced-border { 215 | border-color: $button-balanced-border; 216 | } 217 | 218 | .energized, a.energized { 219 | color: $energized; 220 | } 221 | .energized-bg { 222 | background-color: $energized; 223 | } 224 | .energized-border { 225 | border-color: $button-energized-border; 226 | } 227 | 228 | .royal, a.royal { 229 | color: $royal; 230 | } 231 | .royal-bg { 232 | background-color: $royal; 233 | } 234 | .royal-border { 235 | border-color: $button-royal-border; 236 | } 237 | 238 | .dark, a.dark { 239 | color: $dark; 240 | } 241 | .dark-bg { 242 | background-color: $dark; 243 | } 244 | .dark-border { 245 | border-color: $button-dark-border; 246 | } 247 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/ionic.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import 4 | // Ionicons 5 | "ionicons/ionicons.scss", 6 | 7 | // Variables 8 | "mixins", 9 | "variables", 10 | 11 | // Base 12 | "reset", 13 | "scaffolding", 14 | "type", 15 | 16 | // Components 17 | "action-sheet", 18 | "backdrop", 19 | "bar", 20 | "tabs", 21 | "menu", 22 | "modal", 23 | "popover", 24 | "popup", 25 | "loading", 26 | "items", 27 | "list", 28 | "badge", 29 | "slide-box", 30 | 31 | // Forms 32 | "form", 33 | "checkbox", 34 | "toggle", 35 | "radio", 36 | "range", 37 | "select", 38 | "progress", 39 | 40 | // Buttons 41 | "button", 42 | "button-bar", 43 | 44 | // Util 45 | "animations", 46 | "grid", 47 | "util", 48 | "platform"; 49 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/ionicons/_ionicons-animation.scss: -------------------------------------------------------------------------------- 1 | // Animation Icons 2 | // -------------------------- 3 | 4 | .#{$ionicons-prefix}spin { 5 | -webkit-animation: spin 1s infinite linear; 6 | -moz-animation: spin 1s infinite linear; 7 | -o-animation: spin 1s infinite linear; 8 | animation: spin 1s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | 32 | 33 | .#{$ionicons-prefix}loading-a, 34 | .#{$ionicons-prefix}loading-b, 35 | .#{$ionicons-prefix}loading-c, 36 | .#{$ionicons-prefix}loading-d, 37 | .#{$ionicons-prefix}looping, 38 | .#{$ionicons-prefix}refreshing, 39 | .#{$ionicons-prefix}ios7-reloading { 40 | @extend .ion; 41 | @extend .#{$ionicons-prefix}spin; 42 | } 43 | 44 | .#{$ionicons-prefix}loading-a { 45 | -webkit-animation-timing-function: steps(8, start); 46 | -moz-animation-timing-function: steps(8, start); 47 | animation-timing-function: steps(8, start); 48 | } 49 | 50 | .#{$ionicons-prefix}loading-a:before { 51 | @extend .#{$ionicons-prefix}load-a:before; 52 | } 53 | 54 | .#{$ionicons-prefix}loading-b:before { 55 | @extend .#{$ionicons-prefix}load-b:before; 56 | } 57 | 58 | .#{$ionicons-prefix}loading-c:before { 59 | @extend .#{$ionicons-prefix}load-c:before; 60 | } 61 | 62 | .#{$ionicons-prefix}loading-d:before { 63 | @extend .#{$ionicons-prefix}load-d:before; 64 | } 65 | 66 | .#{$ionicons-prefix}looping:before { 67 | @extend .#{$ionicons-prefix}loop:before; 68 | } 69 | 70 | .#{$ionicons-prefix}refreshing:before { 71 | @extend .#{$ionicons-prefix}refresh:before; 72 | } 73 | 74 | .#{$ionicons-prefix}ios7-reloading:before { 75 | @extend .#{$ionicons-prefix}ios7-reload:before; 76 | } 77 | -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/ionicons/_ionicons-font.scss: -------------------------------------------------------------------------------- 1 | // Ionicons Font Path 2 | // -------------------------- 3 | 4 | @font-face { 5 | font-family: $ionicons-font-family; 6 | src:url("#{$ionicons-font-path}/ionicons.eot?v=#{$ionicons-version}"); 7 | src:url("#{$ionicons-font-path}/ionicons.eot?v=#{$ionicons-version}#iefix") format("embedded-opentype"), 8 | url("#{$ionicons-font-path}/ionicons.ttf?v=#{$ionicons-version}") format("truetype"), 9 | url("#{$ionicons-font-path}/ionicons.woff?v=#{$ionicons-version}") format("woff"), 10 | url("#{$ionicons-font-path}/ionicons.svg?v=#{$ionicons-version}#Ionicons") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | .ion { 16 | display: inline-block; 17 | font-family: $ionicons-font-family; 18 | speak: none; 19 | font-style: normal; 20 | font-weight: normal; 21 | font-variant: normal; 22 | text-transform: none; 23 | text-rendering: auto; 24 | line-height: 1; 25 | -webkit-font-smoothing: antialiased; 26 | -moz-osx-font-smoothing: grayscale; 27 | } -------------------------------------------------------------------------------- /example/www/lib/ionic/scss/ionicons/ionicons.scss: -------------------------------------------------------------------------------- 1 | @import "ionicons-variables"; 2 | /*! 3 | Ionicons, v1.5.2 4 | Created by Ben Sperry for the Ionic Framework, http://ionicons.com/ 5 | https://twitter.com/benjsperry https://twitter.com/ionicframework 6 | MIT License: https://github.com/driftyco/ionicons 7 | */ 8 | 9 | @import "ionicons-font"; 10 | @import "ionicons-animation"; 11 | @import "ionicons-icons"; 12 | -------------------------------------------------------------------------------- /example/www/lib/ionic/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0-beta.14", 3 | "codename": "magnesium-mongoose", 4 | "date": "2015-01-05", 5 | "time": "21:19:42" 6 | } 7 | --------------------------------------------------------------------------------